10 years, 11 months ago.

What should my circuit look like when testing CAN loopback?

Hello mbed community,

I'd like to ask a question about the loopback program in the CAN Handbook. I have copypasta'd the code and compiled it successfully. My guess is that I need two tranceivers for this, but after setting it up and firing up the mbed, I see "send()" and "loop()" a few times before it starts outputting question marks. Maybe I am not doing something right, but just to be sure I'd like an example schematic on how to test CAN loopback communication. If anyone could provide me with this schematic or useful information, that'd be really great. I am using two mcp2551 CAN tranceivers. I will of course give needed answers to your questions to speed up the helping process. Thank you in advance.

2 Answers

- -
poster
10 years, 4 months ago.

At last, I have found the page again that I used to fix my own circuit: http://mbed.org/forum/helloworld/topic/1731 So if you ever run into the same problem as I did a long time ago, have a look there. I can't remember what we did wrong, but the info on that topic was my reference. :) Solved. Closed.

Accepted Answer
10 years, 11 months ago.

The crucial thing is, that every node should see other nodes, including itself. This is what a transciecver does. It makes the differential output for the can-bus and it "wires" together the CAN Rx and CAN Tx pins. How does it should look like is nicely described on this schematic. I use TJA1040, but I see no major difference between TJA1040 and MCP2551.

link to the schematics (page 3) http://www.keil.com/mcb2300/mcb2300-schematics.pdf

Regards

My colleague found the answer needed somewhere else on the mbed website. Will post it when I have the time for it for future reference.

posted by - - 17 May 2013