English
Language : 

C8051F970-A-GM Datasheet, PDF (262/454 Pages) Silicon Laboratories – Low Power Capacitive Sensing MCU with up to 32 kB of Flash
C8051F97x
25.3.2. Setting a SmaRTClock Alarm
The SmaRTClock alarm function compares the 32-bit value of SmaRTClock Timer to the value of the ALARMn
registers. An alarm event is triggered if the SmaRTClock timer is equal to the ALARMn registers. If Auto Reset is
enabled, the 32-bit timer will be cleared to zero one SmaRTClock cycle after the alarm event.
The SmaRTClock alarm event can be configured to reset the MCU, wake it up from a low power mode, or generate
an interrupt. See Section “13. Interrupts” on page 79, Section “16. Power Management” on page 94, and Section
“27. Reset Sources and Supply Monitor” on page 323 for more information.
The following steps can be used to set up a SmaRTClock Alarm:
1. Disable SmaRTClock Alarm Events (RTC0AINT = 0).
2. Set the ALARMn registers to the desired value.
3. Enable SmaRTClock Alarm Events (RTC0AINT = 1).
When using the SmaRTClock in Self-Oscillate or Crystal Modes, the alarm is triggered every N + 2 RTC cycles
except for the first alarm, which triggers after N RTC cycles. N is the value written into the 32-bit ALARM register.
When using the SmaRTClock with the internal LFO, the alarm is triggered every N/2 + 2 RTC cycles except for the
first alarm, which triggers after N/2 RTC cycles. N is the value written into the 32-bit ALARM register. If N is odd,
then the hardware uses N/2 rounded down.
Notes:
1. The ALRM bit, which is used as the SmaRTClock Alarm Event flag, is cleared by disabling SmaRTClock Alarm Events
(RTC0AINT = 0).
2. If AutoReset is disabled, disabling (RTC0AINT = 0) then Re-enabling Alarm Events (RTC0AINT = 1) after a
SmaRTClock Alarm without modifying ALARMn registers will automatically schedule the next alarm after 2^32
SmaRTClock cycles (approximately 36 hours using a 32.768 kHz crystal).
3. The SmaRTClock Alarm Event flag will remain asserted for a maximum of one SmaRTClock cycle. See Section
“16. Power Management” on page 94 for information on how to capture a SmaRTClock Alarm event using a flag which is
not automatically cleared by hardware.
4. When an external clock is used as the SmaRTClock source, the system clock speed must be more than 9 times the
SmaRTClock speed for the SmaRTClock alarm functionality to work correctly.
5. When an external clock source is used as the SmaRTClock source, the system clock speed must be more than 5 times
the SmaRTClock speed for the SmaRTClock alarm functionality to work correctly.
Rev 1.0
263