AnsweredAssumed Answered

9s12X CAN initialisation

Question asked by Wade Whitehorn on Aug 23, 2016
Latest reply on Aug 26, 2016 by Radek Sestak


I am trying to set up the CAN interface on my 9s12XEQ384 so that the baud rate is 500 KBaud.  I am using the TJA1040 CAN tranceiver.

My oscillator is a 5.0 MHz device and I am clocking the micro using the PLL at its maximum of 50 MHz.

I have confirmed, using a software loop as well as an ECT routine that the bus clock is 50 MHz.

I have an application that runs on a 9s12DG256 that will generate a CAN message at 500 KBaud, so I have a way of testing my code.

I found an XLS spread sheet (Called CAN_setup.xls) that calculates CANBTR0 and CANBTR1 values

 

I have tried using both oscillator as well as bus clock as clock source and my message is either too long or too short in time.  I would like to use the oscillator clock as the clock source.  The value for BTR0 = 0x80 and BTR1 = 0x25 as predicted by the XLS spreadsheet.  This does not sync with my other units 500 KBaud bus.

 

Can you see what I am doing wrong?

 

Thanks,

Wade

Outcomes