Introduction to Controller Area Network (CAN)

Similar documents
Course Introduction. Purpose. Objectives. Content. Learning Time

Today. Last Time. Motivation. CAN Bus. More about CAN. What is CAN?

CAN Protocol Implementation

MPX-2515 User s Guide

The House Intelligent Switch Control Network based On CAN bus

Controller area network

Controller Area Network

CAN bus and NMEA2000 1

Communication Networks for the Next-Generation Vehicles

Workshop on In Vehicle Network using CAN By

An Introduction to CAN by Peter Bagschik (I+ME ACTIA)

Implementation of CAN Bus Protocol

BOSCH. CAN Specification. Version , Robert Bosch GmbH, Postfach , D Stuttgart

Development of a CAN Slave Module with SystemC. Igor Sachs Shang Qihua

Recommended readings

An Overview of the Controller Area Network

Operating Systems, Concurrency and Time. real-time communication and CAN. Johan Lukkien

AN713. Controller Area Network (CAN) Basics INTRODUCTION CAN PROTOCOL BASICS CAN OVERVIEW

The Controller Area Network (CAN) Interface

ISO INTERNATIONAL STANDARD. Road vehicles Controller area network (CAN) Part 1: Data link layer and physical signalling

Serial Buses in Industrial and Automotive Applications

EE445M/EE380L.6, Lecture 10 4/3/2016. EE445M/EE360L.6 Embedded and Real-Time Systems/ Real-Time Operating Systems. Lecture 10

EE445M/EE380L.12, Lecture 10 4/2/2018. EE445M/EE360L.6 Embedded and Real-Time Systems/ Real-Time Operating Systems. Lecture 10

IMPLEMENTATION OF CONTROLLER AREA NETWORK FOR AUTOMOTIVE APPLICATIONS

Design of Mixed Higher Layer Protocol Systems.

Digital communication technology for teaching automatic control: the level control case

CAN in Space workshop

Controller Area Network CAN. overview

Figure 1. ECU Access to CAN bus

ISO INTERNATIONAL STANDARD. Road vehicles Controller area network (CAN) Part 3: Low-speed, fault-tolerant, medium-dependent interface

Additional Slides (informative)

CAN FD filter for Classical CAN controllers

Design and Implementation of CAN Bus Controller on FPGA

Tutorial Introduction

CAN Application Layer for industrial applications

A Framework Of Milk Dairy Automation Using CAN Protocol

FlexRay and Automotive Networking Future

Understanding and Using the Controller Area Network Communication Protocol

Implementation and validation of SAE J1850 (VPW) protocol solution for diagnosis application

Gryphon Hardware Information: Dual SJA1000 Fault Tolerant CAN card

DeviceNet - CIP on CAN Technology

EP A1 (19) (11) EP A1 (12) EUROPEAN PATENT APPLICATION. (43) Date of publication: Bulletin 2012/45

CAN-FD Flexible Data Rate CAN

Time Triggered CAN, Implementations, Development and Testing Tools

Controller Area Network (CAN)

Holger Zeltwanger CAN CAN. protocol and its impacts on CANopen. CiA

AUTOMOBILE APPLICATIONS USING CAN PROTOCOL

UNDERSTANDING THE CONTROLLER AREA NETWORK (CAN)

CAN with Flexible Data-Rate

DeviceNet Communication Manual

Freescale Semiconductor, I. SECTION 13 CAN 2.0B CONTROLLER MODULE (TouCAN)

CAN protocol enhancement

Accessing the shared! communication medium!! Media! Access! Conntrol!

Ch 7. Network Interface

CAN FD. An Introduction V

Motors I Automation I Energy I Transmission & Distribution I Coatings. DeviceNet CFW700. User s Manual

AN1105 APPLICATION NOTE

J1939-based application profiles

Controller Area Network. CAN History

DCB1M - Transceiver for Powerline Communication

Collision Avoidance of Vehicle System Using CAN Protocol

Chances and challenges

J1939 OVERVIEW. 1

(Controller Area Network)

Helsinki Metropolia University of Applied Sciences Degree Program in Information Technology

Lab 8 (ETH): Control Area Network

