Upload
sam-spade
View
217
Download
0
Embed Size (px)
Citation preview
7/29/2019 AT91SAM7 - CAN11
1/20
BY
B.CHATRAPATHI
(092N1A0405)
22/01/2013
7/29/2019 AT91SAM7 - CAN11
2/20
22/01/2013
What is CAN ?
Why CAN ?
CAN Protocol
CAN Applications
7/29/2019 AT91SAM7 - CAN11
3/20
22/01/2013
ControllerArea Network
Invented by Robert Bosch GmbH in 1980 for automotiveapplications
Asynchronous Serial Bus
Simple 2-wire differential bus
Absence of node addressing
Message identifier specifies contents and priority
Lowest message identifier has highest priority
Non-destructive arbitration system by CSMA with collisiondetection
Multi-master / Broadcasting concept
Sophisticated error detection & handling system
7/29/2019 AT91SAM7 - CAN11
4/20
22/01/2013
The CAN is an ISO standard (ISO 11898) for serial communication
Today CAN has gained widespread use:
Industrial Automation
Automotive, etc.
The CAN standard includes:
Physical layer
Data-link layer
Some message types
Arbitration rules for bus access
Methods for fault detection and fault confinement
7/29/2019 AT91SAM7 - CAN11
5/20
22/01/2013
Mature Standard
CAN protocol more than 16 years
Numerous CAN products and tools on the market
Hardware implementation of the protocol
Combination of error handling and fault confinement with hightransmission speed (up to 1Mb/s)
Simple Transmission Medium
Twisted pair of wires is the standard, but also just one wire willwork
Other links works, too: Opto - or radio links
Excellent Error Handling CRC error detection mechanism
Fault Confinement
Built-in feature to prevent faulty node to block system
Most used protocol in industrial and automotive world
7/29/2019 AT91SAM7 - CAN11
6/20
22/01/2013
Protocol -
7/29/2019 AT91SAM7 - CAN11
7/2022/01/2013
Protocol -
7. Application Layer
5. Session Layer6. Presentation Layer
4. Transport Layer
3. Network Layer
2. Data Link Layer
1. Physical LayerCAN Protocol
HLPs: CANopen, DeviceNet, OSEK/VDX
Partially Implementedby High LayerProtocol (HLP)
CANLayers
7/29/2019 AT91SAM7 - CAN11
8/2022/01/2013
Protocol -
CAN Controller
CAN Transceiver
7/29/2019 AT91SAM7 - CAN11
9/2022/01/2013
Protocol -
Node 1 Node 2 Node 3 Bus
D D D D
D D r D
D r D DD r r D
r D D D
r D r D
r r D D
r r r r
1 Recessive (r)
0 Dominant (D)
Two logic states on the CAN bus
Bus in dominant state
Bus in recessive state
or idle
Wired-AND Function
7/29/2019 AT91SAM7 - CAN11
10/2022/01/2013
Protocol -
Controller CANController
CANTransceiver
CANBu
sCAN_H
CAN_L
TXD
RXD
CAN Bus is a simple 2-wire differential serial bus
CAN Bus is terminated on each side by a 120 Ohm resistor
7/29/2019 AT91SAM7 - CAN11
11/2022/01/2013
Protocol -
Bit Coding : NRZ (Non-Return-To-Zero code) does not ensure enough edgesfor synchronization
Stuff Bits are inserted after 5 consecutive bits of the same level
Stuff Bits have the inverse level of the previous bit.
No deterministic encoding, frame length depends on transmitted data
Number of consecutive bitswith the same polarity
7/29/2019 AT91SAM7 - CAN11
12/2022/01/2013
Protocol -
Hard synchronization at Start Of Frame bit
Re-Synchronization on each Recessive to Dominant bit
7/29/2019 AT91SAM7 - CAN11
13/2022/01/2013
Protocol -
CAN Bit Period Four Time Segments
Each Time Segment represents a number of Time Quanta (TQ)
1 Time Quantum 1 period of CAN Controller Clock
1 Bit Time 8 to 25 Time Quanta
SYNC_SEG: synchronize the different nodes PROP_SEG: compensate for signal delays across the network
PHASE_SEG1 & 2: compensate for edge phase errors
7/29/2019 AT91SAM7 - CAN11
14/20
22/01/2013
Protocol -
7/29/2019 AT91SAM7 - CAN11
15/20
22/01/2013
Protocol -
SOF: Start Of Frame
CRC: Cyclic Redundancy Code
ACK: Acknowledge
EOF: End of Frame
IFS: Inter Frame Space
7/29/2019 AT91SAM7 - CAN11
16/20
22/01/2013
Protocol -
One undetected error every 1000 years !!!
Error statistics depend on the entire environment
Total number of nodes
Physical layout
EMI disturbance
Automotive example
2000 hours/year
Baud rate: 500 kbps
25% bus load
7/29/2019 AT91SAM7 - CAN11
17/20
22/01/2013
HLP -
CiA (CAN in Automation)
Features
CANopen is a subset from CAL (CANApplication Layer) developed by CiA
Auto configuration the network
Easy access to all device parameters
Device synchronization
Cyclic and event-driven data transfer Synchronous reading or setting of inputs, outputs or parameters
Applications
Machine Automation
Advantages
Accommodating the integration of very small sensors and actuators
Supports inter-operability of different devices High speed real-time capability
7/29/2019 AT91SAM7 - CAN11
18/20
22/01/2013
Applications -
7/29/2019 AT91SAM7 - CAN11
19/20
22/01/2013
Applications -
Building Automation:
Heating control, Air Conditioning, Security, Access & LightControl
Domestic & Food distribution appliances
Washing machines, dishes cleaner, self-service bottledistributors
Automotive & Transportation
Dash Board, Power train & Car Body
Train, bus and truck equipment
Robotic
Production Automation:
Control & link of production machines
Medical
Agriculture
Harvester, seeding, sowing machines, tractor control...
7/29/2019 AT91SAM7 - CAN11
20/20
22/01/2013