Download presentation
Presentation is loading. Please wait.
Published byMilo Bell Modified over 8 years ago
1
D 12.08.2013 Embedded Systems Page1 C166-Core Port 5 Port 3 CPU Dual Port RAM 2 KByte Interrupt Controller Watchdog Peripheral Data External Instr./Data Instr./Data USART ASC BRG GPT1 16 32 PEC 64 K ROM (C164 CI-8RM) or OTP (C164CI-8EM) Interrupt Bus Data Port 8 BRG SSC Sync. Channel (SPI) PLL- Oscillator prog. Multiplier : 0.5; 1; 1.5; 2; 2.5; 3; 4; 5 XBUS (16-bit NON MUX Data / Addresses) T2 T4 T3 13 ext. IR Full -CAN Interface V2.0B active RTC 10-Bit ADC Timer 7 Timer 8 Port 1 Timer 13 1 Comp. Channel 3/6 CAPCOM Channels CAPCOM6 Unit for PWM Generation 89 4 16 6 Port 4 8-Channels External Bus 8/16 bit MUX only & XBUS Control CAPCOM 2 8-Channel C164CI - CAN-Interface P4.6/ CAN TxD P4.5/ CAN RxD Port 0
2
D 23.9.2009 Embedded Systems Seite 2 Controller Area Network - CAN CAN is a protocol for serial communication that supplies distributed realtime tasks with very high safety-requirements CAN is standardized ISO-DIS 11898 (high speed applications) –ISO-DIS 11519-2 (low speed applications)
3
D 12.08.2013 Embedded Systems Page 3 CAN - features Low costs –Serial BUS for 2-wire-lines –High number of CAN-nodes in the automotive sector and in industrial electronics Reliability/Data Integrity –Sophisticated mechanisms for error detection and handling result in high reliability of the transmission Example: 500 kbit/s, 25% bus-load, 2000 operating hours a year Result: Only one undetected error in 1000 years! –Defective messages are detected and repeated –Every bus-node will be informed in case of an error –Low susceptibility against electromagnetic interference Flexibility –Nodes can be very easily added or removed (plug & play). –The number of nodes isn’t limited by the protocol
4
D 12.08.2013 Embedded Systems Page 4 High performance realtime-behaviour –Short messages: 0 to 8 bytes data per message. –Short time of latency between the request of a message and the start of the transmission –Prioritization of messages (Arbitration on Message Priority - AMP) –Multi Master protocol with CSMA/CD CAN - Features Multi-Master-Operations –Every node can be the master –The bus-communication is not prevented by defective nodes –Defective nodes switch off from the bus by themselves High performance transmission rate –maximum transfer rate is 1 MBit/s at 40m bus-length and still about 40 kBit/s at bus-length of 1000m Flexible addressing mechanisms –Messages can be sent to only one or to several nodes –All modes receive simultaneously public data simultaneously
5
D 12.08.2012 Embedded Systems Page 5 CAN: Typical application
6
D 12.08.2013 Embedded Systems Page 6 Application Layer Physical Signalling (Bit –coding, -timing, -synchron.) Physical Medium Attachment (Transmitter/Receiver-Spec.) Medium Dependent Interface (Cable, Plug...) Physical Layer Logical Link Control Error detection, error handling; Control of data-flow; Acceptance filtering. Medium Access Control Bit-Stuffing, Framing, Arbitration Data Link Layer Management Process-Application Layer 7 2 1 Protocol layers of the CAN CAN (ISO 11898) Bosch DeviceNet CAL, CANopen (CiA) SDS (Honeywell) etc...
7
D 12.08.2013 Embedded Systems Page 7 Higher Protocol Layers CAN Application Layer (CAL) –Layer-7 Standard defined by “CAN in Automation” (CiA) –Network-Management for initialisation, monitoring and configuration of nodes in standardised form –Takes into account all aspects for the realisation of open communication via CAN (provides the cooperation of producer specific systems) –Available implementations of CAL simplify the user getting sophisticated “Controller Area Networks” CANopen –Applications are based on CAL. –CANopen dertermines the mode of communication, an application- profile defines the meaning of certain messages) for the considered application –aim: Changeabilty of the subsystems of dedicated applications Further higher protocol layers (standards): –Automotive-sector: VOLCANO, OSEK –Industrial Automation: DeviceNet (ODVA), SDS (Honeywell)
8
D 12.08.2012 Embedded Systems Page 8 Application Layer Physical Signalling (Bit –coding, -timing, -synchron.) Physical Medium Attachment (Transmitter/Receiver-Spec.) Medium Dependent Interface (Cable, Plug...) Physical Layer Logical Link Control Error detection, error handling; Control of data-flow; Acceptance filtering. Data Link Layer Management Process-Application Layer 7 2 1 CAN Protocol Layers CAN (ISO 11898) Bosch DeviceNet CAL, CANopen (CiA) SDS (Honeywell) etc... Medium Access Control Bit-Stuffing, Framing, Arbitration
9
D 12.08.2013 Embedded Systems Page 9 Asynchronous serial bus with linear bus-structure and identical nodes (Multi-Master-BUS) Nodes won’t be addressed - the addresses are parts of the message and are related to those, just as the priority is a characteristic of the message Two bus-states: dominant and recessive –the bus-activation is realized according to the "Wired-AND”- mechanism: dominant bits (logical 0) overwrite recessive bits (logical 1) Bus-access via CSMA/CD with NDA (Carrier Sense Multiple Access/ Collision Detection with Non-Destructive Arbitration): –Before transmission it is tested whether the bus is free –Each sender tests whether the bus level is consistent to its transmission level –In case of discrepancy transmission is stopped and switched to receiving mode Basic Characteristics of CAN
10
D 12.08.2013 Embedded Systems Page 10 NODE A NODE B recessive dominant recessive dominant bus idle CAN BUS recessive dominant Node B transmits recessive level but reads back dominant level Node B loses arbitration and switches to receive mode Basic Characteristics of CAN
11
D 12.08.2013 Embedded Systems Page 11 CAN_H CAN_L z.B. SAE81C90 CAN-Transceiver CAN-BUS CAN-Controller Host-Controller Application z.B. 80C166 z.B. ABS z.B. C164CR oder C515C z.B. EMS Node ANode B (further nodes) U Diff CAN Typical Structure of CAN-Nodes
12
D 12.08.2013 Embedded Systems Page 12 Identifier CRC-Field Data Field (0..8 Bytes) There are two situations in communication: –One node is transmitting (’talker’), all other nodes are receiving (’listener’) –Nodes A requires (from an other node) anything and gets the answer In ’Talk’-mode CAN-nodes use data frames –data frames consist of: an identifier the data, which should be transmitted and a CRC-checksum CAN data frames –The Identifier specifies the content of the message (‘car velocity’, ‘oil temperature’, etc.) and the priority of the message –The data field contains the appropriate value (’36 m/s’, ’110°C’, etc.). –The Cyclic Redundancy Check provides detection of transmission errors –All nodes receive the data frames, unaffected nodes ignore it Base Can Frame
13
D 12.08.2013 Embedded Systems Page 13 In order to get information “Remote Frames” are used –A Remote Frame consists of the identifier and the CRC-checksum, no data are contained CAN Remote Frames IdentifierCRC-Field –The identifier refers to the information to be queried (’car velocity ', ’oil temperature', etc.) and the priority of the message –Every node having available the required information (e.g. the sensor for the oil temperature) reacts with transmission of the appropriate ‘Data Frame’ (same identifier, the data field contains the required information). Data Frame; Identifier ’Oil_temp'; Contains required information ~~~~~ Remote Frame; Identifier ’Oil_temp' Node A Node B (oil temp.- Sensor) How hot is the oil ? 115°C 115 °C !
14
D 12.08.2013 Embedded Systems Page 14 Standard CAN / Extended CAN CAN Version 2.0A - Standard CAN: –The Standard-Frame contains an 11 Bit identifier –With that 2 11 (=2048) different “messages” can be addressed CAN Version 2.0B (passive) : –Some Standard-CAN-Nodes are not able to receive “Extended Frames”, but they are tolerating them and ignore their “messages”. They don’t receive any data, as they don’t produce any errors. –These CAN-Nodes use CAN Version 2.0A, but they are also denoted as nodes Version 2.0B passive –They are used in networks, in which “Standard Frames” as well as “Extended Frames” are worked with CAN Version 2.0B (active) - Extended CAN: –The “Extended Frame” has got an identifier with a length of 29 Bit –Via that more than 536 Million (2 29 ) different “messages” can be addressed
15
D 12.08.2013 Embedded Systems page 15 Full-CAN Controller Message Object 2 CAN Bus Host CPU Message Object n CPU load low high Message Object 1.... Accep- tance Filtering Message Manage- ment CAN-Contoller CAN-Controllers perform the management of the messages and its acceptance filtering autonomously: Full-CAN-Controller: –There are a lot of Message-Objects with its appropriate identifier. –Only if a message with one of the specified identifiers is received, it will be saved and the execution of the program will be interrupted –In that way the load of the CPU can be kept low Infineon C164CI: V2.0B active
16
D 12.08.2013 Embedded Systems page 16 Characteristics of the C164CI CAN-Module The characteristics are comparable with the common CAN-Controller AN82527 All requirements of “CAN spec. V2.0B active” are met (Standard- und Extended-CAN) Maximum CAN-transfer rate of 1 MBit/s Full CAN Device: –15 Message-Objects with appropriate identifiers and appropriate state- und control-Bits –Each Message-Object can be defined as transmit - or receive-object.
17
D 12.08.2013 Embedded Systems page 17 Programmable mask-register for acceptance-Filtering –Global mask for incoming messages (Full-CAN-Objects) –Additional mask for message-object 15 (Basic -CAN-) Characteristic Basis-CAN- Characteristic (of Message-Object 15) –Two receiver buffers –Separate global mask-register for acceptance-filtering Connection to CPU (C166-Core) –The module is connected via the chip-internal XBUS (16-Bit BUS-Width) –Interrupts directly to the CPU with all facilities of the interrupt handling To connect with the CAN-BUS only physical level conversion via a Standard-CAN-Transceiver is needed Characteristics of the C164CI CAN-Module
18
D 12.08.2013 Embedded Systems page 18 CAN-Bus Transceiver Receive Transmit CAN_H CAN_L P4.5 P4.6 CAN_L z.B. P8.0 Pa.b Pc.d C164CI CAN_H CAN_RxD CAN_TxD R(opt) (Standby) Connection to the application Connection of the C164CI to the CAN-BUS The CAN-Module uses 2 pins of Port 4 as interface to a BUS- Transceiver (P4.5 - CAN_RxD, P4.6 - CAN_TxD).
19
D 12..08.2013 Embedded Systems page 19 CAN MESSAGES ACCEPTANCE FILTERING CAN CONTROLLER Global Mask (Part of General Registers) Arbitration Register (LAR, Teil des Message Object) 1 11 1 1 11 1 1 0 0 1 10 0 1 00 1 1 1 0 Resultant valid Identifier "d" = don't care 1 10 0 1 00 1 1 d d a) 1 10 0 1 00 1 1 1 0 b) c) d) 1 10 0 1 00 1 1 0 0 1 10 0 1 00 1 1 0 1 1 10 0 1 00 1 1 1 1 Remark: If ‘data frames‘ from more than one Message Object are accepted, so the data frame is stored in the object with the lowest number. If ‘remote frames‘ from more than one Message Object are accepted, so the data of the Object with the lowest number are transmitted Because of the "don't care"- Bits also messages with identifiers b)..d) are acceppted
20
D 12.08.2013 Embedded Systems page 20 Bit-Timing TSeg1TSeg2 Sync- Segm. Sample- Time Transmission - Time Duration of a Bit 1 Zeit- einheit The Bit-Timing is derived from the system clock f PERIPHERAL and is programmable up to the data rate of 1 MBaud (@ f CPU 16 MHz) SFRcan
21
D 12.08.2013 Embedded Systems page 21 Register of the CAN-Controller SFRcan
22
D 12.08.2012 Embedded Systems page 22 Message Object SFRcan CAN-SW
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.