CAN Controller Area Network
lượt xem 10
download
Carrier Sense Multiple Access (CSMA) is a probabilisticMedia Access Control (MAC) protocol in which a node verifies the absence of other traffic before transmitting on a shared transmission medium CAN uses a nondestructive bitwise arbitration, which means that messages remain intact after arbitration is completed even if collisions are detected. All the arbitration takes place without corruption or delay of the message that wins the arbitration.
Bình luận(0) Đăng nhập để gửi bình luận!
Nội dung Text: CAN Controller Area Network
- 10/14/2012 CAN Controller Area Network 1
- 10/14/2012 2
- 10/14/2012 Gesellschaft mit beschränkter Haftung (abbreviated GmbH (most common), GesmbH or Ges.m.b.H.), German for "company with limited liability" Carrier Sense Multiple Access (CSMA) is a probabilistic Media Access Control (MAC) protocol in which a node verifies the absence of other traffic before transmitting on a shared transmission medium CAN uses a nondestructive bitwise arbitration, which means that messages remain intact after arbitration is completed even if collisions are detected. All the arbitration takes place without corruption or delay of the message that wins the arbitration. 3
- 10/14/2012 CAN Standards The Layered ISO 11898:1993 Standard Architecture 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 CAN bus Cables and Connectors Cable Bus speed Cable type Terminator Bus Length resistance/m 0.75 ...0.8 mm2 50 kbit/s at 1000 m 70 mOhm 150 ... 300 Ohm 600 .. 1000 m AWG18 0.5 ... 0.6 mm2 100 kbit/s at 500 m < 60 mOhm 150 ... 300 Ohm 300 ... 600 m AWG20 0.34 ...0.6 mm2 500 kbit/s at 100 m < 40 mOhm 127 Ohm 40 ... 300 m AWG22, AWG20 0.25 ...0.34 mm2 1000 kbit/s at 40 m < 26 mOhm 124 Ohm 0 ... 40 m AWG23, AWG22 Descri Pin Description Colour Pin Colour ption nc - Pin Description Color 1 V- Black 1 V- Black Drain Bare 2 1 CAN_L Red 2 CAN_L Red V+ Red 3 2 CAN_H Green 3 4 CAN_H Green V- Black 3 V+ Yellow 5 V+ Yellow 4 6 nc - CAN_H White 4 CAN_L Blue 5 4
- 10/14/2012 CAN bus Cables and Connectors Pin Signal Description 1 - Reserved 2 CAN_L CAN_L bus line dominant low 3 CAN_GND CAN Ground Shielded twisted pair Unshielded twisted pair 4 - Reserved 5 (CAN_SHLD) Optional CAN Shield 6 GND Optional Ground 7 CAN_H CAN_H bus line dominant high 8 - Reserved 9 (CAN_V+) Optional CAN external supply ISO11898 NOMINAL BUS LEVELS 5
- 10/14/2012 CAN bus Nominal ISO 11992 Bus Levels CAN COMPARISON 6
- 10/14/2012 Dual in-line package Small-outline integrated circuit MCP2551 High-Speed CAN Transceiver AN228 MCP2510 Stand-Alone CAN Controller with SPI™ Interface BLOCK DIAGRAM TYPICAL SYSTEM IMPLEMENTATION 7
- 10/14/2012 8
- 10/14/2012 Collision Avoidance S R O Identifier T Control Data F 10 9 8 7 6 5 4 3 2 1 0 R Field Field Node 1 (Tx) Listening Mode Node 2 (Tx) Listening Mode Node 3 (Tx) DLC Data Node 4 (Tx) Listening Mode recessive Bus (4 x Rx) dominant 9
- 10/14/2012 CAN bus Bit-Stuffing Rule • One characteristic of Non-Return-to-Zero code is that the signal provides no edges that can be used for resynchronization if transmitting a large number of consecutive bits with the same polarity. Therefore bit-stuffing is used to ensure synchronization of all bus nodes???. • This means that during the transmission of a message, a maximum of five consecutive bits may have the same polarity. • The bit-stuff area in a CAN bus frame includes the SOF, Arbitration field, Control field, Data field and CRC field. 10
- 10/14/2012 AN754 Understanding Microchip’s CAN Module Bit Timing 2 ( BRP 1) PROGRAMMING THE TIMING SEGMENTS Time Quantum TQ 2 ( BRP 1) TOSC The are several requirements for programming the FOSC CAN bit timing segments. TQ AND THE BIT PERIOD 1. PropSeg + PS1 ≥ PS2 Baud Rate Prescaler (BRP) 2. PropSeg + PS1 ≥ tprop 3. PS2 > SJW Signal’s round trip time on the physical bus (tbus), t prop 2 (t bus t cmp t drv ) the output driver delay (tdrv), and the input comparator delay (tcmp). 11
- 10/14/2012 AN754 Understanding Microchip’s CAN Module Bit Timing CAN BIT TIMING CONTROL REGISTERS (MCP2510 CNF REGISTERS) AN754 Understanding Microchip’s CAN Module Bit Timing THE CAN BIT TIME All nodes on a given CAN bus must have the same NBT. Nominal Bit Rate (NBR) is defined in the CAN specification as the number of bits 1 NBR f bit per second transmitted by an ideal transmitter with no resynchronization: tbit The Nominal Bit Time (NBT), or tbit, is made up of tbit t SyncSeg t Pr ogSeg t PS 1 t PS 2 non overlapping segments CAN BIT TIME SEGMENTS The Synchronization Segment (SyncSeg) is used to synchronize the nodes on the bus. Bit edges are expected to occur within the SyncSeg. This segment is fixed at 1TQ. The Propagation Segment (PropSeg) exists to compensate for physical delays between nodes. The PropSeg is programmable from 1 - 8TQ. t prog Pr ogSeg ROUND _ UP( ) TQ The two phase segments, PS1 and PS2 are used to compensate for edge phase errors on the bus. PS1 can be lengthened or PS2 can be shortened by resyncronization. The Synchronization Jump Width (SJW) adjusts the bit clock as necessary by 1 - 4TQ (as configured) to maintain synchronization with the transmitted message. 12
- 10/14/2012 CAN BIT RATE VS. BUS LENGTH Propagation delay between nodes t prop 2 (tbus tcmp tdrv ) 13
- 10/14/2012 Establishing the Time Quantum, Establish the Time Segment Given: • Oscillator = 20 MHz • Bit Rate = 500K BPS • BRT = 0, tprop = 750 ns 1 1 2 ( BRP 1) 2 NBT tbit 2 s TQ 100ns f bit 500000 FOSC 20 10 6 t prog 750 Pr ogSeg ROUND _ UP( ) ROUND _ UP( )8 TQ 100 PS1 = 7, PS2 = 4 The selected sample point should be near the 80% value Sample Point = (1 + ProgSeg + PS1) / (1 + ProgSeg + PS1 +PS2) = (1 +8+7) / (1 + 8+7 + 4) = 0.80 = 80% RESYNCHRONIZATION • Resynchronization is implemented to maintain the initial synchronization that was established by the hard synchronization. • Without resynchronization, the receiving nodes could get out of synchronization due to oscillator drift between nodes. • Resynchronization is achieved by implementing a Digital Phase Lock Loop (DPLL) function which compares the actual position of a recessive-to-dominant edge on the bus to the position of the expected edge (within the SyncSeg) and adjusting the bit time as necessary. • The phase error of a bit is given by the position of the edge in relation to the SyncSeg, measured in TQ, and is defined as follows: • e = 0; the edge lies within the SyncSeg. • e > 0; the edge lies before the sample point. (TQ added to PS1). • e < 0; the edge lies after the sample point of the previous bit. (TQ subtracted from PS2) 14
- 10/14/2012 SYNCHRONIZING THE BIT TIME Phase Locked Loops for High-Frequency Receivers and Transmitters Voltage Control Oscillator VI and Vout has at the same frequency 1 566 Voltage-Controlled Oscillator 15
- 10/14/2012 The CAN protocol defines four different types of messages: Data frame. A data frame carries data from a transmitter to the receivers. Remote frame. A remote frame is transmitted by a node to request the transmission of the data frame with the same identifier. Error frame. An error frame is transmitted by a node on detecting a bus error. Overload frame. An overload frame is used to provide for an extra delay between the preceding and the succeeding data or remote frames. Data frames and remote frames are separated from preceding frames by an interframe space. 16
- 10/14/2012 Standard Data Frame MCP2510 EXTENDED DATA FRAME MCP2510 17
- 10/14/2012 ERROR DATA FRAME MCP2510 18
- 10/14/2012 OVERLOAD FRAME MCP2510 19
- 10/14/2012 lnterframe Space IFS lnterframe space for non error-passive nodes or receiver of previous message Interframe space for error-passive nodes Message Validation • The point in time at which a message is taken to be valid is different for the transmitters and receivers of the message. • The message is valid for the transmitter if there is no error until the end-of-frame. If a message is corrupted, retransmission will follow automatically and according to the rules of prioritization. In order to be able to compete for bus access with other messages, retransmission has to start as soon as the bus is idle. • The message is valid for the receiver if there is no error until the last but one bit of the end-of-frame 20
CÓ THỂ BẠN MUỐN DOWNLOAD
-
Căn bản về TCP/IP
8 p | 643 | 232
-
Kiến thức căn bản về TCP/IP
7 p | 691 | 211
-
Căn bản về TCP/IP TCP/IP
4 p | 469 | 201
-
Căn bản về TCP/IP T CP/IP (Transmission Control Protocol/Internet Protocol) là một bộ
7 p | 421 | 156
-
Chapter 5 - ACLs
67 p | 145 | 55
-
Fundamentals of Multicast
55 p | 83 | 17
-
Introduction to Java: 6 Containers
42 p | 91 | 6
-
Thiết kế công cụ đọc thông tin truyền thông trên mạng CAN
8 p | 73 | 6
-
Bài giảng Mạng máy tính và hệ thống thông tin công nghiệp: Chương 2.2 - Đào Đức Thịnh
40 p | 79 | 6
-
Cải tiến phương pháp truy nhập đường truyền cho các hệ thống điều khiển qua mạng CAN
5 p | 34 | 4
Chịu trách nhiệm nội dung:
Nguyễn Công Hà - Giám đốc Công ty TNHH TÀI LIỆU TRỰC TUYẾN VI NA
LIÊN HỆ
Địa chỉ: P402, 54A Nơ Trang Long, Phường 14, Q.Bình Thạnh, TP.HCM
Hotline: 093 303 0098
Email: support@tailieu.vn