Maxim Integrated MAXQ7666 User Manual
Page 187
MAXQ7665/MAXQ7666 User’s Guide
4-57
4.9.4 Receiving/Responding to Remote Frame Requests
The remote frame request is handled like a data frame with data length zero and the EXTRQ and RXS bits are set. Each incoming
remote frame request (RFR) message is compared sequentially with each enabled (MSRDY = 1) message center starting with the low-
est numbered message center (highest priority) and proceeding to the highest numbered message center. Testing continues until a
match is found (incorporating masking functions as required), at which time the incoming RFR message is stored in the respective
message center, the DTBYC bits are updated to indicate the requested number of return bytes, and EXTRQ and MTRQ are both set
to 1. When the message is successfully received and stored, an interrupt of the corresponding message center is asserted, if enabled
by the ERI bit. The EXTRQ bit can be left set if the message center is reconfigured to perform a transmit (T/
R = 1) and used in the stan-
dard reply of a remote frame operating with transmit message centers. EXTRQ can also be cleared by software if the current message
center is not being used to reply to the remote frame request. Higher numbered message centers (lower priority) that are not reviewed
prior to the match are not evaluated during the current message test. Depending on the state of the transmit/receive bit for that mes-
sage center, the CAN module performs one of two responses.
When a remote frame request is successfully received, the message centers enabled for transmission (T/
R = 1) set the EXTRQ and
MTRQ bits in the corresponding message center to mark the message as a "to be sent" message. The CAN module attempts to auto-
matically transmit the requested message if the message center is fully enabled to do so (MSRDY = 1, TIH = 0, DTUP = 1). After the
transmission, the TXS bit in the status register is set, the EXTRQ and MTRQ bits are reset to 0, and a message center interrupt of the
corresponding message center is asserted, if enabled by the respective ETI bit. If the transmit inhibit bit is set (TIH = 1), the message
center receives the RFR, modifying the DTBYC and/or arbitration bits if necessary, but the return data is not transmitted until TIH = 0.
If software wants to modify the data in a message center configured for transmission of an answer to a remote request (EXTRQ set to
1), the microcontroller must set TIH = 1 and DTUP = 0. The microcontroller can then access the data byte registers 0–7, data byte
count (DTBYC3:DTBYC0), the extended or standard mode bit (EX/
ST), and the mask enables (MEME and MDME) of the message cen-
ter to load the required settings. Following the setup, the software should reset TIH to 0 and set DTUP to a 1 bit to signal the CAN that
the access is finished. Until DTUP = 1 and TIH = 0, the transmission of this mailbox is not permitted. Thus, the CAN transmits the newest
data and resets EXTRQ = 0 after the transmission is complete. The message center must first be disabled to change the identifier or
the direction control (T/
R).
Message centers enabled for reception (T/
R = 0) do not automatically transmit the requested data. The remote frame request does,
however, continue to store the requested number of return bytes in DTBYC and set EXTRQ = 1. No data bytes are received or stored
from a remote frame request. The message center can then be configured by software to function as transmitter (T/
R = 1) and trans-
mit the requested data, or the microcontroller can configure another message center in a transmit mode (T/
R = 1) to send the request-
ed data. Note that, when T/
R = 0, the MTRQ bit is not set upon loading of a matching remote frame request.
When a remote frame is received, the CAN module can be configured to either automatically transmit data back to the remote node or
to allow the microcontroller to intervene and establish the conditions for the transmission of the return message. The following exam-
ples outline various options to respond to remote frame requests.
Case 1: Automatic Reply
CAN controller receives a remote frame request (RFR) and automatically transmits data without additional software intervention.
1) Software sets T/
R = 1, MSRDY = 0, DTUP = 0, and TIH = 1.
2) Software loads data into respective message center.
3) Software sets MSRDY = 1, DTUP = 1, and TIH = 0 in same instruction. Note: Software does not change MTRQ = 0 from pre-
viously completed transmission.
4) CAN does not transmit data (MTRQ = 0), but waits for RFR.
5) CAN successfully receives RFR.
6) CAN forces MTRQ = 1 and EXTRQ = 1
7) CAN loads DTBYC from RFR and ID into arbitration registers.
8) CAN automatically transmits data in respective message center.
9) CAN clears EXTRQ = 0 and MTRQ = 0.
Maxim Integrated