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.

TMS320F28388D: TMS320F28388D: Procedure for Dynamic CAN Baud Rate Switching (250kbps to 500kbps) during Runtime

Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE

I am currently working with the TMS320F28388D (C28x) and have successfully implemented a functional CAN A module operating at 250kbps.

I am looking to implement a feature that allows the system to switch the baud rate to 500kbps during runtime (dynamically) without a full system reset.

  • Hello Tushar,

    Unfortunately, we do not have a CAN autobuad example but there is a TEST feature that can put the CAN in silent mode.  In this mode, the CAN will be able to receive frames but will not send ACK or error frames, essentially making the node in listening mode only.

    You can implement a routine following the pseudo-code below:

    a. System Initialization (similar to Device_Init() in the C2000Ware examples where device clocking is set up)

    b. Configure GPIO pins for CAN TX/RX (refer to CAN examples on how this is done)

    c. Initialize CAN using API CAN_initModule()

    d. Set the SILENT mode using API CAN_enableTestMode(CANbase, CAN_TEST_SILENT)

    d. Set CAN Bit Timings using API CAN_setBitRate() - set flag/options for the different bit rates like 250kbps/500kbps/1Mbps...etc as this will be called in a loop

    e. Set CAN Interrupt routes (if you decide to use ISRs) - follow the CAN examples for this

    f. Setup MessageObject using API CAN_setupMessageObject() - see the different CAN examples as reference.  You can set up message filtering, IDs and if ISR is activated or not

    g. loop through steps c through f with each loop using a different baud rate setting and check either through ISR or looping to see if a valid message is received matching what is set up in CAN_setupMessageObject().  Message object should match the attributes (control, ID, DLC) of the CAN frame being sent to the CAN bus.

    Upon valid frame reception, turn off SILENT mode using API CAN_disableTestMode(CANbase)

    Hope this will get you started.

    Regards,

    Joseph