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.

TMS320F28335: Receiving CAN communication error

Part Number: TMS320F28335

When some messages (MBOX) are sent to the TSM320F28335 some data are not received correctly. 

Example: 
MBOX 10, ID = 0x110, byte0 (control mode), byte1 (start), byte2 and byte3 (Pot_target), byte4 and byte5 (vSC_target)
the values sent by bytes 0, 1, 2 e 3 are correct, but the value sent by bytes 4-5 are not.


MBOX 12, ID = 0x112,  byte0 (control mode), byte1 (start), byte2 and byte3 (vBat1_target), byte4 and byte5 (vBat2_target),byte6 and byte7 (vSC_target)
the values sent by bytes 0-1 are correct, the value sent by bytes 2-3 is incorrect and the values sent by bytes 4-5 and 6-7 are correct, although with its variables inverted. Example: value sent - bytes 4-5 (vBat2_target) = 150 and bytes 6-7 = 200 (vSC_target); values received -  vSC_target = 150 and vBat2_target = 200.

The software used for communication was Busmaster and the frequency is 250 kHz

The images bellow are from de code on CCS, the configuration on Busmaster and a test that was made

CAN mailboxes code
1.jpeg
eCAN registers
2.jpeg
MBOX ID configuration
3.jpeg
Busmaster configuration
4.jpeg

Start byte order: Intel (little endian)
Modo_con, Pot_target and vSC_target byte order: Motorola (big endian)

6_1.jpeg

Start byte order: Intel (little endian)
Modo_con, vBat1_target, vBat2_target and vSC_target byte order: Motorola (big endian)

Test made
Test.jpg

What could be causing these errors? Are there any other configurations required?

  • Can you write data to mailbox instead of using bit field?

    If DBO=1:

    ECanaMboxes.MBOX3.MDL.all = 0x33221100;
    ECanaMboxes.MBOX3.MDH.all = 0x77665544;

  • Hello
    I tested it and these are the results:


  • What is the received data?

    Is the tool (your GUI) you used for CAN message transmit and receive? or you are using different protocol over CAN layer?

  • I'm using a PCAN-USB pro FD from PEAK. There's only one field bus connected and i'm using it to transmit and receive messages.

    The received data was:

    raw value = 0x77665544
    physical value = 2.0032e+009
    data bytes = 33 22 11 00 77 66 55 44

    Like the image sent before

  • Hi, I tracked the data to verify whether it was being send correctly to the DSP and that's what I got



    It seens to be sending it correctly, but when it gets to the expressions the vBat1_target shows a wrong value. The configuration of vBat1_target and vBat2_target is practly the same.

  • Hi ,

    What is the physical value (160, 100, or 200), and how is it related to the RAW value (0x640, 0x3E8, or 0x700)? If the physical value is the floating point value of the raw value, how do convert it to hex number (IEEE-754)?

    I assume the DBO=0 (CANMC.10) in your configuration. If DBO=0, the CANMDL[31:24] is byte 0, and CAMMDL[7:0] is byte 3, CAMMDH[31:24] is byte 4, and CANMDH[7:0] is Bytes 7. I draw a table below:

    The VSC_target should be 0xD007 (or 0x07D0), and vBat2_target should be 0x4006 (0r 0x0640 based on your definition). This is different from the value in your table: