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.

TMS320F28379D: CAN bus communication delay

Part Number: TMS320F28379D

I am sending data between 2 dsp board via CAN bus.

Its running and even I am receiving correct data on CAN analyzer as well.

What is the minimum delay is required between sending.

I am sending data at 1000 kbps and sending from 33 micro second loop and loosing data, if I increase the delay I got some data.

I observed that minimum 120-140 micro second delay is required to send data over the CAN bus.

I  calculated following

Can bus, MCU clock speed is 200 MHz.

Max bitrate is 1,000,000 // 1000Kbps.


Each frame has total 131 (approx. )bits including 64 bits of data.


So 1,000,000/131 = 7633 frames can be sent through CAN in 1 seconds


So 1 frame takes 1sec/7633 = 131 micro seconds to send.

-------------------------------------------------------------------------------------------------

if I send 10 times at every 30 micro seconds then I hardly received 2 or 3 data packets on other board.

Is there any way I can send data at every 30 micro seconds through the CAN bus ?

Sample code:

for (;;)

{

Can_send(,,,);

delay (30);  // I am sending data in every 30 micro seconds.

}

  • What is the minimum delay is required between sending.

    There is no "minimum delay" as such. you can send frames back-to-back. The important thing to remember is that transmission of a frame will commence only after the transmission of the previous frame has been completed.

    So 1 frame takes 1sec/7633 = 131 micro seconds to send.

    That is only an approximation. The exact number of bits is never constant. It will change because the number of stuff bits will change based on the data being transmitted. I could take up to 145 us.

    if I send 10 times at every 30 micro seconds then I hardly received 2 or 3 data packets on other board.

    I don't understand how you can transmit a frame every 30 us, when every frame takes at least 131 us to complete transmission.

    Having a constant delay between transmissions is not correct. You need to ensure the previous transmission is complete before initiating the next transmission.