A CONTROLLER AREA NETWORK LAYER FOR RECONFIGURABLE EMBEDDED SYSTEMS

Basics of UART Communication

ECE 653: Computer Networks Mid Term Exam all

Multidrop Ethernet for In-cabinet Applications

Data Link Layer Technologies

CAN-FD FILTER FOR CLASSICAL CAN DEVICES VIENNA 27 OCTOBER BY KENT LENNARTSSON, KVASER AB

µtasker Document Controller Area Netwok (CAN)

CONTROLLER AREA NETWORK (CAN)

CAN (Controller Area Network) Physical Layer

CAN in Automation (CiA) International Users and Manufacturers Group e.v.

AAUSAT3. Software Framework for Reconfigurable Distributed System on AAUSAT3. Group 08gr724

INTER INTRA VEHICULAR COMMUNICATION

DEFINITION AND IMPLEMENTATION OF AN ARCHITECTURAL CONCEPT FOR CONFIGURING A CAN NETWORK

TSS463C. VAN Data Link Controller with Serial Interface. Features. Description

ACC, a Next Generation CAN Controller

SAE J1939. Serial Control and Communications Vehicle Network. Presented by Wilfried Voss

Complete CAN Solutions for Diverse Embedded Applications. CAN Solutions

ISO INTERNATIONAL STANDARD

DNA/DNR-CAN-503 Controller Area Network Layer. User Manual

Using CAN Arbitration for Electrical Layer Testing

CONTROLLER AREA NETWORK AS THE SECURITY OF THE VEHICLES

Operating Manual. Inferface. CANopen. English

in Mainz (Germany) Sponsored by Allen Bradley National Semiconductor Philips Semiconductors Organized by

Probabilistic Worst-Case Response-Time Analysis for the Controller Area Network

Gateway Design for Network based Multi-Motor Control with CAN and Profibus (ICCAS 2005)

Road vehicles Controller area network (CAN) Part 1: Data link layer and physical signalling

CAN / RS485. Product Description. Technical Reference Note. Interface Adapter. Special Features

IR/IrDA transceiver board

A Beginner s Guide to Controller Area Network Bus Access in Modern Vehicles

Problem Set Name the 7 OSI layers and give the corresponding functionalities for each layer.

Simplify CAN and LIN In-vehicle Network Testing

MCP2510. Stand-Alone CAN Controller with SPI Interface FEATURES DESCRIPTION PACKAGE TYPES

Microprocessor Communication Module Connecting On Board Diagnostic System and Personal Computer

DeviceNet CFW500. User s Manual. Phone: Fax: Web: -

Transcription:

Introduction to Controller Area Network (CAN) 2003 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 1

Topics CAN Protocol Overview What is CAN? CAN Message Structure (Frames) Error Handling CAN in Action Sending a Message Receiving a Message Additional Resources 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 2

CAN Protocol Overview What is CAN? CAN Stands for Controller Area Network CAN is an extremely robust standardized communication protocol. CAN protocol was developed by Bosch in the 1980s to create standardization and reduce the cost and weight in vehicle wiring harnesses Primary uses today are automotive and Industrial control applications 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 3

CAN only defines portions of the lower 2 layers of the OSI 7- Layer Reference Model OSI Reference Layers Application Presentation Session Transport Network Data Link Layer Physical Layer CAN Protocol Overview: CAN Protocol Layers Logical Link Control (LLC) - Acceptance Filtering - Overload Notification Medium Access Control (MAC) - Data Encapsulation/Decapsulation - Frame Coding (stuffing/destuffing) - Error Detection/Signalling Physical Signaling (PLS) - Bit Encoding/Decoding/Timing Physical Medium Attachment (PMA) - Driver/Receiver Characteristics Medium Dependent Interface (MDI) - Connectors 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 4

CAN Protocol Overview: CAN Protocol Layers Node specific application HLP such as DeviceNet, J1939, CANopen, CANKingdom, Proprietary, etc. CAN layer Application Network CAN Physical Physical medium, transceiver, wires, connectors, etc. 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 5

