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.

TMS320F280039C: MCAN configured as DCAN

Part Number: TMS320F280039C
Other Parts Discussed in Thread: C2000WARE

Hi Team,

Here are some issues from the customer may need your help:

The project needs to configure MCAN as a normal CAN for sending and receiving. Refer to the routine mcan_ex5_mask_filter_receive project of C2000WARE for sending and receiving. Encountered doubts during the configuration process.

1. What are the functions of the MCAN_DBTP register and the MCAN_NBTP register, and what are the differences?

2. The structure MCAN_BitTimingParams parameters in the routine include MCAN_DBTP's and MCAN_NBTP's. Why does MCAN_setBitTime only use the MCAN_NBTP part?

3. Do I only need to configure the MCAN_NBTP register and then use the MCAN_setBitTime() function to configure it?

4. Do I need to configure the two registers MCAN_DBTP and MCAN_NBTP to have the same bit time, for example, both are configured to 500kbps?

5. If MCAN is configured as a normal CAN, will MCAN_PSR.RFDF be set to 1 after receiving a CAN2.0 message frame?

--

Thanks & Regards

  • 1. What are the functions of the MCAN_DBTP register and the MCAN_NBTP register, and what are the differences?

    Classic CAN operates with a single bit-rate for the entire frame. CAN FD has two bit-rates, one for the nominal phase and another for the data phase. See www.ti.com/lit/SPRAD59 for more information.

    2. The structure MCAN_BitTimingParams parameters in the routine include MCAN_DBTP's and MCAN_NBTP's. Why does MCAN_setBitTime only use the MCAN_NBTP part?

    Not sure I understand. MCAN_setBitTime uses "bitTimes" which includes both NBTP and DBTP segments, as you yourself point out.

    3. Do I only need to configure the MCAN_NBTP register and then use the MCAN_setBitTime() function to configure it?

    If you are going to use the MCAN only in classic CAN mode, configuring NBTP alone is sufficient.

    4. Do I need to configure the two registers MCAN_DBTP and MCAN_NBTP to have the same bit time, for example, both are configured to 500kbps?

    From the title of your thread, it appears you want to use the MCAN in classic CAN mode. In this case, configuring NBTP alone is sufficient. It is also possible to use the MCAN module in CAN FD mode but still use the same bit-rate throughout the frame (BRS=0). In this case also, it should be sufficient to configure NBTP.

    5. If MCAN is configured as a normal CAN, will MCAN_PSR.RFDF be set to 1 after receiving a CAN2.0 message frame?

     I think what you are really asking is what would happen when a CAN FD frame is received by a MCAN module which has been configured for Classic CAN mode. This is not clearly stated in the module spec. I need to try it out.

  • Thanks Hareesh,

    5. If MCAN is configured as a normal CAN, will MCAN_PSR.RFDF be set to 1 after receiving a CAN2.0 message frame?

     I think what you are really asking is what would happen when a CAN FD frame is received by a MCAN module which has been configured for Classic CAN mode. This is not clearly stated in the module spec. I need to try it out.

    Let me clear, the customer want to know if a MCAN module is configured as a classis CAN, what is the behavior after received a classis CAN message. For simple, they want to treat CAN FD module as a classic CAN module.

    And the customer has another question:

    Using mcan_ex5_mask_filter_receive, change TX/RX to GPIO4/5, disable FD mode, disable Bit rate switching. After changes, the device only can receive once CAN(not CANFD) message, the second interrupt can not be triggered.

    And there is the same phenomenon even use mcan_ex8_range_filter_receive.

  • Hi Yale,

    My customer had exact same problem:

    Using mcan_ex5_mask_filter_receive, change TX/RX to GPIO4/5, disable FD mode, disable Bit rate switching. After changes, the device only can receive once CAN(not CANFD) message, the second interrupt can not be triggered.

    except that they make changes on top of ex10.

    In case you want to try it, their problem is solved by removing break point in the ISR.

    Best regards,

    Hang.

  • the customer want to know if a MCAN module is configured as a classis CAN, what is the behavior after received a classis CAN message. For simple, they want to treat CAN FD module as a classic CAN module.

    Yale,

          This is a simple and straightforward case. If the module is setup to receive the message, it would be received and an interrupt generated (if configured and enabled). If the module is not configured to receive the message, it would be ignored (but an ACK would be generated). This is how all CAN modules behave. Nothing special about MCAN here. 

    After changes, the device only can receive once CAN(not CANFD) message, the second interrupt can not be triggered.

    Please run without BP, as Hang suggests.