WM8352
Production Data
22.2.5 SETTING THE ALARM
Writing to the RTC Alarm registers requires a procedure similar to that used when setting RTC time,
in order to prevent accidental alarms being triggered:
.
.
.
.
Set the RTC_ALMSET bit to disable alarms
Read the RTC_ALMSTS bit. Repeat this step until RTC_ALMSTS=1
Set new RTC Alarm in Registers R20 to R22
Clear the RTC_ALMSET bit to re-enable RTC Alarm
The RTC_ALMSET and RTC_ALMSTS bits are defined in Table 134.
ADDRESS
BIT
LABEL
DEFAULT
DESCRIPTION
Stops alarms (instruction only)
0 = normal operation
R23 (17h)
9
RTC_ALMSET
1
RTC Time
control
1 = stop alarms
It is recommended to stop alarms when
setting the RTC alarm. This avoids false
alarms.
8
RTC_ALMSTS
1
Actual status of ALARM circuitry
0 = normal operation
1 = alarms stopped
Table 134 Setting the RTC Alarm
22.3 TRIMMING THE RTC
The RTC has a frequency trim feature to allow compensation for known and constant errors in the
crystal oscillator frequency up to ±8Hz. Programming the frequency trim requires a procedure similar
to that used when setting RTC and ALARM time:
.
.
.
.
Clear the RTC_TICK_ENA bit to disable the 1 second tick generator
Read the RTC_TICKSTS bit. Repeat this step until RTC_TICKSTS=1
Set new RTC frequency trim value in Register R218
Set the RTC_TICK_ENA bit to resume normal operation
PD, February 2011, Rev 4.4
192
w