Clock operations
3
Clock operations
M48T86
3.1
Address map
The address map of the M48T86 is shown in Figure 8. It consists of 114 bytes of user RAM,
10 bytes of RAM that contain the RTC time, calendar and alarm data, and 4 bytes which are
used for control and status. All bytes can be read or written to except for the following:
1. Registers C & D are “Read only.”
2. Bit 7 of Register A is “Read only.”
The contents of the four Registers A, B, C, and D are described in the “Registers” section.
t(s) 3.2
Time, calendar, and alarm locations
c The time and calendar information is obtained by reading the appropriate memory bytes.
du The time, calendar, and alarm registers are set or initialized by writing the appropriate RAM
ro ) bytes. the contents of the time, calendar, and alarm bytes can be either binary or binary-
P t(s coded decimal (BCD) format. Before writing the internal time, calendar, and alarm register,
the SET bit (Register B; Bit 7) should be written to a logic '1.' This will prevent updates from
te c occurring while access is being attempted. In addition to writing the time, calendar, and
le du alarm registers in a selected format (binary or BCD), the data mode (DM) bit (Register B; Bit
so ro 2), must be set to the appropriate logic level ('1' signifies binary data; '0' signifies binary
coded decimal (BCD data). All time, calendar, and alarm bytes must use the same data
b P mode. The SET bit should be cleared after the data mode bit has been written to allow the
- O te real-time clock to update the time and calendar bytes. Once initialized, the real-time clock
) le makes all updates in the selected mode. The data mode cannot be changed without
t(s o reinitializing the ten data bytes. Table 3 on page 15 shows the binary and BCD formats of
s the time, calendar, and alarm locations. The 24/12 bit (Register B; Bit 1) cannot be changed
c b without reinitializing the hour locations. When the 12-hour format is selected, a logic '1' in
u O the high order bit of the hours byte represents PM. The time, calendar, and alarm bytes are
rod - always accessible because they are double-buffered. Once per second the ten bytes are
P t(s) advanced by one second and checked for an alarm condition. If a READ of the time and
calendar data occurs during an update, a problem exists where data such as seconds,
te c minutes, or hours may not correlate. However, the probability of reading incorrect time and
le du calendar data is low. Methods of avoiding possible incorrect time and calendar READs are
OObbssoolete Pro reviewed later in this text.
14/36