CAN Protocol Overview: CAN Networks A CAN network is made up of a group of Nodes Each node can communicate with any other node Communication is handled with extremely robust packets called Messages Transmission speeds of up to 1 Mbps are defined Engine Control Node Dashboard Display Node Door Node Node n messages 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 6

CAN Protocol Overview: What does a CAN Node Do? A node is any sub system that is connected to the CAN bus A node may be very simple or very complex A node may continually send messages, such as a motor speed control node A node may only transmit a message when a system failure has occurred, such as a temperature monitoring node A node may only take action when another node instructs it to do so, such as an electronic valve control 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 7

CAN Protocol Overview: CSMA/CD-CR Carrier Sense (CS) - Every node must monitor bus for a period of no activity before sending a message Multiple Access (MA) - Once a period of no activity occurs, every node has an equal opportunity to transmit a message Collision Detection (CD) - If 2 nodes transmit at the same time, a collision occurs Collision Resolution (CR) - Non-destructive bitwise arbitration to resolve collisions 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 8

CAN Protocol Overview: Arbitration The node(s) losing arbitration become receivers and receive message Node A sends a dominant TX Node A RX Node A TX Node B Node B sends Recessive and monitors a Dominant RX Node B Becomes a receiver 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 9

CAN Protocol Overview: Synchronization No clock in bit stream Receivers synchronize on recessive to dominant transitions Hard Synchronization Re-synchronization SOF 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 10

CAN Protocol Overview: CAN Messages There are several types of Messages or Frames defined Data Frame Transmits data from a transmitting node to any or all other nodes Standard and Extended Remote Frame Is a request for data from other node(s) Standard and Extended Error Frame Signifies bus errors have been detected 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 11

CAN Protocol Overview: Data Frame Standard Data Frame has 11-bit identifier Extended Data Frame has 29-bit identifier Start of Frame ID28 32 Arbitration Field ID18 SRR IDE ID17 ID0 6 Control Field RTR R1 R0 DLC3 DLC0 8N (0 N 8) Data Field 16 CRC Field 2 Ack Field Del ACK Del 7 End of Frame 0 11 100 1 1 1111111 11 msb Identifier 18 lsb Identifier Reserved Bits 4 bits Data Length Code 15 bits CRC 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 12

CAN Protocol Overview: Remote Frame Two types, standard or extended. Identical to the Data Frame, except there is no Data Field and the RTR bit is recessive. 0 ID28 32 Arbitration Field ID18 SRR IDE ID17 ID0 11 0 Control Field 00 6 RTR R1 R0 DLC3 DLC0 CRC Field 16 2 7 Ack Field Del 1 ACK Del End of Frame 1 1111111 11 msb 18 lsb 4 bits Identifier Identifier Reserved Bits Data Length Code 15 bits CRC 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 13

CAN Protocol Overview: Error Handling Several different types of error frames are generated for protocol violations ensures integrity of messages Fault Confinement CAN nodes can transition from working normally to being totally disconnected from the network based on fault data Fault Confinement prevents faulty nodes from continuously transmitting and bogging down a network 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 14

CAN Protocol Overview: Error Handling Acknowledge Error Transmitting node sends ACK Slot bit as a recessive bit and checks for a dominant bit to verify reception CRC Error All nodes receive message, calculate CRC and verify against CRC received Form Error Generated when a dominant bit is detected where one should not be (CRC Delimiter, Ack Delimiter, End of Frame (EOF) field or Interframe Space) Stuff Error The bit stuffing rule is violated if 6 consecutive bits with the same polarity are detected Bit Error Node detects a signal on the bus that is opposite of what it sent 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 15

CAN Protocol Overview: Error Frame An Error Frame will be generated when a node detects one of the many types of errors defined by CAN 6 Error Flag 8 Error Delimiter 000000 000000 6-12 bits Superposition of Error Flags 11111111 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 16

CAN in Action Sending and Receiving Messages 2003 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 17

CAN in action: How does a node determine which messages to act on? Each node has Filter Registers Identifier fields of incoming messages are compared to these Filter Registers to determine if an action is required 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 18

