AnsweredAssumed Answered

CAN Transmission Issue - interrupt based

Question asked by freescale_satya on Jan 19, 2011
Latest reply on Jan 20, 2011 by freescale_satya

Hi,

 

I am trying to transmit around 10 CAN messages at a single instance. here is the logic iam using for S12x micro

 

#define NO_OF_TX_MESSAGES   10

for(index = 0; index < NO_OF_TX_MESSAGES; index++)
{
  //copy id's
 //copy datalength
 //copy all databytes from application buffer
 
 if(TFLG)
 {
   buf_sel = TFLG;
   TBSEL = buf_sel;
 }
 
 // form the correct idrs
 // fill the data into data segment registers
 
 buf_sel = TBSEL;
 TIER |= 0x07; // enable interrupts
 
 TFLG =  buf_sel; // transmit the frame
}


canInterrupt(void)
{
 if(TFLG)
  TIER = 0x00;
}

 

1. Could somebody tell me if the logic is correct or can i make any improvements?

2. I always find not more than 3 messages being transmitted at a time

ex: i want to transmit 0x400, 0x401, 0x402, 0x403 ... 0x409 messages i find only 0x400, 0x401, 0x402 messages are only being transmitted. when i go through the data sheet it says 3 transmit buffers is this issue related to this.

could somebody help me on this? i am unable to proceed further without resolving this issue.

 

Please let me know if u did not understand or i missed something.

 

thanks in advance,

 

regards,

satya

Outcomes