EmbeddedRelated.com
Forums

why CAN bus has two lines (CAN_L and CAN_H)

Started by kasu nandu May 16, 2007
hi every body,

can anybody help me out of this confusion...?

Why CAN bus has two lines..CAN_L and CAN_H

I tried to get the sollution for this from some of my friends..but cant get the exact answer..

Why it is using two lines

1. was it for the process of arbitration...?

2. or is the bit level data transmission (dominant or recessive) for CAN
bus using two lines for any purpose...?

or what is the main purpose of using two lines for CAN bus....??

plz help me out from this confusion in detail ...i will be greatly thank full to you alllllllllllll

regards
KASU

regards
Yadunandan Kasu(Nandu)
Hi,

CAN actually needs 3 lines, CAN_L, CAN_H and ground. It is a differential line,
where the the signal is represented by a differencs between CAN_L and CAN_H. If
the difference is positive and larger than a certain minimum voltage it is a
"1" and if the difference is negative it is a "0" (or the other way around, but
you get the picture). You can read more about differential signalling here
<http://en.wikipedia.org/wiki/Differential_signaling>.

It is done in this way because then you can have very long cable lengths with a
twisted pair type of cable. If a disturbance is affecting the cable, it is
affecting both wires in the same way, which then effectiviely is canceled out
since it isn't differential. Also the line is said to be balanced which means
that each node (or perhaps only the end nodes in a large network) are
terminated with the same impedance as the cable (normally around 120 ohms)
which cancels out reflections that would otherwise be a big problem for higher
communication speeds.

The ground is needed since it isn't a current loop type of circuit but a
voltage level (difference) circuit. The voltage with respect to ground has to
be within certain maximum limits. To be sure that the ground levels at both end
are at the same (or almost the same) level, the grounds have to be connected.

Hope this helps as a start. Here are another good link.
<http://www.interfacebus.com/Design_Connector_CAN.html>

Otherwise google is your friend.

Regards / Ruben
<http://rjjournal.zapto.org>
Hi Jonsson,
I really thankful for you for such a useful information and i am clear with the confusion with your reply ...

thanks alot for consuming your valluable time for me to explain,
I wil go through the links u have send to me also...

thanks and regards
Kasu
Hello

There are a couple of misconceptions here. Please see
http://www.dgtech.com/images/primer.pdf and especially Figure 5.

It is indeed true that the important characteristic is the difference
voltage between Can_Hi and Can_Lo and not their relationship to ground. It
is not necessary to even use the ground - I typically give demonstrations
with up to 20 nodes at 500 Kbps with only the two CAN wires - not ground -
not even an invisible one (i.e. through ground or earth of AC mains
supply). Telephones work like this - there are 2 differential lines plus
one or two ground leads. Now we all know we just need 2 wires to connect
our phone up ...right ? We only need the Plus and minus wires and it
works fine. (at least in USA and Canada - but others must be the same)

Further - in most differential signal schemes such as RS485, FlexRay and
J1708, CAN is a notable exception in its voltages. The two lines do not
"cross" each other to create these "negative" voltages...but rather they
come together to give zero volts difference (both lines are at about 2.5
volts) , or are pulled apart (Can_hi to 3.5 and Can_lo drops to about 1.5
volts) to give about +2.5 volts difference (between the hi and lo lines).
See Figure 5 on the link above.

When the difference is zero volts (both at about 2.5 volts) - this is
recessive or a logic 1.
When the difference voltage is about 2...this is dominant or a logic 0.

This is also how the arbitration scheme works. A node can pull the two
wires apart to create a "0", but can't force them together to create a "1".
Think open collector.

Also: you mention that external interference cancels out inside the node
because this signal will be in-phase while the wanted CAN signals are 180
degrees out of phase. This is true. BUT also: since the CAN signals are
108 out of phase, these high frequency signals cancel out as far as the
outside world sees them - this means the CAN wires (a transmission line) do
not act as a radio transmitter attracting the attention of the radio police
(i.e USA FCC). Therefore, no shielded cable is needed (as J1939
specifies). In fact, several manufacturers using J1939 are getting rid of
the shielded cable and notice no performance degradation.

