您的当前位置:首页正文

CAN总线2.0说明书

2020-09-08 来源:钮旅网


BOSCHCAN SpecificationVersion 2.01991, Robert Bosch GmbH, Postfach 50, D-7000 Stuttgart 1ThidttdithFMk404

The document as a whole may be copied and distributed withoutrestrictions. However, the usage of it in parts or as a whole in otherdocuments needs the consent of Robert Bosch GmbH. Robert BoschGmbH retains the right to make changes to this document withoutnotice and does not accept any liability for errors.

Imported into Framemaker 4 by:

Chuck Powers, Motorola MCTG Multiplex Applications, April 5,1995.

BOSCHCAN Specification 2.0Sep. 1991page 1RecitalThe acceptance and introduction of serial communication to more and moreapplications has led to requirements that the assignment of message identifiers tocommunication functions be standardized for certain applications. These applicationscan be realized with CAN more comfortably, if the address range that originally hasbeen defined by 11 identifier bits is enlargedTherefore a second message format (’extended format’) is introduced that provides alarger address range defined by 29 bits. This will relieve the system designer fromcompromises with respect to defining well-structured naming schemes. Users of CANwho do not need the identifier range offered by the extended format, can rely on theconventional 11 bit identifier range (’standard format’) further on. In this case they canmake use of the CAN implementations that are already available on the market, or ofnew controllers that implement both formats.In order to distinguish standard and extended format the first reserved bit of the CANmessage format, as it is defined in CAN Specification 1.2, is used. This is done in sucha way that the message format in CAN Specification 1.2 is equivalent to the standardformat and therefore is still valid. Furthermore, the extended format has been definedso that messages in standard format and extended format can coexist within the samenetwork.This CAN Specification consists of two parts, with••Part A describing the CAN message format as it is defined in CAN Specification 1.2;Part B describing both standard and extended message formats.In order to be compatible with this CAN Specification 2.0 it is required that a CANimplementation be compatible with either Part A or Part B.NoteCAN implementations that are designed according to part A of this or according toprevious CAN Specifications, and CAN implementations that are designed according topart B of this specification can communicate with each other as long as it is not madeuse of the extended format.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30 PART A

