Sale ends todayGet 30% off any course (excluding packages)

Ends in --- --- ---

CAN Bus Communications Decoded: The BUS (Physical Implementation)

Watch This Course

$199 USD $99.50 USD

Or 8 easy payments of only $12.44 Instant access. Easy checkout. No fees. Learn more
Course Access for Life
60 day money back guarantee

The BUS (Physical Implementation)


00:00 - When we talk about a CAN network, we're really talking about a complete protocol specification for the physical wiring of the network, the electrical signalling voltage levels and how these are read and converted into data bits and then how those bits are arranged in a specific message structure.
00:16 As you can see, the term CAN network is pretty comprehensive and can be a little bit intimidating.
00:22 In this section of the course, we'll split the term apart into the component elements and detail the technical theory required to understand how the system works as a whole.
00:30 We'll start by looking at the physical implementation of a CAN network which is called the bus.
00:36 Bus is a bit of an odd name but its definition is a shared digital pathway between devices, allowing them to communicate.
00:44 In reality this means it's the physical wires that we're going to run between our devices.
00:48 We have the obey some rules when we run these wires to ensure our network operates reliably.
00:54 THis includes what wire should be used, how many wires there are, how connections are made and how the bus should physically be laid out.
01:02 Interestingly the original Bosch CAN protocol specification does not include a section on the physical wiring of the bus.
01:10 This was intentionally omitted to allow different physical implementations to be developed for the different usages of a CAN network.
01:17 For example a low speed non critical network might have a different and probably cheaper physical wiring implementation to a high speed safety critical network.
01:27 For our automotive usage however, we almost always follow the ISO 11898-2, often called the CAN high speed or ISO CAN specification for our physical bus wiring.
01:40 With the addition of also twisting our communication wires.
01:44 This provides a good balance of cost vs performance, allowing the bus to be constructed cost effectively while ensuring reliable communication at our maximum speed which is 1 megabit per second or 1 million bits per second.
01:58 A CAN network is what's known as a broadcast network.
02:01 This means that every single device on the network can see all of the messages being transmitted.
02:07 A device never sends a specific message to another device, it just broadcasts it out over the entire network.
02:14 Each message has a specific identification code and devices are programmed to only look for identification codes that they are interested in.
02:22 Physically, this is implemented by each device on our CAN network having a CAN high and a CAN low pin.
02:29 At the most base level, our physical wiring task is simply to connect all of the CAN high pins together and all of the CAN low pins together.
02:38 We do need to do this by constructing our wiring in a specific way and adhering to the ISO CAN spec to ensure communication is going to be stable and reliable.
02:48 This is done by building a central bus trunk consisting of a twisted pair of wires.
02:53 One being CAN high and the other being CAN low.
02:56 This trunk travels the entire length of our network within our wiring harness, spanning between the 2 most distant devices that are on the network within the vehicle.
03:05 Along the length of this trunk we splice into the CAN high and CAN low wires running shorter bus nodes to other devices that need to be on the network.
03:14 These nodes are constructed of the same twisted wire as the trunk.
03:19 At either end of the bus trunk, we connect the CAN high and CAN low wires together with 120 ohm resistors called termination resistors.
03:28 The bus trunk should never exceed 40 m in length and in practice this isn't usually a problem in a performance automotive application for reasonably obvious reasons due to the sizes of the vehicles that we're working on.
03:40 The bus nodes on the other hand, ideally should not exceed 300 mm in length which is something we need to take into account when it comes to routing our wiring harness.
03:51 The reason for these length specifications is to do with the speed of propagation of electrical signals along the length of the wire and reflections when that signal reaches the end.
03:59 A detailed explanation of this is outside the scope of the course but in a basic sense, the signals in our wires travel at the speed of light.
04:08 While this is very fast, it's not instant, meaning these signals take actual time to get from one end of the bus to the other.
04:17 And if we make the main trunk too long, it's possible a device on one end of the bus might change its electrical signal before it reaches the other end of the trunk.
04:28 This can cause communication errors known as arbitration errors.
04:31 If we stick within the specified limits though, our network will be reliable up to the maximum transmission speed specified in the ISO CAN standard of 1 megabit per second.
04:41 While the ISO standard doesn't specify twisting our bus wires together, this is something that we do for a couple of reasons.
04:48 The first is that it ensures the CAN high and CAN low wires are always physically close to one another so should therefore be exposed to similar levels of radiative electrical noise.
04:59 We'll address exactly why this is important later in the course.
05:01 The second reason is to do with the way the devices on the network send out their electrical signals on the bus.
05:08 We end up with small currents flowing in the CAN high and CAN low wires that are in opposite directions.
05:14 By twisting these bus wires together the electrical noise generated by these currents switching on and off very quickly, cancel one another out, limiting the effect of radiative electrical noise to the surrounding components.
05:27 Now we do have some real world considerations to be aware of and often we need to compromise on 2 areas of the ISO specification.
05:35 The first of these is meeting the 300 mm maximum bus node length.
05:40 This can often be impractical as having to have the main bus trunk and therefore the wiring harness path travel so close to every device on the network, often becomes overly messy and cumbersome.
05:51 Secondly, many CAN devices have termination resistors built into them.
05:55 This can cause problems if that device is connected to a node and not one of the ends of the main bus trunk.
06:01 For this reason I always suggest ordering devices without termination resistors installed if possible or selecting devices where they can be switched on and off in configuration software or by moving a physical jumper.
06:13 We can always add terminations resistors manually and we'll be looking at exactly how to do this reliably later in the course.
06:20 With that said, if they're integrated into a device, it can be a big task or even impossible to remove them so choose your devices wisely.
06:28 As you're working with CAN devices and reading various different manufacturer's documentation, you'll see variations on these standards listed.
06:36 MoTeC as an example states a maximum node length of 500 mm and the usage of 100 ohm termination resistors.
06:44 The values in this course are taken directly from the high speed CAN standards so sticking to them as best as you can is going to be best practice.
06:52 But a slight variation for the sake of simplicity is unlikely to result in a non functioning network.
06:58 I'm yet to see these real world considerations cause a CAN network in a performance vehicle to fail or even be unreliable but the chance is always there.
07:08 While I won't hesitate to build a CAN bus with nodes longer than 300 mm, I still try to keep them as short as possible and make all efforts to only have 2 termination resistors placed at either end of the main trunk.

We usually reply within 12hrs (often sooner)

Need Help?

Need help choosing a course?

Experiencing website difficulties?

Or need to contact us for any other reason?