Distributed Real-Time Systems (TI-DRTS) Track 2. CAN-BUS Introduction. Version 9.11.2009 Ref. VECTOR application note & Motorola note



Similar documents
Welcome to the Introduction to Controller Area Network web seminar My name is William Stuart, and I am a Applications Engineer for the Automotive

CAN Specification 2.0, Part B page 1 PART B. CAN in Automation, Am Weichselgarten 26, D Erlangen

Tutorial.

Elettronica dei Sistemi Digitali Costantino Giaconia SERIAL I/O COMMON PROTOCOLS

Local Interconnect Network Training. Local Interconnect Network Training. Overview

Comparison of FlexRay and CAN-bus for Real-Time Communication

Understanding SAE J1939. by Simma Software, Inc.

In-Vehicular Communication Networking Protocol

Vorlesung Kommunikationsnetze Fieldbus Systems

Protocols for Wired and Wireless Networks in Vehicle Systems

A Security Evaluation and Internal Penetration Testing Of the CAN-bus

2.1 CAN Bit Structure The Nominal Bit Rate of the network is uniform throughout the network and is given by:

DeviceNet Communication Manual

Bluetooth in Automotive Applications Lars-Berno Fredriksson, KVASER AB

FlexRay A Communications Network for Automotive Control Systems

The SAE J1939 Communications Network

Computer Networks. Data Link Layer

LAN Switching Computer Networking. Switched Network Advantages. Hubs (more) Hubs. Bridges/Switches, , PPP. Interconnecting LANs

LIN (Local Interconnect Network):

Section 34. Controller Area Network (CAN)

DigiPoints Volume 1. Student Workbook. Module 4 Bandwidth Management

Introduction to. LIN (Local Interconnect Network)

Ring Local Area Network. Ring LANs

Computer Network. Interconnected collection of autonomous computers that are able to exchange information

Getting Started with CANopen Version Application Note AN-AON

Positioning Controller

The I2C Bus. NXP Semiconductors: UM10204 I2C-bus specification and user manual HAW - Arduino 1

EECS 122: Introduction to Computer Networks Multiaccess Protocols. ISO OSI Reference Model for Layers

Bus Data Acquisition and Remote Monitoring System Using Gsm & Can

Introduction to RACE FUELS Hans-Christian von der Wense Munich, Germany

In-Vehicle Networking

ECE 358: Computer Networks. Homework #3. Chapter 5 and 6 Review Questions 1

Real-Time Systems Hermann Härtig Real-Time Communication (following Kopetz, Liu, Schönberg, Löser)

Implementing MOD bus and CAN bus Protocol Conversion Interface

CS263: Wireless Communications and Sensor Networks

Ethernet. Ethernet Frame Structure. Ethernet Frame Structure (more) Ethernet: uses CSMA/CD

Process Control and Automation using Modbus Protocol

RPDO 1 TPDO 1 TPDO 5 TPDO 6 TPDO 7 TPDO 8

standard. Acknowledgement: Slides borrowed from Richard Y. Yale

Serial Communications

Vehicle data acquisition using CAN By Henning Olsson, OptimumG

CCNA R&S: Introduction to Networks. Chapter 5: Ethernet

Multiplexed Networks for Embedded Systems. CAN, LIN, FlexRay, Safe-by- Wire...

Introduction to Higher-Level Protocols Version 1.0 Application Note AN-AND-1-160

Automotive Communication Network Trends

Written examination in Computer Networks

TD-03011E. Identifier Usage in CANopen Networks

Based on Computer Networking, 4 th Edition by Kurose and Ross

Serial Communications

Data Link Layer Overview

Development of Scalable CAN Protocol

DATA COMMUNICATION AND NETWORKS

Local Area Networks transmission system private speedy and secure kilometres shared transmission medium hardware & software

Real-time Operating Systems Lecture 27.1

Software Development for Multiple OEMs Using Tool Configured Middleware for CAN Communication

Data Link Layer(1) Principal service: Transferring data from the network layer of the source machine to the one of the destination machine

CSMA/CA. Information Networks p. 1

The Future of CAN / CANopen and the Industrial Ethernet Challenge by Wilfried Voss, President esd electronics, Inc USA