While I am at it - ISO 18898 specifies a CAN network can tolerate a short
of either CAN signal to ground or one open lead (ground has to be intact
for this to work) and still function. Of course, this will be without the
benefits of the differential bus.

However, in practice it appears that many CAN transceivers are unable to
work with Can_Hi shorted to ground. This is apparently not meeting this
specification. However, J1939 (heavy duty truck and bus) specifies that
CAN will not work with Can_Hi shorted to ground but will with Can_Lo
shorted to ground. But, in this same document schematics of CAN
transceiver circuits using discrete components (no ICs) are shown meaning
this is an old document. I invite comment on this issue. Two
semiconductor companies have not responded to my questions on their
products (yet).

Hope this helps

Bob Boys

San Francisco, California
on temporary assingment to Detroit, Michigan.
Hi,

Thank you for some interesting points regarding the CAN bus. See comments
below.

> Hello
>
> There are a couple of misconceptions here. Please see
> http://www.dgtech.com/images/primer.pdf and especially Figure 5.
>
> It is indeed true that the important characteristic is the difference
> voltage between Can_Hi and Can_Lo and not their relationship to ground. It
> is not necessary to even use the ground - I typically give demonstrations
> with up to 20 nodes at 500 Kbps with only the two CAN wires - not ground -
> not even an invisible one (i.e. through ground or earth of AC mains
> supply). Telephones work like this - there are 2 differential lines plus
> one or two ground leads. Now we all know we just need 2 wires to connect
> our phone up ...right ? We only need the Plus and minus wires and it
> works fine. (at least in USA and Canada - but others must be the same)

Running without ground may work in a close area where the different euipment on
the bus always is at the same, or almost the same, ground level. Remember that
the voltage level the transciever sees is relative it's own ground. All
circuits, including CAN transceivers, have an absolute maximum rating regarding
voltage with respect to ground on their inputs. This has to be addressed if the
ground level fluctuation differs between nodes in a bus. One way to do it is to
connect the grounds and force the different nodes to the same ground reference.
This may cause large ground loop currents though which in turn may be solved
using a buss isolated from the node grounds, which then has it's own ground
reference that doesn't fluctuate. Although the CAN bus isn't a current loop,
the transceiver circuits provides a (sort of) internal connection between the
bus and the ground and this makes a weak connection between the grounds in the
different nodes which makes the voltage level be within the maximum rating for
the circuits in most of the cases. However, without the extra ground wire, and
sometimes also with it, the tranceiver circuits has to be protected from
transients on the Can_Hi and the Can_Lo lines. With the extra ground wire, the
transient currents runs through the ground wire. If there is no ground wire you
must make sure there is a current path to the local ground through some
transient protection devices, such as TVS diodes, before the voltage levels
caused by the transient rises above the absolute maximum rating of the
transceiver, causing a breakdown in it.

Fluctuating ground differences, caused by heavy load equipment switching on and
off, for example, may also disturb high speed communication.

A telephone, on the other hand, is a completely different thing compared to a
CAN bus and it's voltage level signaling. It has only two wires because it uses
a current signaling interface, converting the current variations to sound and
vice versa, with a transformer. This method is also used with Twisted Pair
Ethernet communication. A transformer doesn't need a connection to ground since
the current goes through it the same way either with or without a ground
reference. And the secondary of the transformer is isolated from the primary,
making the secondary circuit isolated from the telephone line. Any voltage
biased on the primary will not go through to the secondary, as long as the
voltage difference is below the insulation breakdown voltage of the
transformer.

> Further - in most differential signal schemes such as RS485, FlexRay and
> J1708, CAN is a notable exception in its voltages. The two lines do not
> "cross" each other to create these "negative" voltages...but rather they
> come together to give zero volts difference (both lines are at about 2.5
> volts) , or are pulled apart (Can_hi to 3.5 and Can_lo drops to about 1.5
> volts) to give about +2.5 volts difference (between the hi and lo lines).
> See Figure 5 on the link above.
>
> When the difference is zero volts (both at about 2.5 volts) - this is
> recessive or a logic 1.
> When the difference voltage is about 2...this is dominant or a logic 0.
>
> This is also how the arbitration scheme works. A node can pull the two
> wires apart to create a "0", but can't force them together to create a "1".
> Think open collector.

