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: CAN didn't give out data if call "CAN_disableController" right after "CAN_sendMessage"

Part Number: TMS320F28388D


Hi expert,

My customer encountered an issue on CPU1. They find calling "CAN_disableController" right after "CAN_sendMessage" will disrupt the CAN communication. But adding a delay like "DEVICE_DELAY_US(180);" between "CAN_disableController" and "CAN_sendMessage" can solve this issue. 

As for the delay length, we found "DEVICE_DELAY_US(170);" will not work, while "DEVICE_DELAY_US(180);" will work. Could you give more explanation or debug suggestion for this to find the root casue?

SharePeripherals.zip

Thanks

Sheldon

  • Hi Sheldon,

    Function CAN_sendMessage() requires transferring data from message RAM to IF registers, waiting for busy bit to clear, configuring the CAN data register, setting up the TX rqst bit to finally start sending the data to the TX pin.  CAN IP protocol would also wait for the ACK bit from a receiver in order to complete the loop, otherwise the module would keep re transmitting the data until message is received.  All these activities in the CAN_sendMessage function would take up some latency, as to how long will depend on the length of data being transmitted, SYSCLK speed and if there are valid ACK received from other nodes.  It might work in the user's current configuration but might require more/less delay time if data or set up will change in the future.

    I think the best way to deal with this is to poll of the TX OK  in CAN_ES register immediately after CAN_sendMessage() rather than adding a delay time which may vary in the future if customer would change the CAN configuration/set up.

    Best regards,

    Joseph