BOSCH1233.13.1.13.1.23.1.33.1.43.1.53.24566.16.27899.1ContentsSep. 1991Part A - page 3INTRODUCTION................................................................................4BASIC CONCEPTS............................................................................5MESSAGE TRANSFER.....................................................................10Frame Types......................................................................................10DATA FRAME....................................................................................10REMOTE FRAME..............................................................................15ERROR FRAME.................................................................................16OVERLOAD FRAME..........................................................................17INTERFRAME SPACING...................................................................18Definition of TRANSMITTER/RECEIVER..........................................20MESSAGE VALIDATION...................................................................21CODING.............................................................................................22ERROR HANDLING...........................................................................23Error Detection...................................................................................23Error Signalling...................................................................................23FAULT CONFINEMENT.....................................................................24BIT TIMING REQUIREMENTS..........................................................27INCREASING CAN OSCILLATOR TOLERANCE..............................31Protocol Modifications........................................................................31ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1 BOSCH1 INTRODUCTIONThe Controller Area Network (CAN) is a serial communications protocol whichefficiently supports distributed realtime control with a very high level of security.Its domain of application ranges from high speed networks to low cost multiplex wiring.In automotive electronics, engine control units, sensors, anti-skid-systems, etc. areconnected using CAN with bitrates up to 1 Mbit/s. At the same time it is cost effective tobuild into vehicle body electronics, e.g. lamp clusters, electric windows etc. to replacethe wiring harness otherwise required.The intention of this specification is to achieve compatibility between any two CANimplementations. Compatibility, however, has different aspects regarding e.g. electricalfeatures and the interpretation of data to be transferred. To achieve designtransparency and implementation flexibility CAN has been subdivided into differentlayers.•••the (CAN-) object layerthe (CAN-) transfer layerthe physical layerIntroductionSep. 1991Part A - page 4The object layer and the transfer layer comprise all services and functions of the datalink layer defined by the ISO/OSI model. The scope of the object layer includes•••finding which messages are to be transmitteddeciding which messages received by the transfer layer are actually to be used,providing an interface to the application layer related hardware.There is much freedom in defining object handling. The scope of the transfer layermainly is the transfer protocol, i.e. controlling the framing, performing arbitration, errorchecking, error signalling and fault confinement. Within the transfer layer it is decidedwhether the bus is free for starting a new transmission or whether a reception is juststarting. Also some general features of the bit timing are regarded as part of thetransfer layer. It is in the nature of the transfer layer that there is no freedom formodifications.The scope of the physical layer is the actual transfer of the bits between the differentnodes with respect to all electrical properties. Within one network the physical layer, ofcourse, has to be the same for all nodes. There may be, however, much freedom inselecting a physical layer.The scope of this specification is to define the transfer layer and the consequences ofthe CAN protocol on the surrounding layers.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1 BOSCH2 BASIC CONCEPTSCAN has the following properties•••••••••prioritization of messagesguarantee of latency timesconfiguration flexibilitymulticast reception with time synchronizationsystem wide data consistencymultimastererror detection and signallingautomatic retransmission of corrupted messages as soon as the bus is idle againdistinction between temporary errors and permanent failures of nodes and autonomous switching off of defect nodesBasic ConceptsSep. 1991Part A - page 5Layered Structure of a CAN NodeApplication LayerObject Layer - Message Filtering - Message and Status HandlingTransfer Layer - Fault Confinement - Error Detection and Signalling - Message Validation - Acknowledgment - Arbitration - Message Framing - Transfer Rate and TimingPhysical Layer - Signal Level and Bit Representation - Transmission MediumROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1 BOSCH•Basic ConceptsSep. 1991Part A - page 6The Physical Layer defines how signals are actually transmitted. Within this specification the physical layer is not defined so as to allow transmission medium and signal level implementations to be optimized for their application.The Transfer Layer represents the kernel of the CAN protocol. It presents messages received to the object layer and accepts messages to be transmitted from the object layer. The transfer layer is responsible for bit timing and synchronization, message framing, arbitration, acknowledgment, error detection and signalling, and fault confinement.The Object Layer is concerned with message filtering as well as status and message handling.••The scope of this specification is to define the transfer layer and the consequences ofthe CAN protocol on the surrounding layers.MessagesInformation on the bus is sent in fixed format messages of different but limited length(see section 3: Message Transfer). When the bus is free any connected unit may startto transmit a new message.Information RoutingIn CAN systems a CAN node does not make use of any information about the systemconfiguration (e.g. station addresses). This has several important consequences.System Flexibility: Nodes can be added to the CAN network without requiringany change in the software or hardware of any node and application layer.Message Routing: The content of a message is named by an IDENTIFIER. TheIDENTIFIER does not indicate the destination of the message, but describes themeaning of the data, so that all nodes in the network are able to decide byMESSAGE FILTERING whether the data is to be acted upon by them or not.Multicast: As a consequence of the concept of MESSAGE FILTERING anynumber of nodes can receive and simultaneously act upon the same message.Data Consistency: Within a CAN network it is guaranteed that a message issimultaneously accepted either by all nodes or by no node. Thus dataconsistency of a system is achieved by the concepts of multicast and by errorhandling.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1 BOSCHBasic ConceptsSep. 1991Part A - page 7Bit rateThe speed of CAN may be different in different systems. However, in a given systemthe bitrate is uniform and fixed.PrioritiesThe IDENTIFIER defines a static message priority during bus access.Remote Data RequestBy sending a REMOTE FRAME a node requiring data may request another node tosend the corresponding DATA FRAME. The DATA FRAME and the correspondingREMOTE FRAME are named by the same IDENTIFIER.MultimasterWhen the bus is free any unit may start to transmit a message. The unit with themessage of higher priority to be transmitted gains bus access.ArbitrationWhenever the bus is free, any unit may start to transmit a message. If 2 or more unitsstart transmitting messages at the same time, the bus access conflict is resolved bybitwise arbitration using the IDENTIFIER. The mechanism of arbitration guarantees thatneither information nor time is lost. If a DATA FRAME and a REMOTE FRAME with thesame IDENTIFIER are initiated at the same time, the DATA FRAME prevails over theREMOTE FRAME. During arbitration every transmitter compares the level of the bittransmitted with the level that is monitored on the bus. If these levels are equal the unitmay continue to send. When a ’recessive’ level is sent and a ’dominant’ level ismonitored (see Bus Values), the unit has lost arbitration and must withdraw withoutsending one more bit.SafetyIn order to achieve the utmost safety of data transfer, powerful measures for errordetection, signalling and self-checking are implemented in every CAN node.Error DetectionFor detecting errors the following measures have been taken:- Monitoring (transmitters compare the bit levels to be transmitted with the bitlevels detected on the bus)- Cyclic Redundancy Check- Bit Stuffing- Message Frame CheckROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1 BOSCHBasic ConceptsSep. 1991Part A - page 8Performance of Error DetectionThe error detection mechanisms have the following properties:- all global errors are detected.- all local errors at transmitters are detected.- up to 5 randomly distributed errors in a message are detected.- burst errors of length less than 15 in a message are detected.- errors of any odd number in a message are detected.Total residual error probability for undetected corrupted messages: less thanmessage error rate * 4.7 * 10-11.Error Signalling and Recovery TimeCorrupted messages are flagged by any node detecting an error. Such messages areaborted and will be retransmitted automatically. The recovery time from detecting anerror until the start of the next message is at most 29 bit times, if there is no furthererror.Fault ConfinementCAN nodes are able to distinguish short disturbances from permanent failures.Defective nodes are switched off.ConnectionsThe CAN serial communication link is a bus to which a number of units may beconnected. This number has no theoretical limit. Practically the total number of unitswill be limited by delay times and/or electrical loads on the bus line.Single ChannelThe bus consists of a single channel that carries bits. From this data resynchronizationinformation can be derived. The way in which this channel is implemented is not fixedin this specification. E.g. single wire (plus ground), two differential wires, optical fibres,etc.Bus valuesThe bus can have one of two complementary logical values: ’dominant’ or ’recessive’.During simultaneous transmission of ’dominant’ and ’recessive’ bits, the resulting busvalue will be ’dominant’. For example, in case of a wired-AND implementation of thebus, the ’dominant’ level would be represented by a logical ’0’ and the ’recessive’ levelby a logical ’1’. Physical states (e.g. electrical voltage, light) that represent the logicallevels are not given in this specification.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1 BOSCHBasic ConceptsSep. 1991Part A - page 9AcknowledgmentAll receivers check the consistency of the message being received and willacknowledge a consistent message and flag an inconsistent message.Sleep Mode / Wake-upTo reduce the system’s power consumption, a CAN-device may be set into sleep modewithout any internal activity and with disconnected bus drivers. The sleep mode isfinished with a wake-up by any bus activity or by internal conditions of the system. Onwake-up, the internal activity is restarted, although the transfer layer will be waiting forthe system’s oscillator to stabilize and it will then wait until it has synchronized itself tothe bus activity (by checking for eleven consecutive ’recessive’ bits), before the busdrivers are set to \"on-bus\" again.In order to wake up other nodes of the system, which are in sleep-mode, a specialwake-up message with the dedicated, lowest possible IDENTIFIER (rrr rrrd rrrr; r =’recessive’ d = ’dominant’) may be used.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1 BOSCH3.1 Frame TypesMessage transfer is manifested and controlled by four different frame types:A DATA FRAME carries data from a transmitter to the receivers.A REMOTE FRAME is transmitted by a bus unit to request the transmission of theDATA FRAME with the same IDENTIFIER.An ERROR FRAME is transmitted by any unit on detecting a bus error.An OVERLOAD FRAME is used to provide for an extra delay between the precedingand the succeeding DATA or REMOTE FRAMEs.DATA FRAMEs and REMOTE FRAMEs are separated from preceding frames by anINTERFRAME SPACE.3.1.1 DATA FRAMEA DATA FRAME is composed of seven different bit fields:START OF FRAME, ARBITRATION FIELD, CONTROL FIELD, DATA FIELD, CRCFIELD, ACK FIELD, END OF FRAME. The DATA FIELD can be of length zero.Message TransferSep. 1991Part A - page 103 MESSAGE TRANSFERInterframeSpaceDATA FRAMEInterframeSpaceorOverloadFrameStart of FrameArbitration FieldControl FieldData FieldCRC FieldACK FieldEnd of FrameROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1 BOSCHData FrameSep. 1991Part A - page 11START OF FRAMEmarks the beginning of DATA FRAMES and REMOTE FRAMEs. It consists of a single’dominant’ bit.A station is only allowed to start transmission when the bus is idle (see BUS IDLE). Allstations have to synchronize to the leading edge caused by START OF FRAME (see’HARD SYNCHRONIZATION’) of the station starting transmission first.ARBITRATION FIELDThe ARBITRATION FIELD consists of the IDENTIFIER and the RTR-BIT.InterframeSpaceStartof FrameARBITRATION FIELDControlFieldRTR BitIdentifierIDENTIFIERThe IDENTIFIER’s length is 11 bits. These bits are transmitted in the order from ID-10to ID-0. The least significant bit is ID-0. The 7 most significant bits (ID-10 - ID-4) mustnot be all ’recessive’.RTR BITRemote Transmission Request BITIn DATA FRAMEs the RTR BIT has to be ’dominant’. Within a REMOTE FRAME theRTR BIT has to be ’recessive’.CONTROL FIELDThe CONTROL FIELD consists of six bits. It includes the DATA LENGTH CODE andtwo bits reserved for future expansion. The reserved bits have to be sent ’dominant’.Receivers accept ’dominant’ and ’recessive’ bits in all combinations.DATA LENGTH CODEThe number of bytes in the DATA FIELD is indicated by the DATA LENGTH CODE.This DATA LENGTH CODE is 4 bits wide and is transmitted within the CONTROLFIELD.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1 BOSCHArbitrationFieldData FrameSep. 1991Part A - page 12CONTROL FIELDDataFieldorCRCFieldr1r0DLC3DLC2DLC1DLC0reservedbitsData Length CodeCoding of the number of data bytes by the DATA LENGTH CODEabbreviations:d ’dominant’r ’recessive’Number of DataBytes012345678Data Length CodeDLC3ddddddddrDLC2ddddrrrrdDLC1ddrrddrrdDLC0drdrdrdrdDATA FRAME: admissible numbers of data bytes: {0,1,....,7,8}.Other values may not be used.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1 BOSCHData FrameSep. 1991Part A - page 13DATA FIELDThe DATA FIELD consists of the data to be transferred within a DATA FRAME. It cancontain from 0 to 8 bytes, which each contain 8 bits which are transferred MSB first.CRC FIELDcontains the CRC SEQUENCE followed by a CRC DELIMITER.DataorControlFieldCRC FIELDAckFieldCRC DelimiterCRC SequenceCRC SEQUENCEThe frame check sequence is derived from a cyclic redundancy code best suited forframes with bit counts less than 127 bits (BCH Code).In order to carry out the CRC calculation the polynomial to be divided is defined as thepolynomial, the coefficients of which are given by the destuffed bit stream consisting ofSTART OF FRAME, ARBITRATION FIELD, CONTROL FIELD, DATA FIELD (ifpresent) and, for the 15 lowest coefficients, by 0. This polynomial is divided (thecoefficients are calculated modulo-2) by the generator-polynomial: X15 + X14 + X10 + X8 + X7 + X4 + X3 + 1.The remainder of this polynomial division is the CRC SEQUENCE transmitted over thebus. In order to implement this function, a 15 bit shift register CRC_RG(14:0) can beused. If NXTBIT denotes the next bit of the bit stream, given by the destuffed bitsequence from START OF FRAME until the end of the DATA FIELD, the CRCSEQUENCE is calculated as follows:CRC_RG = 0;REPEATCRCNXT = NXTBIT EXOR CRC_RG(14);CRC_RG(14:1) = CRC_RG(13:0);CRC_RG(0) = 0;// initialize shift register// shift left by// 1 positionROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1 BOSCHData FrameSep. 1991Part A - page 14IF CRCNXT THENCRC_RG(14:0) = CRC_RG(14:0) EXOR (4599hex);ENDIFUNTIL (CRC SEQUENCE starts or there is an ERROR condition)After the transmission / reception of the last bit of the DATA FIELD, CRC_RG containsthe CRC sequence.CRC DELIMITERThe CRC SEQUENCE is followed by the CRC DELIMITER which consists of a single’recessive’ bit.ACK FIELDThe ACK FIELD is two bits long and contains the ACK SLOT and the ACK DELIMITER.In the ACK FIELD the transmitting station sends two ’recessive’ bits.A RECEIVER which has received a valid message correctly, reports this to theTRANSMITTER by sending a ’dominant’ bit during the ACK SLOT (it sends ’ACK’).CRCFieldACK FIELDEnd ofFrameACK SlotACK DelimiterACK SLOTAll stations having received the matching CRC SEQUENCE report this within the ACKSLOT by superscribing the ’recessive’ bit of the TRANSMITTER by a ’dominant’ bit.ACK DELIMITERThe ACK DELIMITER is the second bit of the ACK FIELD and has to be a ’recessive’bit. As a consequence, the ACK SLOT is surrounded by two ’recessive’ bits (CRCDELIMITER, ACK DELIMITER).END OF FRAMEEach DATA FRAME and REMOTE FRAME is delimited by a flag sequence consistingof seven ’recessive’ bits.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1 BOSCH3.1.2 REMOTE FRAMEA station acting as a RECEIVER for certain data can initiate the transmission of therespective data by its source node by sending a REMOTE FRAME.A REMOTE FRAME is composed of six different bit fields:START OF FRAME, ARBITRATION FIELD, CONTROL FIELD, CRC FIELD, ACKFIELD, END OF FRAME.Contrary to DATA FRAMEs, the RTR bit of REMOTE FRAMEs is ’recessive’. There isno DATA FIELD, independent of the values of the DATA LENGTH CODE which maybe signed any value within the admissible range 0...8. The value is the DATA LENGTHCODE of the corresponding DATA FRAME.Remote FrameSep. 1991Part A - page 15InterFrameSpaceREMOTE FRAMEInterFrameSpaceorOverloadFrameStart of FrameArbitration FieldControl FieldCRC FieldACK FieldEnd of FrameThe polarity of the RTR bit indicates whether a transmitted frame is a DATA FRAME(RTR bit ’dominant’) or a REMOTE FRAME (RTR bit ’recessive’).ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1 BOSCH3.1.3 ERROR FRAMEThe ERROR FRAME consists of two different fields. The first field is given by thesuperposition of ERROR FLAGs contributed from different stations. The followingsecond field is the ERROR DELIMITER.Error FrameSep. 1991Part A - page 16DataFrameERROR FRAMEError FlagInterframeSpace orOverloadFramesuperposition ofError FlagsError DelimiterIn order to terminate an ERROR FRAME correctly, an ’error passive’ node may needthe bus to be ’bus idle’ for at least 3 bit times (if there is a local error at an ’errorpassive’ receiver). Therefore the bus should not be loaded to 100%.ERROR FLAGThere are 2 forms of an ERROR FLAG: an ACTIVE ERROR FLAG and a PASSIVEERROR FLAG.1.2.The ACTIVE ERROR FLAG consists of six consecutive ’dominant’ bits.The PASSIVE ERROR FLAG consists of six consecutive ’recessive’ bits unless itis overwritten by ’dominant’ bits from other nodes.An ’error active’ station detecting an error condition signals this by transmission of anACTIVE ERROR FLAG. The ERROR FLAG’s form violates the law of bit stuffing (seeCODING) applied to all fields from START OF FRAME to CRC DELIMITER or destroysthe fixed form ACK FIELD or END OF FRAME field. As a consequence, all otherstations detect an error condition and on their part start transmission of an ERRORFLAG. So the sequence of ’dominant’ bits which actually can be monitored on the busresults from a superposition of different ERROR FLAGs transmitted by individualstations. The total length of this sequence varies between a minimum of six and amaximum of twelve bits.An ’error passive’ station detecting an error condition tries to signal this by transmissionof a PASSIVE ERROR FLAG. The ’error passive’ station waits for six consecutive bitsROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1 BOSCHOverload FrameSep. 1991Part A - page 17of equal polarity, beginning at the start of the PASSIVE ERROR FLAG. The PASSIVEERROR FLAG is complete when these 6 equal bits have been detected.ERROR DELIMITERThe ERROR DELIMITER consists of eight ’recessive’ bits.After transmission of an ERROR FLAG each station sends ’recessive’ bits andmonitors the bus until it detects a ’recessive’ bit. Afterwards it starts transmitting sevenmore ’recessive’ bits.3.1.4 OVERLOAD FRAMEThe OVERLOAD FRAME contains the two bit fields OVERLOAD FLAG andOVERLOAD DELIMITER.There are two kinds of OVERLOAD conditions, which both lead to the transmission ofan OVERLOAD FLAG:1.The internal conditions of a receiver, which requires a delay of the next DATAFRAME or REMOTE FRAME.Detection of a ’dominant’ bit during INTERMISSION.2.The start of an OVERLOAD FRAME due to OVERLOAD condition 1 is only allowed tobe started at the first bit time of an expected INTERMISSION, whereas OVERLOADFRAMEs due to OVERLOAD condition 2 start one bit after detecting the ’dominant’ bit.End of Frame orError Delimiter orOverload DelimiterOVERLOAD FRAMEInterFrameSpace orOverloadFrameOverloadFlagsuperposition ofOverload FlagsOverload DelimiterAt most two OVERLOAD FRAMEs may be generated to delay the next DATA orREMOTE FRAME.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1 BOSCHOverload FrameSep. 1991Part A - page 18OVERLOAD FLAGconsists of six ’dominant’ bits. The overall form corresponds to that of the ACTIVEERROR FLAG.The OVERLOAD FLAG’s form destroys the fixed form of the INTERMISSION field. Asa consequence, all other stations also detect an OVERLOAD condition and on theirpart start transmission of an OVERLOAD FLAG. (In case that there is a ’dominant’ bitdetected during the 3rd bit of INTERMISSION locally at some node, the other nodeswill not interpret the OVERLOAD FLAG correctly, but interpret the first of these six’dominant’ bits as START OF FRAME. The sixth ’dominant’ bit violates the rule of bitstuffing causing an error condition).OVERLOAD DELIMITERconsists of eight ’recessive’ bits.The OVERLOAD DELIMITER is of the same form as the ERROR DELIMITER. Aftertransmission of an OVERLOAD FLAG the station monitors the bus until it detects atransition from a ’dominant’ to a ’recessive’ bit. At this point of time every bus stationhas finished sending its OVERLOAD FLAG and all stations start transmission of sevenmore ’recessive’ bits in coincidence.3.1.5 INTERFRAME SPACINGDATA FRAMEs and REMOTE FRAMEs are separated from preceding frameswhatever type they are (DATA FRAME, REMOTE FRAME, ERROR FRAME,OVERLOAD FRAME) by a bit field called INTERFRAME SPACE. In contrast,OVERLOAD FRAMEs and ERROR FRAMEs are not preceded by an INTERFRAMESPACE and multiple OVERLOAD FRAMEs are not separated by an INTERFRAMESPACE.INTERFRAME SPACEcontains the bit fields INTERMISSION and BUS IDLE and, for ’error passive’ stations,which have been TRANSMITTER of the previous message, SUSPENDTRANSMISSION.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1 BOSCHInterframe SpaceSep. 1991Part A - page 19For stations which are not ’error passive’ or have been RECEIVER of the previousmessage:FrameINTERFRAME SPACEFrameIntermissionBus IdleFor ’error passive’ stations which have been TRANSMITTER of the previous message:FrameINTERFRAME SPACEFrameBus IdleIntermissionSuspend TransmissionINTERMISSIONconsists of three ’recessive’ bits.During INTERMISSION no station is allowed to start transmission of a DATA FRAMEor REMOTE FRAME. The only action to be taken is signalling an OVERLOADcondition.BUS IDLEThe period of BUS IDLE may be of arbitrary length. The bus is recognized to be freeand any station having something to transmit can access the bus. A message, which ispending for transmission during the transmission of another message, is started in thefirst bit following INTERMISSION.The detection of a ’dominant’ bit on the bus is interpreted as a START OF FRAME.SUSPEND TRANSMISSIONAfter an ’error passive’ station has transmitted a message, it sends eight ’recessive’bits following INTERMISSION, before starting to transmit a further message orrecognizing the bus to be idle. If meanwhile a transmission (caused by another station)starts, the station will become receiver of this message.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1 BOSCHTransmitter / ReceiverSep. 1991Part A - page 203.2 Definition of TRANSMITTER / RECEIVERTRANSMITTERA unit originating a message is called “TRANSMITTER” of that message. The unit staysTRANSMITTER until the bus is idle or the unit loses ARBITRATION.RECEIVERA unit is called “RECEIVER” of a message, if it is not TRANSMITTER of that messageand the bus is not idle.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1BOSCHMessage ValidationSep. 1991Part A - page 214 MESSAGE VALIDATIONThe point of time at which a message is taken to be valid, is different for the transmitterand the receivers of the message.Transmitter:The message is valid for the transmitter, if there is no error until the end of END OFFRAME. If a message is corrupted, retransmission will follow automatically andaccording to prioritization. In order to be able to compete for bus access with othermessages, retransmission has to start as soon as the bus is idle.Receivers:The message is valid for the receivers, if there is no error until the last but one bit ofEND OF FRAME.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1BOSCH5 CODINGBIT STREAM CODINGCodingSep. 1991Part A - page 22The frame segments START OF FRAME, ARBITRATION FIELD, CONTROL FIELD,DATA FIELD and CRC SEQUENCE are coded by the method of bit stuffing. Whenevera transmitter detects five consecutive bits of identical value in the bit stream to betransmitted it automatically inserts a complementary bit in the actual transmitted bitstream.The remaining bit fields of the DATA FRAME or REMOTE FRAME (CRC DELIMITER,ACK FIELD, and END OF FRAME) are of fixed form and not stuffed. The ERRORFRAME and the OVERLOAD FRAME are of fixed form as well and not coded by themethod of bit stuffing.The bit stream in a message is coded according to the Non-Return-to-Zero (NRZ)method. This means that during the total bit time the generated bit level is either’dominant’ or ’recessive’.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1BOSCH6 ERROR HANDLING6.1 Error DetectionError HandlingSep. 1991Part A - page 23There are 5 different error types (which are not mutually exclusive):•BIT ERRORA unit that is sending a bit on the bus also monitors the bus. A BIT ERROR has to be detected at that bit time, when the bit value that is monitored is different from the bit value that is sent. An exception is the sending of a ’recessive’ bit during the stuffed bit stream of the ARBITRATION FIELD or during the ACK SLOT. Then no BIT ERROR occurs when a ’dominant’ bit is monitored. A TRANSMITTER sending a PASSIVE ERROR FLAG and detecting a ’dominant’ bit does not interpret this as a BIT ERROR.STUFF ERRORA STUFF ERROR has to be detected at the bit time of the 6th consecutive equal bit level in a message field that should be coded by the method of bit stuffing.CRC ERRORThe CRC sequence consists of the result of the CRC calculation by the transmitter. The receivers calculate the CRC in the same way as the transmitter. A CRC ERROR has to be detected, if the calculated result is not the same as that received in the CRC sequence.FORM ERRORA FORM ERROR has to be detected when a fixed-form bit field contains one or more illegal bits.ACKNOWLEDGMENT ERRORAn ACKNOWLEDGMENT ERROR has to be detected by a transmitter whenever it does not monitor a ’dominant’ bit during the ACK SLOT.••••6.2 Error SignallingA station detecting an error condition signals this by transmitting an ERROR FLAG. Foran ’error active’ node it is an ACTIVE ERROR FLAG, for an ’error passive’ node it is aPASSIVE ERROR FLAG. Whenever a BIT ERROR, a STUFF ERROR, a FORMERROR or an ACKNOWLEDGMENT ERROR is detected by any station, transmissionof an ERROR FLAG is started at the respective station at the next bit.Whenever a CRC ERROR is detected, transmission of an ERROR FLAG starts at thebit following the ACK DELIMITER, unless an ERROR FLAG for another condition hasalready been started.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1BOSCHFault ConfinementSep. 1991Part A - page 247 FAULT CONFINEMENTWith respect to fault confinement a unit may be in one of three states:•••’error active’’error passive’’bus off’An ’error active’ unit can normally take part in bus communication and sends anACTIVE ERROR FLAG when an error has been detected.An ’error passive’ unit must not send an ACTIVE ERROR FLAG. It takes part in buscommunication but when an error has been detected only a PASSIVE ERROR FLAG issent. Also after a transmission, an ’error passive’ unit will wait before initiating a furthertransmission. (See SUSPEND TRANSMISSION)A ’bus off’ unit is not allowed to have any influence on the bus. (E.g. output driversswitched off.)For fault confinement two counts are implemented in every bus unit:1) TRANSMIT ERROR COUNT2) RECEIVE ERROR COUNTThese counts are modified according to the following rules:(note that more than one rule may apply during a given message transfer)1.When a RECEIVER detects an error, the RECEIVE ERROR COUNT will beincreased by 1, except when the detected error was a BIT ERROR during thesending of an ACTIVE ERROR FLAG or an OVERLOAD FLAG.2.When a RECEIVER detects a ’dominant’ bit as the first bit after sending an ERRORFLAG the RECEIVE ERROR COUNT will be increased by 8.3.When a TRANSMITTER sends an ERROR FLAG the TRANSMIT ERROR COUNTis increased by 8.Exception 1:If the TRANSMITTER is ’error passive’ and detects an ACKNOWLEDGMENTROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1BOSCHFault ConfinementSep. 1991Part A - page 25ERROR because of not detecting a ’dominant’ ACK and does not detect a’dominant’ bit while sending its PASSIVE ERROR FLAG.Exception 2:If the TRANSMITTER sends an ERROR FLAG because a STUFF ERROR occurredduring ARBITRATION whereby the STUFFBIT is located before the RTR bit, andshould have been ’recessive’, and has been sent as ’recessive’ but monitored as’dominant’.In exceptions 1 and 2 the TRANSMIT ERROR COUNT is not changed.4.If an TRANSMITTER detects a BIT ERROR while sending an ACTIVE ERRORFLAG or an OVERLOAD FLAG the TRANSMIT ERROR COUNT is increased by 8.5.If an RECEIVER detects a BIT ERROR while sending an ACTIVE ERROR FLAG oran OVERLOAD FLAG the RECEIVE ERROR COUNT is increased by 8.6.Any node tolerates up to 7 consecutive ’dominant’ bits after sending an ACTIVEERROR FLAG, PASSIVE ERROR FLAG or OVERLOAD FLAG. After detecting the14th consecutive ’dominant’ bit (in case of an ACTIVE ERROR FLAG or anOVERLOAD FLAG) or after detecting the 8th consecutive ’dominant’ bit following aPASSIVE ERROR FLAG, and after each sequence of additional eight consecutive’dominant’ bits every TRANSMITTER increases its TRANSMIT ERROR COUNT by8 and every RECEIVER increases its RECEIVE ERROR COUNT by 8.7.After the successful transmission of a message (getting ACK and no error until ENDOF FRAME is finished) the TRANSMIT ERROR COUNT is decreased by 1 unless itwas already 0.8.After the successful reception of a message (reception without error up to the ACKSLOT and the successful sending of the ACK bit), the RECEIVE ERROR COUNT isdecreased by 1, if it was between 1 and 127. If the RECEIVE ERROR COUNT was0, it stays 0, and if it was greater than 127, then it will be set to a value between 119and 127.9.A node is ’error passive’ when the TRANSMIT ERROR COUNT equals or exceeds128, or when the RECEIVE ERROR COUNT equals or exceeds 128. An errorcondition letting a node become ’error passive’ causes the node to send an ACTIVEERROR FLAG.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1BOSCHFault ConfinementSep. 1991Part A - page 2610.A node is ’bus off’ when the TRANSMIT ERROR COUNT is greater than or equal to256.11.An ’error passive’ node becomes ’error active’ again when both the TRANSMITERROR COUNT and the RECEIVE ERROR COUNT are less than or equal to 127.12.An node which is ’bus off’ is permitted to become ’error active’ (no longer ’bus off’)with its error counters both set to 0 after 128 occurrence of 11 consecutive’recessive’ bits have been monitored on the bus.Note:An error count value greater than about 96 indicates a heavily disturbed bus. It may beof advantage to provide means to test for this condition.Note:Start-up / Wake-up:If during start-up only 1 node is online, and if this node transmits some message, it willget no acknowledgment, detect an error and repeat the message. It can become ’errorpassive’ but not ’bus off’ due to this reason.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1BOSCHFault ConfinementSep. 1991Part A - page 278 BIT TIMING REQUIREMENTSNOMINAL BIT RATEThe Nominal Bit Rate is the number of bits per second transmitted in the absence ofresynchronization by an ideal transmitter.NOMINAL BIT TIMENOMINAL BIT TIME = 1 / NOMINAL BIT RATEThe Nominal Bit Time can be thought of as being divided into separate non-overlappingtime segments. These segments- SYNCHRONIZATION SEGMENT (SYNC_SEG)- PROPAGATION TIME SEGMENT (PROP_SEG)- PHASE BUFFER SEGMENT1 (PHASE_SEG1)- PHASE BUFFER SEGMENT2 (PHASE_SEG2)form the bit time as shown in figure 1.NOMINAL BIT TIMESYNC_SEGPROP_SEGPHASE_SEG1PHASE_SEG2Sample PointFig. 1 Partition of the Bit TimeSYNC SEGThis part of the bit time is used to synchronize the various nodes on the bus. An edgeis expected to lie within this segment.PROP SEGThis part of the bit time is used to compensate for the physical delay times within thenetwork.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1BOSCHBit TimingSep. 1991Part A - page 28It is twice the sum of the signal’s propagation time on the bus line, the input comparatordelay, and the output driver delay.PHASE SEG1, PHASE SEG2These Phase-Buffer-Segments are used to compensate for edge phase errors. Thesesegments can be lengthened or shortened by resynchronization.SAMPLE POINTThe SAMPLE POINT is the point of time at which the bus level is read and interpretedas the value of that respective bit. It’s location is at the end of PHASE_SEG1.INFORMATION PROCESSING TIMEThe INFORMATION PROCESSING TIME is the time segment starting with theSAMPLE POINT reserved for calculation the subsequent bit level.TIME QUANTUMThe TIME QUANTUM is a fixed unit of time derived from the oscillator period. Thereexists a programmable prescaler, with integral values, ranging at least from 1 to 32.Starting with the MINIMUM TIME QUANTUM, the TIME QUANTUM can have a lengthofTIME QUANTUM = m * MINIMUM TIME QUANTUMwith m the value of the prescaler.Length of Time Segments•••••SYNC_SEG is 1 TIME QUANTUM long.PROP_SEG is programmable to be 1,2,...,8 TIME QUANTA long.PHASE_SEG1 is programmable to be 1,2,...,8 TIME QUANTA long.PHASE_SEG2 is the maximum of PHASE_SEG1 and the INFORMATION PROCESSING TIMEThe INFORMATION PROCESSING TIME is less than or equal to 2 TIME QUANTA long.The total number of TIME QUANTA in a bit time has to be programmable at least from8 to 25.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1BOSCHSYNCHRONIZATIONBit TimingSep. 1991Part A - page 29HARD SYNCHRONIZATIONAfter a HARD SYNCHRONIZATION the internal bit time is restarted with SYNC_SEG.Thus HARD SYNCHRONIZATION forces the edge which has caused the HARDSYNCHRONIZATION to lie within the SYNCHRONIZATION SEGMENT of therestarted bit time.RESYNCHRONIZATION JUMP WIDTHAs a result of RESYNCHRONIZATION PHASE_SEG1 may be lengthened orPHASE_SEG2 may be shortened. The amount of lengthening or shortening of thePHASE BUFFER SEGMENTs has an upper bound given by theRESYNCHRONIZATION JUMP WIDTH. The RESYNCHRONIZATION JUMP WIDTHshall be programmable between 1 and min(4, PHASE_SEG1).Clocking information may be derived from transitions from one bit value to the other.The property that only a fixed maximum number of successive bits have the samevalue provides the possibility of resynchronizing a bus unit to the bit stream during aframe. The maximum length between two transitions which can be used forresynchronization is 29 bit times.PHASE ERROR of an edgeThe PHASE ERROR of an edge is given by the position of the edge relative toSYNC_SEG, measured in TIME QUANTA. The sign of PHASE ERROR is defined asfollows:•••e = 0 if the edge lies within SYNC_SEG.e > 0 if the edge lies before the SAMPLE POINT.e < 0 if the edge lies after the SAMPLE POINT of the previous bit.RESYNCHRONIZATIONThe effect of a RESYNCHRONIZATION is the same as that of a HARDSYNCHRONIZATION, when the magnitude of the PHASE ERROR of the edge whichcauses the RESYNCHRONIZATION is less than or equal to the programmed value ofthe RESYNCHRONIZATION JUMP WIDTH. When the magnitude of the PHASEERROR is larger than the RESYNCHRONIZATION JUMP WIDTH,••and if the PHASE ERROR is positive, then PHASE_SEG1 is lengthened by an amount equal to the RESYNCHRONIZATION JUMP WIDTH.and if the PHASE ERROR is negative, then PHASE_SEG2 is shortened by an amount equal to the RESYNCHRONIZATION JUMP WIDTH.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1BOSCHBit TimingSep. 1991Part A - page 30SYNCHRONIZATION RULESHARD SYNCHRONIZATION and RESYNCHRONIZATION are the two forms ofSYNCHRONIZATION. They obey the following rules:1.Only one SYNCHRONIZATION within one bit time is allowed.2.An edge will be used for SYNCHRONIZATION only if the value detected at theprevious SAMPLE POINT (previous read bus value) differs from the bus valueimmediately after the edge.3.HARD SYNCHRONIZATION is performed whenever there is a ’recessive’ to’dominant’ edge during BUS IDLE.4.All other ’recessive’ to ’dominant’ edges (and optionally ’dominant’ to ’recessive’edges in case of low bit rates) fulfilling the rules 1 and 2 will be used forRESYNCHRONIZATION with the exception that a node transmitting a dominant bitwill not perform a RESYNCHRONIZATION as a result of a ’recessive’ to ’dominant’edge with a positive PHASE ERROR, if only ’recessive’ to ’dominant’ edges areused for resynchronization.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1BOSCHOscillator ToleranceSep. 1991Part A - page 319 INCREASING CAN OSCILLATOR TOLERANCEThis section describes an upwards compatible modification of the CAN protocol, asspecified in sections 1 to 8.9.1 Protocol ModificationsIn order to increase the maximum oscillator tolerance from the 0.5% currently possibleto 1.5%, the following modifications, which are upwards compatible to the existing CANspecification, are necessary:[1]If a CAN node samples a dominant bit at the third bit of INTERMISSION, then it willinterpret this bit as a START OF FRAME bit.[2]If a CAN node has a message waiting for transmission and it samples a dominantbit at the third bit of INTERMISSION, it will interpret this as a START OF FRAMEbit, and, with the next bit, start transmitting its message with the first bit of theIDENTIFIER without first transmitting a START OF FRAME bit and withoutbecoming a receiver.[3]If a CAN node samples a dominant bit at the eighth bit (the last bit) of an ERRORDELIMITER or OVERLOAD DELIMITER, it will, at the next bit, start transmitting anOVERLOAD FRAME (not an ERROR FRAME). The Error Counters will not beincremented.[4]Only recessive to dominant edges will be used for synchronization.In agreement with the existing specification, the following rules are still valid.[5]All CAN controllers synchronize on the START OF FRAME bit with a hardsynchronization.[6]No CAN controller will send a START OF FRAME bit until it has counted threerecessive bits of INTERMISSION.This modifications allow a maximum oscillator tolerance of 1.58% and the use of aceramic resonator at a bus speed of up to 125 Kbits/second. For the full bus speedrange of the CAN protocol, still a quartz oscillator is required. The compatibility of theenhanced and the existing protocol is maintained, as long as:[7]CAN controllers with the enhanced and existing protocols, used in one and thesame network, have all to be provided with a quartz oscillator.The chip with the highest requirement for its oscillator accuracy determines theoscillator accuracy which is required from all the other nodes. Ceramic resonators canonly be used when all the nodes in the network use the enhanced protocol.ROBERT BOSCH GmbH, Postfach 50, D-7000 Stuttgart 1PART B

