Document Number: 001-86213 Rev. *C Page 8 of 39
Alarm
The alarm function compares user-programmed values to the
corresponding time/date values and operates under VDD or VBAK
power . When a match occurs, an alarm event occurs. The alarm
drives an internal flag AF (register 00h, bit 6) and may drive the
ACS pin, if desired, by setting the AL/SW bit (register 18h, bit 6)
in the Companion Control register . The alarm condition is cleared
by writing a '0' to the AF bit.
There are five alarm match fields. They are Month, Date, Hours,
Minutes, and Seconds. Each of these fields also has a Match bit
that is used to determine if the field is used in the alarm match
logic. Setting the Match bit to '0' indicates that the corresponding
field will be used in the match process.
Depending on the Match bits, the alarm can occur as specifically
as one particular second on one day of the month, or as
frequently as once per second continuously. The MSB of each
Alarm regist er is a Ma tch b it. E xam ple s of t he M atch bit setti ngs
are shown in Table 3. Selecting none of the match bits (all '1's)
indicates that no match is required. The alarm occurs every
second. Setting the match select bit for seconds to '0' causes the
logic to match the seconds alarm value to the current time of day .
Since a match will occur for only one value per minute, the alarm
occurs once per minute. Likewise setting the seconds and
minutes match select bits causes an exact match of these
values. Thus, an alarm will occur once per hour. Setting seconds,
minutes, and hours causes a match once per day. Lastly,
selecting all match-values causes an exact time and date match.
Selecting other bit combinations will not produce meaningful
results, however the alarm circuit will follow the functions
described.
There are two ways a user can detect an alarm event, by reading
the AF flag or monitoring the ACS pin. The interrupt pin on the
host processor may be used to detect an alarm event. The AF
flag in register 00h (bit 6) will indicate that a time/date match has
occurred. The AF flag will be set to '1' when a match occurs. The
AEN bit must be set to enable the AF flag on alarm matches. The
flag and ACS pin will remain in this state until the AF bit is cleared
by writing it to a '0'. Clearing the AEN bit will prevent further
matches from setting AF but will not automatically cl ear the AF
flag.
The RTC alarm is integrated into the special function registers
and shares its output pin with the 512 Hz calibration and square
wave outputs. When the RTC calibration mode is invoked by
setting the CAL bit (regi ster 00h, bit 2), the ACS output pin will
be driven with a 512 Hz square wave and the alarm will continue
to operate. Since most users only invoke the calibration mode
during production this should have no impact on the otherwise
normal operation of the alarm.
The ACS output may also be used to drive the system with a
frequency other than 512 Hz. The AL/SW bit (register 18h, bit 6)
must be '0'. A user-selectable frequency is provided by F0 and
F1 (register 18h, bits 4 and 5). The other frequencies are 1, 4096,
and 32768 Hz. If a continuous frequency output is enabled with
CAL mode, the alarm function will not be available.
Following is a summary table that shows the relationship
between register control settings and the state of the ACS pin.
Real-time Clock Operation
The real-time clock (RTC) is a timekeeping device that can be
capacitor- or battery-backed for permanently-powered
operation. It offers a software calibration feature that allows high
accuracy.
The RTC consists of an oscillator, clock divider, and a register
system for user access. It divides down the 32.768 kHz
time-base and provides a minimum resolution of seconds (1 Hz).
Static registers provide the user with read/write access to the
time values. It includes registers for seconds, minutes, hours,
day-of-the-week, date, months, and years. A block diagram
shown in Figure 9 illustrates the RTC function.
The user registers are synchronized with the timekeeper core
using R and W bits in register 00h. The R bit is used to read the
time. Changing the R bit from ‘0’ to ‘1’ transfers timekeeping
information from the core into the user registers 02-08h that can
be read by the user. If a timekeeper update is pending when R
Table 2. State of Register Bit
State of Regis t er Bit Function of
ACS pin
CAL AEN AL/SW
01 1Alarm
0 X 0 Square Wave out
1X X512 Hz out
00 1HI-Z
Tab le 3. Alarm Match Bit Examples
Seconds Minutes Hours Date Months Alarm condition
1 1 1 1 1 No match required = alarm 1/second
0 1 1 1 1 Alarm when seconds match = alarm 1/minute
0 0 1 1 1 Alarm when seconds, minutes match = alarm 1/hour
0 0 0 1 1 Alarm when seconds, minutes, hours match = alarm 1/date
0 0 0 0 1 Alarm when seconds, minutes, hours, date match = alarm 1/month