Hi,Peter:I transplant the 5606B code you offered to MPC5604B and it works well,Buff[9] for Tx and Buff[5] for Rx function with the same CAN0 channel.Then I adjust the Buff[6] to Buff[5],unfortunately,The Rx does not work.
(1)Buff[6] and Buff[5] shares the same interrupt vector ,No.69--Flexcan_Buff_04_07
(2) CAN_0.IMRL.R = 0x00000040; // enable BUF06I interrupt
(3)if(CAN_0.IFRL.B.BUF06I)
{
/* upon receiving the interrupt flag */
/* check the ID field */
/* not really needed in this example */
/* useful in case when multiple IDs are received
* by the FIFO (Rx mask feature) */
temp = CAN_0.BUF[6].ID.R;
//if(( 0x12340000 ) != temp)
//{
/* error ! trap here.
* we have configured this MB to receive
* just ID 0x12340000 and not another */
// while(1) {}
// }
rxlength = (uint8_t) CAN_0.BUF[6].CS.B.LENGTH;
/* read the received data */
for (j=0; j<rxlength; j++)
{
RxDATA[j] = CAN_0.BUF[6].DATA.B[j];
}
u8_rxdata=CAN_0.BUF[6].DATA.B[0];
temp = CAN_0.TIMER.R; /* Read TIMER to unlock message buffers */
//CAN_0.IFRL.R = 0x00000020; /* clear the BUF05I bit - bit 5 */
CAN_0.IFRL.R = 0x00000040;/* clear the BUF06I bit - bit 6 */
}
I am puzzled with it,can you offer me some help?