Maxim Integrated High-Speed Microcontroller Users Guide: DS80C390 Supplement User Manual
Page 148

High-Speed Microcontroller User’s Guide: DS80C390 Supplement
148 of 158
overwrite the message center. If this overwrite occurs at the same time that software is attempting to read
several bytes from the message center (such as a multi-byte 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 WTOE = 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 as a 1, even
though a receive overwite condition may not have occurred.
To avoid this situation, software should clear the DTUP bit to 0 prior to reading the message 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 re-read the message center, since a possible overwrite has occurred. The
original message will be lost (as planned since WTOE=1), but new message should be available on the
next read.
One important use of the WTOE bit is to allow the microprocessor to program multiple message centers
with the same ID when operating 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. In transmit mode, the WTOE bit prevents a message center ID from being overwritten by an
incoming remote frame.
The following examples demonstrate the use of the WTOE and other bits when using multiple message
centers with the same arbitration 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 center 1 & 2 with the same arbitration value (abbreviated AV).
2. Software configures message center 1 & 2 to receive (T/ R = 0) and to allow message overwrite
WTOE=1.
3. The first message received that matches AV will be stored into message center 1, DTUP = 1.
4. The second message that matches AV will be stored into message center 1, DTUP = ROW = 1.
5. The third message that matches AV will be stored into message center 1.
6. etc.
Note that in this example message center 2 will never receive a message, and that if software does not
read message center 1 before the second message is received, the first message will be lost.
Case 2: WTOE=0 (Overwrites disabled)
1. Software configures message center 1 & 2 with the same arbitration value (abbreviated AV).
2. Software configures message center 1 & 2 to receive (T/ R = 0) and to disable message overwrite
WTOE = 0.
3. The first message received that matches AV will be stored in message center 1, DTUP = 1.
4. The second message received that matches AV will be stored in message center 2, DTUP = 1
5. Software reads message center 1 and then programs message center 1 DTUP = 0.
6. The third message received that matches AV will be stored into message center 1, DTUP = 1.