CAN protocol basics

Hi all,

Since i am new to CAN protocol i have the following doubts during my study, could anyone help me to understand the queries.

1. Why dominant bit has high priority in CAN protocol?

2. Is it possible to assign same CAN ID for two messages? If yes, then how does the arbitration handle for this?

3. If data and remote frame with same message ID and start transmit at same time which frame(data or remote) win the bus?

4. The nodes connected in the bus have different baud rates, how does the synchronization happened?

5. How can calculate the time taken to transmit a CAN message with  11 bit identifier at 512 kbps?

6. How does the uC get to know whether the received bit is dominant or recessive?

Thanks in advance

  • Hi Prakash,

    Here are some useful overviews of the CAN physical layer and protocol that you can reference:

    www.ti.com/.../sloa101a.pdf
    www.kvaser.com/.../

    To answer your questions:

    1. Dominant bits are said to have priority because they are strongly driven by a CAN transceivers, whereas the recessive bits are not driven. This means that whenever any transceiver is dominant, the entire CAN bus is dominant. The CAN bus is only recessive if all CAN transceivers are recessive.

    2. No, arbitration requires that each node sending a message have an unique identifier field.

    3. The RTR bit following the identifier is recessive for a remote frame and dominant for a data frame, and so in this case the data frame would win arbitration.

    4. Each node on the bus should be configured to have the same baud rate. (There may be separate baud rates for the arbitration portion and data portion if the CAN FD protocol is used, but still in this case the baud rate configurations need to remain compatible from node to node).

    5. The time required for each bit is the reciprocal of the baud rate. The total time of a message would then be the number of bits transmitted times the time per bit plus any propagation delays that occur in the network (e.g., due to transceiver delays, cabling, etc.).

    6. The CAN transceiver (PHY) serves to translate the dominant/recessive bus states to high/low logic states that can be detected by an MCU. Dominant bits are represented by a logic low and recessive bits are represented by a logic high.

    Best regards,
    Max
  • In reply to Max Robertson:

    Hi Max,

    Thanks for your reply. Could you please explain little bit more about the timing calculation of CAN.

    Max Robertson
    5. The time required for each bit is the reciprocal of the baud rate. The total time of a message would then be the number of bits transmitted times the time per bit plus any propagation delays that occur in the network (e.g., due to transceiver delays, cabling, etc.).

    IF you consider for example UART protocol the time taken to transmit a single byte includes the start and stop bit timings also. In the same CAN has more number of bits, so for the case of 11 bit identifier and 29 bit identifier the time taken to transmit a message at 512kbps will be differed. If you knew any page which explains more about the CAN protocol timing, please let me know.

  • In reply to Prakash Balagangatharan:

    Prakash,

    Yes, you are right - the CAN protocol introduces additional overhead bits (like the identifier field) within its frame structure, and this makes the time required for a full frame longer than the time it would require for just the data portion. You can compute the total time as long as you know the different fields that make up the frame - you can find this information in the links I gave in my post above.

    I hope this is clear; please let me know if you have questions.

    Max