This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28379D: CAN Communication Transmission Status Bit

Part Number: TMS320F28379D

Hello,

I'm using the TMS320F28379D microcontroller and I'm trying to use the TxOk bit in the CAN_ES register in my interrupt routine to determine whether CAN is communicating successfully.

As expected, the TxOk bit remains low before I plug in the CAN communication cable.   Then, the TxOk bit goes high when I plug in the CAN communication cable.  However, when I disconnect the CAN communication cable, the TxOk remains high forever, rather than going low.

Why is this happening?  Based on the technical reference manual, it says

Transmission status Bit: This bit indicates the status of transmission.
The bit will be reset after the CPU reads the register.
0 No message has been successfully transmitted since the last time
when this bit was read by the CPU. This bit is never reset by CAN
internal events.
1 A message has been successfully transmitted (error free and
acknowledged by at least one other node) since the last time when
this bit was cleared by a read access of the CPU.

Based on this, I would expect the bit to go back low after I unplug the CAN communication cable since obviously no message could have been successfully transmitted and acknowledged since my last read attempt of this register in the previous call of the interrupt routine.  

Thanks,

Kevin 

  • Kevin,

    I'm using the TMS320F28379D microcontroller and I'm trying to use the TxOk bit in the CAN_ES register in my interrupt routine to determine whether CAN is communicating successfully.

    By "communicating", are you referring to Transmit or Receive or both? In any case, isn’t the assertion of interrupts evidence for communication? TxOk bit is typically used for polling. I am curious as to why this bit is important to you, when you are using interrupts. Anyway, the key statement here is “The bit will be reset after the CPU reads the register.” Remember: Any read of the CANES register will clear this bit.

    However, when I disconnect the CAN communication cable, the TxOk remains high forever, rather than going low.

    How do you determine that TxOk bit is still set?

    ".. no message could have been successfully transmitted and acknowledged since my last read attempt of this register in the previous call of the interrupt routine.."

    What you say is true. Does your network contain only two nodes such that when you disconnect one node, the next attempted transmission would cease to be successful? Remember, TxOk bit will be set if an ACK is received from any node, even if that node did not end up actually receiving that message.