Course Introduction
Purpose
• This training course provides an introduction to Controller Area Network
(CAN) technology, which is used to build networked, multiprocessor
embedded systems.
Objectives
• Understand what CAN technology is, why it’s important and where it can be
a good design solution.
• Learn the fundamental operating concepts and capabilities of CAN
implementations.
• Find out how CAN fits into the 7-layer OSI model.
Content
• 19 pages
• 3 questions
Learning Time
• 30 minutes
1
© 2009, Renesas Technology America, Inc., All Rights Reserved
What is CAN?
Controller Area Network:
Two-wire, bidirectional serial-bus communication method
Originally developed in the mid 1980s by Bosch for
automotive use
Main design objective: economical solution for implementing high-
integrity networking in real-time control applications
Now standardized internationally:
– CAN 2.0A: ISO11519 — low speed
– CAN 2.0B: ISO11898 — high speed
– CAN Validation: ISO16845
Usage exceeded 200,000,000 nodes in 2001, still growing at a 30% rate
annually
– Many current and potential non-automotive application opportunities
2
© 2009, Renesas Technology America, Inc., All Rights Reserved
Non-automotive CAN Applications
• Electronically controlled production and
packaging equipment
– Machine tools; machines for molding, weaving, knitting, and
sewing; systems for folding and wrapping; etc.
• Industrial freezers, printing machines
• Ships, locomotives, railway systems
• Farm and construction machinery
• Semiconductor manufacturing equipment
• Building automation: HVAC systems, elevators, etc.
• Hospital patient-monitoring systems
• Many others
More application information available at: www.canopen.us
3
© 2009, Renesas Technology America, Inc., All Rights Reserved
Key Reasons for Using CAN
1. Reliability
• Error-free communication
2. Economy
• Low wiring cost
• Low hardware cost
3. Scalability
• Easy expandability
• Low node-connection costs
4. Availability
• More chips with CAN hardware
• More off-the-shelf tools
• Higher-level protocols
5. Popularity
• Knowledge base expanding
4
© 2009, Renesas Technology America, Inc., All Rights Reserved
Main Features of CAN
Features Benefits
Has a multiple-master hierarchy For building intelligent and redundant
systems
Provides transfer rates up to For adequate real-time response in
1 Megabit/sec many embedded control applications
Allows 0-8 bytes of user data To accommodate diverse design
per message requirements
Puts multiple transmit or receive For flexibility in system design
message boxes at each node and
assigns each an identifier
5
© 2009, Renesas Technology America, Inc., All Rights Reserved
Main Features of CAN
Features Benefits
Eliminates addresses of transmitting To save bus bandwidth, simplify
and receiving nodes in data software, and allow simultaneous
messages transmission of node-to-node and
broadcast messages
Causes receiving nodes to filter To simplify node hardware and
messages based on their assigned software
identifiers (IDs)
To permit message prioritization
To allow the hardware to arbitrate
the CAN bus
Automatically retransmits messages For accurate communication,
if even in noisy environments
corruption occurs
Provides error detection, signaling To ensure highly reliable network
and fault-confinement measures operation
6
© 2009, Renesas Technology America, Inc., All Rights Reserved
Design Factors to Consider
Distance/environment
– CAN 2.0B: 1Mbps, up to 40m Node A Node B Node C
– CAN 2.0A: 125kbps, up to 500m
– Suitable for difficult environments — industrial,
automotive, and more
Reliability requirements CAN Bus
– Integrated error detection and confinement
– Automatic retransmission of corrupted message
– Probability of undetected bad message
is <4.7 x 10-11
Number of nodes
– Depends on Physical layer; >100 is feasible
Node D Node E Node x
Number of masters
– Every node can initiate communication and negotiate for the bus
Net data transfer rate
– Up to 577Kbps net at 1Mbps total data transfer rate
Message priority
– Message with lowest numerical value identifier wins if two nodes
try to transmit at the same time
7
© 2009, Renesas Technology America, Inc., All Rights Reserved
Data Flow
CAN bus traffic:
The transmitter at a CAN node broadcasts the data frame to all nodes on
the bus.
– Nodes configured to accept the data save it
– Other nodes do nothing with the data
CAN 2.0A has an 11-bit message identifier and operates at a maximum
frequency of 250kbps.
CAN 2.0B has 11-bit or 29-bit message identifiers and operates at up to
1Mbps.
8
© 2009, Renesas Technology America, Inc., All Rights Reserved
Question
Match each CAN item to the most appropriate explanation by dragging the
letters on the left to the correct locations on the right. Click Done when you are
finished.
Must be sent by all receiver
A CAN D nodes, or message is re-
transmitted
B Multiple-master hierarchy A A 2-wire serial bus communication
method for multiprocessor systems
C Message identifier C Used for addressing, prioritization,
and bus arbitration
Enables the design of intelligent and
D Acknowledgment B redundant systems
Done Reset Show
Solution
9
© 2009, Renesas Technology America, Inc., All Rights Reserved
Physical Interface
Dominant low (voltage) line
Recessive high line
Bus must be terminated
Most common Physical-layer
choice: ISO11898-2
10
© 2009, Renesas Technology America, Inc., All Rights Reserved
Physical-Layer Implementation
CAN transceiver: the Renesas HA13721
ASSP IC:
–For in-vehicle applications
–ISO11898-2 compliant
–High-speed CAN (up to 1Mbps)
–Active Standby modes
–Over-temperature detection
–Over-current detection
(Vcc-short/GND-short detection)
–Optimized EMI performance
–Txd, MODE input pins; 3.3V
compatible
CANH = C_HI
CANL = C_LO
11
© 2009, Renesas Technology America, Inc., All Rights Reserved
CAN Bus Data Frame
TX High levels are
TX LO levelsTXareLow
dominant
levels are TX HI levels are
recessive (bus
recessive
(drive bus)dominant (drive bus) (bus termination
termination controls) controls)
CANCAN
TXTX
MCU Output to
Transceiver
C_HI CAN HI
Transceiver
Output to Bus
C_LO
CAN LO
CAN uses non-return-to-zero (NRZ) serial data
12
© 2009, Renesas Technology America, Inc., All Rights Reserved
Message Bit Time: 4 Segments
NOMINAL BIT TIME
SYNC_SEG PROP_SEG PHASE_SEG1 PHASE_SEG2
SYNC_SEG: Nodes are synchronized within Sample Point
this phase
PROP_SEG: Propagation delay compensation
value [ = 2 x (signal propagation time
+ input comparator delay
+ output driver delay)]
PHASE_SEG1 and PHASE_SEG2: Establish correct sampling point
13
© 2009, Renesas Technology America, Inc., All Rights Reserved
Maintaining Synchronization
‘Bit stuffing’ is applied as needed to keep the bus
synchronized:
• Too many consecutive dominant or recessive bits
cause the transmitting node to insert a bit of the
opposite polarity
• Resulting signal edge is used to establish timing
synchronization at all nodes on the bus
• The bit is inserted whenever a sequence of five bits
with the same polarity occurs
14
© 2009, Renesas Technology America, Inc., All Rights Reserved
Maintaining Synchronization
Stuffed bit
15
© 2009, Renesas Technology America, Inc., All Rights Reserved
Question
Which of these statements correctly describe voltage and timing
aspects of CAN bus operation? Select all that apply and then click
Done.
A dominant value (positive differential voltage >900 mV) is created by
driving the C_HI line high and the C_LO line low.
Mandatory CAN bus termination resistors create a recessive value
when all bus nodes go to a high-impedance state.
Because CAN uses NRZ serial data, synchronization between nodes is
maintained automatically.
The PROP_SEG portion of the bit time is used to compensate for
physical delays within the network.
Done
16
© 2009, Renesas Technology America, Inc., All Rights Reserved
CAN in the OSI Model
Higher-Layer Protocols CAN Features
Application Data Link
Data
Network Process to Application
LLC
Acceptance Filtering
Presentation Overload Notification
Data Data Representation and Recovery Management
Host Encryption
Layers
Data Session MAC
Interhost Communication Data Encapsulation/Decapsulation
Frame Coding (Stuffing, Destuffing)
Transport Medium Access Management
Segments Error Detection
End-to-End Connections and Error Signaling
Reliability Acknowledgment
Serialization / Deserialization
Network
Packets Path Determination and IP
(Logical Addressing)
Media Data Link Physical
Layers Frames MAC and LLC Bit Encoding/Decoding
(Physical Addressing) Bit Timing
Synchronization
Physical Driver/Receiver Characteristics
Bits Media, Signal and Binary
Transmission
ISO 11898
Mouse over any of the blocks containing fine print to learn more.
17
© 2009, Renesas Technology America, Inc., All Rights Reserved
Higher-layer CAN Protocols
Automotive Industrial Other
DeviceNet NMEA2000
Incompatible OEM (marine)
GM (LAN3.0)
CAN Open CANaerospace
Daimler-Chrysler
(avionics)
Ford
Toyota, etc. Proprietary
SAE J1939
(heavy trucks)
ISO11783
(agricultural vehicles)
Proprietary
CAN Interface
18
© 2009, Renesas Technology America, Inc., All Rights Reserved
Glossary
Advanced CAN: CAN peripheral with varying numbers of buffers configurable for transmit/receive. Receive buffers have hardware
filtering on at least mask/match identifier content.
Basic CAN: CAN peripheral with no hardware filtering. Typically two receive buffers act as a FIFO and accept all bus traffic.
Usually one transmit buffer.
Bit Time: Nominal time of one bit on the CAN bus. Made up of multiple segments that allow each node to synchronize to the
received bus traffic. All nodes on a bus must be configured to the same (nominal) bit time.
CAN: Controller Area Network.
CAN 2.0B: Version 2.0 was the last version of CAN defined by Bosch. Part B added extended identifiers and the idea of hardware
filtering.
CIA: CAN in Automation. Group controlling the CANOpen protocol.
CANOpen: Multi-area communication protocol using CAN.
CRC: Cyclic Redundancy Check.
DeviceNet: Industrial communication protocol using CAN.
Dominant/Recessive: Dominant bits on Physical layer can override recessive bits.
Filters: Hardware in the CAN peripheral that can mask/match bits within the identifier field. Used to determine whether or not to
route bus data to a mailbox.
GM LAN 3.0: GM protocol. Encompasses all GM serial protocols.
Identifier: Frame field that indicates the message content. This field also is used to arbitrate the message priority on the bus. A
lower ID has a higher priority.
– Standard Format: Frames use an 11-bit identifier.
– Extended Format: Frames use a 29-bit ID.
ISO 11898: ISO standardized version of CAN.
Mailbox: CAN hardware buffer that can be used to transmit or receive data. Most FullCAN implementations have at least 16
mailboxes.
ODVA: Open DeviceNet Vendor Association. Group controlling DeviceNet protocol.
Time Quanta: Smallest time unit used by CAN. Multiple time quanta make up the segments of a bit time.
TT CAN: Time Triggered CAN. More deterministic form of CAN. Assigns time slots when nodes may transmit.
FlexRay: Next-generation automotive network. Time slots on the bus provide more deterministic behavior.
Vector-CanTech: Supplier of the majority of CAN software drivers and tools for ECUs of North American and European
automobiles.
19
© 2009, Renesas Technology America, Inc., All Rights Reserved
Question
Is the following statement true or false? Click Done when you are finished.
“Basically, CAN is concerned with the lowest layers of the OSI model, but CAN
2.0B also implements part of the transport layer.”
True
False
Done
20
© 2009, Renesas Technology America, Inc., All Rights Reserved
Course Summary
CAN description, applications, features/benefits
Design factors/parameters
Data frame and data flow
Timing issues
Physical interface, OSI model, and higher-level protocols
Glossary
21
© 2009, Renesas Technology America, Inc., All Rights Reserved