AnsweredAssumed Answered

Receive data uninterruptedly from a CAN module

Question asked by Shi Yinbiao on Nov 9, 2016
Latest reply on Nov 9, 2016 by Shi Yinbiao

How can I use a CAN module to receive ten frame data uninterruptedly.Because when I send data to MPC5606B, I can only received two frame data at the most.My code based on MPC5606B as follows:

 

void RecieveMsg (void)
{
   uint8_t j;
   vuint32_t dummy;
   vuint32_t RxID=0;
   if(CAN_0.IFRL.B.BUF04I == 1)
    {
         RxCODE = CAN_0.BUF[4].CS.B.CODE; 
         RxID = CAN_0.BUF[4].ID.R;
         RxLENGTH = CAN_0.BUF[4].CS.B.LENGTH;
         for (j=0; j<RxLENGTH; j++)
         {
            RxDATA[j] = CAN_0.BUF[4].DATA.B[j];
            printf("RxDATA :%x\r",(uint16_t)RxDATA[j]);/*Via a serial port to print data to screen*/
         }
         RxTIMESTAMP = CAN_0.BUF[4].CS.B.TIMESTAMP;
         dummy = CAN_0.TIMER.R; 
         CAN_0.IFRL.R = 0x00000010; 
    }

}

Outcomes