Yes, this is correct. I was thinking more about RS485 signals which doesn't
have the dominant/recessive part.

> Also: you mention that external interference cancels out inside the node
> because this signal will be in-phase while the wanted CAN signals are 180
> degrees out of phase. This is true. BUT also: since the CAN signals are
> 108 out of phase, these high frequency signals cancel out as far as the
> outside world sees them - this means the CAN wires (a transmission line) do
> not act as a radio transmitter attracting the attention of the radio police
> (i.e USA FCC). Therefore, no shielded cable is needed (as J1939
> specifies). In fact, several manufacturers using J1939 are getting rid of
> the shielded cable and notice no performance degradation.

This is also correct and an important thing to keep in mind. EMC is not only
about not getting disturbed but also about not disturbing. A lot of times, as
here, these goes hand in hand though.

>
> While I am at it - ISO 18898 specifies a CAN network can tolerate a short
> of either CAN signal to ground or one open lead (ground has to be intact
> for this to work) and still function. Of course, this will be without the
> benefits of the differential bus.
>
> However, in practice it appears that many CAN transceivers are unable to
> work with Can_Hi shorted to ground. This is apparently not meeting this
> specification. However, J1939 (heavy duty truck and bus) specifies that
> CAN will not work with Can_Hi shorted to ground but will with Can_Lo
> shorted to ground. But, in this same document schematics of CAN
> transceiver circuits using discrete components (no ICs) are shown meaning
> this is an old document. I invite comment on this issue. Two
> semiconductor companies have not responded to my questions on their
> products (yet).
>

Good to know.

Regards / Ruben
<http://rjjournal.zapto.org>
--- In 6..., Robert Boys wrote:
>
> Hello
>
> There are a couple of misconceptions here. Please see
> http://www.dgtech.com/images/primer.pdf and especially Figure 5.
>
> It is indeed true that the important characteristic is the difference
> voltage between Can_Hi and Can_Lo and not their relationship to ground. It
> is not necessary to even use the ground - I typically give demonstrations
> with up to 20 nodes at 500 Kbps with only the two CAN wires - not ground -
> not even an invisible one (i.e. through ground or earth of AC mains
> supply). Telephones work like this - there are 2 differential lines plus
> one or two ground leads. Now we all know we just need 2 wires to connect
> our phone up ...right ? We only need the Plus and minus wires and it
> works fine. (at least in USA and Canada - but others must be the same)
>
> Further - in most differential signal schemes such as RS485, FlexRay and
> J1708, CAN is a notable exception in its voltages. The two lines do not
> "cross" each other to create these "negative" voltages...but rather they
> come together to give zero volts difference (both lines are at about 2.5
> volts) , or are pulled apart (Can_hi to 3.5 and Can_lo drops to about 1.5
> volts) to give about +2.5 volts difference (between the hi and lo lines).
> See Figure 5 on the link above.

Looks like roughly designed for TTL input levels.

I am not very familiar with the can spec, but like all these differential current schemes there are two options, either direct connected or isolated.

If there is a direct galvanic connection and you have no earth reference point you are in effect relying on input protective devices and the generated output levels to keep the system operating within the power supply ranges, not a very robust scheme in my view, maybe usable if you work of one supply voltage like in a car and you rely on distributed earth.

In theory you should also be able to short either line to ground or power, you would still have a differential input, of course unless there is an isolation scheme this would result in an inverted signal in fifty percent of the cases, most receivers would not like that.

Since I just woke up (five in the morning) and are operating on only one cylinder feel free to disagree:-)

Regards

