EasyManua.ls Logo

Microchip Technology dsPIC30F - Appendix B: CAN Overview

Microchip Technology dsPIC30F
738 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
dsPIC30F Family Reference Manual
DS70074C-page 26-12 © 2004 Microchip Technology Inc.
APPENDIX B: CAN OVERVIEW
This appendix provides an overview of the Controller Area Network (CAN) bus. The CAN
Section of this reference manual discusses the implementation of the CAN protocol for that
hardware module.
B.1 CAN Bus Background
The Controller Area Network (CAN) is a serial communications protocol which efficiently
supports distributed real-time control with a very high level of security.
Its domain of application ranges from high speed networks to low cost multiplex wiring. In
automotive electronics, engine control units, sensors, anti-skid-systems, etc., are connected
using CAN with bit rates up to 1 Mbit/sec. The silicon cost is also low enough to be cost effective
at replacing wiring harnesses in the automobile. The robustness of the bus in noisy
environments and the ability to detect and recover from fault conditions makes the bus suitable
for industrial control applications such as DeviceNet, SDS and other field bus protocols.
CAN is an asynchronous serial bus system with one logical bus line. It has an open, linear bus
structure with equal bus nodes. A CAN bus consists of two or more nodes. The number of
nodes on the bus may be changed dynamically without disturbing the communication of other
nodes. This allows easy connection and disconnection of bus nodes (e.g., for addition of system
function, error recovery or bus monitoring).
The bus logic corresponds to a “wired-AND” mechanism, “recessive” bits (mostly, but not
necessarily equivalent to the logic level “1”) are overwritten by “dominant” bits (mostly logic level
0”). As long as no bus node is sending a dominant bit, the bus line is in the recessive state, but
a dominant bit from any bus node generates the dominant bus state. Therefore, for the CAN
bus line, a medium must be chosen that is able to transmit the two possible bit states (dominant
and recessive). One of the most common and cheapest ways is to use a twisted wire pair. The
bus lines are then called “CANH” and “CANL”, and may be connected directly to the nodes or
via a connector. There's no standard defined by CAN regarding the connector to be used. The
twisted wire pair is terminated by terminating resistors at each end of the bus line. The
maximum bus speed is 1 Mbit, which can be achieved with a bus length of up to 40 meters. For
bus lengths longer than 40 meters, the bus speed must be reduced (a 1000 m bus can be
realized with a 40 Kbit bus speed). For a bus length above 1000 meters, special drivers should
be used. At least 20 nodes may be connected without additional equipment. Due to the
differential nature of transmission, CAN is insensitive to EMI because both bus lines are
affected in the same way which leaves the differential signal unaffected. The bus lines can also
be shielded to reduce the electromagnetic emission of the bus itself, especially at high baud
rates.
The binary data is coded corresponding to the NRZ code (Non-Return-to-Zero; low level =
dominant state; high level = recessive state). To ensure exact synchronization of all bus nodes,
bit stuffing is used. This means that during the transmission of a message a maximum of five
consecutive bits may have the same polarity. Whenever five consecutive bits of the same
polarity have been transmitted, the transmitter will insert one additional bit of the opposite
polarity into the bit stream before transmitting further bits. The receiver also checks the number
of bits with the same polarity and removes the stuff bits from the bit stream (-destuffing).
In the CAN protocol it is not bus nodes that are addressed, but the address information is
contained in the messages that are transmitted. This is done via an identifier (part of each
message) which identifies the message content (e.g., engine speed, oil temperature etc.). The
identifier additionally indicates the priority of the message. The lower the binary value of the
identifier, the higher the priority of the message.

Table of Contents

Other manuals for Microchip Technology dsPIC30F