Ma Ming

msCAN question?

Discussion created by Ma Ming on Feb 18, 2006
Latest reply on Apr 27, 2006 by Thomas Gaffney
Does anybody tried to work with the CAN bus on the current board of 9s12dp256?
I have some question on it ...
At first,my program works properbly in loop back mode.
However when I config it to work in nomal mode . the listening CAN node receive nothing.
Does the following Initialize have error?
void MSCAN_INITIAL(void)
 CAN1CTL0_INITRQ=1;         //the MSCAN Initialization Mode
 while(!CAN0CTL1_INITAK);   //The MSCAN has entered Initialization Mode.
 CAN0CTL1_CANE=1;    //CAN0 enable && Oscillator Clock.
 CAN1CTL1_CANE=1;    //CAN1 enable
 CAN0IDAC=0x20;               //Eight identifier acceptance filters,
 CAN0IDAR3=ID0[3];        //MSCAN Identifier Acceptance Registers
 CAN0IDMR5=0xFF;        //MSCAN Identifier Mask Registers
 CAN0BTR0=0x63;    //Synchronization jump width 2 Tq clock cycles
 CAN1BTR0=0x63;    //Baud Rate Prescaler Bin 100011=35 Prescaler value
 CAN0BTR1=0x13;    //SAMP 1 timetime segment 2=2 Tq clock cycles
 CAN1BTR1=0x13;    //                         time segment 1=4 Tq clock cycles
 CAN0CTL1_LISTEN=0;  //1 = Listen Only Mode activated
 //CAN1CTL1_LOOPB=1;  //1 = Loop Back Self Test enabled
 while(CAN1CTL1_INITAK);    //out Initialization Mode

 CAN0RIER=0x01;        //CAN0  Interrupt Enable
 CAN1RIER=0x01;        //CAN1  Interrupt Enable
Here is my Transmit program.
     CAN1TBSEL=CAN1TFLG;  //Transmit Buffer Selection
     CAN1TXDSR4=0x44;//MSCAN 1 Transmit Data
if you find some errors,I beg you tell me .
thanks a lot for you help me:womanvery-happy:
( if you want to see the hardware of my current board ,you can visit or see the Attachment: