Other Parts Discussed in Thread: TM4C1231D5PM, TM4C123BE6PZ
We have several implementations of CAN using an external oscilator that are working admirably. I am now trying to enable a CAN peripheral on a device that has not external oscillator.
I am using simpletx.c as a baseline. I have removed the UART code, as I have no UART, changed the CAN pins to the ones I use, disabled the NMI pin collision and moved to the baud rate I need: 250K.
I view the external CAN bus and there is definately many well organized bits on the bus. But my bus immediately goes into passive error.
I am looking at the bus and I am not sure what a bit stream should look like, but a rough calculation indicates that I have the wrong baud rate.
Is there an example of using the CAN peripheral with the internal clock?
What do you look at on the CAN bus to verify baud rate? The shortes'bit' looks like about 1msec, which is about 1Kbaud.
I looked at a CAN bus running 250kbaud and what I call a 'bit' is 4usec wide, as expected. So I think by using the clock setup as I have it is running the CAN bus at 1kbaud.
I am using :
SysCtlClockSet(SYSCTL_OSC_INT | SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL);
CANBitRateSet(CAN0_BASE, SysCtlClockGet(), 250000);
SysCtlClockGet returns 37,500