RE: Loop connection
"John Dammeyer" <[email protected]> Wed, 1 Apr 2015 09:10:30 -0700
| Newsgroups | gmane.comp.hardware.bus.can |
|---|---|
| Message-ID | <[email protected]> |
Hello Hideki,
I'd suggest you step back from trying to solve the problem for a moment and
examine first principals for the driver and transmission line theory.
1. The CAN driver is not like an RS485 differential bus where the logic
lows and highs mean that current changes direction through the wires.
a. Under ideal conditions in a recessive or 0 state the driver supplies
2.5V with respect to ground onto both the CAN_H and CAN_L signal lines.
Because this is done internally through a fairly high resistance (the input
impedance of the receiver) any transmitting node can pull the signals away
from this 2.5V level
b. Any device that wants to transmit a dominant or logic 1 turns on
circuitry that sets the CAN_L at about 1V and the CAN_H at or above 3V. The
drive capability of this part of the circuit can source/sink up to 60mA.
c. That 60mA drive is what limits the CAN bus to at most 120 nodes.
That's because the parallel combination of the worst case input resistance
of all receiver nodes and two 120 Ohm bus termination resistors is such that
with a 3.5V difference between CAN_H and CAN_L you will reach 60mA.
2. So why 120 Ohm resistors? For this you have to dive back into your
engineering books and study transmission lines.
a. There's a product out there called a TDR which stands for Time Domain
Reflectometer. It places a pulse with almost zero rise time on a wire and
then measures the time it takes for an echo of the pulse to return.
b. Every wire has some sort of impendence at a frequency of interest due
to the wire capacitance and inductance which is a result of the insulation
type wire spacing between the source and return line. For CAN cable it's
120 Ohm, for RS485 ideally 100 Ohm.
c. Without a termination resistor at each end of the wire that high
speed pulse is reflected back from the open end which looks like an infinite
resistor. This pulse can be high enough to fool receiver circuitry into
thinking it sees a recessive voltage level when the signal is dominant. The
time for the pulse to go to the end and back can be measured to determine
the length of the wire. That time for the reflection is important for CAN
because of the ACK slot in the message.
d. The driver circuitry in most CAN drivers is such it requires at least
one low resistance path for the drive current in order to properly form the
voltage difference between the CAN_H and CAN_L signals. So you have to have
at least one 120 Ohm resistor somewhere or they just won't work. A circular
network doesn't work as a transmission line and does not provide reliable
signaling.
3. But, if you read the data sheets you will see that many of the CAN
drivers have a pin that can be used to slow down the rise time and with that
you can use slower data rates.
a. For slower data rates making the rise time slower means less radiated
electrical noise and smaller reflections.
b. For slower data rates you can use 4 conductor unshielded solid core
telephone wire or Ethernet cable and CAN will work.
c. Reflections and noisy bus signals will have less impact at slow data
rates especially if you sample the receive signal 3x.
d. And by slower I mean under 50kbps but odds are your bus will be one
interesting antenna creating noise in the RF spectrum somewhere.
e. You still need at least one low value resistor in order to complete
the circuit for the CAN transmit side of the bus driver.
f. And yes you could probably even get away with a loop for a bus.
4. But do it wrong and the CAN bus will still be very forgiving but you
will chase ghosts with the occasional node going error passive or even bus
off with no apparent or reproducible cause. That defeats the whole point of
having a robust virtually error free network.
5. On a properly constructed CAN bus system there are usually zero errors.
Cheers
John Dammeyer
--
Archives and useful links: http://groups.yahoo.com/group/CANbus
Subscribe and unsubscribe at www.vector.com/canlist/
Report any problems to <[email protected]>