CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

CAN bus termination resistors

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
newguy



Joined: 24 Jun 2004
Posts: 1903

View user's profile Send private message

CAN bus termination resistors
PostPosted: Wed Jul 05, 2006 10:50 am     Reply with quote

I'd like to ask how sensitive the CAN bus is to termination resistors that are not 120 ohms.

Here's my situation: Box A, Box B and Box C are all connected via CAN bus. Box A is on one end, B in the middle, and C on the end. I'm using LT1796 transceivers, and I'm also enabling their slew rate control. Distance between A and B: 10 - 20', distance between B and C: 10 - 20'. Bus speed is 250 kBps (but can be lowered).

There is a 120 ohm termination resistor in Box A across the CANH and CANL terminals of the 1796. Box B has no termination resistor since it is in the middle of the cable run. Box C is where things get interesting.

Box C is actually a graphical display unit. The system can have 1 - 3 of them. The displays have two CAN connection points, and it doesn't matter which connector is the "upstream" connector. Distance between these displays is no more than 12". These graphical display units must autoinitialize when added to the system (or upon powerup), and the system must also recognize a display(s) being removed from the system. I have all that stuff sorted out - it's the CAN terminations that have me concerned. I must also mention that each of these display units must be identical - from a manufacturing standpoint I can't have multiple models each with a different CAN termination resistance. From a customer standpoint, the displays must be identical too.

Since there can be 1, 2 or 3 Box C's, I'm worried about the CAN bus' termination resistance. I can't put 120 ohm CAN termination resistors in Box C because there can be three of them, making the overall termination resistance just 40 ohms.

I'm leaning toward putting 240 ohm termination resistors in Box C. With two displays, the overall resistance is the optimum 120 ohms, and with 3 it's 80 ohms.

I've tested (with short cable runs - I can't test long ones) having 80 and 240 ohm terminations on one end of the bus, and the system works. I'm worried about longer cable runs.

Can someone experienced with CAN chime in with an opinion whether this is a feasible solution or not?
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

PostPosted: Wed Jul 05, 2006 11:43 am     Reply with quote

As far as I am aware the termination resistors are there for two purposes

1. is ofcourse to prevent ghost or refelected signals on longer stretches of wire

2. they allow the bus to rise and fall properly in its differential manner

For 1 its important they be at far ends of the wires. But for 2 I imagine that they can be right next to each other if needed.

Try making A and B 120 and making the C nodes something in the realm of 2.6k, thats what all my projects get.


I doubt you'll have a problem with this. As long as the overall network is in spec.
sjbaxter



Joined: 26 Jan 2006
Posts: 141
Location: Cheshire, UK

View user's profile Send private message Visit poster's website

PostPosted: Wed Jul 05, 2006 12:20 pm     Reply with quote

Just to add to iso9001's comments; the termination for small/short networks is not too critical but the 120ohm across HI and LO at each extreme is desirable.

For bigger networks, 120 at each end is the theory, but in practice you need to 'tune' the network to account for the effects of the cable resistance, network backbone length, bus speed and any ringing causes by the length of the node spurs (which is why these should be less than a meter). Which is why for things like car development there are some elaborate (and expensive) tools out there to analyse the network.

I have a network on my bench at the moment which has 8 nodes and is about 8 meters long. It works at 500k with about 40% bus load (without generating bus errors or error frames) with or without termination !!!

It is usual to put the option of switching in/out a 120ohm terminator in each node (for expandable networks) or having no termination in the nodes but a fixed 'tuned' network cable harness with the termination built in.

Put a scope on the bus and see how clean the waveform is.
_________________
Regards,
Simon.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jul 05, 2006 12:25 pm     Reply with quote

Two other ideas:

If each display module has two CAN connectors, you can connect
the modules together with patch cables. Then give the customer
a terminator plug to put in the open connector in the last module
at the end of the chain.

Or, you could devise some auto-termination method where each
display module detects if it has two cables plugged in, or just one.
If it has only one cable, it switches on the termination resistor.
newguy



Joined: 24 Jun 2004
Posts: 1903

View user's profile Send private message

PostPosted: Wed Jul 05, 2006 12:54 pm     Reply with quote

Simon & PCM:

Thanks, I appreciate the information.

I thought of switching the termination resistor in/out, but do you have an idea of how that can be done without a relay? The problem (to me) is switching in a 'floating' load. I know I can get off-the-shelf solid state relays that will do the job, but they're too big and too expensive.

The end user is going to an ordinary person - this thing is going in a truck. I'm going to be very lucky if the customer even bothers to read the manual. For that reason, I really can't have a termination cable that the user has to plug into the last display (they'll either forget it, lose it, or put it in the wrong place). I can't build the terminations into the cable either, because these things will be connected via ordinary 6 conductor phone cable with the modular plugs on each end. That was one of the things the customer insisted upon - easily replaceable/obtainable cabling for when the cables get trashed (and they will).

From what I've been able to gather, I think that I'll go with my original plan: 120 ohm termination in A, no termination in B (because it's in the middle of the run), and 240 ohm terminations in C. I tested 120 to 240 and 120 to 80 ohm cases with about 10' of cable and the system ran fine with no errors. I think it should be okay.

One last thing: I can't actually scope the waveforms because the h/w doesn't yet exist! Very Happy I am, however, starting on the PCB layout/design for C, and I wanted to have some assurance that the thing would work.
sjbaxter



Joined: 26 Jan 2006
Posts: 141
Location: Cheshire, UK

View user's profile Send private message Visit poster's website

PostPosted: Wed Jul 05, 2006 1:45 pm     Reply with quote

If you are unsure or want the flexability, I would design a resistor into the PCB design. You then have the option of whether to fit it or not and what the final value is at the production stage. Easier to cater for it in the design than not at all !!

Mine are fitted to all nodes with a DIL DIP switch through the node case to allow the selection without dismantling the node.

In you installation, if you only have the 3 nodes and you provide/specify the way the nodes are wired externally, then you can pretty much fix which node contains the terminators.

i.e A(T=120)-------------------B----------------------C(T=120)

If you expand the network, just put the new node between A-B or B-C and don't add any more terminators

i.e. a(T=120)..............B.........D.........E.......F............C(T=120)

after all you need at-least 2 nodes in a network, so make these the terminated end nodes.
_________________
Regards,
Simon.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group