beautypg.com

11 overwrite enable/disable feature -60, 11 overwrite enable/disable feature – Maxim Integrated MAXQ7666 User Manual

Page 190

background image

MAXQ7665/MAXQ7666 User’s Guide

4-60

Important Information Concerning ID Changes When Awaiting Data from a Previous Remote Frame Request

The use of acceptance filtering (MEME = 1) in conjunction with remote frame requests can result in a modification of the message cen-
ter arbitration registers. Suppose, for example, that a message center is configured to transmit a remote frame request (MTRQ = 1,
EXTRQ = 0, T/

R = 0, and MSRDY = 1). If arbitration masks are used, it is possible for a second frame request from an external node

to modify this requesting node’s arbitration register value prior to reception of the previously requested data. When a remote frame
request is received, the message ID is loaded into that message center’s arbitration registers. When message identification masking
is not used (MEME = 0), the message ID always matches the arbitration value, so the process is transparent. If masking is used, how-
ever, the message ID ANDed with the appropriate mask is loaded into that message center’s arbitration registers, resulting in a change
of the arbitration values for that message center. To prevent this situation, acceptance filtering should be disabled (MEME = 0) for any
message center configured for remote frame handling.

4.11 Overwrite Enable/Disable Feature

The writeover enable bit (WTOE) located in each message center (C0MxAR3) enables or disables the overwriting of unread messages
in message centers 1–15. Programming WTOE = 1 following a system reset or CRST bit-enabled reset allows newly received mes-
sages that pass arbitration to overwrite unread (i.e., message centers with DTUP = 1) messages. When an overwrite occurs, the receive
overwrite bit (ROW) in the respective CAN message control register is set. When WTOE = 0, message centers that have data waiting
to be read (indicated by DTUP = 1) or transmitted (EXTRQ = 1) are not overwritten by incoming data.

Special care must be taken when reading data from a message center with the overwrite feature enabled (WTOE = 1). Caution is nec-
essary because the WTOE bit, when set, allows an incoming message to overwrite the message center. If an overwrite occurs at the
same time that software is attempting to read several bytes from the message center (such as a multibyte data field), it is possible that
the read could return a mix of information from the old and overwriting messages. If the message center being set up with TWOE = 1
was previously a transmit message center, ensure that the TIH bit is cleared to 0 (TIH can only be written while T/

R is set to 1). If TIH

is set to 1 and that message center is changed to receive with WTOE = 1, the ROW bit will always read back a 1, even though a receive
overwrite condition may not have occurred. To avoid this situation, software should clear the DTUP bit to 0 prior to reading the mes-
sage center, and then verify afterwards that the DTUP bit remained at 0. If DTUP remains cleared after the read, no overwrite occurred
and the returned data was correct. If DTUP = 1 after the read, then software again should clear DTUP = 0 and reread the message
center, since a possible overwrite has occurred. The original message will be lost (as planned since WTOE = 1), but a new message
should be available on the next read.

One important use of the WTOE bit is to allow the microcontroller to program multiple message centers with the same ID when oper-
ating in the receive mode, with WTOE = 0. This allows the CAN module to store multiple incoming messages in a series of message
centers, creating a large storage area for high-speed recovery of large amounts of data. The CPU is required to manage the use of
these message centers to keep track of the incoming data, but the use of multiple message centers and disabling of their overwrite
(WTOE = 0) function prevents the module from potentially losing data during a high-speed data transfer.

The following examples demonstrate the use of the WTOE and other bits when using multiple message centers with the same arbitra-
tion value. Case 2 illustrates the approach described above for configuring multiple message centers to capture a large amount of
data at a relatively high rate.

Case 1: WTOE = 1 (Overwrites Allowed)

1) Software configures message centers 1 and 2 with the same arbitration value (abbreviated AV).

2) Software configures message centers 1 and 2 to receive (T/

R = 0) and to allow message overwrite (WTOE = 1).

3) The first message received that matches AV is stored in message center 1, DTUP = 1.

4) The second message that matches AV is stored in message center 1, DTUP = ROW = 1.

5) The third message that matches AV is stored in message center 1.

6) Etc.

Note that in this example, message center 2 never receives a message and that, if software does not read message center 1 before
the second message is received, the first message is lost.

Maxim Integrated

This manual is related to the following products: