Question about CAN bus accuracy
Posted: Fri Nov 23, 2012 9:42 am
the facts:
If I have a flowchart that sends, lets say, one package of CAN every second with the function DELAY or with TIMER, the measured answer is very accurate (0,002 [ms]).
If I send that communication to other microcontroller, and using the detection of a CAN package as a trigger to send its own CAN package with a delay, THAT DELAY is not allays the same, even if I program it to do so.
this variable delay can be around 0.1-0.3 [ms] with my CAN bus running at 500 Kbits/s
question:
Is the detection of a CAN package somehow variable inside of the microcontroller (even if the data received is the same every time) ?
here is a screenshot showing the measurements
As you can see, the period (show the signal send by Tx, below ) is much accurate than the measure on top that show the answer to that CAN signal.
here are the files just if someone want to play , I just disable the TMR interrupt icon in RX to see the signal as is coming from TX
If I have a flowchart that sends, lets say, one package of CAN every second with the function DELAY or with TIMER, the measured answer is very accurate (0,002 [ms]).
If I send that communication to other microcontroller, and using the detection of a CAN package as a trigger to send its own CAN package with a delay, THAT DELAY is not allays the same, even if I program it to do so.
this variable delay can be around 0.1-0.3 [ms] with my CAN bus running at 500 Kbits/s
question:
Is the detection of a CAN package somehow variable inside of the microcontroller (even if the data received is the same every time) ?
here is a screenshot showing the measurements
As you can see, the period (show the signal send by Tx, below ) is much accurate than the measure on top that show the answer to that CAN signal.
here are the files just if someone want to play , I just disable the TMR interrupt icon in RX to see the signal as is coming from TX