MPC5534 flexcan can not work normally

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC5534 flexcan can not work normally

325 Views
wangfalong
Contributor I

Hi,

   I am using MPC5534 CAN Rx FIFO, but it can not work normally!!!

Here is my code:

CAN_C.MCR.R = 0x5001003F; // Put in Freeze Mode & enable all 64 message buffers
CAN_C.CR.R = 0x13DB2006; // Configure for 80MHz, 250KHz bit time

for (i=0; i<64; i++)
{
CAN_C.BUF[i].CS.B.CODE = 0; // Inactivate all message buffers
}
CAN_C.BUF[0].CS.B.CODE = 8; // Message Buffer 0 set to TX INACTIVE
CAN_C.BUF[0].CS.B.IDE = 1; // Use standard ID length
CAN_C.BUF[0].ID.R = 0x0cff0231; // Transmit ID is 111
CAN_C.BUF[0].CS.B.RTR = 0; // Data frame, not remote Tx request frame
CAN_C.BUF[0].CS.B.LENGTH = 8 ; // # bytes to transmit w/o null
CAN_C.BUF[0].CS.B.SRR = 0; // Tx frame (not req'd for standard frame)

CAN_C.BUF[60].CS.B.IDE = 1; // MB 9 will look for a extended ID
CAN_C.BUF[60].ID.R = 0x18ff0231; // MB 9 will look for ID
CAN_C.BUF[60].CS.B.CODE = 4; // MB 9 set to RX EMPTY

CAN_C.IMRL.B.BUF60M=1;

CAN_C.RXIMR[60].R = 0x1FFFFFF8;
CAN_C.MCR.R = 0x0000003F;

Only with this sentence(CAN_C.RXIMR[60].R = 0x1FFFFFF8), sending and receiving are abnormal!!

Do you have any good examples or suggestions?

Tags (1)
0 Kudos
0 Replies