EasyManua.ls Logo

Microchip Technology dsPIC30F - Page 629

Microchip Technology dsPIC30F
738 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
© 2004 Microchip Technology Inc. DS70070B-page 23-31
Section 23. CAN
CAN Module
23
To enable standard and extended frames to be sent across a shared network, it is necessary to
split the 29-bit extended message identifier into 11-bit (Most Significant) and 18-bit (Least Signif-
icant) sections. This split ensures that the Identifier Extension bit (lDE) can remain at the same
bit position in both standard and extended frames.
The next field is the Control field, consisting of 6 bits. The first 2 bits of this field are reserved and
are at dominant state. The remaining 4 bits of the Control field are the Data Length Code (DLC)
and specify the number of data bytes.
The remaining portion of the frame (Data field, CRC field, Acknowledge field, End-Of-Frame and
intermission) is constructed in the same way as for a standard data frame.
23.4.1.3 Remote Frame
A data transmission is usually performed on an autonomous basis with the data source node
(e.g., a sensor sending out a data frame). It is possible however for a destination node to request
the data from the source. For this purpose, the destination node sends a “remote frame” with an
identifier that matches the identifier of the required data frame. The appropriate data source node
will then send a data frame as a response to this remote request.
There are two differences between a remote frame and a data frame, shown in Figure 23-5. First,
the RTR bit is at the recessive state and second there is no Data field. In the very unlikely event
of a data frame and a remote frame with the same identifier being transmitted at the same time,
the data frame wins arbitration due to the dominant RTR bit following the identifier. In this way,
the node that transmitted the remote frame receives the desired data immediately.
23.4.1.4 The Error Frame
An error frame is generated by any node that detects a bus error. An error frame, shown in
Figure 23-6, consists of 2 fields, an error flag field followed by an Error Delimiter field. The Error
Delimiter consists of 8 recessive bits and allows the bus nodes to restart bus communications
cleanly after an error. There are two forms of error flag fields. The form of the error flag field
depends on the error status of the node that detects the error.
If an error-active node detects a bus error then the node interrupts transmission of the current
message by generating an active error flag. The active error flag is composed of six consecutive
dominant bits. This bit sequence actively violates the bit-stuffing rule. All other stations recognize
the resulting bit-stuffing error and in turn generate error frames themselves, called Error Echo
Flags. The error flag field therefore consists of between six and twelve consecutive dominant bits
(generated by one or more nodes). The Error Delimiter field completes the error frame. After
completion of the error frame, bus activity retains to normal and the interrupted node attempts to
resend the aborted message.
If an error passive node detects a bus error then the node transmits an Error Passive flag
followed, again, by the Error Delimiter field. The Error Passive flag consists of six consecutive
recessive bits. From this it follows that, unless the bus error is detected by the transmitting node
or other error active receiver that is actually transmitting, the transmission of an error frame by
an error passive node will not affect any other node on the network. If the bus master node
generates an error passive flag then this may cause other nodes to generate error frames due
to the resulting bit-stuffing violation. After transmission of an error frame, an error passive node
must wait for 6 consecutive recessive bits on the bus before attempting to rejoin bus
communications.
23.4.1.5 The Interframe Space
Interframe Space separates a proceeding frame (of whatever type) from a following data or
remote frame. lnterframe Space is composed of at least 3 recessive bits, called the intermission.
This is provided to allow nodes time for internal processing of the message by receiving nodes
before the start of the next message frame. After the intermission, the bus line remains in the
recessive state (bus idle) until the next transmission starts.
If the transmitting node is in the error passive state, an additional 8 recessive bit times will be
inserted in the Interframe Space before any other message is transmitted by that node. This time
period is called the Suspend Transmit field. The Suspend Transmit field allows additional delay
time for other transmitting nodes to take control of the bus.

Table of Contents

Other manuals for Microchip Technology dsPIC30F