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.

Tms570ls1224: DCAN protocol, problem of communicating two microcontrollers through CAN Bus

Part Number: TMS570LS1224
Other Parts Discussed in Thread: HALCOGEN

Hi, All. I have 2 TMS570LS1224 Launchpad, I want to send and receive CAN messages between them. I follow the official TI tutorial, "training.ti.com/hercules-how-tutorial-can-communication". However, it does not work.

Firstly, for the hardware part, I use CAN Transceiver MCP2551, data sheet can be found here, "ww1.microchip.com/.../21667f.pdf". I connect Launchpad, J10, pin 38(Rx) and 39(Tx) to the transceiver, Rxd and Txd. The VSS is connected to the ground, VDD is connect to 5v power supply from Microcontroller. CAN_H is connected to another transceiver's CAN_H, so does CAN_L. Both CAN_H and CAN_L connect to a 200 Ohm resistor. I think that I am wiring correctly. All the wires inserts tightly in the breadboard.

Secondly, for the software part. For transmit code, I have no idea how to test whether it sends or not. The code is same as the official Tutorial posted above. For the Receiver code, this statement "while( !canIsRxMessageArrived(canREG1, canMESSAGE_BOX1) ) ;" never ends. The sender is send to canREG1, canMESSAGEBOX_1, and receiver is also receive at canREG1, canMESSAGEBOX_1. The HalCoGen is configured exactly same as the tutorial without any error, same as CCSv7.

Also, the tutorial's  receiver code contains a line, "error = checkPacket(&tx_data[0], &rx_data[0], D_SIZE)", at 13:30 of the video. There is no tx_data defined and declared in receiver's project, it would result in a compile error.

Thanks for help.

  • Hello Joe,

    Have been able to successfully send and receive CAN data in loopback mode? This is probably the best first step in your learning experience. There are an example code sets included in Halcogen Help-->examples that performs this task.

    In lieu of using loopback mode, can you put an oscilloscope on the Tx/Rx pins to see what signals are being transmitted/received if any? This could be viewed both at the MCU pin as well as at the CANH/L pins on the transceiver to insure data us making it to the bus. Be careful when probing the CAN bus as the probe loading could impact the CAN bus.