lpcware

CAN- Automatic retransmission

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 18, 2016 by lpcware
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.

Outcomes