Datasheet

PIC18F47J53 FAMILY
DS39964B-page 254 Preliminary 2010 Microchip Technology Inc.
When ALRMCFG = 00 and the CHIME bit = 0
(ALRMCFG<6>), the repeat function is disabled and
only a single alarm will occur. The alarm can be
repeated up to 255 times by loading the ALRMRPT
register with FFh.
After each alarm is issued, the ALRMRPT register is
decremented by one. Once the register has reached
00’, the alarm will be issued one last time.
After the alarm is issued a last time, the ALRMEN bit is
cleared automatically and the alarm turned off. Indefinite
repetition of the alarm can occur if the CHIME bit = 1.
When CHIME = 1, the alarm is not disabled when the
ALRMRPT register reaches00’, but it rolls over to FF
and continues counting indefinitely.
17.3.2 ALARM INTERRUPT
At every alarm event, an interrupt is generated. Addi-
tionally, an alarm pulse output is provided that operates
at half the frequency of the alarm.
The alarm pulse output is completely synchronous with
the RTCC clock and can be used as a trigger clock to
other peripherals. This output is available on the RTCC
pin. The output pulse is a clock with a 50% duty cycle
and a frequency half that of the alarm event (see
Figure 17-6).
The RTCC pin can also output the seconds clock. The
user can select between the alarm pulse, generated by
the RTCC module, or the seconds clock output.
The RTSECSEL (PADCFG1<2:1>) bits select between
these two outputs:
Alarm pulse – RTSECSEL<2:1> = 00
Seconds clock – RTSECSEL<2:1> = 01
FIGURE 17-6: TIMER PULSE GENERATION
17.4 Low-Power Modes
The timer and alarm can optionally continue to operate
while in Sleep, Idle and even Deep Sleep mode. An
alarm event can be used to wake-up the microcontroller
from any of these Low-Power modes.
17.5 Reset
17.5.1 DEVICE RESET
When a device Reset occurs, the ALCFGRPT register
is forced to its Reset state, causing the alarm to be dis-
abled (if enabled prior to the Reset). If the RTCC was
enabled, it will continue to operate when a basic device
Reset occurs.
17.5.2 POWER-ON RESET (POR)
The RTCCFG and ALRMRPT registers are reset only
on a POR. Once the device exits the POR state, the
clock registers should be reloaded with the desired
values.
The timer prescaler values can be reset only by writing
to the SECONDS register. No device Reset can affect
the prescalers.
RTCEN bit
ALRMEN bit
RTCC Alarm Event
RTCC Pin