CAN- Automatic retransmission

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CAN- Automatic retransmission

338 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by akshimmu on Mon Apr 18 23:02:57 MST 2016
I have written the CAN driver for LPC1778 CAN module using Keil IDE as follows:

if(can12->SR & (1<<2) && (!bMsgSent))/*tx is free & msg not sent*/
{
can12->TFI1 = MsgBuf_TX.Frame; 
can12->TID1 = MsgBuf_TX.MsgID;
can12->TDA1 = MsgBuf_TX.DataA;
can12->TDB1 = MsgBuf_TX.DataB;
can12->CMR = m_bCAN_mode;
bMsgSent=1;
}

                delay_ms(100); //100 ms delay

if((can12->SR & (1<<3)) && bMsgSent) /*transmission complete*/
{
bReturn_val=1;
}


I have no other nodes on the bus and am using the simulator provided by keil. As per CAN Specs,a message is treated as successfully transmitted only after it has been acknowledged by any other node. But my doubt is, how does Bit 3 in GSR(Transmission complete) get set(bReturn_val=1) if no other nodes have acknowledged the transmitted message?
Is there something im missing?
The CAN is in normal mode.
Labels (1)
0 Kudos
1 Reply

255 Views
lpcware
NXP Employee
NXP Employee
bump
0 Kudos