2 RTCC Alarm Overview
The RTCC module offers a configurable alarm feature that provides the flexibility to be configured with several different options. The alarm can be setup to trigger an alarm interrupt flag once every ½ second to once every year, with an included alarm repeat counter register that is used to determine how many times the alarm repeats before the alarm enable bit (ALRMEN) is lowered. An alarm event is generated when the RTCC time/date matches the time/date stored in the alarm registers, which are configured by the user. Aside from ALRMRPT and the CHIME bit, the alarm registers should not be updated while the alarm is enabled to prevent false alarm triggers. This feature of the RTCC module generates an Interrupt Flag (RTCCIF) every time an alarm alert is issued, which can be implemented in many applications as a trigger for other peripherals or as an interrupt service routine. In addition to the interrupt flag that is raised with every alarm alert, the RTCC can also provide an alarm pulse output that is synchronous with the RTCC clock that can be used as a trigger for other peripherals. To implement the RTCC interrupt, the RTCCIE bit of the Peripheral Interrupt Enable (PIE) register must be set.