bin am rätseln was es ist, meine ModBus-Verbindung klappt einfach nicht.
Vom PC kommen Daten an. Der Xmega64A3 antwortet nicht.
Alles schon zigmal überprüft. Finde nix negatives.
Code
Device = Xmega64A3, VCC = 3.3;
{ $BOOTRST $08000} {Reset Jump to $08000}
define_fuses
Override_Fuses;
NoteBook = D;
ProgMode = PDI;
COMport = USB;
Supply = 3.3, 100;
LockBits0 = [];
FuseBits0 = [];
FuseBits1 = [];
FuseBits2 = [];
FuseBits5 = [BodLevel0, BodLevel2];
ProgFlash = true; // or false – program Flash
ProgEEprom = false; // or false – program EEprom
import SysTick, TickTimer, WatchDog, QDEC_C0, QDEC_D1, ModBus, SerPortD1, SerPortF0;
from System import Processes, longword, float, longint;
define
// The XMegas don't provide any Oscillator fuses.
// So the application must setup the desired values
// possible OSC types: extXTAL, extClock, ext32kHz, int32Khz, int2MHz, int32MHz
//>> CPU=32MHz, PeripherX4=32MHz, PeripherX2=32MHz
OSCtype = extXTAL = 7372800, PLLmul = 4, prescB = 1, prescC = 1;
SysTick = 10; {msec}
WatchDog = msec125; {presc = 3}
StackSize = $0100, iData;
FrameSize = $0100, iData;
Scheduler = iData;
TickTimer = Timer_C1;
QDECphase_C0 = PortD, 0, 1; // Port, Phase0, Phase90 input pin
QDECres_C0 = 32; // Resolution QDEC D0
QDECevChan_C0 = 0;
QDECphase_D1 = PortE, 0, 1; // Port, Phase0, Phase90 input pin
QDECres_D1 = 32; // Resolution QDEC D1
QDECevChan_D1 = 2;
// SerPortF0 = 57600, Databit8, Stop2; // RTU Hr. Wagner default. ModBus-Tester meckert bei dieser Einstellung!!
SerPortF0 = 57600, Databit8, parEven, Stop1; // RTU default
RxBufferF0 = 100, iData; // recommended 255, but may be lower (danger: minimum is max message length in bytes)
TxBufferF0 = 100, iData; // recommended 255, but may be lower (danger: minimum is max message length in bytes)
SerCtrlF0 = PortF, 4, Positive;
ModBus = SerPortF0, 50, iData, 240; // port, capacity of MODBUS data block in words, iData/xData, effective bytes (Framesize = effective bytes + function code + crc + EXTRA)
ModBusMode = RTU, Timer_D0;
SerPortD1 = 19200;
TxBufferD1 = 32, iData;
RxBufferD1 = 8, iData;
uses ModBusServRTU;