AnsweredAssumed Answered

Cannot set CANBSEL to CANTFLG on MC9S12G128

Question asked by ilya_r on May 31, 2013
Latest reply on Jun 4, 2013 by ilya_r


I am trying to send a CAN message but in the debugger the following lines of code are skipped:

 

do {

    CANTBSEL = CANTFLG;

  }while(!CANTBSEL);

 

here is the full function:

 

void CANMsgTX(J1939_MSG *MsgTX)
{
  volatile byte txbuffer;
  while(!CANTFLG)

 
  do  {
    CANTBSEL = CANTFLG;
  }while(!CANTBSEL);

    
  txbuffer = CANTBSEL;

 

  LoadMsgTX(MsgTX);

 

  CANTFLG = txbuffer;
}

 

 

thus CANBSEL and txbuffer stay at 0

Outcomes