AP29000
Connecting C166 and C500 Microcontroller to CAN
Ways of handling the SAE 81C90/91 and the CAN Module on the C167CR / C515C
Application Note 63 V 1.0, 2004-02
• To transmit a Remote Frame, make sure that you have configured a message
object "n" (e.g. MO 2) that handles Remote Frames (RTR = 1) and that carries the
right identifier and "0" in the DLC. Like the Data Frame, the Remote Frame is
transmitted by setting the bit that corresponds to message object n in the registers
TRSR1 (messages 0 - 7) or TRSR2 (messages 8 - 15), respectively. Several bits
may be set simultaneously which results in the transmission of all
selected messages starting with the one with the highest message index.
• Please note that the corresponding Data Frame is not stored into this message
object n from which the Remote Frame was sent. Another message object
configured to handle Data Frames (RTR=0) is needed.
A possibility to avoid this:
• Configure a message object "n" that handles Remote Frames (RTR = 1) and that
carries the right identifier and "0" in the DLC.
• Transmit the Remote Frame.
• Wait until bit TC in the MOD register is set on the successful transmission of the
frame.
• Now change bit RTR in the descriptor bytes to zero and adjust the DLC.
• When now the corresponding Data Frame arrives, it will be stored in this message
object (as long as there's no other message object with RTR=0, the same identifier,
and a higher message object priority).
You have to make sure, though, that the reprogramming of the RTR bit is done before
the corresponding Data Frame is transmitted. Be also aware of the fact that the
requested Data Frame is not necessarily the frame that directly follows the transmitted
Remote Frame.
6.5.3 Evaluation of a received Message with the SAE 81C90/91
• If the SAE 81C90/91 receives a Remote Frame with an identifier that matches with
the identifier of a message object configured to handle Remote Frames (RTR=1),
then the DLC, the data bytes and the identifier remain unchanged. The Remote
Frame is automatically answered with the corresponding Data Frame.
• If the SAE 81C90/91 receives a Data Frame with an identifier that matches with the
identifier of a message object configured to handle Data Frames (RTR=0), then the
data bytes in the Data Field are copied into the data bytes of this message object.
The DLC is updated while The RTR bit and the identifier remain unchanged. The
device sets the corresponding receive-ready bit in the RRx register and bit RI in the
register INT and generates an interrupt to the host controller (if enabled). The
interrupt service routine then first has to read INT to determine the reason for the
interrupt.