Maxim Integrated High-Speed Microcontroller Users Guide: Network Microcontroller Supplement User Manual

Page 156

Advertising
background image

High-Speed Microcontroller User’s

Guide: Network Microcontroller

Supplement

156

If software wants to modify the data in a message center configured for transmission of an answer to a remote request (EXTRQ set to

a 1), the microcontroller must set the TIH = 1 and DTUP = 0. The microcontroller can then access the data byte registers 0–7, data

byte count (DTBYC3–0), 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 a 0 and set DTUP to a 1 bit to signal the CAN

that the access is finished. Until the 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

allow the microcontroller to intervene and establish the conditions for the transmission of the return message. The following examples

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 previously 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.

Case 2:

Software-initiated reply. (Using TIH as gating control.) CAN module wants to receive an RFR and wait for software
to determine when and what is transmitted in reference to RFR.

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 = 1 in same instruction.

Note: Software does not change MTRQ = 0 from previous 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 waits for software to read message center and determine the fact that EXTRQ = 1.

9. Software can load data into message center (or it can already have the data established).

10. Software writes MSRDY = 1, DTUP = 1, and TIH = 0 in same instruction.

11. CAN automatically transmits data (as per RFR DTBYC) in respective message center.

12. CAN clears EXTRQ = 0 and MTRQ = 0.

Maxim Integrated

Advertising