21
CAN 1 30/05/22 Controller Area Network

can ppt

Embed Size (px)

DESCRIPTION

ppt of can protocal

Citation preview

Page 1: can ppt

CAN

1 13/04/23

Controller Area Network

Page 2: can ppt

CAN

2 13/04/23

CAN Agenda

What is CAN ? Why CAN ? CAN Protocol CAN Higher Layer Protocols CAN Applications AT91 CAN Microcontrollers – Roadmap

Page 3: can ppt

CAN

3 13/04/23

What is CAN ? 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

Page 4: can ppt

CAN

4 13/04/23

Why CAN ? 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 high

transmission speed (up to 1Mb/s) Simple Transmission Medium

Twisted pair of wires is the standard, but also just one wire will work

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

Page 5: can ppt

CAN

5 13/04/23

CAN Protocol

Protocol -

Page 6: can ppt

CAN

6 13/04/23

ISO-OSI Reference Model

Protocol -

7. Application Layer

5. Session Layer

6. Presentation Layer

4. Transport Layer

3. Network Layer

2. Data Link Layer

1. Physical LayerCAN Protocol

HLPs: CANopen, DeviceNet, OSEK/VDX

Partially Implemented by High Layer Protocol (HLP)

CA

N L

ayer

s

Page 7: can ppt

CAN

7 13/04/23

Typical CAN Node

Protocol -

µController CAN Controller

CAN Transceiver

CA

N B

usCAN_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

Page 8: can ppt

CAN

8 13/04/23

Error Detection Analysis

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

Page 9: can ppt

CAN

9 13/04/23

CAN High Layer Protocols

HLP -

Page 10: can ppt

CAN

10 13/04/23

HLP Definition

HLP -

One undetected error every 1000 years !!!

CAN protocol defines only the physical and a low data link layer ! The HLP defines:

Start-up behavior Definition of message identifiers for the different nodes Flow control Transportation of messages > 8bytes Definition of contents of Data Frames Status reporting in the system

Page 11: can ppt

CAN

11 13/04/23

CAN Kingdom

HLP -

CAN Kingdom is more than a HLP (Meta Protocol): Introduced by KVASER, Sweden A ‘King’ (system designer) takes the full responsibility of the system The King is represented by the Capital (supervising node)s CAN Kingdom provides simple unique identification of system nodes

Applications Machine Automation

Advantages Designed for safety critical applications Real time performance Scalability Integration of DeviceNet modules in CAN Kingdom possible

Page 12: can ppt

CAN

12 13/04/23

CAN Applications

Applications -

Page 13: can ppt

CAN

13 13/04/23

CAN: a Large Field of Applications

Applications -

Building Automation: Heating control, Air Conditioning, Security, Access & Light

Control… Domestic & Food distribution appliances

Washing machines, dishes cleaner, self-service bottle distributors…

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...

Page 14: can ppt

CAN

14 13/04/23

AT91SAM7 CAN Embedded ControllersA1 - A2 - A3 - X

AT91SAM7 -

Page 15: can ppt

CAN

15 13/04/23

CAN Controllers Types

3 types of CAN controllers exist: CAN Controllers 2.0 Part A: standard frames CAN Controllers 2.0 Part B Passive or ‘extended frames passive’ CAN Controllers 2.0 Part B Active or ‘extended frames active’

CAN Implementations: 2 main implementations strategy BasicCAN: cheaper CAN Controller

• 1 or 2 Rx buffers (FIFO) and 1 Tx buffer• Minimal Filtering

FullCAN: high performance CAN Controllers• Set of buffers called Mailboxes• Dedicated Mailbox Filtering

Our CANs: 2.0A/2.0B (Active) & FullCAN

AT91SAM7 -

Page 16: can ppt

CAN

16 13/04/23

AT91SAM7A3 – AT91SAM7XCAN Controller

SAM7A3 / SAM7X -

Page 17: can ppt

CAN

17 13/04/23

CAN Controller Structure

SAM7A3 / SAM7X -

Page 18: can ppt

CAN

18 13/04/23

Mailbox Organisation

SAM7A3 / SAM7X -

Eight 32-bit registers by mailbox

Mailbox x Mode Register Mailbox x Acceptance Mask Register Mailbox x ID Register Mailbox x Family ID Register Mailbox x Status Register Mailbox x Data Low Register Mailbox x Data High Register Mailbox x Control Register

Mailbox Channel Buffer

CAN_MAMxCAN_MAMx

CAN_MMRxCAN_MMRx

CAN_MIDxCAN_MIDx

CAN_MFIDxCAN_MFIDx

CAN_MDLxCAN_MDLx

CAN_MSRxCAN_MSRx

CAN_MDHxCAN_MDHx

CAN_MCRxCAN_MCRx

Mailbox x

Page 19: can ppt

CAN

19 13/04/23

Mailbox Priority

SAM7A3 / SAM7X -

Reception Modes: In this modes, the mailbox with the lowest number is serviced first.

Transmission Modes: Mailbox with the highest priority PRIOR lowest value. When several mailboxes try to transmit a message at the same time, the mailbox with

the highest priority is services first. If at least two mailboxes have the same priority (same PRIOR value), the mailbox with

the lowest number is serviced first.

Mailbox Mode Register

PRIOR 16

Page 20: can ppt

CAN

20 13/04/23

Multiple Transfer or Abort Requests

SAM7A3 / SAM7X -

The CAN Transfer Command Register (CAN_TCR) allows to perform several transfer requests at the same time.

The CAN Abort Command Register (CAN_ACR) allows to perform several abort requests at the same time.

Page 21: can ppt

CAN

21

THANK YOU !

13/04/23