English
Language : 

DS80C320-MCG Datasheet, PDF (161/175 Pages) Dallas Semiconductor – High-Speed Microcontroller User Guide
High-Speed Microcontroller User’s Guide
Setting the alarm to cause an interrupt once during a 24-hour period is done by setting all the alarm
registers to the desired value and enabling all compare bits. A recurring alarm is enabled by clearing the
compare enable bits associated with one or more alarm registers. For example, to specify an alarm to
occur once a minute, the SSCE and SCE bits would be set. In general, a recurring alarm is set using the
next lower time increment than the desired interrupt period. For example, if an alarm was desired once an
hour, on the hour, a compare on the Real Time Alarm Minute Register would be performed, because the
Real Time Clock Minute Register will match the corresponding alarm register only once an hour. The
RTASS, RTAS, and RTAM registers would be cleared to 00h, and the SSCE, SCE, and MCE bits would
all be set to 1 to match on the time xx:00:00:00. Writing an invalid time to these registers (loading the
RTAM register with 3Dh or 61 minutes, for example) will never cause a match by the RTC. It is the
responsibility of the software to ensure that only valid times are written to these registers.
It is important to remember that any RTC register whose corresponding compare enable bit is cleared to 0
will always be treated as a match. The alarm registers are interrogated once per subsecond tick to check
for an alarm condition. If the SSCE bit was set to a don’t care (cleared to 0) in the above example, a
match (and interrupt) would occur during every subsecond of the minute in which the Real Time Alarm
Minute register matched.
If an alarm occurs while in data retention state (VCC < VBAT ), the RTCIF flag will be set and the interrupt
will remain pending. When power is reapplied to the device, the device will execute an RTC interrupt as
soon as interrupts are enabled.
USING THE DAY OF THE WEEK BITS
The DS87C530 contains 3 Day of the Week bits, DOW.2-0 located in the upper 3 bits of the Real Time
Clock Hour register (RTCH;FDh). These allow the processor to count from 1 to 7. The day of the week
bits will increment anytime the hour register changes from 17h to 00h, indicating a new day. When the
day of the week register reaches a count of 111b, it will roll over to 001b.
If the day of the week feature is not needed, writing 000b to the bits will disable the ability of an hour
register rollover to change the day of the week. The bits will remain at 000b. This is very convenient
from a software standpoint, as it is not necessary to zero out the high order bits when determining the
hour from the RTC Hour register.
CHOOSING AN RTC CRYSTAL
The RTC clock source is provided by an external 32.768 kHz crystal attached to the RTCX1 and RTCX2
leads of the DS87C530. The device can be programmed to operate with a crystal rated for either a 6 pF
or 12.5 pF load capacitance. The crystal selection is determined by the RTC Crystal Capacitance Select
bit (TRIM.6). The default state of this bit after a no–battery reset is for a 12.5 pF crystal.
In general, a lower capacitance crystal will consume less power, but will be more susceptible to noise.
Unlike the processor crystal inputs (X1, X2), the RTC crystal does not require external load capacitors.
Placing load capacitors on the RTC crystal input pins will cause the RTC to keep incorrect time. To
prevent system noise from affecting the RTC, the RTCX1 and RTCX2 pins should be guard-ringed with
the GND2 signal.
161 of 175