Advanced embedded systems design l.jpg
This presentation is the property of its rightful owner.
Sponsored Links
1 / 28

Advanced Embedded Systems Design PowerPoint PPT Presentation


  • 89 Views
  • Uploaded on
  • Presentation posted in: General

Advanced Embedded Systems Design. Lecture 10 Controller Area Networks BAE 5030 - 003 Fall 2004 Instructor: Marvin Stone Biosystems and Agricultural Engineering Oklahoma State University. Goals for Class Today. Questions over reading / homework ( Chapters 23, 24 )

Download Presentation

Advanced Embedded Systems Design

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Advanced embedded systems design l.jpg

Advanced Embedded Systems Design

Lecture 10 Controller Area Networks

BAE 5030 - 003

Fall 2004

Instructor: Marvin Stone

Biosystems and Agricultural Engineering

Oklahoma State University


Goals for class today l.jpg

Goals for Class Today

  • Questions over reading / homework (Chapters 23, 24)

  • USB from a developers prospective – (Patrick)

  • SPI and I2C – (Brody)

  • Controller Area Networks introduction – (Stone)

  • Set assignment


Communications busses for embedded systems a very abridged list l.jpg

Automotive

SAE J1850

SAE J1708 / 1587

CAN based

SAE J1939 / ISO 11783

Fault tolerant busses

ByteFlight

FlexRay

TTP / TTCAN

MOST

Avionics

MIL-STD-1553

ARINC 429

Marine

NMEA 0183

NMEA 2000 (IEC 61162-3 )

Ethernet

Ethernet

IEEE

803.2 – Further defined ethernet

803.11 – wireless LAN

802.15.4 – Zigbee

LIN

On-board busses (inter-IC busses)

SPI

I2C

Microwire

1-Wire

Industrial

MODBUS

RS485

Ethernet

Fieldbus

Bitbus

CAN

DeviceNet

SDS

CiA

Proprietary

RS 485

CAN

Communications busses for embedded systems(A very abridged list!)


Can controller area network introduction l.jpg

CAN – Controller Area Network - Introduction

  • History

    • Developed by Bosch in mid 1980’s to meet a need for networking ECUs (electronic control units in automobiles)

    • Initially introduced with an 11-bit message identifier (CAN 1.0 – 1.2), later a 29 bit identifier introduced (CAN 2.0)

      • Now:

        • 11 bit only parts: CAN 1.2 (Also CAN2.0A)

          • 2048 different CAN messages

        • 11 bit compatible with 29 bit messages: CAN 2.0B 29 bit passive

        • xmit and receive 11 and 29 bit ID: CAN 2.0B

          • 536 million CAN messages

    • CAN has since been heavily adopted

      • ~350 million protocol controllers sold in 2003 (Bosch / CiA)

      • Broad industrial support

        • Automotive

          • J2284 / IDB-C 500 - kBaud automotive physical and data link

          • J1939 – Heavy duty vehicle physical/data link/network/app layer

          • Proprietary

        • Industrial

          • DeviceNet – Industrial physical/data link/network layers

          • SDS - Industrial physical/data link/network layers

          • Proprietary

    • See: http://www.can-cia.de/can/protocol/history/history.html


Can overview l.jpg