BOSCH1233.13.23.2.13.2.23.2.33.2.43.2.53.33.445677.17.28910ContentSep. 1991Part B - page 33INTRODUCTION................................................................................34BASIC CONCEPTS............................................................................36MESSAGE TRANSFER.....................................................................42Frame Formats...................................................................................42Frame Types......................................................................................42DATA FRAME....................................................................................42REMOTE FRAME..............................................................................49ERROR FRAME.................................................................................50OVERLOAD FRAME..........................................................................51INTERFRAME SPACING...................................................................53Conformance with regard to Frame Formats.....................................55Definition of TRANSMITTER/RECEIVER..........................................55MESSAGE FILTERING......................................................................56MESSAGE VALIDATION...................................................................57CODING.............................................................................................58ERROR HANDLING...........................................................................59Error Detection...................................................................................59Error Signalling...................................................................................60FAULT CONFINEMENT.....................................................................61OSCILLATOR TOLERANCE..............................................................64BIT TIMING REQUIREMENTS..........................................................27ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCH1 INTRODUCTIONIntroductionSep. 1991Part B - page 34The Controller Area Network (CAN) is a serial communications protocol whichefficiently supports distributed realtime control with a very high level of security.Its domain of application ranges from high speed networks to low cost multiplex wiring.In automotive electronics, engine control units, sensors, anti-skid-systems, etc. areconnected using CAN with bitrates up to 1 Mbit/s. At the same time it is cost effective tobuild into vehicle body electronics, e.g. lamp clusters, electric windows etc. to replacethe wiring harness otherwise required.The intention of this specification is to achieve compatibility between any two CANimplementations. Compatibility, however, has different aspects regarding e.g. electricalfeatures and the interpretation of data to be transferred. To achieve designtransparency and implementation flexibility CAN has been subdivided into differentlayers according to the ISO/OSI Reference Model:•the Data Link Layer--•the Logical Link Control (LLC) sublayerthe Medium Access Control (MAC) sublayerthe Physical LayerNote that in previous versions of the CAN specification the services and functions ofthe LLC and MAC sublayers of the Data Link Layer had been described in layersdenoted as ’object layer’ and ’transfer layer’. The scope of the LLC sublayer is•••to provide services for data transfer and for remote data request,to decide which messages received by the LLC sublayer are actually to be accepted,to provide means for recovery management and overload notifications.There is much freedom in defining object handling. The scope of the MAC sublayermainly is the transfer protocol, i.e. controlling the Framing, performing Arbitration, ErrorChecking, Error Signalling and Fault Confinement. Within the MAC sublayer it isdecided whether the bus is free for starting a new transmission or whether a receptionis just starting. Also some general features of the bit timing are regarded as part of theMAC sublayer. It is in the nature of the MAC sublayer that there is no freedom formodifications.The scope of the physical layer is the actual transfer of the bits between the differentnodes with respect to all electrical properties. Within one network the physical layer, of ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHIntroductionSep. 1991Part B - page 35course, has to be the same for all nodes. There may be, however, much freedom inselecting a physical layer.The scope of this specification is to define the MAC sublayer and a small part of theLLC sublayer of the Data Link Layer and to describe the consequences of the CANprotocol on the surrounding layers.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCH2 BASIC CONCEPTSCAN has the following properties•••••••••prioritization of messagesguarantee of latency timesconfiguration flexibilityBasic ConceptsSep. 1991Part B - page 36multicast reception with time synchronizationsystem wide data consistencymultimastererror detection and signallingautomatic retransmission of corrupted messages as soon as the bus is idle againdistinction between temporary errors and permanent failures of nodes and autonomous switching off of defect nodesLayered Architecture of CAN according to the OSI Reference Model•The Physical Layer defines how signals are actually transmitted and therefore deals with the description of Bit Timing, Bit Encoding, and Synchronization. Within this specification the Driver/Receiver Characteristics of the Physical Layer are not defined so as to allow transmission medium and signal level implementations to be optimized for their application.The MAC sublayer represents the kernel of the CAN protocol. It presents messages received from the LLC sublayer and accepts messages to be transmitted to the LLC sublayer. The MAC sublayer is responsible for Message Framing, Arbitration, Acknowledgment, Error Detection and Signalling. The MAC sublayer are supervised by a management entity called Fault Confinement which is self-checking mechanism for distinguishing short disturbances from permanent failures.The LLC sublayer is concerned with Message Filtering, Overload Notification and Recovery Management.••ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHBasic ConceptsSep. 1991Part B - page 37Data Link LayerLLCAcceptance FilteringOverload NotificationRecovery ManagementSupervisorMACData Encapsulation/DecapsulationFrame Coding (Stuffing, Destuffing)Medium Access ManagementError DetectionError SignallingAcknowledgmentSerialization / DeserializationFaultConfinementPhysical LayerBit Encoding/DecodingBit TimingSynchronizationDriver/Receiver CharacteristicsBus FailureManagementLLC = Logical Link ControlMAC = Medium Access ControlROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHBasic ConceptsSep. 1991Part B - page 38The scope of this specification is to define the Data Link Layer and the consequencesof the CAN protocol on the surrounding layers.MessagesInformation on the bus is sent in fixed format messages of different but limited length(see section 3: Message Transfer). When the bus is free any connected unit may startto transmit a new message.Information RoutingIn CAN systems a CAN node does not make use of any information about the systemconfiguration (e.g. station addresses). This has several important consequences.System Flexibility: Nodes can be added to the CAN network without requiringany change in the software or hardware of any node and application layer.Message Routing: The content of a message is named by an IDENTIFIER. TheIDENTIFIER does not indicate the destination of the message, but describes themeaning of the data, so that all nodes in the network are able to decide byMessage Filtering whether the data is to be acted upon by them or not.Multicast: As a consequence of the concept of Message Filtering any number ofnodes can receive and simultaneously act upon the same message.Data Consistency: Within a CAN network it is guaranteed that a message issimultaneously accepted either by all nodes or by no node. Thus dataconsistency of a system is achieved by the concepts of multicast and by errorhandling.Bit rateThe speed of CAN may be different in different systems. However, in a given systemthe bit-rate is uniform and fixed.PrioritiesThe IDENTIFIER defines a static message priority during bus access.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHBasic ConceptsSep. 1991Part B - page 39Remote Data RequestBy sending a REMOTE FRAME a node requiring data may request another node tosend the corresponding DATA FRAME. The DATA FRAME and the correspondingREMOTE FRAME are named by the same IDENTIFIER.MultimasterWhen the bus is free any unit may start to transmit a message. The unit with themessage of higher priority to be transmitted gains bus access.ArbitrationWhenever the bus is free, any unit may start to transmit a message. If 2 or more unitsstart transmitting messages at the same time, the bus access conflict is resolved bybitwise arbitration using the IDENTIFIER. The mechanism of arbitration guarantees thatneither information nor time is lost. If a DATA FRAME and a REMOTE FRAME with thesame IDENTIFIER are initiated at the same time, the DATA FRAME prevails over theREMOTE FRAME. During arbitration every transmitter compares the level of the bittransmitted with the level that is monitored on the bus. If these levels are equal the unitmay continue to send. When a ’recessive’ level is sent and a ’dominant’ level ismonitored (see Bus Values), the unit has lost arbitration and must withdraw withoutsending one more bit.SafetyIn order to achieve the utmost safety of data transfer, powerful measures for errordetection, signalling and self-checking are implemented in every CAN node.Error DetectionFor detecting errors the following measures have been taken:-Monitoring (transmitters compare the bit levels to be transmitted with the bitlevels detected on the bus)-Cyclic Redundancy Check-Bit Stuffing-Message Frame CheckPerformance of Error DetectionThe error detection mechanisms have the following properties:- all global errors are detected.- all local errors at transmitters are detected.- up to 5 randomly distributed errors in a message are detected.- burst errors of length less than 15 in a message are detected.- errors of any odd number in a message are detected.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHBasic ConceptsSep. 1991Part B - page 40Total residual error probability for undetected corrupted messages: less thanmessage error rate * 4.7 * 10-11.Error Signalling and Recovery TimeCorrupted messages are flagged by any node detecting an error. Such messages areaborted and will be retransmitted automatically. The recovery time from detecting anerror until the start of the next message is at most 31 bit times, if there is no furthererror.Fault ConfinementCAN nodes are able to distinguish short disturbances from permanent failures.Defective nodes are switched off.ConnectionsThe CAN serial communication link is a bus to which a number of units may beconnected. This number has no theoretical limit. Practically the total number of unitswill be limited by delay times and/or electrical loads on the bus line.Single ChannelThe bus consists of a single channel that carries bits. From this data resynchronizationinformation can be derived. The way in which this channel is implemented is not fixedin this specification. E.g. single wire (plus ground), two differential wires, optical fibres,etc.Bus valuesThe bus can have one of two complementary logical values: ’dominant’ or ’recessive’.During simultaneous transmission of ’dominant’ and ’recessive’ bits, the resulting busvalue will be ’dominant’. For example, in case of a wired-AND implementation of thebus, the ’dominant’ level would be represented by a logical ’0’ and the ’recessive’ levelby a logical ’1’. Physical states (e.g. electrical voltage, light) that represent the logicallevels are not given in this specification.AcknowledgmentAll receivers check the consistency of the message being received and willacknowledge a consistent message and flag an inconsistent message.Sleep Mode / Wake-upTo reduce the system’s power consumption, a CAN-device may be set into sleep mode ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHBasic ConceptsSep. 1991Part B - page 41without any internal activity and with disconnected bus drivers. The sleep mode isfinished with a wake-up by any bus activity or by internal conditions of the system. Onwake-up, the internal activity is restarted, although the MAC sublayer will be waiting forthe system’s oscillator to stabilize and it will then wait until it has synchronized itself tothe bus activity (by checking for eleven consecutive ’recessive’ bits), before the busdrivers are set to \"on-bus\" again.Oscillator ToleranceThe Bit Timing requirements allow ceramic resonators to be used in applications withtransmission rates of up to 125kbit/s as a rule of thumb; for a more precise evaluationrefer toDias, S; Chapman, M;“Impact of Bit Representation on Transport Capacity and ClockAccuracy in Serial Data Streams”,SAE Technical Paper Series 890532, Multiplexing in Automobiles SP-773March 1989For the full bus speed range of the CAN protocol, a quartz oscillator is required.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHMessage TransferSep. 1991Part B - page 423 MESSAGE TRANSFER3.1 Frame FormatsThere are two different formats which differ in the length of the IDENTIFIER field:Frames with the number of 11 bit IDENTIFIER are denoted Standard Frames. Incontrast, frames containing 29 bit IDENTIFIER are denoted Extended Frames.3.2 Frame TypesMessage transfer is manifested and controlled by four different frame types:A DATA FRAME carries data from a transmitter to the receivers.A REMOTE FRAME is transmitted by a bus unit to request the transmission of theDATA FRAME with the same IDENTIFIER.An ERROR FRAME is transmitted by any unit on detecting a bus error.An OVERLOAD FRAME is used to provide for an extra delay between the precedingand the succeeding DATA or REMOTE FRAMEs.DATA FRAMEs and REMOTE FRAMEs can be used both in Standard Frame Formatand Extended Frame Format; they are separated from preceding frames by anINTERFRAME SPACE.3.2.1 DATA FRAMEA DATA FRAME is composed of seven different bit fields:START OF FRAME, ARBITRATION FIELD, CONTROL FIELD, DATA FIELD, CRCFIELD, ACK FIELD, END OF FRAME. The DATA FIELD can be of length zero.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHInterframeSpaceData FrameSep. 1991Part B - page 43DATA FRAMEInterframeSpaceorOverloadFrameStart of FrameArbitration FieldControl FieldData FieldCRC FieldACK FieldEnd of FrameSTART OF FRAME (Standard Format as well as Extended Format)The START OF FRAME (SOF) marks the beginning of DATA FRAMES and REMOTEFRAMEs. It consists of a single ’dominant’ bit.A station is only allowed to start transmission when the bus is idle (see ’INTERFRAMESpacing’). All stations have to synchronize to the leading edge caused by START OFFRAME (see ’HARD SYNCHRONIZATION’) of the station starting transmission first.ARBITRATION FIELDThe format of the ARBITRATION FIELD is different for Standard Format andExtended Format Frames.--In Standard Format the ARBITRATION FIELD consists of the 11 bit IDENTIFIERand the RTR-BIT. The IDENTIFIER bits are denoted ID-28 ... ID-18.In Extended Format the ARBITRATION FIELD consists of the 29 bit IDENTIFIER,the SRR-Bit, the IDE-Bit, and the RTR-BIT. The IDENTIFIER bits are denoted ID-28... ID-0.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHData FrameSep. 1991Part B - page 44In order to distinguish between Standard Format and Extended Format the reserved bitr1 in previous CAN specifications version 1.0-1.2 now is denoted as IDE Bit.Standard FormatArbitration FieldSOFControlFieldRIrTD0REData Field11 bit IDENTIFIERDLCExtended FormatArbitration FieldSOFSIRDREControlFieldRrrT10RData Field11 bit IDENTIFIER18 bit IDENTIFIERDLCIDENTIFIERIDENTIFIER - Standard FormatThe IDENTIFIER’s length is 11 bits and corresponds to the Base ID in ExtendedFormat. These bits are transmitted in the order from ID-28 to ID-18. The leastsignificant bit is ID-18. The 7 most significant bits (ID-28 - ID-22) must not be all’recessive’.IDENTIFIER - Extended FormatIn contrast to the Standard Format the Extended Format consists of 29 bits. Theformat comprises two sections:Base ID with 11 bits and theExtended ID with 18 bitsROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHData FrameSep. 1991Part B - page 45Base IDThe Base ID consists of 11 bits. It is transmitted in the order from ID-28 to ID-18. Itis equivalent to format of the Standard Identifier. The Base ID defines the ExtendedFrame’s base priority.Extended IDThe Extended ID consists of 18 bits. It is transmitted in the order of ID-17 to ID-0.In a Standard Frame the IDENTIFIER is followed by the RTR bit.RTR BIT (Standard Format as well as Extended Format)Remote Transmission Request BITIn DATA FRAMEs the RTR BIT has to be ’dominant’. Within a REMOTE FRAME theRTR BIT has to be ’recessive’.In an Extended Frame the Base ID is transmitted first, followed by the IDE bit and theSRR bit. The Extended ID is transmitted after the SRR bit.SRR BIT (Extended Format)Substitute Remote Request BITThe SRR is a recessive bit. It is transmitted in Extended Frames at the position of theRTR bit in Standard Frames and so substitutes the RTR-Bit in the Standard Frame.Therefore, collisions of a Standard Frame and an Extended Frame, the Base ID (see’Extended IDENTIFIER’ below) of which is the same as the Standard Frame’s Identifier,are resolved in such a way that the Standard Frame prevails the Extended Frame.IDE BIT (Extended Format)Identifier Extension BitThe IDE Bit belongs to- the ARBITRATION FIELD for the Extended Format- the Control Field for the Standard FormatThe IDE bit in the Standard Format is transmitted ’dominant’, whereas in the ExtendedFormat the IDE bit is recessive.CONTROL FIELD (Standard Format as well as Extended Format)The CONTROL FIELD consists of six bits. The format of the CONTROL FIELD isdifferent for Standard Format and Extended Format. Frames in Standard Formatinclude the DATA LENGTH CODE, the IDE bit, which is transmitted ’dominant’ (seeROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHData FrameSep. 1991Part B - page 46above), and the reserved bit r0. Frames in the Extended Format include the DATALENGTH CODE and two reserved bits r1 and r0. The reserved bits have to be sent’dominant’, but receivers accept ’dominant’ and ’recessive’ bits in all combinations.ArbitrationFieldCONTROL FIELDStandard Format and Extended FormatIDE / r1r0DLC3DLC2DLC1DLC0DataFieldorCRCFieldreservedbitsData Length CodeDATA LENGTH CODE (Standard Format as well as Extended Format)The number of bytes in the DATA FIELD is indicated by the DATA LENGTH CODE.This DATA LENGTH CODE is 4 bits wide and is transmitted within the CONTROLFIELD.Coding of the number of data bytes by the DATA LENGTH CODEabbreviations:d ’dominant’r ’recessive’Number of DataBytes012345678Data Length CodeDLC3ddddddddrDLC2ddddrrrrdDLC1ddrrddrrdDLC0drdrdrdrdROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHData FrameSep. 1991Part B - page 47DATA FRAME: admissible numbers of data bytes: {0,1,....,7,8}.Other values may not be used.DATA FIELD (Standard Format as well as Extended Format)The DATA FIELD consists of the data to be transferred within a DATA FRAME. It cancontain from 0 to 8 bytes, which each contain 8 bits which are transferred MSB first.CRC FIELD (Standard Format as well as Extended Format)contains the CRC SEQUENCE followed by a CRC DELIMITER.DataorControlFieldCRC FIELDAckFieldCRC DelimiterCRC SequenceCRC SEQUENCE (Standard Format as well as Extended Format)The frame check sequence is derived from a cyclic redundancy code best suited forframes with bit counts less than 127 bits (BCH Code).In order to carry out the CRC calculation the polynomial to be divided is defined as thepolynomial, the coefficients of which are given by the destuffed bit stream consisting ofSTART OF FRAME, ARBITRATION FIELD, CONTROL FIELD, DATA FIELD (ifpresent) and, for the 15 lowest coefficients, by 0. This polynomial is divided (thecoefficients are calculated modulo-2) by the generator-polynomial: X15 + X14 + X10 + X8 + X7 + X4 + X3 + 1.The remainder of this polynomial division is the CRC SEQUENCE transmitted over thebus. In order to implement this function, a 15 bit shift register CRC_RG(14:0) can beused. If NXTBIT denotes the next bit of the bit stream, given by the destuffed bitsequence from START OF FRAME until the end of the DATA FIELD, the CRCSEQUENCE is calculated as follows:CRC_RG = 0;// initialize shift registerROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHREPEATData FrameSep. 1991Part B - page 48CRCNXT = NXTBIT EXOR CRC_RG(14);CRC_RG(14:1) = CRC_RG(13:0);// shift left byCRC_RG(0) = 0;// 1 positionIF CRCNXT THENCRC_RG(14:0) = CRC_RG(14:0) EXOR (4599hex);ENDIFUNTIL (CRC SEQUENCE starts or there is an ERROR condition)After the transmission / reception of the last bit of the DATA FIELD, CRC_RG containsthe CRC sequence.CRC DELIMITER (Standard Format as well as Extended Format)The CRC SEQUENCE is followed by the CRC DELIMITER which consists of a single’recessive’ bit.ACK FIELD (Standard Format as well as Extended Format)The ACK FIELD is two bits long and contains the ACK SLOT and the ACK DELIMITER.In the ACK FIELD the transmitting station sends two ’recessive’ bits.A RECEIVER which has received a valid message correctly, reports this to theTRANSMITTER by sending a ’dominant’ bit during the ACK SLOT (it sends ’ACK’).CRCFieldACK FIELDEnd ofFrameACK SlotACK DelimiterACK SLOTAll stations having received the matching CRC SEQUENCE report this within the ACKSLOT by superscribing the ’recessive’ bit of the TRANSMITTER by a ’dominant’ bit.ACK DELIMITERThe ACK DELIMITER is the second bit of the ACK FIELD and has to be a ’recessive’bit. As a consequence, the ACK SLOT is surrounded by two ’recessive’ bits (CRCDELIMITER, ACK DELIMITER).ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHRemote FrameSep. 1991Part B - page 49END OF FRAME (Standard Format as well as Extended Format)Each DATA FRAME and REMOTE FRAME is delimited by a flag sequence consistingof seven ’recessive’ bits.3.2.2 REMOTE FRAMEA station acting as a RECEIVER for certain data can initiate the transmission of therespective data by its source node by sending a REMOTE FRAME.A REMOTE FRAME exists in both Standard Format and Extended Format. In bothcases it is composed of six different bit fields:START OF FRAME, ARBITRATION FIELD, CONTROL FIELD, CRC FIELD, ACKFIELD, END OF FRAME.Contrary to DATA FRAMEs, the RTR bit of REMOTE FRAMEs is ’recessive’. There isno DATA FIELD, independent of the values of the DATA LENGTH CODE which maybe signed any value within the admissible range 0...8. The value is the DATA LENGTHCODE of the corresponding DATA FRAME.InterFrameSpaceREMOTE FRAMEInterFrameSpaceorOverloadFrameStart of FrameArbitration FieldControl FieldCRC FieldACK FieldEnd of FrameROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHError FrameSep. 1991Part B - page 50The polarity of the RTR bit indicates whether a transmitted frame is a DATA FRAME(RTR bit ’dominant’) or a REMOTE FRAME (RTR bit ’recessive’).3.2.3 ERROR FRAMEThe ERROR FRAME consists of two different fields. The first field is given by thesuperposition of ERROR FLAGs contributed from different stations. The followingsecond field is the ERROR DELIMITER.DataFrameERROR FRAMEError FlagInterframeSpace orOverloadFramesuperposition ofError FlagsError DelimiterIn order to terminate an ERROR FRAME correctly, an ’error passive’ node may needthe bus to be ’bus idle’ for at least 3 bit times (if there is a local error at an ’errorpassive’ receiver). Therefore the bus should not be loaded to 100%.ERROR FLAGThere are 2 forms of an ERROR FLAG: an ACTIVE ERROR FLAG and a PASSIVEERROR FLAG.1.2.The ACTIVE ERROR FLAG consists of six consecutive ’dominant’ bits.The PASSIVE ERROR FLAG consists of six consecutive ’recessive’ bits unless itis overwritten by ’dominant’ bits from other nodes.An ’error active’ station detecting an error condition signals this by transmission of anACTIVE ERROR FLAG. The ERROR FLAG’s form violates the law of bit stuffing (seeCODING) applied to all fields from START OF FRAME to CRC DELIMITER or destroysthe fixed form ACK FIELD or END OF FRAME field. As a consequence, all otherstations detect an error condition and on their part start transmission of an ERRORROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHOverload FrameSep. 1991Part B - page 51FLAG. So the sequence of ’dominant’ bits which actually can be monitored on the busresults from a superposition of different ERROR FLAGs transmitted by individualstations. The total length of this sequence varies between a minimum of six and amaximum of twelve bits.An ’error passive’ station detecting an error condition tries to signal this by transmissionof a PASSIVE ERROR FLAG. The ’error passive’ station waits for six consecutive bitsof equal polarity, beginning at the start of the PASSIVE ERROR FLAG. The PASSIVEERROR FLAG is complete when these 6 equal bits have been detected.ERROR DELIMITERThe ERROR DELIMITER consists of eight ’recessive’ bits.After transmission of an ERROR FLAG each station sends ’recessive’ bits andmonitors the bus until it detects a ’recessive’ bit. Afterwards it starts transmitting sevenmore ’recessive’ bits.3.2.4 OVERLOAD FRAMEThe OVERLOAD FRAME contains the two bit fields OVERLOAD FLAG andOVERLOAD DELIMITER.There are two kinds of OVERLOAD conditions, which both lead to the transmission ofan OVERLOAD FLAG:1.The internal conditions of a receiver, which requires a delay of the next DATAFRAME or REMOTE FRAME.Detection of a ’dominant’ bit at the first and second bit of INTERMISSION.If a CAN node samples a dominant bit at the eighth bit (the last bit) of an ERRORDELIMITER or OVERLOAD DELIMITER, it will start transmitting an OVERLOADFRAME (not an ERROR FRAME). The Error Counters will not be incremented.2.3.The start of an OVERLOAD FRAME due to OVERLOAD condition 1 is only allowed tobe started at the first bit time of an expected INTERMISSION, whereas OVERLOADFRAMEs due to OVERLOAD condition 2 and condition 3 start one bit after detectingthe ’dominant’ bit.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHOverload FrameSep. 1991Part B - page 52At most two OVERLOAD FRAMEs may be generated to delay the next DATA orREMOTE FRAME.End of Frame orError Delimiter orOverload DelimiterOVERLOAD FRAMEInterFrameSpace orOverloadFrameOverloadFlagsuperposition ofOverload FlagsOverload DelimiterOVERLOAD FLAGconsists of six ’dominant’ bits. The overall form corresponds to that of the ACTIVEERROR FLAG.The OVERLOAD FLAG’s form destroys the fixed form of the INTERMISSION field. Asa consequence, all other stations also detect an OVERLOAD condition and on theirpart start transmission of an OVERLOAD FLAG. In case that there is a ’dominant’ bitdetected during the 3rd bit of INTERMISSION then it will interpret this bit as START OFFRAME.Note:Controllers based on the CAN Specification version 1.0 and 1.1 have anotherinterpretation of the 3rd bit if INTERMISSION: If a ’dominant’ bit was detectedlocally at some node, the other nodes will not interpret the OVERLOAD FLAGcorrectly, but interpret the first of these six ’dominant’ bits as START OFFRAME; the sixth ’dominant’ bit violates the rule of bit stuffing causing an errorcondition.OVERLOAD DELIMITERconsists of eight ’recessive’ bits.The OVERLOAD DELIMITER is of the same form as the ERROR DELIMITER. Aftertransmission of an OVERLOAD FLAG the station monitors the bus until it detects atransition from a ’dominant’ to a ’recessive’ bit. At this point of time every bus stationhas finished sending its OVERLOAD FLAG and all stations start transmission of sevenmore ’recessive’ bits in coincidence.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCH3.2.5 INTERFRAME SPACINGInterframe SpaceSep. 1991Part B - page 53DATA FRAMEs and REMOTE FRAMEs are separated from preceding frameswhatever type they are (DATA FRAME, REMOTE FRAME, ERROR FRAME,OVERLOAD FRAME) by a bit field called INTERFRAME SPACE. In contrast,OVERLOAD FRAMEs and ERROR FRAMEs are not preceded by an INTERFRAMESPACE and multiple OVERLOAD FRAMEs are not separated by an INTERFRAMESPACE.INTERFRAME SPACEcontains the bit fields INTERMISSION and BUS IDLE and, for ’error passive’ stations,which have been TRANSMITTER of the previous message, SUSPENDTRANSMISSION.For stations which are not ’error passive’ or have been RECEIVER of the previousmessage:FrameINTERFRAME SPACEFrameIntermissionBus IdleFor ’error passive’ stations which have been TRANSMITTER of the previous message:FrameINTERFRAME SPACEFrameBus IdleIntermissionSuspend TransmissionINTERMISSIONconsists of three ’recessive’ bits.During INTERMISSION the only action to be taken is signalling an OVERLOADcondition and no station is allowed to actively start transmission of a DATA FRAME orREMOTE FRAME.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHNote:Interframe SpaceSep. 1991Part B - page 54If a CAN node has a message waiting for transmission and it samples a dominantbit at the third bit of INTERMISSION, it will interpret this as a START OF FRAMEbit, and, with the next bit, start transmitting its message with the first bit of itsIDENTIFIER without first transmitting a START OF FRAME bit and withoutbecoming receiver.BUS IDLEThe period of BUS IDLE may be of arbitrary length. The bus is recognized to be freeand any station having something to transmit can access the bus. A message, which ispending for transmission during the transmission of another message, is started in thefirst bit following INTERMISSION.The detection of a ’dominant’ bit on the bus is interpreted as a START OF FRAME.SUSPEND TRANSMISSIONAfter an ’error passive’ station has transmitted a message, it sends eight ’recessive’bits following INTERMISSION, before starting to transmit a further message orrecognizing the bus to be idle. If meanwhile a transmission (caused by another station)starts, the station will become receiver of this message.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHConformanceSep. 1991Part B - page 553.3 Conformance with regard to Frame FormatThe Standard Format is equivalent to the Data/Remote Frame Format as it is describedin the CAN Specification 1.2. In contrast the Extended Format is a new feature of theCAN protocol. In order to allow the design of relatively simple controllers, theimplementation of the Extended Format to its full extend is not required (e.g. sendmessages or accept data from messages in Extended Format), whereas the StandardFormat must be supported without restriction.New controllers are considered to be in conformance with this CAN Specification, ifthey have at least the following properties with respect to the Frame Formats defined in3.1 and 3.2:--Every new controller supports the Standard Format;Every new controller can receive messages of the Extended Format. This requiresthat Extended Frames are not destroyed just because of their format. It is, however,not required that the Extended Format must be supported by new controllers.3.4 Definition of TRANSMITTER / RECEIVERTRANSMITTERA unit originating a message is called “TRANSMITTER” of that message. The unit staysTRANSMITTER until the bus is idle or the unit loses ARBITRATION.RECEIVERA unit is called “RECEIVER” of a message, if it is not TRANSMITTER of that messageand the bus is not idle.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHMessage FilteringSep. 1991Part B - page 564 MESSAGE FILTERINGMessage filtering is based upon the whole Identifier. Optional mask registers that allowany Identifier bit to be set ’don’t care’ for message filtering, may be used to selectgroups of Identifiers to be mapped into the attached receive buffers.If mask registers are implemented every bit of the mask registers must beprogrammable, i.e. they can be enabled or disabled for message filtering. The length ofthe mask register can comprise the whole IDENTIFIER or only part of it.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHMessage ValidationSep. 1991Part B - page 575 MESSAGE VALIDATIONThe point of time at which a message is taken to be valid, is different for the transmitterand the receivers of the message.Transmitter:The message is valid for the transmitter, if there is no error until the end of END OFFRAME. If a message is corrupted, retransmission will follow automatically andaccording to prioritization. In order to be able to compete for bus access with othermessages, retransmission has to start as soon as the bus is idle.Receivers:The message is valid for the receivers, if there is no error until the last but one bit ofEND OF FRAME. The value of the last bit of END OF FRAME is treated as ’don’t care’,a dominant value does not lead to a FORM ERROR (cf. section 7.1).ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCH6 CODINGBIT STREAM CODINGCodingSep. 1991Part B - page 58The frame segments START OF FRAME, ARBITRATION FIELD, CONTROL FIELD,DATA FIELD and CRC SEQUENCE are coded by the method of bit stuffing. Whenevera transmitter detects five consecutive bits of identical value in the bit stream to betransmitted it automatically inserts a complementary bit in the actual transmitted bitstream.The remaining bit fields of the DATA FRAME or REMOTE FRAME (CRC DELIMITER,ACK FIELD, and END OF FRAME) are of fixed form and not stuffed. The ERRORFRAME and the OVERLOAD FRAME are of fixed form as well and not coded by themethod of bit stuffing.The bit stream in a message is coded according to the Non-Return-to-Zero (NRZ)method. This means that during the total bit time the generated bit level is either’dominant’ or ’recessive’.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCH7 ERROR HANDLING7.1 Error DetectionError HandlingSep. 1991Part B - page 59There are 5 different error types (which are not mutually exclusive):•BIT ERRORA unit that is sending a bit on the bus also monitors the bus. A BIT ERROR has to be detected at that bit time, when the bit value that is monitored is different from the bit value that is sent. An exception is the sending of a ’recessive’ bit during the stuffed bit stream of the ARBITRATION FIELD or during the ACK SLOT. Then no BIT ERROR occurs when a ’dominant’ bit is monitored. A TRANSMITTER sending a PASSIVE ERROR FLAG and detecting a ’dominant’ bit does not interpret this as a BIT ERROR.STUFF ERRORA STUFF ERROR has to be detected at the bit time of the 6th consecutive equal bit level in a message field that should be coded by the method of bit stuffing.CRC ERRORThe CRC sequence consists of the result of the CRC calculation by the transmitter. The receivers calculate the CRC in the same way as the transmitter. A CRC ERROR has to be detected, if the calculated result is not the same as that received in the CRC sequence.FORM ERRORA FORM ERROR has to be detected when a fixed-form bit field contains one or more illegal bits. (Note, that for a Receiver a dominant bit during the last bit of END OR FRAME is not treated as FORM ERROR).ACKNOWLEDGMENT ERRORAn ACKNOWLEDGMENT ERROR has to be detected by a transmitter whenever it does not monitor a ’dominant’ bit during the ACK SLOT.••••ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCH7.2 Error SignallingError HandlingSep. 1991Part B - page 60A station detecting an error condition signals this by transmitting an ERROR FLAG. Foran ’error active’ node it is an ACTIVE ERROR FLAG, for an ’error passive’ node it is aPASSIVE ERROR FLAG. Whenever a BIT ERROR, a STUFF ERROR, a FORMERROR or an ACKNOWLEDGMENT ERROR is detected by any station, transmissionof an ERROR FLAG is started at the respective station at the next bit.Whenever a CRC ERROR is detected, transmission of an ERROR FLAG starts at thebit following the ACK DELIMITER, unless an ERROR FLAG for another condition hasalready been started.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHFault ConfinementSep. 1991Part B - page 618 FAULT CONFINEMENTWith respect to fault confinement a unit may be in one of three states:•••’error active’’error passive’’bus off’An ’error active’ unit can normally take part in bus communication and sends anACTIVE ERROR FLAG when an error has been detected.An ’error passive’ unit must not send an ACTIVE ERROR FLAG. It takes part in buscommunication, but when an error has been detected only a PASSIVE ERROR FLAGis sent. Also after a transmission, an ’error passive’ unit will wait before initiating afurther transmission. (See SUSPEND TRANSMISSION)A ’bus off’ unit is not allowed to have any influence on the bus. (E.g. output driversswitched off.)For fault confinement two counts are implemented in every bus unit:1) TRANSMIT ERROR COUNT2) RECEIVE ERROR COUNTThese counts are modified according to the following rules:(note that more than one rule may apply during a given message transfer)1.When a RECEIVER detects an error, the RECEIVE ERROR COUNT will beincreased by 1, except when the detected error was a BIT ERROR during thesending of an ACTIVE ERROR FLAG or an OVERLOAD FLAG.2.When a RECEIVER detects a ’dominant’ bit as the first bit after sending an ERRORFLAG the RECEIVE ERROR COUNT will be increased by 8.3.When a TRANSMITTER sends an ERROR FLAG the TRANSMIT ERROR COUNTis increased by 8.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHFault ConfinementSep. 1991Part B - page 62Exception 1:If the TRANSMITTER is ’error passive’ and detects an ACKNOWLEDGMENTERROR because of not detecting a ’dominant’ ACK and does not detect a’dominant’ bit while sending its PASSIVE ERROR FLAG.Exception 2:If the TRANSMITTER sends an ERROR FLAG because a STUFF ERROR occurredduring ARBITRATION, and should have been ’recessive’, and has been sent as’recessive’ but monitored as ’dominant’.In exceptions 1 and 2 the TRANSMIT ERROR COUNT is not changed.4.If an TRANSMITTER detects a BIT ERROR while sending an ACTIVE ERRORFLAG or an OVERLOAD FLAG the TRANSMIT ERROR COUNT is increased by 8.5.If an RECEIVER detects a BIT ERROR while sending an ACTIVE ERROR FLAG oran OVERLOAD FLAG the RECEIVE ERROR COUNT is increased by 8.6.Any node tolerates up to 7 consecutive ’dominant’ bits after sending an ACTIVEERROR FLAG, PASSIVE ERROR FLAG or OVERLOAD FLAG. After detecting the14th consecutive ’dominant’ bit (in case of an ACTIVE ERROR FLAG or anOVERLOAD FLAG) or after detecting the 8th consecutive ’dominant’ bit following aPASSIVE ERROR FLAG, and after each sequence of additional eight consecutive’dominant’ bits every TRANSMITTER increases its TRANSMIT ERROR COUNT by8 and every RECEIVER increases its RECEIVE ERROR COUNT by 8.7.After the successful transmission of a message (getting ACK and no error until ENDOF FRAME is finished) the TRANSMIT ERROR COUNT is decreased by 1 unless itwas already 0.8.After the successful reception of a message (reception without error up to the ACKSLOT and the successful sending of the ACK bit), the RECEIVE ERROR COUNT isdecreased by 1, if it was between 1 and 127. If the RECEIVE ERROR COUNT was0, it stays 0, and if it was greater than 127, then it will be set to a value between 119and 127.9.A node is ’error passive’ when the TRANSMIT ERROR COUNT equals or exceeds128, or when the RECEIVE ERROR COUNT equals or exceeds 128. An errorcondition letting a node become ’error passive’ causes the node to send an ACTIVEERROR FLAG.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHFault ConfinementSep. 1991Part B - page 6310.A node is ’bus off’ when the TRANSMIT ERROR COUNT is greater than or equal to256.11.An ’error passive’ node becomes ’error active’ again when both the TRANSMITERROR COUNT and the RECEIVE ERROR COUNT are less than or equal to 127.12.An node which is ’bus off’ is permitted to become ’error active’ (no longer ’bus off’)with its error counters both set to 0 after 128 occurrence of 11 consecutive’recessive’ bits have been monitored on the bus.Note:An error count value greater than about 96 indicates a heavily disturbed bus. It may beof advantage to provide means to test for this condition.Note:Start-up / Wake-up:If during start-up only 1 node is online, and if this node transmits some message, it willget no acknowledgment, detect an error and repeat the message. It can become ’errorpassive’ but not ’bus off’ due to this reason.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHOscillator ToleranceSep. 1991Part B - page 649 OSCILLATOR TOLERANCEA maximum oscillator tolerance of 1.58% is given and therefore the use of a ceramicresonator at a bus speed of up to 125 Kbits/s as a rule of thumb; for a more preciseevaluation refer toDias, S; Chapman, M;“Impact of Bit Representation on Transport Capacity and ClockAccuracy in Serial Data Streams”,SAE Technical Paper Series 890532, Multiplexing in Automobiles SP-773March 1989For the full bus speed range of the CAN protocol, a quartz oscillator is required.The chip of the CAN network with the highest requirement for its oscillator accuracydetermines the oscillator accuracy which is required from all the other nodes.Note:Can controllers following this CAN Specification and controllers following the previousversions 1.0 and 1.1, used in one and the same network, must all be equipped with aquartz oscillator. That means ceramic resonators can only be used in a network with allthe nodes of the network following CAN Protocol Specification versions 1.2 or later.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHBit TimingSep. 1991Part B - page 6510 BIT TIMING REQUIREMENTSNOMINAL BIT RATEThe Nominal Bit Rate is the number of bits per second transmitted in the absence ofresynchronization by an ideal transmitter.NOMINAL BIT TIMENOMINAL BIT TIME = 1 / NOMINAL BIT RATEThe Nominal Bit Time can be thought of as being divided into separate non-overlappingtime segments. These segments- SYNCHRONIZATION SEGMENT (SYNC_SEG)- PROPAGATION TIME SEGMENT (PROP_SEG)- PHASE BUFFER SEGMENT1 (PHASE_SEG1)- PHASE BUFFER SEGMENT2 (PHASE_SEG2)form the bit time as shown in figure 1.NOMINAL BIT TIMESYNC_SEGPROP_SEGPHASE_SEG1PHASE_SEG2Sample PointFig. 1 Partition of the Bit TimeSYNC SEGThis part of the bit time is used to synchronize the various nodes on the bus. An edgeis expected to lie within this segment.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHBit TimingSep. 1991Part B - page 66PROP SEGThis part of the bit time is used to compensate for the physical delay times within thenetwork. It is twice the sum of the signal’s propagation time on the bus line, the inputcomparator delay, and the output driver delay.PHASE SEG1, PHASE SEG2These Phase-Buffer-Segments are used to compensate for edge phase errors. Thesesegments can be lengthened or shortened by resynchronization.SAMPLE POINTThe SAMPLE POINT is the point of time at which the bus level is read and interpretedas the value of that respective bit. It’s location is at the end of PHASE_SEG1.INFORMATION PROCESSING TIMEThe INFORMATION PROCESSING TIME is the time segment starting with theSAMPLE POINT reserved for calculation the subsequent bit level.TIME QUANTUMThe TIME QUANTUM is a fixed unit of time derived from the oscillator period. Thereexists a programmable prescaler, with integral values, ranging at least from 1 to 32.Starting with the MINIMUM TIME QUANTUM, the TIME QUANTUM can have a lengthofTIME QUANTUM = m * MINIMUM TIME QUANTUMwith m the value of the prescaler.Length of Time Segments•••••SYNC_SEG is 1 TIME QUANTUM long.PROP_SEG is programmable to be 1,2,...,8 TIME QUANTA long.PHASE_SEG1 is programmable to be 1,2,...,8 TIME QUANTA long.PHASE_SEG2 is the maximum of PHASE_SEG1 and the INFORMATION PROCESSING TIMEThe INFORMATION PROCESSING TIME is less than or equal to 2 TIME QUANTA long.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHBit TimingSep. 1991Part B - page 67The total number of TIME QUANTA in a bit time has to be programmable at least from8 to 25.Note:It is often intended that control units do not make use of different oscillators for the localCPU and its communication device. Therefore the oscillator frequency of a CAN devicetends to be that of the local CPU and is determined by the requirements of the controlunit. In order to derive the desired bitrate, programmability of the bittiming is necessary.In case of CAN implementations that are designed for use without a local CPU thebittiming cannot be programmable. On the other hand these devices allow to choose anexternal oscillator in such a way that the device is adjusted to the appropriate bit rateso that the programmability is dispensable for such components.The position of the sample point, however, should be selected in common for all nodes.Therefore the bit timing of SLIO devices must be compatible to the following definitionof the bit time:Sync-Seg1 TimeQuantumProp-Seg1 TimeQuantumPhase Buffer Seg. 14 Time QuantaPhase Buffer Seg. 24 Time Quanta1 Bit Time10 Time QuantaHARD SYNCHRONIZATIONAfter a HARD SYNCHRONIZATION the internal bit time is restarted with SYNC_SEG.Thus HARD SYNCHRONIZATION forces the edge which has caused the HARDSYNCHRONIZATION to lie within the SYNCHRONIZATION SEGMENT of therestarted bit time.RESYNCHRONIZATION JUMP WIDTHAs a result of RESYNCHRONIZATION PHASE_SEG1 may be lengthened orPHASE_SEG2 may be shortened. The amount of lengthening or shortening of thePHASE BUFFER SEGMENTs has an upper bound given by theRESYNCHRONIZATION JUMP WIDTH. The RESYNCHRONIZATION JUMP WIDTHshall be programmable between 1 and min(4, PHASE_SEG1).Clocking information may be derived from transitions from one bit value to the other.The property that only a fixed maximum number of successive bits have the samevalue provides the possibility of resynchronizing a bus unit to the bit stream during aframe. The maximum length between two transitions which can be used forresynchronization is 29 bit times.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHBit TimingSep. 1991Part B - page 68PHASE ERROR of an edgeThe PHASE ERROR of an edge is given by the position of the edge relative toSYNC_SEG, measured in TIME QUANTA. The sign of PHASE ERROR is defined asfollows:•••e = 0 if the edge lies within SYNC_SEG.e > 0 if the edge lies before the SAMPLE POINT.e < 0 if the edge lies after the SAMPLE POINT of the previous bit.RESYNCHRONIZATIONThe effect of a RESYNCHRONIZATION is the same as that of a HARDSYNCHRONIZATION, when the magnitude of the PHASE ERROR of the edge whichcauses the RESYNCHRONIZATION is less than or equal to the programmed value ofthe RESYNCHRONIZATION JUMP WIDTH. When the magnitude of the PHASEERROR is larger than the RESYNCHRONIZATION JUMP WIDTH,••and if the PHASE ERROR is positive, then PHASE_SEG1 is lengthened by an amount equal to the RESYNCHRONIZATION JUMP WIDTH.and if the PHASE ERROR is negative, then PHASE_SEG2 is shortened by an amount equal to the RESYNCHRONIZATION JUMP WIDTH.SYNCHRONIZATION RULESHARD SYNCHRONIZATION and RESYNCHRONIZATION are the two forms ofSYNCHRONIZATION. They obey the following rules:1.Only one SYNCHRONIZATION within one bit time is allowed.2.An edge will be used for SYNCHRONIZATION only if the value detected at theprevious SAMPLE POINT (previous read bus value) differs from the bus valueimmediately after the edge.3.HARD SYNCHRONIZATION is performed whenever there is a ’recessive’ to’dominant’ edge during BUS IDLE.4.All other ’recessive’ to ’dominant’ edges fulfilling the rules 1 and 2 will be used forRESYNCHRONIZATION with the exception that a node transmitting a dominant bitwill not perform a RESYNCHRONIZATION as a result of a ’recessive’ to ’dominant’edge with a positive PHASE ERROR, if only ’recessive’ to ’dominant’ edges areused for resynchronization.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHDifferences of CAN SpecificationVersions 1.2 and 2.0Sep. 1991- 1 -DifferencesAmendment of CAN Specification 1.2 has been included in part B of this Specification.The respective alterations are marked with an asterisk.page B-25 and page B-62:Alteration of Fault Confinement rule 6page B-34 to B-37:The layered architecture of CAN was described by different layers according to theISO/OSI Reference Model.page B-41:*Note to Oscillator Tolerance includedpage B-43:The numbering of the Identifier bits has been changed.page B-51:*According to the Oscillator Tolerance a third condition for generation of an OverloadFrame was introduced.page B-52:*A note was added because the Interpretation of the last bit of Intermission has beenchanged.page B-54:*A note was introduced because of another interpretation of Start of Frame.page B-55:Section 3.3 “Conformance with regard to Frame Formats”.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30BOSCHDifferences of CAN SpecificationVersions 1.2 and 2.0Sep. 1991- 2 -page B-56:Chapter 4 “Message Filtering” was introduced recently.page B-64:*Note to the compatibility of the protocol modified according to the Oscillator Tolerances.page B-67:Note to the bittiming of implementations for ECUs without local CPU.ROBERT BOSCH GmbH, Postfach 300240, D-7000 Stuttgart 30

因篇幅问题不能全部显示,请点此查看更多更全内容