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.

CAN communication Bus busy check in C2000 series

Other Parts Discussed in Thread: TMS320F2808

Hi Hareesh,

If the nodes those who lost the arbitration keep trying for bus access then it will be in a tight loop right?

Suppose I have 4 nodes and all are sending data continuously through CAN(Consider first node has highest priority and it continues for remaining(2,3,4)). Then the possibility of getting Bus access for 4th node will be difficult? or how it get handled?

In reply to Dheeraj Kunnath:

How many retry will execute for the data transfer?

Answer--> In case of lost arbitration, retries will be forever. In case of error, it is a bit more complicated, depending on who is the source of error.

 

Hareesh

  • Dheeraj,

                In theory it is indeed possible for a MSGID (note that I am not using the word “node”, but a MSGID is indeed tied to a node; you should not use the same MSGID in more than one node) with a higher priority to hog the bus and not let other (nodes with) lower priority MSGIDs to get a chance to transmit. This is possible when the bus load is close to 100% or 100%. This must be handled in the application.

     

    But usually it is not the case that a bus operates at 100% bus load in a real-world application. There will be bus idle times when nodes with lower priority MSGIDs should be able to transmit. In a high-bus-load situation, it is certainly possible that lower priority messages don’t go out in time (or don’t go out at all).

  • Do we need to configure the bus idle time or is it a common default period ?
  • HI Hareesh,
    Thanks for your input,
    How the bus load will be calculated?In TMS320F2808 there are 32 mailbox, So a try of 32 Messages at a time can be consider as 100% load?
    How the bus idle time configured? Is it configured through register setting or is it a default value for CAN communication?
  • The minimum bus-idle-time is fixed by the protocol. The maximum can be anything and is determined by the application.

    Bus load is again determined by the application. Say you configure 2 mailboxes for transmission. You could set the flag for transmission at the same time and set the flag again as soon as the first transmission is over. This way, both MBXes keep transmitting non-stop. If you monitor the bus load on a bus analyzer, you should see 100% bus load.
  • Dheeraj,

                For general information about the protocol itself (which is not covered in our documentation), there are excellent resources online.

    • Wikipedia & many videos on YouTube cover the protocol extensively.
    • Good resource for a tutorial is https://www.kvaser.com/about-can/the-can-protocol/.
    • I have benefited immensely from reading the book “A Comprehensible Guide to Controller Area Network” by Wilfried Voss.
    • There are also good Application Notes on our website. You can find them listed in the References section of my own app.note SPRA876.

  • Hi Hareesh,

    If I configured all 32 mailbox(TMS320F2808) with data and giving command to TX, will each message box try for bus at same time or it is a sequential order of bus access?

    If all 32 trying bus access together how the arbitration works? arbitration comes in picture with data field (as all 32 mail box are using same Message ID/ identifier)?

    Thanks in advance..

  • The answer to your question is in the eCAN Reference Guide: "If two mailboxes have the same priority, then the mailbox with the higher number is transmitted first." To elaborate, if you have not programmed the transmit priority for the mailboxes, i.e. TPL = 0 (or if the TPL value is the same), then the numerically higher mailbox will get the priority. If you initiate transmission out of all 32 MBXes at the same time, the sequence of transmission would be MBX31, MBX30, MBX29,.......MBX1, MBX0. You can understand this easily if you run the example CAN_TRPRTSTP_A from my app.note SPRA876.

     

    The word "arbitration" in CAN world refers to arbitration between two nodes competing to gain access to the CAN bus. It does not refer to mailboxes within the same node. Arbitration is done solely based on the MSGID of the frames competing for the bus. Within a node, transmit priority is based on the MBX number (if TPL value is equal between the mailboxes). If the TPL value is not the same, then priority is based on the TPL value. Again, please refer to my app.note example.

  • Thank you Hareesh for your valuable input.