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.

A small can of CAN expertise needed

Part Number: EK-TM4C123GXL
Other Parts Discussed in Thread: TCAN1042H

I copied the example C:\ti\TivaWare_C_Series-2.2.0.295\examples\peripherals\can\simple_tx.c and built it. The code runs but I got no wiggles out of PB5, it just stays high. PB4 and 5 are RX and TX, not CANL and CANH so I did not think I needed terminators. Also In applications I have seen it often feeds a device like a TCAN1042H that converts tx and rx into/from CANH/CANL. What the heck, I put 130 ohms between them and started seeing signals for a few seconds and then it would shut down.

Also the polarity of RX is the same as TX, where before it was always low. I ain't the sharpest knife in the drawer and this is a whole new can of worms for me so a bit of explanation would help. When my prototype arrives the TM123 will be connected to a TCAN1042H.

Thanks,

John

  • Hi John,

      There are several things as to why you cannot see CAN0TX on PB5. In order to run CAN example, you must first create a CAN network. A CAN network must at least consist of two nodes. If you simply run simple_tx.c then it will not work. You need to have another board running the simple_rx.c on a two-node CAN network. The second board running simple_rx.c will receive packets from the board that runs simple_tx.c. Note that in a real CAN network, each node must have a CAN transceiver which is not available on the LaunchPad. There needs to have a proper termination resistors on the CAN bus too. 

      This app note contain more CAN examples that are ready to run.   https://www.ti.com/lit/pdf/spna245

  • Oop!

    Hi Charles, I had not meant to send that original and I updated it without realizing you had answered. You confirmed my suspicions about unrequited love between CAN devices. Perhaps I finally saw some data until it went to offline mode. Anyway I feel that the example code has now 

  • Hi John,

      Please update me again when you run the example with the TCAN1042H connected to the network. I think what might have happened right now is that CAN transmit error counter (TEC) has exceeded 255 which forces the node into bus-off state. You can check the CANSTRS and CANERR to see what errors you are getting. I will suggest you wait unit you have a full network to rerun the example as without the transceiver and the network setup, you will get errors.