Hi,
I have a 9s12XEQ384 running on a 5 MHz resonator and I have CAN communication using TJA1040 and TJA1042 that works at 250 Kb/s and 500 Kb/s.
I now need to make it work at 1 Mb/s.
I can see that I need to change my 5 MHz resonator to a 8 MHz resonator.
Now the settings for CAN_BTR0 and CAN_BTR1 is where I am confused.
For 250 Kb/s I have
#define BTR0_250 0x41 // 5 MHz reference
#define BTR1_250 0x34 // Sample at 4 / 5 = 80%
for 500 Kb/s I have
#define BTR0_500 0xC0 // Suggested by Radek - Works
#define BTR1_500 0x34 // Suggested by Radek - Works
When I use your CAN calculator (ver 7) I get
#define BTR0_1000 0x40 // 8 MHz reference
#define BTR1_1000 0x94 // 3 samples / bit
But when I go back to using a 5 MHz resonator on the calculator it says
For 250 Kb/s
#define BTR0_250 0x41
#define BTR1_250 0x16 or 0x96
for 500 Kb/s
#define BTR0_500 0x40
#define BTR1_500 0x16 or 0x96
Now I have confirmed the 250 and 500 KB/s as working using CAN_BTR1 = 0x34
So which is correct? And should I use the above for 1 Mb/s ?
Regards,
Wade Whitehorn