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 Tx Rx with Simulink model CAN_MultiID_Tx_Rx_F2837xD

Part Number: TMS320F28379D
Other Parts Discussed in Thread: LAUNCHXL-F28379D, C2000WARE

Hello to the TI team

I have been working with the TMS320 F28379D LaunchPad XL development board with Simulink auto-coding (MATLAB r2020b).

When I Monitor&Tune or BuildStart&Deploy the model "CAN_MultiID_Tx_Rx_F2837xD.slx", I don't manage to see any CAN data when I'm connected to the board via PEAK to the J12 CAN-H & L.

I have read several past posts on the topic:

e2e.ti.com/.../launchxl-f28379d-simulink-can-bus-transmit
e2e.ti.com/.../faq-can-frequently-asked-questions

Then I checked my wiring and also some of the details regarding the OSCCLK. Hopefully J12 is the right place to connect to.

If anyone has run the model "CAN_MultiID_Tx_Rx_F2837xD.slx" and successfully viewed CAN traffic, I would appreciate some guidance.

I am unsure if the model's CAN baud rate is 500 or 1000 kb/s but I get a BusHeavy when setting the Peak PCAN-View to 500. Typically I have managed to get CAN comms working on several prior platforms from NXP, Raspberry Pi etc, so I'm looking to understand what I might be doing incorrectly within a TI environment.

I hope the 3 images are clear and legible.

  • Chris,

    I believe the issue is in the pin assignment tab, where Tx is assigned to GPIO31 and Rx is assigned to GPIO30.  On the LaunchPad GPIO12 is Tx and GPIO17 is Rx.  This is captured on page 10 of the schematics, located in this C2000Ware path C:\ti\c2000\C2000Ware_4_00_00_00\boards\LaunchPads\LAUNCHXL-F28379D\R2.0

    Best,

    Matthew

  • Chris,

        I recommend you run the simple CAN transmit example from my app.report (www.ti.com/lit/sprace5). The example can be downloaded as part of C2000ware. These are tested examples. Ensure this example works and you are able to see the data in PCAN-view. Once you ensure H/W is good, you can focus on Simulink. Likely incorrect GPIO assignment like Matt pointed out.

  • Chris,

    In this model "CAN_MultiID_Tx_Rx_F2837xD.slx" loopback is enabled by enabling the self test mode. You may need to disable this self test mode and add the proper Tx and Rx pin assignments in the configuration parameters for F28379D Launchpad.

    Also, if you are using latest R2021b release, the CAN Transmit and Receive blocks support transmission and reception of multiple IDs in a single mailbox in R2021b release. You may configure these blocks directly instead of doing it by custom code.

    Best Regards,

    Ram Alla | MathWorks

  • Thank you Matt. Apologies for the newbie questions.

    I've looked at the board schematic and the Dev Kit pdf. Can I be sure that the numbering printed on the board (12 and 17 for example) corresponds to GPIO12 and GPIO17? I don't see a pin to GPIO mapping table but I might be wrong.

    Also I don't know the exact electronic difference between Tx/Rx and High/Low since I haven't designed PCB layouts, I'm usually connecting to a High and Low pin via a DB9 connector.

  • Thank you Ram,

    I've looked inside the model and I am not able to see anything that I can alter. I searched for documentation and found this page but I'm not sure if it's closely related: https://uk.mathworks.com/help/supportpkg/texasinstrumentsc2000/ref/sect_hw-imp-pane-c28x-sci.html 

    Could you provide a few screenshots or images to describe the steps to add 'proper Tx & Rx pin assignments in the configuration parameters for F28379D'?

    I'm sure once I've picked up the basics then I won't ask such trivial questions. I'm more familiar with the config blocks for other chipsets such as NXP, but in this Simulink model I don't see much that I can edit, so perhaps it's a case of adding certain library blocks.

    If you have the time to attach/explain a working slx model vs a non-working one, then that would provide useful guidance.

    Kindest regards

    Chris

  • I've looked at the board schematic and the Dev Kit pdf. Can I be sure that the numbering printed on the board (12 and 17 for example) corresponds to GPIO12 and GPIO17? I don't see a pin to GPIO mapping table but I might be wrong.

    Those are indeed the GPIO numbers.

    Also I don't know the exact electronic difference between Tx/Rx and High/Low since I haven't designed PCB layouts, I'm usually connecting to a High and Low pin via a DB9 connector.

    Please refer to the wiring diagram in www.ti.com/lit/spracu9. Tx/Rx are pins at the MCU boundary. CANH & CANL are pins at the transceiver boundary.

  • Thank you. Having seen the assignments already set up in the Model Configuration for eCAN_A and eCAN_B, I saw that GPIO12 & 17 were assigned to eCAN_B, so I swapped the setting in the Simulink CAN blocks to use B instead of A. I will continue to do some more testing.

    Kindest regards

    Chris

  • Chris,

         This is not relevant to the debug, but "eCAN" refers to the CAN module in older 28xx devices. The CAN module in this device is called DCAN. Perhaps Mathworks needs to correct the terminology. eCAN and DCAN are completely different CAN modules.