Hi everybody
I actually developed a CAN bus interface which is running with an external 16MHz (100ppm) XO clock. I want a can bitrate up to 1Mbit/s. I have a PIC18F45K80 and CAN CCS library. I configure the can_set_baud function with these parameters :
with prescaler @ 0 I have a 125ns Tq and configuration above give
1 Tq for jumpwidth
2 Tq for phase seg 1
2 Tq for propagation time
3 Tq for phase seg 2
So 8 Tq . I have a CAN PEAK user interface on my computer which receive succesfully my data frames.
BUT on oscilloscope I can see 1.2µs bit time instead of 1µs
Why?
Regards
collink
Joined: 08 Jan 2010 Posts: 137 Location: Michigan
Posted: Tue Jul 05, 2011 11:25 am
If it's working then I wouldn't complain. ;-)
Your calculations do seem correct as far as the canbus timing goes.
One thing though: That's 1 TQ for the start quanta. It's always 1 TQ for start then however many TQ you set for SEG1, PROP, SEG2. Jump width is something else entirely.
As for your oscilloscope: You might not be able to trust that. Oscilloscopes are for looking at wave forms not getting perfectly accurate pulse widths. Depending on how you have the scope setup and how the waveform looked you could have some error. The most important thing is that your baud timing seems to be accurate and you say that the PC side is able to properly receive the data.
Thom
Joined: 30 Jun 2011 Posts: 3 Location: France
Posted: Wed Jul 06, 2011 3:21 am
Thanks for your answer
Most device with CAN are running at 20MHz. I'm trying to run at this frequency in order to see if I add 2 Tq (so 10 Tq instead 8) give a good bit timing
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum