Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

9853 periodic CAN frame 1us drift

Solved!
Go to solution

Hi all, I am working with on cRIO with a 9853. The bus is set to 1Mbit/s and I have to send a frame every 400us. With the oscilloscope I see that the frames are transmitting every 400us or 401us.

Why there is this 1us drift?

 

The code is a simple while with a 400us timer and the CAN write, all in the FPGA.

 

Thanks!

 

 

0 Kudos
Message 1 of 5
(3,482 Views)

CAN is not deterministic.  Frames can be lost, priority might mean other messages go out from other devices on the bus, poor wiring might cause in consistent networks, etc.  For any number of reasons data will be lost, and the CAN device will simply re-transmit it and try again later automatically.  I'm actually quite surprised you have it within 1us.  Is there a problem with this amount of jitter?

Message 2 of 5
(3,443 Views)

Hi Hooovahh! Thanks for replying. Yes! I have only 1us jitter, but that is not enogth.

 

The protocol is very simple, the master sends every 400us one frame and the slaves use it to synchornize between them.

Any advice to improve the jitter? 1us at 1Mbit/s is just one bit!! 🙂

In the loop I just write at FPGA CAN write node, could any property help me to improve?

 

Thanks!!

0 Kudos
Message 3 of 5
(3,432 Views)

How are you timing it? Is it the same data each time?

 

Based on can synchronization, You should see 1-2 bit times of jitter, as per the bus protocol. As each node runs its own clock, as it detects that the clocks are off, bit times are expanded/reduced to maintain synchronization.

Message 4 of 5
(3,428 Views)
Solution
Accepted by topic author fjsanchezb

@fjsanchezb wrote:

The protocol is very simple, the master sends every 400us one frame and the slaves use it to synchornize between them.


CAN is not the right approach for synchronization.  As I said it is non-deterministic.  A square wave generator would probably be a better solution.  Posting the code might help but I assume it is very simplistic.

Message 5 of 5
(3,426 Views)