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.

CAN bus simple examples not workinh on Stellaris LM4F120

I'm testing the CAN library from StellarisWare with two Stellaris LM4F120 boards. One is programed with the simple_tx code and the other with the simple_rx example code and the other with the simple_rx example code. Both codes were adapted to the LM4F120 with the right CAN pins. The CANTX of one board is connected directly to the CANRX pin of the other, and vice-versa. When both boards are running, no message of "send/receive success" are sent through UART to the terminal. The board with the simple_tx code only keeps counting the sent message but the "total count" is always zero. Terminal communication via UART is working well on both boards. What can I do?

  • Hi,

    No, no, big mistake to cross-link the micro's CAN pins directly. This is not an UART. You need an interface circuit between the two boards - the input for that interface will be CAN_RX and CAN_TX (micro's pins), but the output will be CAN_HI and CAN_LO, linked on a transmission line, adapted to both ends for the characteristic impedance (usually 120 ohms). Such interface can be SN65HVD1050D from TI for instance. All CAN_HI pins will go to the same wire, as well as all CAN_LO pins will go to the other wire.

    Look for this interface circuit and the application notes related to CAN on TI site.

    Petrei

  • Yeah, I did it to simplify the test, but it made it fail. Thank you!