PIC 18F45K80 CAN bus speed issue

An area to discuss 8-bit PIC specific problems and examples

Moderator: Benj

Post Reply
lexicon
Flowcode v5 User
Posts: 55
Joined: Mon Apr 06, 2015 6:30 pm
Has thanked: 20 times
Been thanked: 22 times

PIC 18F45K80 CAN bus speed issue

Post by lexicon »

I'm using a PIC 18F45K80, running @64MHz (16MHz resonator, 4xPLL), CAN bus is set to 500kbs in Flowcode7.
When I try to use the internal CAN it is not working correctly - it seems the transmit speed is about 10% too fast.
Although PICOscope is able to decode it, our CANalyser does not accept the traffic which results in a permanent re-transmit:
FC7-not_working.jpg
FC7-not_working.jpg (95.39 KiB) Viewed 90930 times
Using the same configuration in FC5 works fine (CANalyser accepts, no re-transmit):
FC5-working.jpg
FC5-working.jpg (82.77 KiB) Viewed 90930 times
As can be seen, the FC7 transmit period (delta between cursor positions) is 201uS and in FC5 it is about 218uS.

One solution here would be to use FC5, but that gives me issues with other parts of the project and it would just make sense to be using the later version.

ETA: The same project also uses the UART @250kbs and that appears to be fine, so it's not a general speed issue, it seems to be CAN specific.

Post Reply