Debugging CAN, LIN, and Flexray Automotive Buses with an Oscilloscope ––

Debugging CAN, LIN, and Flexray Automotive Buses with an Oscilloscope ––

Debugging CAN, LIN, and FlexRay Automotive Buses with an Oscilloscope –– APPLICATION NOTE Debugging CAN, LIN, and FlexRay Automotive Buses with an Oscilloscope APPLICATION NOTE Introduction THIS APPLICATION NOTE Embedded systems applications growing rapidly in the automotive • Gives a brief orientation on the industry. Many vehicle designs use CAN, LIN or FlexRay to physical layer and packet structures communicate among electronic control units (ECUs), and between of CAN / CAN FD, LIN, and FlexRay ECUs and sensors, actuators and displays. These buses are critical buses, with a goal of providing just enough detail to help with in providing real-time communications in and among important troubleshooting subsystems from braking systems to infotainment systems. • Explains how to set up decoding on an oscilloscope equipped with CAN / CAN, LIN, and FlexRay are relatively mature bus protocols CAN FD, LIN or FlexRay decoding and are designed to be robust and easy to integrate. Even so, • Explains how to interpret decoded communications can be impacted by noise, board layout, and serial bus data on an appropriately- power-up/down timing. Problems can include excessive bus errors equipped oscilloscope and lock-ups. Unlike basic protocol analyzers, oscilloscopes • Explains what triggering and equipped with protocol decoding, can be used to see both the searching options are available decoded bus traffic, as well as signal quality. This ability to see bus With optional serial triggering signals and decoded traffic makes oscilloscopes the best choice for and analysis capability, Tektronix troubleshooting. oscilloscopes become powerful tools for embedded system designers working Perhaps more importantly, oscilloscopes can be used to with CAN, LIN, and FlexRay buses. In troubleshoot problems at the system level. Automobiles rely on this application note the 5 Series MSO is used to demonstrate decoding and extensive networks of sensors, actuators and displays, and many triggering on these buses. problems involve bus timing relative to I/O events or values. Oscilloscopes are well-suited for looking at I/O signals and bus Other Tektronix oscilloscopes also support CAN, LIN, and FlexRay transactions at the same instant. Because of this capability, they are triggering and analysis. See “Serial the instrument of choice for system-level debugging. Support Using Oscilloscopes and Optional Software” for a complete listing. 2 | TEK.COM/INNOVATIVE-SCOPES Debugging CAN, LIN, and FlexRay Automotive Buses with an Oscilloscope APPLICATION NOTE CAN/CAN FD HOW IT WORKS The Controller Area Network (CAN) was The CAN/CAN FD bus is a balanced (differential) 2-wire interface running originally developed in the 1980s by the Robert over a Shielded Twisted Pair (STP), Un- shielded Twisted Pair (UTP), or Bosch GmbH as a low cost communications ribbon cable. Each node uses a male 9-pin D connector. A number of bus between devices in electrically noisy different data rates are defined, with 1Mb/s being the fastest for CAN and environments. Mercedes-Benz became the first 8 Mb/s the fastest for CAN FD. All modules must support at least 20 kb/s. automobile manufacturer in 1992 to employ Normally all devices in a system transfer information at uniform and fixed bit CAN in their automotive systems. Today, every rates. Maximum cable length depends on the data rate used. The maximum automotive manufacturer uses CAN controllers line length can be thousands of meters at low speeds; 40 meters at 1 Mb/s and networks to control a variety of Electronic is typical. Termination resistors are used at each end of the cable. Control Units (ECUs) in their automobiles. It is Non Return to Zero (NRZ) bit encoding is used with bit stuffing to ensure the primary bus used for engine timing controls, compact messages with a minimum number of transitions and high noise anti-lock braking systems and power train immunity. The CAN bus interface uses an asynchronous transmission controls to name a few. And due to its electrical scheme where any node may begin transmitting anytime the bus is free. noise tolerance, minimal wiring, excellent error Messages are broadcast to all nodes on the network. In cases where detection capabilities and high data transfer multiple nodes initiate messages at the same time, bitwise arbitration is speeds, CAN is expanding into other applications used to determine which message is higher priority. Messages can be such as industrial control, marine, medical, one of four types: aerospace, and more. As vehicle networks have evolved to support MESSAGE TYPES DESCRIPTION many more functions, an urgent need has arisen to support faster data communication between Data Frame Used to transmit data Data and Remote frames are controlled by start and stop bits at Remote Transmission Used to request data nodes. This has led to CAN FD, a higher speed the beginning and end of each frame Request (RTR) Frame version of CAN which can achieve a max data and include the following fields: rate of 8 Mbps with a payload up to 64 bytes Arbitration field, Control field, Data field, CRC field and an ACK field. long compared to the max data rate of 1 Mbps and payload of 8 bytes for CAN. The first version Error Frame Any node on the bus that detects an error transmits an error frame which causes all nodes on the bus to view the current of the CAN FD standard was released in 2012 but message as incomplete and the transmitting node to resend it was later updated into an ISO standard called the message ISO CAN FD in 2015. The ISO version introduced Overload Frame Initiated by receiving devices to indicate they are not ready additional safeguards to improve communication to receive data yet reliability. The original version is now known as non-ISO CAN FD and is not compatible with ISO CAN FD. TEK.COM/INNOVATIVE-SCOPES | 3 Debugging CAN, LIN, and FlexRay Automotive Buses with an Oscilloscope APPLICATION NOTE Structure of Data and Remote Transmission Request Frames CAN 2.0 SOF Arbitration Field Control Field Data Field CRC Field ACK EOF INT 1 bit 11 bits (Std ID) 6 bits 0-8 bytes 16 bits 2 bits 7 bits 3 bits 29 bits (Ext ID) CAN FD SOF Arbitration Field Control Field Data Field CRC Field 18 or ACK EOF INT 1 bit 12 bits (Std ID) 8 or 9 bits 0-64 bytes 22 bits 2 bits 7 bits 3 bits 32 bits (Ext ID) FIELD DESCRIPTION SOF The frame begins with a start of frame (SOF) bit which is the same for CAN and CAN FD Arbitration Includes an Identifier (address) and the Remote Transmission Request (RTR) bit used to distinguish between a data frame and a data request frame, also called a remote frame. The identifier can either be standard format (11 bits - version 2.0A) or extended format (29 bits - version 2.0B). CAN FD shares the same addressing as CAN for standard and extended formats but removes the RTR bit and maintains a dominant r1 bit. Control Consists of six bits including the Identifier Extension (IDE) bit which distinguishes between a CAN 2.0A (11 bit identifier) standard frame and a CAN 2.0B (29 bit identifier) extended frame. The Control Field also includes the Data Length Code (DLC). The DLC is a four bit indication of the number of bytes in the data field of a Data frame or the number of bytes being requested by a Remote frame. CAN FD uses eight or nine bits in the Control Field and also uses the IDE, r0 and DLC bits. Three additional bits are added that include Extended Data Length (EDL) used to determine if packet is CAN or CAN FD, Bit Rate Switch (BRS) used to separate arbitration phase from data phase and Error State Indicator (ESI). The same four bit DLC is used differently in CAN FD for lengths ≥ 8. Data The CAN data field consists of 0 to 8 bytes of data. CAN FD supports 0 to 8 bytes but has an increased payload ability to support 12, 16, 20, 32, 48 or 64 bytes. CRC A 15 bit cyclic redundancy check code and a recessive delimiter bit is used in CAN. CAN FD uses 17 bits (plus CRC delimiter bit) for payloads ≤ 16 bytes or 21 bits (plus CRC delimiter bit) for ≥ 16 bytes. There are 4 additional stuff bits used for CAN FD. ACK The Acknowledge field is two bits long. The first is the slot bit, transmitted as recessive, but then overwritten by dominant bits transmitted from any node that successfully receives the transmitted message. The second bit is a recessive delimiter bit. There is a slight difference in CAN FD where the receiver recognizes 2 bit times as a valid ACK. EOF Seven recessive bits indicate the end of frame (EOF). The intermission (INT) field of three recessive bits indicates the bus is free. Bus Idle time may be any arbitrary length including zero. 4 | TEK.COM/INNOVATIVE-SCOPES Debugging CAN, LIN, and FlexRay Automotive Buses with an Oscilloscope APPLICATION NOTE SETTING UP CAN / CAN FD BUS DECODING On Tektronix oscilloscopes equipped with CAN decoding and triggering, pressing the front panel Bus button lets you define inputs to the scope as a bus. To enable the oscilloscope to decode information being transferred, you enter some basic parameters: • CAN standard • Type of signal • Input channel • Bit rate(s) • Voltage threshold • Sample point (as a percent of bit time) The CAN bus is a differential signal. Although the oscilloscope can acquire and decode the bus using single-ended probing, the signal fidelity and noise immunity is improved by using differential probing. TEK.COM/INNOVATIVE-SCOPES | 5 Debugging CAN, LIN, and FlexRay Automotive Buses with an Oscilloscope APPLICATION NOTE INTERPRETING CAN / CAN FD BUS INFORMATION CAN BUS ELEMENT INDICATED BY The decoded bus waveform indicates the elements of a CAN message Start of Frame is indicated using color-coded graphics.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    20 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us