Transmit Assembly Registers Identifier bits CAN in action: Sending a Message Data bits Transmit Assembly Registers typically reside in the CAN controller CAN Protocol Engine - Start/stop bits - CRC Checking - Message Arbitration Bus Transceiver Messages CAN Bus 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 19

Transmit Assembly Registers Identifier bits CAN in action: Sending a Message Data bits Transmit Assembly Registers typically reside in the microcontroller CAN Protocol Engine - Start/stop bits - CRC Checking - Message Arbitration The Go command is given and the assembled message is given to the protocol engine which is part of the CAN controller hardware Bus Transceiver Messages CAN Bus 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 20

CAN in action: Sending a Message Transmit Assembly Registers Identifier bits Data bits These are typically generated (loaded) by the microcontroller CAN Protocol Engine - Start/stop bits - CRC Checking - Message Arbitration The Go command is given and the assembled message is given to the protocol engine which is part of the CAN controller hardware Bus Transceiver Messages The assembled message is transmitted onto the bus CAN Bus 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 21

Bus Transceiver Receive Assembly Registers Identifier bits CAN in action: Receiving a Message Data bits Messages CAN Bus The receive assembly register captures every message on the bus CAN Protocol Engine - Error Checking - CRC Checking Message Filters Receive Register 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 22

Bus Transceiver Receive Assembly Registers Identifier bits Data bits CAN Protocol Engine - Error Checking - CRC Checking CAN in action: Receiving a Message Messages The receive assembly register captures every message CAN Bus The protocol engine checks for errors and allows message to pass if valid Message Filters Receive Register 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 23

Bus Transceiver Receive Assembly Registers Identifier bits Data bits CAN Protocol Engine - Error Checking - CRC Checking Message Filters CAN in action: Receiving a Message Messages The receive assembly register captures every message CAN Bus The protocol engine checks for errors and allows message to pass if valid Filters are typically programmed into the CAN controller Receive Register 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 24

Bus Transceiver Receive Assembly Registers Identifier bits Data bits CAN Protocol Engine - Error Checking - CRC Checking Message Filters Receive Register CAN in action: Receiving a Message Messages The receive assembly register captures every message Filters are typically programmed into the microcontroller CAN Bus The protocol engine checks for errors and allows message to pass if valid The microcontroller can now act on the received message 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 25

CAN in action: Its not as difficult as it looks! Most aspects of sending or receiving a message is handled by the protocol engine Transmitting a message typically requires only the loading of the identifier and data bytes - then giving the GO command Receiving a message typically requires monitoring a status byte or interrupt pin and then reading the data that has been received 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 26

Summary CAN is a robust data communications protocol which is suitable for: Simple sensor and display applications Distributing control across the network System critical applications in automotive and industrial markets. 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 27

If you would like to learn more Some Industry Groups CAN In Automation (CIA) www.can-cia.de Open DeviceNet Vendors Association www.odva.org SAE (e.g., J1939) Some Development Tools Kvaser AB www.kvaser.se Diversified Engineering www.diversifiedengineering.net 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 28

Microchip s CAN Products MCP2515 Stand-alone CAN controller MCP250xx CAN I/O Expander (four devices) MCP2551 CAN Transceiver PIC18CXX8 8-bit MCU with CAN (two devices) PIC18FXX8 8-bit MCU with CAN (four devices) PIC18FX680 and PIC18FX585 with ECAN technology (four devices) dspic30f601x 16-bit MCU with CAN 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 29

Application Notes References ADN004, Ease into the Flexible CANbus Network AN713, An introduction to the CAN protocol that discusses the basics and key features. AN212, Smart Sensor CAN Node using the MCP2510 and PIC16F876 AN215, A Simple CAN Node using the MCP2510 and PIC12C67X AN228, A CAN Physical Layer Discussion AN754, Understanding Microchip s CAN Module Bit Timing AN815, Understanding the MCP250xx Devices AN816, A CAN System Using Multiple MCP25050 CAN I/O Expanders AN872, Upgrading from the MCP2510 to the MCP2515 2004 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 30

Web Seminar: June 23, 2004 Introduction to Controller Area Network (CAN) 2003 Microchip Technology Incorporated. All Rights Reserved. Introduction to Controller Area Network (CAN) 31