XMC4800 Ethercat Distributed Clock sync0 and sync1 issues

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User11120
Level 1
Level 1
Hello everyone.
I'm currently working with an XMC4800 in order to develop an Ethercat slave device with "fast sampling" capabilities, i.e., I'm trying to get an entire vector of acquisitions inside the single ethercat cycle.

As far as I understood, the DC feature, together with the sync0 and sync1 interrupts driven by the ESC, can be used to get a very precise synchronization of the acquisition process. In particular, I'm using the Dave example provided and selecting the DC parameters inside the twincat environment.
Here I'm able to define the following parameters:
- a main cycle period (let's say 1000us) can be defined through the PLC
- the sync0 interrupt period. This can be selected to be a multiplier or divider of the main cycle time (from 1000 times to 1/1000 times)
- the sync1 interrupt period. This can be selected to be only a multiplier of the main cycle time (from 1000 times to 1)

My idea was to use the sync0 interrupt to drive the ADC and populate a vector with new precisely timed data, and the sync1 interrupt to virtually send out this vector (cleaning the acquired data and resetting the acquisition).

With the default configuration, both the interrupts are working correctly, the device goes in the OP state and the two routines are called, respectively, with the correct timings (checked with an oscilloscope connected to an output pin).
However, when I set for the sync0 interrupt a divider of the base time, let's say 1/100 = 10us, the device is not able to reach the OP state if the sync1 interrupt is enabled and its period is below a certain value (in my case 4000us, i.e, setting a multiplier of 4).
I tryed to play a little with these parameters, and I found several "not working" configurations of this kind. Is there anyone that experienced the same issue? Is there a way to solve it?

PS: in order to be able to use a low value for the sync0 period, I already changed inside the SSC tool the MIN_PD_CYCLE_TIME that is preventing the device to reach the OP state with lower values of the sync0 period.

Thanks in advance for your support.

Regards,
Luca
0 Likes
2 Replies
MichaelIFX
Employee
Employee
50 replies posted 25 replies posted 10 replies posted
Dear Luca,
what I understood from BECKHOFF in a telephone call in the past is, the dividing option of the base time inside TwinCAT is a kind of debugging feature and not meant to be used for "normal" operation.
So for further information and limitations of this feature I propose you talk to BECKHOFF directly.

Kind Regards

Michael
0 Likes
User11120
Level 1
Level 1
Dear Michael,
thanks for your answer. I tried to use this feature to sync the xmc4800 acquisitions just because, as far as I understood, it is apparently the same trick used by the Beckhoff EL3702 module (2-channel analog input terminal with oversampling) where changing the number of subsamples amounts to update this two parameters.
Right now, I found an alternative solution by using the sync1 interrupt only during the setup phase. In the case this solution will not be sufficient I will try to contact beckhoff directly.

Thanks again,
Luca
0 Likes