2 important ds5000t/ds2250t application note, Mportant, Ds5000t/ds2250t – Maxim Integrated Secure Microcontroller User Manual
Page 156: Pplication

Secure Microcontroller User’s Guide
156 of 187
The timekeeper contains a shift register with 128 bit locations. The first 64 locations correspond to a
pattern shown in
. The next 64 are time data. Before access to time data can occur, the 64-bit
pattern must be written. A pattern recognition circuit checks the incoming bits. As each correct bit of the
pattern is received, the pointer is advanced. Any incorrect bit will cause the pointer to stop, and it may
only be reset by a read operation. When the 64 bits of the pattern have been correctly written, access to
RTC data begins. The next 64 bits are time data according to
. When the 64 bits of time data
have been read or written (each bit increments the pointer), the pointer has completed its cycle of 128.
The next time access is initiated by writing the pattern again. The pointer should be reset with a read
operation, to set it to a known location.
To write a data bit to the RTC, a MOVX instruction that forces A2 low and A0 to the state of the bit must
be performed. All other address lines should be low. Address line A2 can be thought of as the write
enable to the clock and A0 as the input bit. Therefore, to write the 64 bits of the pattern recognition
sequence, 64 MOVX instructions must be executed. A read is performed in a similar manner, but A2 is
high. Notice that data is encoded into the address line. Either a MOVX A, @DPTR or MOVX @DPTR,
A will accomplish a write if the DPH contains 00H, and DPL contains 0000000Xb. The data bit is A0.
The R/
W
signal is irrelevant.
To read a data bit from the clock after the 64-bit pattern has been entered, a MOVX instruction (MOVX
A, @Ri or MOVX A, @DPTR) must be executed that sets A2 to a 1. The data bit desired will then be
returned in bit 7 of the accumulator. Therefore, to retrieve the 8 bytes of time information in the clock, 64
read MOVX instructions must be executed.
Since the clock pointer increments for each memory access (read or write), extra reads or writes must not
be performed (the pointer would move accidentally). For this reason, any interruption of the time
read/write process should close ECE2 immediately. An inadvertent memory access to this space would
move the pointer, and time data would appear to be garbage on returning to timekeeping. Consequently,
interrupts must be disabled when executing time transactions.
Note that the clock access is performed as a Bytewide memory access. The
EA
pin must remain high. If
this pin is low, all memory access is directed outside the chip via the expanded bus. Therefore, the
timekeeper would be outside the current memory map.
is a flowchart that summarizes how to access the time for retrieval and modification. Also, an
application example at the end of this section lists a program that contains sample subroutines for
communicating with the clock.
17.2 Important DS5000T/DS2250T Application Note
The ECE2 bit used to access the RTC on the DS5000T and DS2250T is nonvolatile. If the processor is
reset or power is lost during an access to the RTC (while ECE2 = 1), it maintains its state following reset.
This unintentional setting of the ECE2 bit may interfere with MOVX instructions if software expects the
bit to be cleared following reset. As a general precaution, it is recommended that the ECE2 bit be cleared
as part of the reset routine of the device.