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.

TMS320F28069: F28069 canbus receive problem

Part Number: TMS320F28069
Other Parts Discussed in Thread: TMS320F28335

I'm having some problems receiving data in Canbus 2.0B format. 

When CAN only sends a single piece of data at a time, the received data is normal. When CAN sends multiple data, the received data is abnormal.

The information I want to send is as follows:

The information read by the ID of 0x04f83402 is as follows: 

recv_L receive MDL data

recv_H receive MDH data

The ID of 0x04f83402 should read 0x00. Therefore, recv_L and recv_H should both be 0. What is the problem?

Li Feng, Chen

  •  Li Feng,

                    I don’t understand what you mean by "single piece of data". I presume you referring to referring to a single-byte like 0x00. The mailbox RAM is just like regular RAM. It stores the previously received data. When you power-up the device, the MBX RAM contains some random data. This data will be over-written with the bytes of a received frame. After you read the bytes from the receive MBX, those bytes still remain there. i.e. they don’t "vanish" or become zeroes. Since the DLC value of the received frame is known, you need to write your code in such a way that it grabs the true data and ignores the rest . for example, if a received frame has only 3 bytes, your code should only grab those 3 bytes and ignore the other 5.

  • I just set the MSGID of Mailbox14 to 0x84f83402. The data is only 1byte.

    I did not set other IDs: 0x84f83400, 0x84f83401, 0x84f83403. When CAN sends multiple data, the received data is abnormal.

    The information read by the ID of 0x04f83402 is as follows: 

    What is the problem?

    Li Feng, Chen

  • I already provided the solution in my previous post. You only need to read the byte(s) that were received. If you received only byte (indicated by DLC=1 for the received frame), then your code should only read that byte and ignore the rest. As explained before, the MBX RAM will contain “something”. It is just like regular RAM. 

    Please download my Application report http://www.ti.com/lit/SPRA876. It has many tested examples. Note that the examples were written for the TMS320F28335 device. However, they can be easily adopted for any 28x device with eCAN, provided you take care of the change in SYSCLKOUT speed and the resultant changes warranted for the CANBTC register. I also request you to look at the Debug tips provided. Most CAN issues can be resolved by going through this checklist.