dsPIC30F Family Reference Manual
DS70070B-page 23-30 © 2004 Microchip Technology Inc.
23.4.1 CAN Message Formats
The CAN protocol engine handles all functions for receiving and transmitting messages on the
CAN bus. Messages are transmitted by first loading the appropriate data registers. Status and
errors can be checked by reading the appropriate registers. Any message detected on the CAN
bus is checked for errors and then matched against filters to see if it should be received and
stored in one of the two receive registers.
The CAN Module supports the following frame types:
• Standard Data Frame
• Extended Data Frame
• Remote Frame
• Error Frame
• Interframe Space
23.4.1.1 Standard Data Frame
A standard data frame is generated by a node when the node wishes to transmit data. The
standard CAN data frame is shown in Figure 23-3. In common with all other frames, the frame
begins with a Start-Of-Frame bit (SOF - dominant state) for hard synchronization of all nodes.
The SOF is followed by the Arbitration field consisting of 12 bits, the 11-bit identifier (reflecting
the contents and priority of the message) and the RTR bit (Remote Transmission Request bit).
The RTR bit is used to distinguish a data frame (RTR - dominant) from a remote frame.
The next field is the Control field, consisting of 6 bits. The first bit of this field is called the Identifier
Extension (IDE) bit and is at dominant state to specify that the frame is a standard frame. The
following bit is reserved by the CAN protocol, RB0, and defined as a dominant bit. The remaining
4 bits of the Control field are the Data Length Code (DLC) and specify the number of bytes of
data contained in the message.
The data being sent follows in the Data field which is of the length defined by the DLC above (0-8
bytes).
The Cyclic Redundancy Check (CRC) field follows and is used to detect possible transmission
errors. The CRC field consists of a 15-bit CRC sequence and a delimiter bit. The message is
completed by the End-Of-Frame (EOF) field, which consists of seven recessive bits with no
bit-stuffing.
The final field is the Acknowledge field. During the ACK Slot bit the transmitting node sends out
a recessive bit. Any node that has received an error free frame acknowledges the correct
reception of the frame by sending back a dominant bit (regardless of whether the node is
configured to accept that specific message or not). The recessive Acknowledge Delimiter
completes the Acknowledge Slot and may not be overwritten by a dominant bit, except when an
error frame occurs.
23.4.1.2 Extended Data Frame
In the extended CAN data frame, shown in Figure 23-4, the Start-Of-Frame bit (SOF) is followed
by the Arbitration Field consisting of 38 bits. The first 11 bits are the 11 Most Significant bits of
the 29-bit identifier (“Base-lD”). These 11 bits are followed by the Substitute Remote Request bit
(SRR), which is transmitted as recessive. The SRR is followed by the lDE bit which is recessive
to denote that the frame is an extended CAN frame. It should be noted from this, that if arbitration
remains unresolved after transmission of the first 11 bits of the identifier, and one of the nodes
involved in arbitration is sending a standard CAN frame (11-bit identifier), then the standard CAN
frame will win arbitration due to the assertion of a dominant lDE bit. Also, the SRR bit in an
extended CAN frame must be recessive to allow the assertion of a dominant RTR bit by a node
that is sending a standard CAN remote frame. The SRR and lDE bits are followed by the remain-
ing 18 bits of the identifier (“lD-Extension”) and a dominant Remote Transmission Request bit.