SPI I2C LIN Ethernet. u Today: Wired embedded networks. u Next lecture: CAN bus u Then: wireless embedded network

Microcomputer Protocol Implementation at Local Interconnect Network Georgi Krastev

ARM Ltd 110 Fulbourn Road, Cambridge, CB1 9NJ, UK.

Chapter 4. Medium Access Control. IN2P3 Octobre 2002 Jean-Pierre Thomesse

Mbps PCI LAN Controller A Guide to Compatibility

LANs. Local Area Networks. via the Media Access Control (MAC) SubLayer. Networks: Local Area Networks

Express Forwarding : A Distributed QoS MAC Protocol for Wireless Mesh

EnOcean Radio Protocol 2. September 26, 2013 SPECIFICATION V1.0. Subject to modifications EnOcean Radio Protocol 2 V1.0 Page 1/19

How to Hack Your Mini Cooper: Reverse Engineering CAN Messages on Passenger Automobiles

Industrial Networks & Databases

Multiple clock domains

SocketCAN CAN Driver Interface under Linux

UMBC. ISA is the oldest of all these and today s computers still have a ISA bus interface. in form of an ISA slot (connection) on the main board.

In networking ECUs in heavy-duty vehicles, it is the J1939 protocol that. plays a key role. J1939 networks are based on the CAN bus (high-speed

Road Vehicles - Diagnostic Systems

TCP in Wireless Networks

Comparison of CAN, TTP and Flexray Communication Protocols

BCS THE CHARTERED INSTITUTE FOR IT. BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT COMPUTER NETWORKS

Eliminate Risk of Contention and Data Corruption in RS-485 Communications

Computer buses and interfaces

9chapter. Indutrial networks. Presentation: Needs and available components. Technologies. Schneider Electric policy

Introduction to LIN. Webinar

RTT 60.5 msec receiver window size: 32 KB

Random Access Protocols

Data Exchange On The CAN Bus I

Generic term for using the Ethernet standard in automation / industrial applications

Automotive Ethernet Prototype and test development with CANoe/CANalyzer.Ethernet

How To Communicate With A Token Ring Network (Dihon)

Medium Access Control (MAC) Protocols for Ad hoc Wireless Networks - III

Objectives. Lecture 4. How do computers communicate? How do computers communicate? Local asynchronous communication. How do computers communicate?

A Transport Protocol for Multimedia Wireless Sensor Networks

Tutorial Introduction

The OSI Model and the TCP/IP Protocol Suite PROTOCOL LAYERS. Hierarchy. Services THE OSI MODEL

FOUNDATION Fieldbus High Speed Ethernet Control System

LIN (Local Interconnected Network)

BROADBAND AND HIGH SPEED NETWORKS

It explains the differences between the Plesiochronous Digital Hierarchy and the Synchronous Digital Hierarchy.

Transcription:

Distributed Real-Time Systems (TI-DRTS) Track 2 CAN-BUS Introduction Version 9.11.2009 Ref. VECTOR application note & Motorola note

What is CAN? Controller Area Network (CAN) is a common, small area network solution that supports distributed product and distributed system architectures The CAN bus is used to interconnect a network of electronic nodes or modules Typically, a two wire, twisted pair cable is used for the network interconnection Slide 2

CAN - Highlights Is a high-integrity serial data communications bus for real-time applications Is event driven Operates at data rates of up to 1 Mbits/s Has excellent error detection capabilities Was originally developed by Bosch for use in cars Is now being used in many other industrial automation and control applications Is an international standard: ISO 11898 Slide 3

Why use CAN? Slide 4

CAN History CAN first introduced by Bosch in 1986 Bosch published CAN specification version 2.0 in 1991 Official ISO CAN standard in 1993: ISO 11898 In 1999 57 million CAN controller chips sold Estimated to 300 million CAN chips in 2003 Slide 5

Field Buses in the Automotive Industry Slide 6

Typical CAN Network Slide 7

CAN Standards Although CAN was originally developed in Europe by Robert Bosch for automotive applications, the protocol has gained wide acceptance and has become an open, international ISO standard As a result, the Bosch CAN 2.0B specification has become the de facto standard that new CAN chip designs follow CAN ISO Standardization: ISO PRF 16845 : CAN Conformance Test Plan ISO PRF 11898-1: CAN Transfer Layer ISO PRF 11898-2: CAN High Speed Physical Layer ISO DIS 11898-3: CAN Fault Tolerant Physical Layer ISO DIS 11898-4: TTCAN Time Triggered CAN Slide 8

CAN 2.0 Structure of a CAN Node ISO/OSI Reference Model CAN Specification, ISO 11898, deals only with the Physical & Data Link Layers for a CAN network Slide 9

Three-Layer Reference Model Application Process Layer 7 Layer 2 Layer 1 Application Layer Data Link Layer Physical Layer Management Slide 10

Key Reasons to Use CAN Low connect cost Low cost components Growing number of CAN chips Increasing knowledge base Increasing integration service base Wide variety of CAN-based products Wide variety of Off-the-Shelf tools available Potential lower wiring costs Lower weight Slide 11

What Industries are using CAN? Slide 12

CAN Higher Layer Protocols (1) CAN is used as the basis for several major "7-layer" protocol developments such as: CAL: CAN Application Layer (CiA: Can In Automation) CAN Kingdom (Kvasar) CANopen (CiA: Can In Automation) DeviceNet (Rockwell Automation, ODVA) Volcano (Developed by Volvo) SAE J1939 (Society of Automotive Engineers) TTCAN: Time Triggered CAN (Bosch) Slide 13

CAN Higher Layer Protocols (2) Each of these large protocol architectures are essentially complete industry-specific network solutions packaged to include defined requirements for the: physical layer, address structure & message structure conversation structure data structure application/network interface Slide 14

How does CAN operate? CAN is a multiplexed serial communication channel Can transfer up to 8 data bytes within a single message For larger amounts of data, multiple messages are commonly used Most CAN based networks select a single bit rate While communication bit rates may be as high as 1 MBit/s, most implementations are 500Kbit/s or less CAN supports data transfers between multiple peers No master controller is needed to supervise the network conversation Slide 15

Bit Rate versus Bus Length Bit Rate (kbits/s) 1000 500 135 100 50 Maximum Bus length (m) 50 110 620 790 1640 A Rule of Thumb for bus length > 100 m: Bit Rate (Mbit/s) * Lmax (m) <=60 [Ref: Etschberger] Slide 16

Bit Rate versus Bus Length [Ref: Etschberger] Slide 17

CAN Identifiers Labels the content (type) of a message used by receivers to select a message Used for arbitration & determines the priority of the message Low id.number = high priority Slide 18

CAN 2.0A vs CAN 2.0B Slide 19

CAN 2.0A Message Frame CAN 2.0A (Standard Format) 11 bit message identifier (2048 different frames) Transmits and receives only standard format messages Slide 20

CAN Message Frame Slide 21

CAN 2.0B Message Frame CAN 2.0B (Extended Format) Capable of receiving CAN 2.0A messages 29 bit message identifier (512 million frames) 11 bits for a CAN 2.0A message + 18 bits for a CAN 2.0B message Slide 22

Two Communcation Types Transmitter Receiver 1 1. Transmitter initated Data Frame (ID=100, RTR Bit = 0) Receiver 2 2. Remote Transmission Request: Remote Frame (ID=105, RTR Bit = 1, Data Length=7) Data Frame (ID=105, RTR Bit = 0, Data Length= 7) Receiver 7 Slide 23

Arbitration (1) Carrier Sense, Multiple Access with Collision Avoidance (CSMA/CA) Method used to arbitrate and determine the priority of messages Uses enhanced capability of non-destructive bitwise arbitration to provide collision resolution Slide 24

Arbitration (2) A station may send if the bus is free (carrier sense) Any message begins with a field for unique bus arbitration containing the message ID The station with the lowest ID is dominant (D-Bit) So the lowest ID has highest priority Sending is not interfered since the propagation on the bus is much smaller than a duration of a bit Slide 25

Bitwise Arbitration Any potential bus conflicts are resolved by bitwise arbitration Dominant state (logic 0) has precedence over a recessive state (logic 1) Competition for the bus is won by node 2. Nodes 0 and 1 automatically become receivers of the message Nodes 0 and 1 will re-transmit their messages when the bus becomes available again Slide 26

Example of Bitwise Arbitration Slide 27

Qualities: Safe Collision and Tx-feedback The CAN-controller has 2 important features: A collision do not destroy any message on the bus All Tx s with recessive levels stops immediately and changes to Rx s. The Tx-node with highest priority wins the bus and sends data Every transmitted message is evaluated by each receiving node, and if the received message is damaged the Tx-node is alerted with a feedback at dominant level, sent from the Rx-node Slide 28

Error Detection CAN implements five error detection mechanisms Three at the message level Cyclic Redundancy Checks (CRC) Frame Checks Acknowledgment Error Checks Two at the bit level Bit Monitoring Bit Stuffing Slide 29

Cyclic Redundancy Check (CRC) (Message Level) The 15 bit CRC is computed by the transmitter based on the message content All receivers that accept the message, recalculates the CRC and compares against the received CRC If the two values do not match a CRC error is flagged Slide 30

Frame Check (Message Level) If a receiver detects an invalid bit in one of these positions a Form Error (or Format Error) will be flagged: CRC Delimiter ACK Delimiter End of Frame Bit Field Interframe Space (the 3 bit INTermission field and a possible Bus Idle time) Slide 31

ACK Error Check (Message Level) Each receiving node writes a dominant bit into the ACK slot If a transmitter determines that a message has not been ACKnowledged then an ACK Error is flagged. ACK errors may occur because of transmission errors because the ACK field has been corrupted or there is no operational receivers Slide 32

Bit Monitoring (Bit Level) Each bit level (dominant or recessive) on the bus is monitored by the transmitting node Bit monitoring is not performed during arbitration or on the ACK Slot Slide 33

Bit Stuffing (Bit Level) Bit stuffing is used to guarantee enough edges in the NRZ bit stream to maintain synchronization: After five identical and consecutive bit levels have been transmitted, the transmitter will automatically inject (stuff) a bit of the opposite polarity into the bit stream Receivers of the message will automatically delete (destuff) such bits If any node detects six consecutive bits of the same level, a stuff error is flagged Slide 34

Error Flag If an error is detected by at least one node The node that detects the error will immediately abort the transmission by sending an Error Flag An Error Flag consists of six dominant bits This violates the bit stuffing rule and all other nodes respond by also transmitting Error Flags Slide 35

What is needed to implement CAN? Slide 36

Requirements for a CAN Controller Slide 37

FullCAN vs BasicCAN Controller FullCAN Controller: Typically 16 message buffers, sometimes more Global and Dedicated Message Filtering Masks Dedicated H/W for Reducing CPU Workload More Silicon => more cost e.g. Powertrain BasicCAN Controller: 1 or 2 Tx and Rx buffers Minimal Filtering More Software Intervention Low cost e.g. Car Body Slide 38

CANopen CANopen: a standardized application for distributed industrial automation systems Based on CAN standard and CAL (Can Application Layer) In Europe the definitive standard for the implementation of industrial CAN-based system solutions Standardized by CiA (CAN-in-Automation) Devices profiles e.g. digital/analog I/O modules, drives, encoders, MMI-units, controllers Two types of communication mechanisms: unconfirmed transmission of data frames to transfer process data confirmed transmission of data (for configuration purpose) Slide 39

DeviceNet DeviceNet developed by Rockwell Automation in 1995 Main CAN automation technology in USA and Asia ODVA: Open DeviceNet Vendor Assocation (>300 members) DeviceNet is a connection-based communication model (ConnectionId = CAN identifier) Two message types: explicit and I/O messages Max 64 nodes in a DeviceNet network Slide 40

Three Development Scenarios based on a layer-2 implementation Application based on a standard application layer Application CAL/ CAN Kingdom based on a standardized application profile Application CANopen / DeviceNet CAN CAN CAN Slide 41

CAN Summary CAN is designed for asynchronous communication (event communication) with little information contents (8 bytes) Max 1MBit/s Useful for soft real-time systems Many microcontrollers comes with an integrated CAN controller A low-cost solution New invention: TTCAN a Time-Triggered CAN protocol Slide 42

References [Etschberger]: Controller Area Network basics, protocols, chips and applications, by Konrad Etschberger, IXXAT Press, 2001 www.can.bosch.com Contains specification documents References Links ODVA: Open DeviceNet Vendors Association www.odva.org CiA: CAN in Automation http://www.can-cia.org/ Slide 43