AnsweredAssumed Answered

CAN bus data transmission

Question asked by Henry Wu on Jun 22, 2015
Latest reply on Jun 23, 2015 by Henry Wu

I try to send out two 8bytes data in my firmware by using S12DP512. Once I set the CANXTFLG to 0x01, data would be sent on the CAN bus continuously. It is non stop.

 

Can anyone tell me what's happen to the bus? Below is my source code.

 

// *******************************************

if(CANXTFLG != 7) {

    CANXTARQ = 0x7;

  }

  while(CANXTFLG != 7);

 

 

  b_ptr = (unsigned char*)(&(cdata.c118));

  CANXTBSEL = 0x01;

 

  CANXTXIDR0 = ID118_0;

  CANXTXIDR1 = ID118_1;

  CANXTXIDR2 = ID118_2;

  CANXTXIDR3 = ID118_3;

 

 

  CANXTXDSR0 = *b_ptr++;

  CANXTXDSR2 = *b_ptr++;

  CANXTXDSR1 = *b_ptr++;

  CANXTXDSR3 = *b_ptr++;

  CANXTXDSR5 = *b_ptr++;

  CANXTXDSR4 = *b_ptr++;

  CANXTXDSR6 = *b_ptr++;

  CANXTXDSR7 = *b_ptr++;

 

 

  JEVS_CANXTXDLR   = 8;

  JEVS_CANXTXTBPR  = 1;

  JEVS_CANXTFLG    = 0x01;                      

    

  b_ptr = (unsigned char*)(&(cdata.c109));

  JEVS_CANXTBSEL = 0x02;      

 

 

  JEVS_CANXTXIDR0 = ID119A_0;

  JEVS_CANXTXIDR1 = ID119A_1;

  JEVS_CANXTXIDR2 = ID119A_2;

  JEVS_CANXTXIDR3 = ID119A_3;

 

  CANXTXDSR0 = *b_ptr++;

  CANXTXDSR2 = *b_ptr++;

  CANXTXDSR1 = *b_ptr++;

  CANXTXDSR3 = *b_ptr++;

  CANXTXDSR4 = *b_ptr++;

  CANXTXDSR5 = *b_ptr++;

  CANXTXDSR6 = *b_ptr++;

  CANXTXDSR7 = *b_ptr++;

 

  CANXTXDLR   = 8;

  CANXTXTBPR  = 2;

  CANXTFLG    = 0x02;

 

  CANXTIER_TXEIE1 = 1;

Outcomes