Theo
--- In 6..., "Ruben Jsson" wrote:
> Running without ground may work in a close area where the different
> euipment on the bus always is at the same, or almost the same,
> ground level. Remember that the voltage level the transciever sees
> is relative it's own ground. All circuits, including CAN
> transceivers, have an absolute maximum rating regarding voltage with
> respect to ground on their inputs. This has to be addressed if the
> ground level fluctuation differs between nodes in a bus. One way to
> do it is to connect the grounds and force the different nodes to the
> same ground reference. This may cause large ground loop currents
> though which in turn may be solved using a buss isolated from the
> node grounds, which then has it's own ground reference that doesn't
> fluctuate. Although the CAN bus isn't a current loop, the
> transceiver circuits provides a (sort of) internal connection
> between the bus and the ground and this makes a weak connection
> between the grounds in the different nodes which makes the voltage
> level be within the maximum rating for the circuits in most of the
> cases. However, without the extra ground wire, and sometimes also
> with it, the tranceiver circuits has to be protected from transients
> on the Can_Hi and the Can_Lo lines. With the extra ground wire, the
> transient currents runs through the ground wire. If there is no
> ground wire you must make sure there is a current path to the local
> ground through some transient protection devices, such as TVS
> diodes, before the voltage levels caused by the transient rises
> above the absolute maximum rating of the transceiver, causing a
> breakdown in it.

Note to all, I hope the information I give is useful, as it is
priceless to me...

LOL!
Ruben, I don't really try to step on toes--I don't know if you can
see the problem, but your statements appear awefully misleading and
somewhat incorrect to me, so I want to clarify...

You talked about "running without ground", but what do you mean,
really? Technically, such an idea does not even exist. I suppose you
meant using only one wire for a signal, and relying on a common power
supply ground or such for the reference. In other words, not running
two wires directly between the boards (signal and reference, which is
often common ground). Well, do you understand what CANH and CANL are?
They are the "differential" pair, which works the same as the two wire
(signal and ground), only more helpful in long distances because it
avoids ground loops. Note that there is only one signal level at any
time on a CAN bus, though the MCU itself uses one pin for each
direction of communication (CANRX,CANTX), which does NOT DIRECTLY
CORRESPOND to CANL and CANH on the bus.

You seemed to indicate that a CAN bus is not a current loop, but you
should know that the current loop is more important than voltage. That
is why there are strict recommendations for the termination resistance
of each CAN node. The drivers depend on enough current flowing, to be
reliable at long distances!

Trust me, this technology is well used on the expensive automobiles;
the manufacturers are not being naive about these issues ;-)

There is an excellent purpose for using the common GND surrounding
CANL/CANH wires on a cable. It is not for GND reference. It is to
allow shielding of the cable, to avoid RF radiation or interference.

Hope this helps enlighten all. Note that I'm not here to argue, just
drop this information. Thanks for tuning in ;-)
> Note to all, I hope the information I give is useful, as it is
> priceless to me...
>
> LOL!
> Ruben, I don't really try to step on toes--I don't know if you can
> see the problem, but your statements appear awefully misleading and
> somewhat incorrect to me, so I want to clarify...
>
> You talked about "running without ground", but what do you mean,
> really? Technically, such an idea does not even exist. I suppose you
> meant using only one wire for a signal, and relying on a common power
> supply ground or such for the reference. In other words, not running
> two wires directly between the boards (signal and reference, which is
> often common ground). Well, do you understand what CANH and CANL are?
> They are the "differential" pair, which works the same as the two wire
> (signal and ground), only more helpful in long distances because it
> avoids ground loops. Note that there is only one signal level at any
> time on a CAN bus, though the MCU itself uses one pin for each
> direction of communication (CANRX,CANTX), which does NOT DIRECTLY
> CORRESPOND to CANL and CANH on the bus.
>
> You seemed to indicate that a CAN bus is not a current loop, but you
> should know that the current loop is more important than voltage. That
> is why there are strict recommendations for the termination resistance
> of each CAN node. The drivers depend on enough current flowing, to be
> reliable at long distances!

Ruben said the CAN bus is not a current loop, that is because such a configuration forms a transmission line with a defined cable impedance and a terminating resistor to match.

That is also where the confusion stems from, the drivers would need to supply enough current to drive the termination resistor, i.e. an output to supply current, but it is not what is known as a current loop, these assume low freq. or DC levels.