CAN Overview

  • CAN = Controller Area Network

    • Serial data communications protocol for real-time application using a multiple access bus

      • Messages have assignable priority

        • most critical can dominate during heavy load

      • Messages are short (controlled length)

        • opportunities to insert a new message come often

  • Asynchronous serial communications

    • Serial bus vs. point-to-point

      • Reduction in wiring complexity

      • Better information sharing

  • Low probability of an undetected error

    • 4.7 x 10-11 x message error rate

      • For a message error rate of 25/sec: 1 undetected error per 10,000 hours operation


  • Capacity comparison l.jpg

    Capacity Comparison


    Capacity and performance l.jpg

    Capacity and Performance

    • Use of bus bandwidth @250 kBaud by messages

      • 100 messages per second (10 ms repetition) =5%

        • Torque/Speed control on engine

        • Hitch control

      • 10 messages per second (100 ms repetition) =0.5%

        • Throttle position

        • GPS Lat/Lon data

        • Implement application rate control (process data)

      • 1 message per second (1s repetition) =0.05%

        • Display updates

        • System status


    Message latency l.jpg

    Message latency

    • 134 bit message @250 kBaud (bit stuffing ignored)

      • @ 4 ms per bit = 536 ms = 0.5 ms per message max

    • Highest priority message

      • must wait no more than ~0.5 ms

    • Low priority messages

      • must wait till higher priority messages clear

      • latency may be long at high bus loads


    Conventional wiring no bus l.jpg

    Conventional Wiring (No Bus)

    Serial

    Communication

    Links


    A simple can application serial bus l.jpg

    A Simple CAN Application (Serial Bus)


    Can introduction l.jpg

    CAN - Introduction

    • Network structure

      • Intended as a bus, but other physical implementations are possible

      • Limitations – No “Tee’s”


    An overview of can based networking l.jpg

    An overview of CAN based networking

    • CAN - Elements

      • CSMA/CA

        • Bitwize priority access strategy

          • Uses distributed synchronization of bit timing

        • Non-destructive collisions

      • Message components

        • Identifier / Data

      • Bus Access - Arbitration / Prioritization

      • Error Detection / Error Confinement

      • Filtering

      • Other features

        • In Frame Acknowledgement

        • RTR


    Slide13 l.jpg

    • Message structure

      • Message frame contains:

        • 11/29 bit Identifier

        • Data length

        • 0-8 bytes data

        • CRC

        • In-frame acknowledgement


    Can frame format can 2 0b l.jpg

    CAN Frame Format - CAN 2.0B


    Typical ecu components l.jpg

    Typical ECU Components


    Ecu connection to the bus l.jpg

    ECU Connection to the bus

    ECU 1

    ECU 2

    CAN_H

    CAN_L

    TBC_PWR

    Terminator

    Terminator

    CAN_H

    CAN_L

    TBC_RTN


    Physical network structure l.jpg

    Message

    Message

    Physical network structure

    Message

    Message


    Message components l.jpg

    Message Components

    11 bits or 29 bits

    Message (up to 150 bits)

    0 to 8 bytes (0 to 64 bits)

    Identifier

    Data

    Start

    Serial bit stream


    Can arbitration l.jpg

    CAN Arbitration

    ISO 11878

    Lower numbered identifiers assume higher priority


    Bit time control length of a single bit l.jpg

    Bit time control – Length of a single bit

    • Bit must arrive a destination before phase_seg1 begins. Sampling at receiver will occur within the phase segment.

    • Prop_seg. should accommodate total out and back propagation time plus delay in tranceivers


    Can synchronization bit timing l.jpg

    CAN synchronization / bit timing

    • Definitions:

      • Synchronization segment (Sync_Seg) - that part of the bit time where bit edges are expected to occur

      • Propagation segment (Prop_Seg) - intended to compensate for the physical delay times

      • Phase segment (Phase_seg1, Phase_seg2) – Provide control of the sample point position

      • Synchronization Jump Width (SJW) defines how far a resynchronization may move the Sample Point inside the limits defined by the Phase Buffer Segments to compensate for edge phase errors.

    • Synchronization

      • Hard synchronization will be done to align bits at the beginning of a message.

      • Phase_seg1 is lengthened or phase_seg2 is shortened to minimize phase error by up to the synchronization jump width (SJW). Larger phase errors cannot be compensated for.

    • See:http://www.can.bosch.com/docu/CiA99Paper.pdf


    Physical layer l.jpg

    Physical Layer

    • Many physical layer definitions

      • Most ISO 11898 based

    • Maximum number of ECU's

      • Typical 30 (per segment)

    • Typical Media

      • Twisted shielded pair

        • 120 W nominal impedance

        • Two data lines (CAN_H, CAN_L)

        • One shield

      • Twisted Quad un-shielded

        • 75 W nominal impedance

        • Two data lines (CAN_H, CAN_L)

        • Two termination supply lines

    • Signal

      • Compatable with ISO 11898 drivers (eg. Phillips 80C250)


    Iso 11898 bus levels microchip an 228 l.jpg

    ISO 11898 Bus levels – Microchip AN 228


    Mapping of can to the osi microchip an 228 l.jpg

    Mapping of CAN to the OSI – Microchip AN 228

    • Characteristics of CAN - CAN provides Data Link functions


    To form a complete communications system l.jpg

    To form a complete communications system

    ISO 7498


    Message filtering example l.jpg

    Message Filtering - Example

    Accept if:

    (ID AND MASK) XOR MATCH = 0

    10111100100

    IDENTIFIER

    1 = Care, 0= Don’t Care

    11100000000

    MASK

    10100000000 =

    ID AND MASK

    Pattern must match

    10100000000

    MATCH

    00000000000 =

    (ID AND MASK) XOR MATCH


    Error detection l.jpg

    Error Detection

    • 5 Error Types Detected

      • Bit Error (Sent bit doesn’t match monitored bit)

      • Stuff Error (more than 6 successive in one state)

      • CRC error

      • Form Error

      • Acknowledge Error

    • Probability of an undetected error

      • 4.7 x 10-11 x message error rate

        • for a message error rate of 25/sec, 1 undetected error per 10,000 hours operation


    Assignment l.jpg

    Assignment

    • Install the Pont time triggered scheduler in hardware and toggle the RED/GREEN LED at 1 per sec.

    • Read Pont, Chapter 25, 28

    • Tutorial – 30 min

      • Review SAE J1708, SAE J1850, SAE J1939

      • or

      • Review DeviceNET and SDS


  • Login