computer network 6 can

53
VI. CAN Felix Lin Computer Network

Upload: felix-lin

Post on 20-Jun-2015

206 views

Category:

Technology


3 download

DESCRIPTION

Introduction to CAN(Controller Area Network)

TRANSCRIPT

  • 1. Felix Lin

2. Overview Concepts Message Frame Error Handling Discussion Conclusion 3. OSI Model CAN Application Layer Presentation Layer Session Layer Transport Layer Network Layer Data Link Layer Physical Layer CANopen/MilCAN/DeviceNet NA NA NA NA LLC/MAC ISO11898 Mapping 4. Controller Area Network Half-Duplex Differential Bus Broadcast(Multicast) Message Message-Based communication protocol Non-Returnto-Zero (NRZ) transmission method Low cost and Simple implementation Good error detection capabilities Excellent two-wire fault tolerance capabilities Either of the two wires in the bus is broken. Either of the two wires are shorted to power, to ground, or together. 5. (Automotive device) 6. 1980s Bosch GmbH ISO(International Standards Organization SAE(Society Automotive Engineers) 1991 2.0A/B 7. Before CAN After CAN 8. ISO 11898 Controller Area Network 1 Data Link and PHY 2 High-speed medium access unit 3 Low-speed, fault-tolerant, medium-dependent interface 4 Time-triggered communication 5 High-speed medium access unit with low-power mode 6 High-speed medium access unit with selective wake- up functionality ISO 11992 p2p ISO 16845 Conformance test Plan SAE J2411 9. 2.0A Same as 1.2 spec. Only Support Standard Data Frame (11-bit ID) 2.0B(passive) Support Standard(11-bit ID) Ignore Extended Data Frame(29-bit ID) 2.0B(active) Support Standard(11-bit ID) and Extended Data Frame(29-bit ID) 10. Bit Rate Bit Time Bus Length 1 Mbps 1 s 25 m 800 kbps 1.25 s 50 m 500 kbps 2 s 100 m 250 kbps 4 s 250 m 125 kbps 8 s 500 m 62.5 kbps 16 s 1000 m 20 kbps 50 s 2500 m 10 kbps 100 s 5000 m 11. Overview Concepts Message Frame Error Handling Discussion Conclusion 12. () (multi-master) 13. Bus ACK Node ( Masks Filters ) nodes , nodes node 14. CS Carrier Sense BUS MA Multiple Access CD Collision Detection CR Collision Resolution (Arbitration) () 15. VCC from 4.5 to 5.5V uCTxRx / CANHCANL 0~3.0V V > 1.0V dominant(Logic 0) V < 0.5V recessive(Logic 1) 16. ID field ID RTR 17. Sync Segment Propagation Segment Phase Buffer Segment1 Phase Buffer Segment2 Sample Point 18. Timing Segment TQ(Time Quanta) 8-25 TQ TQ PIC 2*(BRP + 1 ) (Tosc) -> (Tosc = 1/Fosc) 19. DB-9 5-pin Mini Style connector: ANSI/B93.55M-1981 RJ-45 6-pin Deutsch DT04-6P Eurostyle Terminal block 20. 1 - Reserved 2 CAN_L CAN_L bus line (dominant low) 3 CAN_GND CAN Ground 4 - Reserved 5 (CAN_SHLD) Optional CAN shield 6 (GND) Optional CAN ground 7 CAN_H CAN_H bus line (dominant high) 8 - Reserved (error line) 9 CAN_V+ Optional power 21. Pin Function DeviceNet Color 1 Drain Bare 2 V+ Red 3 V- Black 4 CAN_H White 5 CAN_L Blue 22. 1: CAN_H = CAN_H bus line (dominant high) 2: CAN_L = CAN_L bus line (dominant low) 3: CAN_GND = Ground/0 V/V-4: Reserved 5: Reserved 6: (CAN_SHLD) = Optional CAN Shield 7: CAN_GND = Ground/0 V/V- 8 (CAN_V+) = Optional CAN external positive supply 23. Pin Function Recommended cable color 1 Power negative Black 2 CAN_H White 3 Optional Signal GND Yellow 4 Optional Initiate Gray 5 Power positive Red 6 CAN_L Blue 24. 1: CAN_GND = Ground/0 V/V- 2: CAN_L = CAN_L bus line (dominant low) 3: (CAN_SHLD) = Optional CAN Shield 4: CAN_H = CAN_H bus line (dominant high) 5: (CAN_V+) = Optional CAN external positive supply 25. Overview Concepts Message Frame Error Handling Discussion Conclusion 26. Data Frame Standard Data Frame 2.0A Extended Data Frame 2.0B Remote Frame Error Frame Overload Frame 27. SOF: Start of Frame RTR: Remote Transmission Request IDE: Identifier Extension DLC: Data Length Code CRC: Cyclic Redundancy Check IFS: Inter-Frame Space 28. SOF: Start of Frame SRR: Substitute Remote Request IDE: Identifier Extension RTR: Remote Transmission Request DLC: Data Length Code CRC: Cyclic Redundancy Check IFS: Inter-Frame Space 29. 1 Remote Frame(or RTR) is used by a node when it requires information to be sent to it from another node. 30. When a node detects one of the many types of errors defined by the CAN protocol, an Error Frame occurs. 31. CRC Error X15 + X14 + X10 + X8 + X7 + X4 + X3 + 1 Acknowledgement Error dominant(0) Ack. Slot Form Error 1 bit dominant(0) Stuff Error Due to NRZ Stuff Bit Stuff Error Bit Error Arbitration filed Ack. filed 32. Overload frames are generated by nodes that require more time to process messages already received. 33. Overview Concepts Message Frame Error Handling Discussion Conclusion 34. CAN node ( transmit/receive error counters) TEC REC CAN Error Counters Error Active Error Passive Bus Off CAN node CAN bus (Active > Passive > Bus-Off) Bus-Off CAN node 35. 127 127 127 127 255 36. CAN node (messages) Error-Frames () Active Error Flag ( 6 dominate)Error Frame Stuff ErrorCAN node Error Frames ( Error Echo Flags) (TEC/REC) Error Frame bus ! 37. TEC REC 127, CAN node Error-Passive () Error-Passive node Passive Error Flag ( 6recessive )Error Frame Passive Error Flags Error Frames (TEC/REC) Error Frame Error-Passive node dominate3 intermission 8 38. TEC 255 CAN node Bus-Off CAN node message CAN node Error Active bus recovery(11 recessive 128 !!) Configuration mode 39. Overview Concepts Message Frame Error Handling Discussion Conclusion 40. HLP Higher Layer Protocols Application Layer in CAN? CANopen CanKingdom CCP/XCP DeviceNet J1939 MilCAN NMEA 2000 OSEK/VDX SDS 41. Overview Concepts Message Frame Error Handling Discussion Conclusion 42. CAN(L1, L2) 43. BOSCH, CAN Specification version 2.0, 1991 Marco Di Natale, Understanding and using the Controller Area Network, October 30, 2008 Microchip, AN713 Controller Area Network(CAN) Basics, Sep. 2005 Microchip, "CAN Workshop 202 Freescale, Analog Bus Communication and Products Wikipedia CAN bus