1 / 22

An Introduction to CAN CAN Basics 2 Renesas Interactive

An Introduction to CAN CAN Basics 2 Renesas Interactive. Key reasons to use CAN. Scalability Low wiring cost Low node connection costs More and more chips More off the shelf tools Knowledge base growing Reliability (error free). CAN Message Frames. Data Frame - Carries the actual data

kyrie
Télécharger la présentation

An Introduction to CAN CAN Basics 2 Renesas Interactive

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. An Introduction to CAN CAN Basics 2 Renesas Interactive

  2. Key reasons to use CAN • Scalability • Low wiring cost • Low node connection costs • More and more chips • More off the shelf tools • Knowledge base growing • Reliability (error free)

  3. CAN Message Frames • Data Frame - Carries the actual data • Error Frame - When error is detected by any node’shardware • Overload Frame - Request a delay on the bus • Interframe Space - Provides minimum spacing between data and remote frames Allows error frames priority • Remote Frame - Request transmission of Data Frame.

  4. Data Flow

  5. Data Frame • Start of Frame • Arbitration Field • Control Field • Data Field • CRC • ACK Field • End of Frame

  6. Start of Frame • A single dominant bit while the bus is idle • All nodes synchronize timing to leading edge All nodes synchronize to edge

  7. Arbitration Field Standard; 11-bit identifier Extended; 29-bits

  8. Arbitration Carrier Sense Multiple Access/Collision Resolution = CSMA/CR By using Dominant and Recessive Bits Handling collisions

  9. Control Field Control Field contains the DLC • 2 bits reserved • 4 bits Data Length Code; number of Data Field bytes

  10. Data Field • Data content = payload of the frame • 0-8 bytes • MSB transmitted first

  11. CRC Field • 15 bit CRC value followed by a recessive delimiter • Generated by transmitter node’s HW and verified in receiver’s HW • CRC polynomial: x15+x14+x10+x8+x7+x4+x3+1

  12. ACK Field ACK FIELD = ACK SLOT + ACK DELIMITER All receivers that received valid message reports with a ’dominant’ bit during the ACK slot Any receiver that disagrees votes no after the delimiter with an error flag

  13. End of Frame DATA FRAME and REMOTE FRAME delimited by ‘End of Frame’ consisting of seven recessive’ bits. Gives a break before the next frame..

  14. Error detection Locally detected errors When is an error frame sent? • Bit error -receive bit at sender not equal to transmit bit. • Bit stuffing violation -max 5 bits with same polarity • CRC error -checksum violation • Form error -bit pulse malshaped • Ack error -no dominant level in ACK slot so sender must retransmit

  15. What is needed? • Firmware • CAN controller • CAN transceivers • A physical media

  16. Example ofRenesas CAN MCUs • SH705x series • Automotive Powertrain • SH7047 series • General purpose SH2…soon updated derivative available. • M32R/ECU series • Automotive Powertrain • M32C series • General purpose (1-3 channels of CAN) • M16C/6N series • M16C/62 family with CAN. General purpose. • M16C/29 series • General Purpose M16C/Tiny with CAN. • M16C/10 series • Better off with M16C/Tiny or R8C/Tiny • R8C/Tiny series • General Purpose

  17. Question 1 Which is normally by far the most common frame type? • Data Frame • Error Frame • Overload Frame • Remote Frame A: 1 B: 2 C: 3 D: 4

  18. Question 2 Which of these statements is false? • The data field in a data frame can consist of max 255 bytes • The data field has only 8 bytes • You must specify for each data frame how many data bytes follow • Remote frames are not necessary to use CAN A: 1 B: 2 C: 3 D: 4

  19. Question 3 Which of these is false? • The CRC field is sent by all receivers and verified by the transmitter. • Each receiver generates a CRC on the observed data frame and compares it with the transmitted CRC check value. • Every receiver which has received a valid message correctly, reports this to the transmitting node with a ’dominant’ bit during the ACK slot. Any node that disagrees, votes no after the delimiter by sending an error flag. A: 1 B: 2 C: 3

  20. Question 4 When is an error frame sent? • Bit stuffing violation; > 5 bits with same polarity • CRC error; checksum violation • Form error; bit pulse malshaped • Ack error; no dominant level in ACK slot so sender must retransmit A: 1-3 B: 2-4 C: 2 and 4 D: All above

  21. Glossary • Advanced CAN: CAN peripheral with varying numbers of buffers configurable for transmit/receive. Receive buffers have hardware filtering on at least mask/match identifier content. • Basic CAN: CAN peripheral with no hardware filtering. Typically two receive buffers act as FIFO accepting all bus traffic. Usually one transmit buffer. • Bit Time: Nominal time of one bit on the CAN bus. Made up of multiple segments that allows each node to synchronize to the received bus traffic. All nodes on a bus must be configured to the same (nominal) bit time. • CAN:Controller Area Network • CAN 2.0B: Version 2.0 was the last version of CAN defined by Bosch. Part B added extended identifiers and the idea of hardware filtering. • CIA: CAN in Automation. Group controlling the CANOpen protocol. • CANOpen: Multi-area communication protocol using CAN. • CRC: Cyclic Redundancy Check • DeviceNet: Industrial communication protocol using CAN. • Dominant/Recessive: Dominant bits on physical layer can override recessive bits. • Filters: Hardware in the CAN peripheral that can mask/match bits within the identifier field used to determine whether or not route bus data to a mailbox. • GM LAN 3.0: GM protocol, encompasses all GM serial protocols. • Identifier: Frame field that indicates the message content. This field also is used to arbitrate the message priority on the bus; lower identifier is higher priority. • Standard Format; frames use 11 bit identifier. • Extended Format “- 29 bits • ISO 11898: ISO standardized version of CAN. • Mailbox: CAN hardware buffer that can be used to transmit or receive data. Most full CAN implementations have at least 16 mailboxes. • ODVA: Open DeviceNet Vendor Association. Group controlling DeviceNet protocol. • Time Quanta: Smallest time unit used by CAN. Multiple time quanta make up the segments of a bit time. • TT CAN: Time Triggered CAN. More deterministic CAN by assigning time slots when nodes may transmit. • FlexRay: Next generation automotive network. Time slots on the bus provide more deterministic behavior. • Vector-CanTech: Supplier of the majority of CAN software drivers and tools to North American and European automobile ECUs.

  22. Come back for more! End CAN Basics 2

More Related