Controller Area Network

Ranked #6,992 in Computers & Electronics, #137,310 overall

Controller Area Network

Controller Area Network (CAN) is a broadcast, differential serial bus standard, originally developed in the 1980s by Robert Bosch GmbH, for connecting electronic control units (ECUs). CAN was specifically designed to be robust in electromagnetically noisy environments and can utilize a differential balanced line like RS-485. It can be even more robust against noise if twisted pair wire is used. Although initially created for automotive purposes (as a vehicle bus), nowadays it is used in many embedded control applications (e.g., industrial) that may be subject to noise. The messages it sends are small (8 data bytes max) but are protected by a CRC-15 (polynomial 0x62CC) that guarantees a Hamming bit length of 6 (so up to 5 bits in a row corrupted will be detected by any node on the bus).

Domotics - Home & Industrial Automation Foundations

Domotics - Home & Industrial Automation Foundations
Domotics - Home & Industrial Automation Foundations
Protocols & Buses in House
Protocols & Buses in House
EIB Protocol
The European Installation Bus (hereafter referred to as "the Installation Bus" or in short as "the Bus") is designed as a management system in the field of electrical installation for load switching, environmental control and security, for different types of buildings.
Havi Protocol
The Internet Protocol (IP) was designed to solve several complex problems related to message delivery in widely distributed computer networks such as the Internet. Home networks are generally more contained and predictable environments than the Internet.

The HAVi architecture was designed to fully exploit the capabilities of the IEEE-1394 technology, and to solve the problems of reliable message delivery in these environments in a much more economical manner.
Modbus Protocol
Some communication standards just emerge. Not because they are pushed by a large group of vendors or a special standards organisation.

These standards-like the Modbus interface-emerge because they are good, simple to implement and are therefore adapted by many manufacturers. Because of this, Modbus became the first widely accepted fieldbus standard.
X10 Protocol
X10 is an international and open industry standard for communication among electronic devices used for home automation, also known as domotics.

It primarily uses power line wiring for signaling and control, where the signals involve brief radio frequency bursts representing digital information. A wireless radio based protocol transport is also defined.
Atmega 128 microcontroller
The Atmega 128 is produced by the Atmel Corporation, a leading manufacturer of semiconductors, microcontrollers, RF devices, Flash memory drives, integrated circuits, and other devices used in computer architecture.
Loading
Bit rates up to 1 Mbit/s are possible at network lengths below 40 m. Decreasing the bit rate allows longer network distances (e.g. 125 kbit/s at 500 m).

The CAN data link layer protocol is standardized in ISO 11898-1 (2003). This standard describes mainly the data link layer - composed of the Logical Link Control (LLC) sublayer and the Media Access Control (MAC) sublayer - and some aspects of the physical layer of the OSI Reference Model. All the other protocol layers are left to the network designer's choice.

Data Transmision

CAN features an automatic 'arbitration free' transmission. A CAN message transmitted with highest priority will 'win' the arbitration, and the node transmitting the lower priority message will sense this and back off and wait.

This is achieved by CAN transmitting data through a binary model of "dominant" bits and "recessive" bits where dominant is a logical 0 and recessive is a logical 1. This means open collector, or 'wired or' physical implementation of the bus (but since dominant is 0 this is sometimes referred to as wired-AND). If one node transmits a dominant bit and another node transmits a recessive bit then the dominant bit "wins" (a logical AND between the two).

So, if you are transmitting a recessive bit, and someone sends a dominant bit, you see a dominant bit, and you know there was a collision. (All other collisions are invisible.) The way this works is that a dominant bit is asserted by creating a voltage across the wires while a recessive bit is simply not asserted on the bus. If anyone sets a voltage difference, everyone sees it, hence, dominant. Thus there is no delay to the higher priority messages, and the node transmitting the lower priority message automatically attempts to re-transmit 6 bit clocks after the end of the dominant message.

When used with a differential bus, a Carrier Sense Multiple Access/Bitwise Arbitration (CSMA/BA) scheme is often implemented: if two or more devices start transmitting at the same time, there is a priority based arbitration scheme to decide which one will be granted permission to continue transmitting. The CAN solution to this is prioritised arbitration (and for the dominant message delay free), making CAN very suitable for real time prioritised communications systems.

During arbitration, each transmitting node monitors the bus state and compares the received bit with the transmitted bit. If a dominant bit is received when a recessive bit is transmitted then the node stops transmitting (i.e., it lost arbitration). Arbitration is performed during the transmission of the identifier field. Each node starting to transmit at the same time sends an ID with dominant as binary 0, starting from the high bit. As soon as their ID is a larger number (lower priority) they'll be sending 1 (recessive) and see 0 (dominant), so they back off. At the end of ID transmission, all nodes but one have backed off, and the highest priority message gets through unimpeded.

by

PentAngeli

Hello, I am BCM, I have been a writer and blogger online for many years.
My main areas of expertise are automation,computers and renewable energy.
I...
more »

Feeling creative? Create a Lens!