<meta content=en-us http-equiv=Content-Language><meta content="Microsoft FrontPage 5.0"name=GENERATOR><meta contents="can, control area network, tutorial, networking, communication, bit""keywords"><meta content="Totorial on CAN -Control Area Network`"name=DESCRIPTION><meta content=FrontPage.Editor.Document name=ProgId><meta content="text/html; charset=utf-8"http-equiv=Content-Type><title>
   Control Area Network (CAN) Tutorial - ElectroSofts.com
  </title><style></style><style fprolloverstyle>A:hover {color: red; font-weight: bold}</style><meta content="tb, default"name="Microsoft Border"><body link=#000000 vlink=#000000><table border=0 cellpadding=0 cellspacing=0 width=100%><tbody><tr><td><div align=center><center> <table style="border-collapse: collapse"border=0 bordercolor=#111111 cellpadding=0 cellspacing=0 height=5 id=AutoNumber1 width=770><tbody><tr><td style="border: 1px solid #FFE1E1"height=11 width=78><p align=center><b> <font face=Arial size=2> <a href=../index.html> HOME </a> </font> </b></p><td bgcolor=#000000 colspan=2 height=21 rowspan=2 width=236> <td style="border: 1px solid #FFE1E1"align=center height=11 width=146><b> <font face=Arial size=2>   <a href=http://electrosofts.com/webdir> Electronics Directory </a> </font> </b><td style="border: 1px solid #FFE1E1"align=center height=11 width=146><b> <font face=Arial size=2> <a href=http://electrosofts.com/articles.html> Articles/ Tutorials </a> </font> </b><td style="border: 1px solid #FFE1E1"align=center height=11 width=159><b> <font face=Arial size=2> <a href=http://electrosofts.com/ebooks> eBooks </a> </font> </b><tr><td style="border: 1px solid #FFE1E1"height=10 width=78><p align=center><b> <font face=Arial size=2> <a href=../about.html> About Us </a> </font> </b></p><td style="border: 1px solid #FFE1E1"align=center height=10 width=146><b> <font face=Arial size=2> <a href=http://electrosofts.com/forum> FORUM </a> </font> </b><td style="border: 1px solid #FFE1E1"align=center height=10 width=146><b> <font face=Arial size=2> <a href=http://electrosofts.com/links> Links </a> </font> </b><td style="border: 1px solid #FFE1E1"align=center height=10 width=159><b> <font face=Arial size=2> <a href=http://electrosofts.com/feedback.html> Contact Us </a> </font> </b><tr><td bgcolor=#D90000 bordercolor=#FF0000 height=1 width=80> <td bgcolor=#000000 bordercolor=#FF0000 colspan=2 height=1 width=236><a href=http://electrosofts.com> <img border=0 height=32 src=../images/electrosofts.jpg width=232> </a><td bgcolor=#D90000 bordercolor=#FF0000 colspan=3 height=1 width=454> <tr><td bordercolor=#FF0000 height=1 width=80><td bgcolor=#000000 bordercolor=#FF0000 height=1 width=174><p align=left><img border=0 height=27 src=../images/shadebwl.jpg width=27></p><td bgcolor=#000000 bordercolor=#FF0000 height=1 width=62><img align=right border=0 height=27 hspace=0 src=../images/shadebwr.jpg width=27><td bordercolor=#FF0000 colspan=3 height=1 width=454></table> </center></div></table><table border=0 cellpadding=0 cellspacing=0 dir=ltr width=100%><tbody><tr><td valign=top><div align=center><center> <table style="border-collapse: collapse"border=1 bordercolor=#FFE1E1 cellpadding=4 cellspacing=0 width=770><tbody><tr><td width=918><div align=center><center> <table style="border-collapse: collapse"border=1 bordercolor=#FFFFFF cellpadding=4 cellspacing=0 height=335 width=755><tbody><tr><td style="border: 1px solid #FF0000"bgcolor=#FFE1E1 bordercolor=#FF0000 colspan=2 height=64 width=753><font face=Arial>                                                  <b> <font size=5> An Inroduction to CAN </font> </b> </font> <p align=right><font face=Arial size=2> By  <b> <a href=http://electrosofts.com/sudhish> Sudhish Kumar </a> </b> </font></p><tr><td height=270 width=313><script><!--
