1
\$\begingroup\$

I've been struggling with getting CAN bus transmission to work properly. I'm driving the setup with a Parallax Propeller board and the specifics are in another post, but I have a more specific question about the CAN bus wiring and termination:

Each source I've found that describes CAN bus termination does so with something like the top of the diagram shown below - a high and a low wire with 120ohm resistors at each end.

However, in my lab setup what I actually have is equivalent to the lower part of the diagram shown - the resistance is actually in the "middle", between the two devices. I've also tried playing with that resistance value, from taking it off entirely, and around 110ohms, as well as 220ohms and they all suffer from the same problem and the chip I'm using is reporting a transmission error.

Two 120ohm resistors in parallel should be the same as 60ohms resistance. But does the actual position of the resistors along the wire matter? The devices are physically about 6 feet of wire apart and it's running at 500Khz. I know some basics including Ohms Law, and I get that CAN uses voltage differential to transmit, but if the position of the resistors is what is wrong then there's definitely something I don't understand about how this circuit is supposed to work.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
  • \$\begingroup\$ Do the boards you are using share a common 0V? CAN was designed for automotive use so there is an assumption of all boards having a chassis reference. The transmitters and receivers have to be within the common mode bus voltage range. \$\endgroup\$ – Martin Mar 31 '17 at 7:54
  • \$\begingroup\$ The Propeller board, my CAN bus shield, and the ground pins on the ODB-II connector are all tied together, so yes. I'm honestly not sure what "common mode" means in this context (Googling it now). When I put my voltmeter on either of the wires (and the other end on my common ground) it gives the expected recessive voltage of about 2.5v). \$\endgroup\$ – bgp Mar 31 '17 at 7:56
4
\$\begingroup\$

The intent of the resistors at each end of the bus is to control transients due to time delays. The bus needs to be terminated with its characteristic impedance at each end.

However if the bus is only 6 feet long I would expect your implementation with a 60 ohm resistor in the middle to work. I expect you have some other problem.

You do need to have a device configured to receive the CAN packet and return an ACK to not have an error from the transmitter - some CAN bus monitors do not do so as they are expected to be non-intrusive. In that case you will get an error from the transmitter if there is no other node.

You may need to put another normal CAN node on the network to get the correct response.

\$\endgroup\$
  • \$\begingroup\$ Makes sense. The device I'm driving is an MCP2515 (which connects to an MCP2551 which does the actual CAN transmission) and on the other end is a Sinocastel "ODB-Smart" GPS device: sinocastel.com/product/item-3.html I've been assuming that would be providing the ACK, but maybe I'm wrong. And short of using an oscilloscope (don't have one to hand) I haven't yet figured out how to determine if that's the case. \$\endgroup\$ – bgp Mar 31 '17 at 3:05
  • \$\begingroup\$ Also that MCP2515 has to be programmed to run at the same bit rate, message format (normal or extended), and probably some other parameters, as the device at the other end. \$\endgroup\$ – electrogas Jun 20 '17 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.