Of course the higher the freq. and the longer the distance the closer the actual cabling needs to match this characteristic impedance, say coax comes in closely defined impedance ranges same for cat5 and other such schemes.
You may remember the "terminating" caps you needed to fit to unused receivers in distributed systems, they could not be left open, same for extra outlets on the TV cable, they have a resistor built in.

A perfectly balanced and matched transmission line would not interact with the external environments at all, all transmitted energy is dumped in the cable and terminating resistor, nothing gets reflected or radiated and no radiation enters the system.

But just in case there is a flaw in all this perfection, like a bend in the cable or a cable made with bell wire for example spoiling the impedance, a shield is often a good idea to improve noise immunity and by coincidence also can provide the ground reference in cheapass systems were you want to save the expense of isolation.

The teacher's interminable ramblings about organ pipes in an engineering course had a purpose other then get the students to attend church.

> There is an excellent purpose for using the common GND surrounding
> CANL/CANH wires on a cable. It is not for GND reference. It is to
> allow shielding of the cable, to avoid RF radiation or interference.

Hmm, not quite, Ruben is quite correct, you -always- need a ground reference somewhere to stay in the operating range of the receivers, a different issue from balanced lines.

If you do not provide one, the protective input devices will form one for you, a "weak" Earth as Ruben calls it.

If you are using some form of isolation on the receiver you still need a zero reference, say the Ethernet cards I use have Itsy Bitsy transformers on their balanced inputs to provide isolation and a relatively high value resistor to some form of ground reference like case and power ground to avoid exceeding the voltage spec on the isolators..

I note a direct coupled system is not a good idea for systems that can have substantial differences in ground potential, ground loop currents in shields are not a good thing, maybe not an issue in cars with all potentials close to ground.
Cheers,

Theo
Hello

This is becoming quite the discussion. This is interesting as we are
looking at some assumptions many people have that might not be entirely
true.

Today I connected up two Dearborn Group S3 analyzers (
www.dgtech.com/~rboys/flyers/s3.pdf ).

Each S3 has two dual wire CAN channels and they are not isolated with
galvanic or opto isolators. I chose the S3 because of this. I figured the
isolators in the other analyzers DG has might interfere with my experiment.
Each has two Philips SJA1000 CAN controller chips and I think they also are
using Philips transceiver chips.

I made a small network about 1 meter long with two 120 ohm termination
resistors - one at each end of my small network.
Three wires: CAN_Hi and CAN_Lo and a ground. I can easily disconnect or
short these three wires together.

So - my small network contains 4 CAN nodes - two connected at each end of
the network (no drop lines).
Speed 500 Kbps. Sending a CAN message from one node to the other three
every 50 msec..

When I do this the CAN traffic stops:

- short hi to ground.
- open either hi or low with ground attached or not (makes no difference).
- short hi and lo together.

When I do this it does not matter - CAN continues with no error frames or
other discernable misfortune:

- short lo to ground
- disconnect the ground wire.

I found this interesting because I had read that CAN should work with one
of the hi or lo open if the ground is intact. I was at Chrysler the other
day and when we disconnected either one on a mockup car - the CAN network
stopped !

Now - concerning the ground:

It did not seem to make any difference whether it was connected or not.
This makes some sense as the CAN signals are supposed to be reference to
each and not ground.
I did not subject the network to any nasty stuff.

I then connected a lab power supply between the grounds of the S3 analyzers
(of course with the ground disconnected) and I saw no difference with the
two grounds 0 to 40 volts apart - polarity was tried both ways.
No difference was seen. No smoke, no error frames and no bus-off. Just
worked fine.

Bob Boys
on temporary assignment in Detroit, Michigan
> I found this interesting because I had read that CAN should work with one of the hi or lo open if the ground is intact. I was at Chrysler the other day and when we disconnected either one on a mockup car - the CAN network stopped !

There is a kind of "fault tolerant CAN transceivers" capable of maintain communication under some fault conditions: no differential mode (one wire open), some shorts, etc., with reduced noise immunity and reliability, and reporting failure to CPU. They were developed for automotive app. (short wiring & good ground).

Regards,

Jordi Costa