Hello TI Team,
I am working on TM4C123GH6PM microcontroller for CAN application. I am sending/receiving the data from/to PCAN.
I have used CANBitRateSet() driver function for setting the baud rate with 80MHz clock. It was observed that, when the baud rate is configured for 100k,125k,250k , 500kbps and 800kbps, it works smoothly. But when the baud rate is increased to 1Mbps, the PCAN displays BUSHEAVY/BUSOFF conditions for 80MHz sysclk.
Then instead of CANBitRateSet() function, i tried by using CANBitTimingSet() for setting the bit rate which inturn uses tCANBitClkParms structure as shown below. The CAN clock was set to 80MHz. In this configuration also, it was observed that, when bit rate is 1mbps the PCAN displays BUSHEAVY/BUSOFF conditions.
tCANBitClkParms CANBitClkSettings[] =
{
{16, 8, 4, 32}, // CANBAUD_100K ok at 80MHz clock.
{13, 2, 4, 40}, // CANBAUD_125K ok at 80MHz clock.
{4, 3, 2, 40} , // CANBAUD_250K ok at 80MHz clock.
{10, 5, 4, 2} , // CANBAUD_500K ok at 80MHz clock.
{5, 4, 4, 10}, //4 - CANBAUD_800K ok at 80MHz clock.
{8, 1, 1, 8}, // CANBAUD_1M ok at 80MHz clock.
{6, 4, 4, 11}, //6 - CANBAUD_666k ok at 80MHz clock.
{3, 1, 1, 23} //7 - CANBAUD_700k ok at 80MHz clock.
};
The tCANBitClkParms data structure contains the values for SyncPropPhase1, Phase2, SJW, BRP used for calculating bit rate.
typedef struct
{
uint32_t ui32SyncPropPhase1Seg;
uint32_t ui32Phase2Seg;
uint32_t ui32SJW;
uint32_t ui32QuantumPrescaler;
}
tCANBitClkParms;
I am using SN65HVD1040D CAN transceiver and using 8MHz XTAL.
Here is attached hardware interface.
Please help me to fix the problem.
Thanks in advance.