google_ad_client = "pub-1403170442550738";
google_ad_width = 336;
google_ad_height = 280;
google_ad_format = "336x280_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "FFE1E1";
google_color_bg = "FFFFFF";
google_color_link = "000000";
google_color_url = "000000";
google_color_text = "000000";
//--></script> <script src=http://pagead2.googlesyndication.com/pagead/show_ads.js></script>  <td style="word-spacing: 0; margin-left: 18; margin-right: 18; margin-top: 5"height=270 width=439><h1><font face=Arial size=4>   <u> Control Area network </u>   </font></h1> <p class=MsoNormal><font face=Arial>                  This tutorial will give the brief idea about CAN bus protocol, its functionality and different features of it. This tutorial is divided into mainly five sections as listed below. </font></p> <p style="text-indent: -.25in; margin-left: 1.0in"class=MsoNormal><font face=Arial> 1. </font> <span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Arial">       </span> <font face=Arial> Introduction to CAN    </font></p> <p style="text-indent: -.25in; margin-left: 1.0in"class=MsoNormal><font face=Arial> 2. </font> <span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Arial">       </span> <font face=Arial> CAN layers </font></p> <p style="text-indent: -.25in; margin-left: 1.0in"class=MsoNormal><font face=Arial> 3. </font> <span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Arial">       </span> <font face=Arial> CAN Properties </font></p> <p style="text-indent: -.25in; margin-left: 1.0in"class=MsoNormal><font face=Arial> 4. </font> <span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Arial">       </span> <font face=Arial> Types of CAN </font></p> <p style="text-indent: -.25in; margin-left: 1.0in"class=MsoNormal><font face=Arial> 5. </font> <span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Arial">       </span> <font face=Arial> CAN messages  </font></p></table> </center></div> <h1><font face=Arial>      </font></h1> <h1><font face=Arial> <span style=font-size:12.0pt>             Introduction to CAN: - </span> </font></h1> <p style="text-indent: .5in; text-autospace: none"class=MsoNormal><font face=Arial>             The Controller Area Network (CAN) is a serial communications protocol. CAN is widely used in automotive electronics for engine control, sensors etc.   </font></p> <h3><font face=Arial> Layers of CAN: - </font></h3> <p style="text-indent: .5in; text-autospace: none"class=MsoNormal><font face=Arial> <b>             </b> The CAN functionality is divided into two layers. </font></p> <p style="text-indent: -.25in; text-autospace: none; margin-left: 1.75in"class=MsoNormal><font face=Arial> 1) </font> <span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Arial">       </span> <font face=Arial> Data link layer. </font></p> <p style="text-indent: -.25in; text-autospace: none; margin-left: 1.75in"class=MsoNormal><font face=Arial> 2) </font> <span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Arial">       </span> <font face=Arial> Physical layer. </font></p> <p style="text-autospace: none"class=MsoNormal><font face=Arial>                         Data link layer: - </font></p> <p style="text-autospace: none"class=MsoNormal><font face=Arial>                                     Data link layer is subdivided into two layers </font></p> <p style="text-indent: -.25in; text-autospace: none; margin-left: 1.75in"class=MsoNormal><font face=Arial> 1) </font> <span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Arial">       </span> <font face=Arial> Logical link layer: - </font></p> <p style="text-autospace: none; margin-left: 1.5in"class=MsoNormal><font face=Arial>             Accept the messages by filtering process, overload notification and recovery management tasks will be taken care by this layer. </font></p> <p style="text-indent: -.25in; text-autospace: none; margin-left: 1.75in"class=MsoNormal><font face=Arial> 2) </font> <span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Arial">       </span> <font face=Arial> MAC (medium access control) layer: - </font></p> <p style="text-autospace: none; margin-left: 2.0in"class=MsoNormal><font face=Arial> This layer will do the data encapsulation; frame coding, media access management, error detection and signaling and acknowledgment tasks. </font></p> <p style="text-autospace: none"class=MsoNormal><font face=Arial>                         Physical layer: - </font></p> <p style="text-autospace: none; margin-left: 1.5in"class=MsoNormal><font face=Arial> This layer deals with the bit encoding and de coding, bit timing, synchronization processes.  </font></p> <h3><font face=Arial> CAN properties: - </font></h3> <ul><li><p style="text-indent: 4; text-autospace: none; margin-bottom: 8"align=justify class=MsoHeader><font face=Arial> Multicast reception with time synchronization: Simultaneously multiple nodes can receive the frame. </font></p><li><p style="text-indent: 4; text-autospace: none; margin-bottom: 8"align=justify class=MsoHeader><font face=Arial> Multimaster: When the bus is free any unit may start to transmit a message. The unit with the message of higher priority to be transmitted gains bus access. </font></p><li><p style="text-indent: 4; text-autospace: none; margin-bottom: 8"align=justify class=MsoHeader><font face=Arial> Prioritization of messages: Depending on the importance of messages the priorities will be given to the different messages. </font></p><li><p style="text-indent: 4; text-autospace: none; margin-bottom: 8"align=justify class=MsoHeader><font face=Arial> Arbitration: Whenever the bus is free, any unit may start to transmit a message. If 2 or more units start transmitting messages simultaneously, which unit gets the bus access that will be depend on bitwise arbitration using the identifier. The mechanism of arbitration guarantees that neither information nor time is lost. </font></p><li><p style="text-indent: 4; text-autospace: none; margin-bottom: 8"align=justify class=MsoHeader><font face=Arial> System wide data consistency. </font></p><li><p style="text-indent: 4; text-autospace: none; margin-bottom: 8"align=justify class=MsoHeader><font face=Arial> Message Routing: An identifier names the content of a message. The identifier does not indicate the destination of the message, but describes the meaning of the data, so that all nodes in the network are able to decide by message filtering whether the data is to be acted upon by them or not. </font></p><li><p style="text-indent: 4; text-autospace: none; margin-bottom: 8"align=justify class=MsoHeader><font face=Arial> Eemote Data Request: By sending a remote frame a node requiring data may request another node to send the corresponding data frame. The same identifier names the data frame and the corresponding remote frame </font> <span style="font-family: Arial"> . </span></p><li><p style="text-indent: 4; text-autospace: none; margin-bottom: 8"align=justify class=MsoHeader><font face=Arial> Error detection and signaling. </font> <span style="font-family: Arial"> </span></p><li><p style="text-indent: 4; text-autospace: none; margin-bottom: 8"align=justify class=MsoHeader><font face=Arial> Automatic retransmission of corrupted messages as soon as the bus is idle again. </font></p><li><p style="text-indent: 4; text-autospace: none; margin-bottom: 8"align=justify class=MsoHeader><font face=Arial> There is a distinction between temporary errors and permanent failures of nodes and autonomous switching off of defect nodes. </font></p><li><p style="text-indent: 4; text-autospace: none; margin-bottom: 8"align=justify class=MsoHeader><font face=Arial> Configuration flexibility: Any number of nodes can be added to or removed from the system without doing any modification in software or hardware parts. </font></p><li><p style="text-indent: 4; text-autospace: none; margin-bottom: 8"align=justify class=MsoHeader><font face=Arial> Bit rate: The speed of CAN message transfer may be different in different systems. But for a given system </font> <span style="font-size: 10.0pt; font-family: Arial"> </span> <font face=Arial> the bitrate is uniform and fixed </font> <span style="font-family: Arial"> . </span></p><li><p style="text-indent: 4; text-autospace: none; margin-bottom: 8"align=justify class=MsoHeader><font face=Arial> Single Channel: The bus consists of a single channel that carries bits. The way in which this channel is implemented is not fixed. </font></p><li><p style="text-autospace: none; text-indent: 4; margin-bottom: 8"align=justify class=MsoHeader><font face=Arial> E.g. single wire, two differential wires, optical fibres, etc. </font></p><li><p style="text-indent: 4; text-autospace: none; margin-bottom: 8"align=justify class=MsoHeader><font face=Arial> Bus values: The bus can have one of two complementary logical values: dominant (0) or recessive (1). During simultaneous transmission of dominant and recessive bits, the resulting bus value will be dominant. </font></p><li><p style="text-indent: 4; text-autospace: none; margin-bottom: 8"align=justify class=MsoHeader><font face=Arial> Acknowledgment: All receivers check the consistency of the message being received and will acknowledge the transmitter by sending dominant bit in acknowledgement field in case of proper message reception </font></p><li><p style="text-indent: 4; text-autospace: none; margin-bottom: 8"align=justify class=MsoHeader><font face=Arial> Sleep/Wakeup mode: To reduce the power consumption CAN-device may be set into sleep mode without any internal activity and with disconnected bus drivers. </font></p><li><p style="text-indent: 4; text-autospace: none; margin-bottom: 8"align=justify class=MsoHeader><font face=Arial> Interframe spacing data frames and remote frames are separated from preceding frames by interframe spacing field. </font></p></ul> <p style="text-autospace: none"align=justify class=MsoHeader><font face=Arial>   </font></p> <p style="text-indent: .5in; text-autospace: none"class=MsoHeader><font face=Arial> <b> Different Types of CAN: - </b> </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> There are two types of CAN implementations depending in the size of the identifier field.    </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> 1) STANDARD: 11-bit wide identifier field. </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> 2) EXTENDED: 29-bit wide identifier field. </font></p> <p style="text-autospace: none; margin-left: .5in"class=MsoHeader><font face=Arial>             </font></p> <p style="text-autospace: none; margin-left: .5in"class=MsoHeader><font face=Arial> <b> CAN message types: - </b> </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> <b> 1. Data frame </b> : - </font></p> <p style="text-autospace: none; margin-left: .5in"class=MsoNormal><span style="font-family: Arial">             </span> <font face=Arial> Description </font> <span style="font-family: Arial"> : - </span> <font face=Arial> Carries data from a transmitter to the receivers </font> <span style="font-family: Arial"> . </span></p> <p style="text-autospace: none; margin-left: 1.0in"class=MsoNormal><font face=Arial> Fields: - </font> <span style="font-size: 10.0pt; font-family: Arial"> Start of Frame, Arbitration Field, Control Field, Data Field, CRC Field, ACK Field, End of Frame. </span></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> <b> Format: - </b> </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial>   </font></p> <p style="text-autospace: none"class=MsoNormal><font face=Arial>                                                                                       </font></p> <table style="border-collapse: collapse; border: medium none; margin-left: 23.4pt"bgcolor=#FFE1E1 border=1 bordercolor=#D90000 cellpadding=0 cellspacing=0 class=MsoNormalTable height=69 width=739><tbody><tr style="height: 32.1pt"><td style="width: 48; height: 24; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF><b> <font face=Arial> Bits:     </font> </b><td style="width: 41; height: 24; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF><b> <font face=Arial> 1 </font> </b><td style="width: 96; height: 24; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF><b> <font face=Arial> 12/32 </font> </b><td style="width: 94; height: 24; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF><b> <font face=Arial>  6   </font> </b><td style="width: 70; height: 24; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF><b> <font face=Arial>  0-64      </font> </b><td style="width: 63; height: 24; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF><b> <font face=Arial>  16    </font> </b><td style="width: 74; height: 24; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF><b> <font face=Arial>  2   </font> </b><td style="width: 34; height: 24; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF><b> <font face=Arial> 7  </font> </b><td style="width: 83; height: 24; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF> <tr style="height: 32.1pt"><td style="width: 48; height: 42; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF> <td style="width: 41; height: 42; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFE1E1><p style="text-autospace: none"class=MsoNormal><b> <font face=Arial>  SOF </font> </b></p><td style="width: 96; height: 42; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFE1E1><p style="text-autospace: none"class=MsoNormal><b> <font face=Arial> Arbitration Field  </font> </b></p><td style="width: 94; height: 42; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFE1E1><p style="text-autospace: none"class=MsoNormal><b> <font face=Arial> Control field </font> </b></p><td style="width: 70; height: 42; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFE1E1><p style="text-autospace: none"class=MsoNormal><b> <font face=Arial> Data field </font> </b></p><td style="width: 63; height: 42; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFE1E1><p style="text-autospace: none"class=MsoNormal><b> <font face=Arial> CRC field </font> </b></p><td style="width: 74; height: 42; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFE1E1><p style="text-autospace: none"class=MsoNormal><b> <font face=Arial> ACK field </font> </b></p><td style="width: 34; height: 42; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFE1E1><p style="text-autospace: none"class=MsoNormal><b> <font face=Arial> EOF </font> </b></p><td style="width: 83; height: 42; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFE1E1><p class=MsoNormal><b> <font face=Arial> Interframe space </font> </b></p></table> <p style="text-autospace: none"class=MsoNormal><font face=Arial>   </font></p> <p style="text-autospace: none; margin-left: 1.0in"class=MsoNormal><font face=Arial> <b> SOF: </b> Start of frame bit. It is the indication of start of frame when a dominant bit is detected after the bus idle condition. </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> <b> Arbitration: </b> The arbitration field is depending on the type of frame.                  </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial>   </font></p> <p><img border=0 height=239 src=standard.gif width=747></p> <p style="text-autospace: none"class=MsoNormal><font face=Arial> <b>             <img border=0 height=218 src=extended.gif width=699> </b> </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: 1.0in"class=MsoNormal><font face=Arial> This field contains: </font></p> <p style="text-autospace: none; margin-left: 1.5in"class=MsoNormal><font face=Arial> <b> Identifier field: </b> contains informations about message. In case of standard frame the length of this field is 11 bits and in case of extended 18 more bits are added to it .So in case of extended frame total size of identifier field it is 29 bits. </font></p> <p style="text-autospace: none; margin-left: 1.5in"class=MsoNormal><font face=Arial> <b> SRR: </b> one bit wide. Used in case of extended frame. SRR bit will be recessive and in case standard frame this bit replaces the RTR bit. . </font></p> <p style="text-autospace: none; margin-left: 1.5in"class=MsoNormal><font face=Arial> <b> RTR: </b> one bit wide. Indicates that incoming frame is a data frame or a remote frame depending on the value of this bit. If its a dominant bit implies incoming bit stream is of data frame else if recessive then remote frame. </font></p> <p style="text-autospace: none; margin-left: 1.5in"class=MsoNormal><font face=Arial> <b> IDE: </b> one bit wide. Indicates that the incoming frame is of standard format if dominant bit is received in this field or else extended one (if recessive). </font></p> <p style="text-autospace: none; margin-left: 1.5in"class=MsoNormal><font face=Arial> <b> Control field: </b> six bit wide. Two bits r0 and r1 are reserved. In standard frame r1 is replaced by IDE bit. And remaining 4 bits called as data length control (DLC) describes total length of data field. </font></p> <p style="text-autospace: none; margin-left: 1.5in"class=MsoNormal><font face=Arial> <b> Data field: </b> contains the actual information within the limit of {08} bytes. </font></p> <p style="text-autospace: none; margin-left: 1.5in"class=MsoNormal><font face=Arial> <b> CRC field: </b> 16 bit wide. Divided into two parts: </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: 1.0in"class=MsoNormal><font face=Arial> CRC sequence: 15 bit length. Calculated over SOF to data field. </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: 1.0in"class=MsoNormal><font face=Arial> CRC delimiter: 1 bit recessive bit. </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: 1.0in"class=MsoNormal><font face=Arial> <b> ACK field: </b> 2 bit wide and contain two fields ACK flag and ACK     delimiter. </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: 1.0in"class=MsoNormal><font face=Arial> ACK flag: being successful reception of frame the receiver will   indicate the transmitter by putting a dominant bit in this place. Otherwise recessive. <b>   </b> </font></p> <p style="text-autospace: none; margin-left: 111.0pt"class=MsoNormal><font face=Arial> ACK delimiter: A recessive bit. </font></p> <p style="text-autospace: none; margin-left: 111.0pt"class=MsoNormal><font face=Arial> <b> END OF FRAME: </b> 7 bit wide. Consists of 7 recessive bits. <b> </b> </font></p> <p style="text-indent: -69.0pt; text-autospace: none; margin-left: 2.5in"class=MsoNormal><font face=Arial> <b> Interframe space </b> : 3 bit wide <b> . </b> Two continuous frames are separated by interframe space. Normal interfame bit values should be recessive. In case of other values the next state will be predicted depending on the bit position. Detailed discussion of this will be done in later part of this tutorial. </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> <b>   </b> </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> <b> 2. Remote frame </b> : - </font></p> <p style="text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> <b>             </b> Description: - Transmitted by a bus unit to request the transmission of the data frame with the same identifier </font> <span style="font-family: Arial"> . </span></p> <p style="text-autospace: none; margin-left: .5in"class=MsoNormal><span style="font-family: Arial">             </span> <font face=Arial> Fields: - </font> <span style="font-size: 10.0pt; font-family: Arial"> Start of Frame, Arbitration Field, Control Field, CRC Field, ACK Field, End of Frame. </span></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> Format: - </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial>   </font></p> <p style="text-autospace: none"class=MsoNormal><font face=Arial>    </font></p> <table style="border-collapse: collapse; border: medium none; margin-left: 41.3pt"bgcolor=#FFE1E1 border=1 bordercolor=#D90000 cellpadding=0 cellspacing=0 class=MsoNormalTable height=32><tbody><tr><td style="width: 57.95pt; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF height=30 valign=top width=77><b> <font face=Arial> Bits:  </font> </b><td style="width: 57.95pt; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF height=30 valign=top width=77><p style="text-autospace: none"class=MsoNormal><b> <font face=Arial> 1  </font> </b></p><td style="width: 64.55pt; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF height=30 valign=top width=86><b> <font face=Arial>   11/29    </font> </b><td style="width: 61.0pt; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF height=30 valign=top width=81><b> <font face=Arial> 6  </font> </b><td style="width: 58.4pt; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF height=30 valign=top width=78><b> <font face=Arial> 16  </font> </b><td style="width: 58.65pt; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF height=30 valign=top width=78><b> <font face=Arial> 2         </font> </b><td style="width: 58.1pt; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF height=30 valign=top width=77><b> <font face=Arial>            7   </font> </b><tr><td style="width: 57.95pt; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF height=44 valign=top width=77> <td style="width: 57.95pt; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center height=44 valign=top width=77><p style="text-autospace: none"class=MsoNormal><b> <font face=Arial>    SOF </font> </b></p><td style="width: 64.55pt; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center height=44 valign=top width=86><p style="text-autospace: none"class=MsoNormal><b> <font face=Arial> Arbitration field </font> </b></p><td style="width: 61.0pt; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center height=44 valign=top width=81><p style="text-autospace: none"class=MsoNormal><b> <font face=Arial> Control    field </font> </b></p><td style="width: 58.4pt; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center height=44 valign=top width=78><p style="text-autospace: none"class=MsoNormal><b> <font face=Arial> CRC field </font> </b></p><td style="width: 58.65pt; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center height=44 valign=top width=78><p style="text-autospace: none"class=MsoNormal><b> <font face=Arial> ACK field </font> </b></p><td style="width: 58.1pt; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center height=44 valign=top width=77><p style="text-autospace: none"class=MsoNormal><b> <font face=Arial>    EOF </font> </b></p></table> <p style="text-autospace: none"class=MsoNormal><font face=Arial> <b>                         </b> </font></p> <p style="text-autospace: none"class=MsoNormal><font face=Arial> <b>                         </b> Remote frame is similar to data frame except that it will not contain data field. And RTR bit is used to indicate the remote frame. </font></p> <p style="text-autospace: none"class=MsoNormal><font face=Arial> <b>   </b> </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> <b>   </b> </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> <b> 3. Error frame: - </b> </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> Description: - Any unit on detecting a error transmits an error frame. </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> Fields: - Error flag and Error delimiter. </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> Format: - </font></p> <p style="text-autospace: none"class=MsoNormal><font face=Arial>                       </font></p> <table style="border-collapse: collapse; border: medium none; margin-left: 46.55pt"bgcolor=#FFE1E1 border=1 bordercolor=#D90000 cellpadding=0 cellspacing=0 class=MsoNormalTable height=70 width=626><tbody><tr style="height: 13.75pt"><td style="width: 79; border: 1.0pt solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"bgcolor=#FFFFFF height=30 valign=top><p style="text-autospace: none"class=MsoNormal><b> <font face=Arial> Bits:              </font> </b></p><td style="width: 269; border: 1.0pt solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF height=30 valign=top><b> <font face=Arial>     6 </font> </b><td style="width: 232; border: 1.0pt solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF height=30 valign=top><p style="text-autospace: none"class=MsoNormal><b> <font face=Arial>               8 </font> </b></p><tr style="height: 13.75pt"><td style="width: 79; border: 1.0pt solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"bgcolor=#FFFFFF height=37 valign=top> <td style="width: 269; border: 1.0pt solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center height=37 valign=top><b> <font face=Arial>  Error flag </font> </b><td style="width: 232; border: 1.0pt solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center height=37 valign=top><b> <font face=Arial>     Error delimiter </font> </b></table> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial>   </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"align=justify class=MsoNormal><font face=Arial> As shown in above figure there will be two fields in error frame, error flag and error delimiter. </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"align=justify class=MsoNormal><font face=Arial> There are two types of error frames are there in CAN </font></p> <p style="text-indent: -.25in; text-autospace: none; margin-left: 1.75in"align=justify class=MsoNormal><font face=Arial> 1) </font> <span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Arial">       </span> <font face=Arial> Active error frame: Error flag -6 dominant bits. </font></p> <p style="text-indent: -.25in; text-autospace: none; margin-left: 1.75in"align=justify class=MsoNormal><font face=Arial> 2) </font> <span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7.0pt; font-family: Arial">       </span> <font face=Arial> Passive error frame. Error flag -6 recessive bits. </font></p> <p style="text-autospace: none; margin-left: 1.0in"align=justify class=MsoNormal><font face=Arial> And in both the cases all the bits of error delimiter will be all recessive. Depending on the node internal error count register condition the respective type of error frame will be transmitted. </font></p> <p style="text-autospace: none; margin-left: 1.0in"align=justify class=MsoNormal><font face=Arial> <b> Types of error: </b> There are five types of error are there in CAN and are listed below. And in case any one of these error is observed the error frame is transmitted. </font></p> <p style="text-autospace: none; margin-left: 1.0in"align=justify class=MsoNormal><font face=Arial>             <b> Bit error </b> : During transmission the node transmits the bit at transmit time region and receives the bit at receive time and two bits are compared if they are not equal then that is considered as bit error. </font></p> <p style="text-autospace: none; margin-left: 1.0in"align=justify class=MsoNormal><font face=Arial> <b>             Stuff error: </b> In a frame if continuous 5 recessive or dominant bits are transmitted, the sixth bit should be of opposite to that. While receiving if continuous 5 recessive or dominant bits are received then the next incoming bit is of same value that of previous then it will be considered as stuff error. </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: 1.0in"align=justify class=MsoNormal><font face=Arial> <b> CRC error </b> : While receiving data or remote frame the CRC value will be calculated and is compared with the received CRC values. In case of proper frame transmission both will be equal. Else that will be considered as CRC error and error frame will be transmitted. </font></p> <p style="text-autospace: none; margin-left: 1.0in"align=justify class=MsoNormal><font face=Arial> <b>             Form error: </b> Form error will be related to the error in forming the frame. For e.g. delimiter (CRC, ACK) missing or improper end of frame, these conditions are taken as form error and immediately error frame is transmitted.  </font></p> <p style="text-indent: -.5in; text-autospace: none; margin-left: 1.5in"align=justify class=MsoNormal><font face=Arial> <b>             Acknowledgement error: </b> During the transmission of data <b> </b> or remote frame, in the ACK flag field the transmitter will put recessive bit and expect dominant bit from receive pin. If dominant bit is observed then that is considered as proper transmission. In other case it is acknowledgement error. The error frame is transmitted if acknowledgment error is observed. </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> <b>   </b> </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> <b>             </b> Depending on node state the active error frame or passive error frame is transmitted. The error frame is transmitted immediately if error found is of type other than CRC error. And in case of CRC error the error frame will be transmitted immediate next bit of ACK delimiter. </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> <b>   </b> </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> <b> 4. Overload frame: - </b> </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> Description: - Detection of any one of overload condition make node to transmit overload frame. </font></p> <p style="text-indent: .5in; text-autospace: none; margin-left: .5in"class=MsoNormal><font face=Arial> Fields: - Overload flag and Overload delimiter. </font></p> <p style="text-autospace: none; margin-left: 1.0in"class=MsoNormal><font face=Arial> Format: - </font></p> <table style="border-collapse: collapse; border: medium none; margin-left: 46.55pt"bgcolor=#FFE1E1 border=1 bordercolor=#D90000 cellpadding=0 cellspacing=0 class=MsoNormalTable height=66 width=626><tbody><tr style="height: 13.75pt"><td style="width: 79; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"bgcolor=#FFFFFF height=32 valign=top><p style="text-autospace: none"class=MsoNormal><b> <font face=Arial> Bits:              </font> </b></p><td style="width: 269; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF height=32 valign=top><b> <font face=Arial>     6 </font> </b><td style="width: 232; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center bgcolor=#FFFFFF height=32 valign=top><p style="text-autospace: none"class=MsoNormal><b> <font face=Arial>               8 </font> </b></p><tr style="height: 13.75pt"><td style="width: 79; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"bgcolor=#FFFFFF height=31 valign=top> <td style="width: 269; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center height=31 valign=top><b> <font face=Arial> Overload flag </font> </b><td style="width: 232; border: 1px solid #D90000; padding-left: 5.4pt; padding-right: 5.4pt; padding-top: 0in; padding-bottom: 0in"align=center height=31 valign=top><b> <font face=Arial>     Overload delimiter </font> </b></table> <p style="text-autospace: none"class=MsoNormal><font face=Arial>                           As shown in above figure there will be two fields in overload frame, overload flag and overload delimiter. </font></p></table> <script><!--
google_ad_client = "pub-1403170442550738";
google_alternate_color = "CC0000";
google_ad_width = 728;
google_ad_height = 15;
google_ad_format = "728x15_0ads_al";
google_ad_channel ="4645973219";
google_color_border = "FFE1E1";
google_color_bg = "FFFFFF";
google_color_link = "CC0000";
google_color_url = "000000";
google_color_text = "000000";
//--></script> <script src=http://pagead2.googlesyndication.com/pagead/show_ads.js></script> <form action=http://www.google.com/custom target=_top><p> <p>(You can contact author through email: sudhish@electrosofts.com )<table bgcolor=#ffffff border=0><tbody><tr><td align=left height=32 nowrap=nowrap valign=top><font face=Arial> <a href=http://www.google.com/> <img align=middle alt=Google border=0 height=32 src=http://www.google.com/logos/Logo_25wht.gif width=75> </a> </font><td nowrap=nowrap><font face=Arial> <input name=domains type=hidden value=electroSofts.com> </font> <font face=Arial> <input maxlength=255 name=q size=31> <input name=sa type=submit value=Search> </font><tr><td> <td nowrap=nowrap><table><tbody><tr><td><font face=Arial> <input checked name=sitesearch type=radio> <font color=#000000 size=-1> Web </font> </font><td><font face=Arial> <input name=sitesearch type=radio value=electroSofts.com> <font color=#000000 size=-1> electroSofts.com </font> </font></table> <font face=Arial> <input name=client type=hidden value=pub-1403170442550738> <input name=forid type=hidden value=1> <input name=ie type=hidden value=ISO-8859-1> <input name=oe type=hidden value=ISO-8859-1> <input name=cof type=hidden value=GALT:#008000;GL:1;DIV:#FF3366;VLC:663399;AH:center;BGC:F3DDFF;LBGC:FFFFFF;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;LH:90;LW:600;L:http://electrosofts.com/images/electrsofts.jpg;S:http://electrosofts.com;FORID:1;> <input name=hl type=hidden value=en> </font></table></form>  </center></div> </table><table border=0 cellpadding=0 cellspacing=0 width=100%><tbody><tr><td><font face="Lucida Sans Unicode"> <p align=center><font color=#606060 face=Verdana size=1> <a href=http://electrosofts.com/> Home </a>    |    <a href=http://electrosofts.com/about.html> About Us </a>    |   <a href=http://electrosofts.com/articles.html> Articles/ Tutorials </a>    |   <a href=http://electrosofts.com/downloads/index.html> Downloads </a>    |   <a href=http://electrosofts.com/feedback.html> Feedback </a>    |   <a href=http://electrosofts.com/links/index.html> Links </a>    |   <a href=http://electrosofts.com/ebooks/index.html> eBooks </a>    |   <a href=../privacy.html> Privacy Policy </a> <br> Copyright © 2005-2007 electroSofts.com. <br> <a href=mailto:webmaster@electroSofts.com> webmaster@electroSofts.com </a> </font></p> </font></table>