Example: biology

Controller Area Network (CAN) Basics

1999 Microchip Technology 1AN713 Controller area Network (CAN) BasicsINTRODUCTIONC ontroller area Network (CAN) was initially created byGerman automotive system supplier Robert Bosch inthe mid-1980s for automotive applications as a methodfor enabling robust serial communication. The goal wasto make automobiles more reliable, safe and fuel-effi-cient while decreasing wiring harness weight and com-plexity. Since its inception, the CAN protocol has gainedwidespread popularity in industrial automation andautomotive/truck applications. Other markets wherenetworked solutions can bring attractive benefits likemedical equipment, test equipment and mobilemachines are also starting to utilize the benefits of goal of this application note is to explain some ofthe Basics of CAN and show the benefits of choosingCAN for embedded systems networked OVERVIEWMost Network applications follow a layered approach tosystem implementation.

dards Organization and Society of Automotive Engi-neers (SAE) have defined some protocols based on CAN that include the Media Dependant Interface defini-tion such that all of the lower two layers are specified. ISO11898 is a standard for high-speed applications, ISO11519 is a standard for low-speed applications, and

Tags:

  Controller, Network, Basics, Area, Society, Automotive, Controller area network, Society of automotive

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Advertisement

Transcription of Controller Area Network (CAN) Basics

1 1999 Microchip Technology 1AN713 Controller area Network (CAN) BasicsINTRODUCTIONC ontroller area Network (CAN) was initially created byGerman automotive system supplier Robert Bosch inthe mid-1980s for automotive applications as a methodfor enabling robust serial communication. The goal wasto make automobiles more reliable, safe and fuel-effi-cient while decreasing wiring harness weight and com-plexity. Since its inception, the CAN protocol has gainedwidespread popularity in industrial automation andautomotive/truck applications. Other markets wherenetworked solutions can bring attractive benefits likemedical equipment, test equipment and mobilemachines are also starting to utilize the benefits of goal of this application note is to explain some ofthe Basics of CAN and show the benefits of choosingCAN for embedded systems networked OVERVIEWMost Network applications follow a layered approach tosystem implementation.

2 This systematic approachenables interoperability between products from differ-ent manufacturers. A standard was created by theInternational Standards Organization (ISO) as a tem-plate to follow for this layered approach. It is called theISO Open Systems Interconnection (OSI) NetworkLayering Reference Model and is shown in Figure 1 CAN protocol itself implements most of the lowertwo layers of this reference model. The communicationmedium portion of the model was purposely left out ofthe Bosch CAN specification to enable system design-ers to adapt and optimize the communication protocolon multiple media for maximum flexibility (twisted pair,single wire, optically isolated, RF, IR, etc.)

3 With thisflexibility, however, comes the possibility of interopera-bility concerns. To ease some of these concerns, the International Stan-dards Organization and society of automotive Engi-neers (SAE) have defined some protocols based onCAN that include the Media Dependant Interface defini-tion such that all of the lower two layers are specified. ISO11898 is a standard for high-speed applications,ISO11519 is a standard for low-speed applications, andJ1939 (from SAE) is targeted for truck and bus applica-tions. All three of these protocols specify a 5V differen-tial electrical bus as the physical rest of the layers of the ISO/OSI protocol stack are leftto be implemented by the system software Layer Protocols (HLPs) are generally used to imple-ment the upper five layers of the OSI Reference Model.

4 HLPs are used to:1) standardize startup procedures including bit ratesused, 2) distribute addresses among participating nodesor types of messages, 3) determine the structure of the messages, and 4) provide system-level error handling routines. This is by no means a full list of the functions HLPs perform,however it does describe some of their basic PROTOCOL BASICSC arrier Sense Multiple Access with Collision Detection (CSMA/CD)The CAN communication protocol is a CSMA/CD proto-col. The CSMA stands for Carrier Sense MultipleAccess. What this means is that every node on the net-work must monitor the bus for a period of no activitybefore trying to send a message on the bus (CarrierSense).

5 Also, once this period of no activity occurs, everynode on the bus has an equal opportunity to transmit amessage (Multiple Access). The CD stands for CollisionDetection. If two nodes on the Network start transmittingat the same time, the nodes will detect the collision andtake the appropriate action. In CAN protocol, a non-destructive bitwise arbitration method is utilized. Thismeans that messages remain intact after arbitration iscompleted even if collisions are detected. All of this arbi-tration takes place without corruption or delay of thehigher priority are a couple of things that are required to sup-port non-destructive bitwise arbitration.

6 First, logicstates need to be defined as dominant or , the transmitting node must monitor the state ofthe bus to see if the logic state it is trying to send actu-ally appears on the bus. CAN defines a logic bit 0 as adominant bit and a logic bit 1 as a recessive bit. Author:Keith Pazul Microchip Technology 2 Preliminary 1999 Microchip Technology dominant bit state will always win arbitration over arecessive bit state, therefore the lower the value in theMessage Identifier (the field used in the message arbitra-tion process), the higher the priority of the message. As anexample, suppose two nodes are trying to transmit a mes-sage at the same time.

7 Each node will monitor the bus tomake sure the bit that it is trying to send actually appearson the bus. The lower priority message will at some pointtry to send a recessive bit and the monitored state on thebus will be a dominant. At that point this node loses arbi-tration and immediately stops transmitting. The higher pri-ority message will continue until completion and the nodethat lost arbitration will wait for the next period of no activityon the bus and try to transmit its message CommunicationCAN protocol is a message-based protocol, not anaddress based protocol. This means that messages arenot transmitted from one node to another node based onaddresses.

8 Embedded in the CAN message itself is thepriority and the contents of the data being transmitted. Allnodes in the system receive every message transmittedon the bus (and will acknowledge if the message was prop-erly received). It is up to each node in the system to decidewhether the message received should be immediately dis-carded or kept to be processed. A single message can bedestined for one particular node to receive, or many nodesbased on the way the Network and system are designed. For example, an automotive airbag sensor can be con-nected via CAN to a safety system router node router node takes in other safety system informa-tion and routes it to all other nodes on the safety systemnetwork.

9 Then all the other nodes on the safety systemnetwork can receive the latest airbag sensor informa-tion from the router at the same time, acknowledge ifthe message was received properly, and decidewhether to utilize this information or discard useful feature built into the CAN protocol is theability for a node to request information from othernodes. This is called a Remote Transmit Request(RTR). This is different from the example in the previ-ous paragraph because instead of waiting for informa-tion to be sent by a particular node, this nodespecifically requests data to be sent to it. For example, a safety system in a car gets frequentupdates from critical sensors like the airbags, but it maynot receive frequent updates from other sensors like theoil pressure sensor or the low battery sensor to makesure they are functioning properly.

10 Periodically, the safetysystem can request data from these other sensors andperform a thorough safety system check. The systemdesigner can utilize this feature to minimize Network traf-fic while still maintaining the integrity of the additional benefit of this message-based protocolis that additional nodes can be added to the systemwithout the necessity to reprogram all other nodes torecognize this addition. This new node will start receiv-ing messages from the Network and, based on themessage ID, decide whether to process or discard thereceived Message Frame DescriptionCAN protocol defines four different types of messages(or Frames). The first and most common type of frameis a Data Frame.


Related search queries