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.

CCS/TMS570LC4357: CAN communication between transceivers

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN, SN65HVD251, TMS570LS3137, , TMS570LS1227

Tool/software: Code Composer Studio

I did configuration in HALCOGEN, in CCS but on the transmission pin it transmits nothing. From the microcontroller at transceiver and after the other microcontroller nothing happens. WHY?

  • Hello,

    Please, give more information about you hardware setup.

  • This is the part of halcogen with tx configuration.  

  • Hello,

    I don't see any activated Message box.

    Is it possible to give more information on your hardware setup (MCU, Transceivers, connections)

  • Sorry, message box was enabled. 

    Can transceivers SN65HVD251, I tied wires from the pins from the first  MCU to the first transceiver TX-TX, RX-RX and second transceiver at the second MCU.

  • Please tell me what's the matter with canMessage_Box1, canMessage_Box2 etc, where do i find them, where i find them in the program???

  • Hello,

    You must connect 120 Ohm termination resistors at both ends (between CANH and CANL). Also, check whether Loopback mode is disabled.

  • How do I check this?I have rezistors in the circuit.

  • How to configure correctly Can msg1-8 for tx and rx project?

  • Hello,

    Attached is project (both CCS and HALCoGen) that sends few bytes from CAN1 to CAN2. The code is for TMS570LS3137 but you can use it as a reference.

    8831.TMS570LS3137PGE_CAN.zip

  • But on the Can side I see that you didn't configure anything in Halcogen.

  • Hello,

    Sorry, during renaming the files all settings were lost.

    Attached projects were made for tms570ls3137 HDK and interrupt method is used. HDK has CAN transceivers on it.

    5857.TMS570LS3137ZWT_CAN1_2_CAN2.ZIP

  • For the tx and rx project the same CAN mode must be configured? For exemple CAN1 at tx and CAN1 at RX?

  • Why not read on the oscilloscope anything from yhe TX pin on microcontroller (i used DCAN1TX/3.5A) on J10???

  • Hello,

    If it is possible, attach your HALCoGen project so I can check the settings

  • 1323.PROIECT1.zip

    I have two projects(One for tx and one for rx)

    I'm takeing data from the sensor, arrived at MCU1, throught the CAN i have send them to other microcontroller, and after the computer. 

    The CAN side doesn't work. Basically, at the end, i have the same data in two different ports in the terminal. I would like to mention that I made the bus with the resistors and the transceivers. 

  • Hello,

    You don't have CAN interrupts enabled in VIM module. Also canMessageNotification in notification.c need to be modified.

    I recommend you to check the example "example_canIntCommunication.c". This example is not available for TMS570LC4357 but you can see the instructions for TMS570LS3137 ( you can open help file for  TMS570LS3137 or you can create a project for TMS570LS3137 and read Help).

  • How do I enable interrupts in "VIM module"??

    And what needs to be changed in "canMessageNotification in notification.c"??

  • Hello,

    Interrupts can be managed by HALCoGen (for example from "VIM Channel 0-31" tab you can enable/disable Channel 16, CAN1 High interrupt).

    Chapter 15 in TRM is dedicated to Vectored Interrupt Manager (VIM) Module. There you can find more information on VIM.

    I've attached project in previous post to refer to. canMessageNotification function is in notification.c file. CAN examples are available in HALCoGen examples folder as well. You can find an example that does not use interrupt method.

  • I think my problem is in halcogen. The code is exactly as in the example and from the microcontroller on the TX pin does not send me anything, it only sends me the start bit.

  • With the Rs pin from the transceiver where do I connect it?

  • I think my problem is in halcogen. The code is exactly as in the example and from the microcontroller on the TX pin does not send me anything, it only sends me the start bit.

    why???

  • Hei, 

    When I do the configuration in Halcogen for CAN1 tx, I have to set something to CAN1 Port???

  • Hello,

    DCAN1TX is exposed to connector J10, pin 45. Check whether you are probing the correct pin.

    I don't have TMS570LC4357 at my place but I expect to receive one next week. After receiving I can make code for TMS570LC4357

    I've just tested the code I attached in this thread for TMS570LS3137 and it works.

  • The pin is correct. Maybe the problem is in Halcogen in configuration, because the code part is fixed as in the example. 

    Can transmit and can receive. 

    On this part og Halcogen i meant if i change something: 

  • When I make the settings here, how many files should I finally have in the source?

  • Here I have to change something?

  • Hello, 

    Do you have any idea why the pin CAN transmit nothing?

  • On the device, what should I choose? Which is the difference between TMS570LC4357ZWT and TMS570LC4357ZWT_FREERTOS?

  • Hello,

    Option with FREERTOS generates files and drivers to use TMS570LC4357 with FreeRTOS. In your case you should use the other option (without FreeRTOS).

    Attached is a project that uses TMS570LC4357 and sends message from CAN1 to CAN2. I've used HDK which has connected CAN transceivers on board. HL_notification.c file is modified as well.

    0028.CAN1_TO_CAN2_4357.ZIP

  • What is represents HDK? 

    And why changes should be made to "notification.c?

  • Hello,

    HDK comes from Hercules Development Kit:

    http://www.ti.com/tool/tmdx570lc43hdk

    Interrupt handler calls canMessageNotification() which is in notification.c I had attached both HALCoGen and CCS project so you can follow the code.

  • If I have two projects, CAN_TX and CAN_RX, I make changes in both projects?for example and in CAN_TX and in CAN_RX or just in one of them?

  • Hello,

    The changes depends on your application. In attached project changes are to confirm data is received.

  • I have two microcontrollers and tow Can transceivers.I have to get data from a sensor, go to the microcontroller, then follows the part of can, one after the other microcontroller and after the Pc. This part with the two transceivers I do not understand and not the configuration in halcogen, For example, how many projects i have to have, One separate for TX,  and one separate for RX, or how? 

  • Hello,

    Here you can find Introduction to the Controller Area Network:

    http://www.ti.com/lit/an/sloa101b/sloa101b.pdf

    After that I recommend you to start with CAN example that is under HALCoGen installation folder. With this example you can start dealing with CAN without using transceivers with LauncPad. After that you can try connecting transceivers and connect two LaunchPads or two CAN modules of single LaunchPad. The way to connect transceivers to MCU could be found in HDK schematic diagrams ( schematic diagram for TMS570LS1227 HDK could be found here: processors.wiki.ti.com/.../TMS570LS12x_HDK_Kit: ) Also, try to run the code I've attached in this thread.

  • How is the difference between can controller and can transceiver?

  • Hello,

    The following is from wikipedia:

    Each node requires a

    • Central processing unit, microprocessor, or host processor
      • The host processor decides what the received messages mean and what messages it wants to transmit.
      • Sensors, actuators and control devices can be connected to the host processor.
    • CAN controller; often an integral part of the microcontroller
      • Receiving: the CAN controller stores the received serial bits from the bus until an entire message is available, which can then be fetched by the host processor (usually by the CAN controller triggering an interrupt).
      • Sending: the host processor sends the transmit message(s) to a CAN controller, which transmits the bits serially onto the bus when the bus is free.
    • Transceiver Defined by ISO 11898-2/3 Medium Access Unit [MAU] standards
      • Receiving: it converts the data stream from CANbus levels to levels that the CAN controller uses. It usually has protective circuitry to protect the CAN controller.
      • Transmitting: it converts the data stream from the CAN controller to CANbus levels.
        For example, this is a CAN transceiver used in Hercules Development Kit:

        http://www.ti.com/lit/ds/symlink/sn65hvda541-q1.pdf

  • Hello,

    Why don't I read any data on CAN pins,

    for example I load the program on the microcontroller and when I try to read it does not work, as if the pin is invalid.