English
Language : 

SH7709S Datasheet, PDF (468/807 Pages) Renesas Technology Corp – Renesas 32-Bit RISC Microcomputer Super RISC engine Family/SH7700 Series
13.3.4 Alarm Function
Figure 13.4 shows how to use the alarm function.
Alarms can be generated using seconds, minutes, hours, day of the week, date, month, or any
combination of these. Set the ENB bit (bit 7) to 1 in the register to which the alarm applies, and
then set the alarm time in the lower bits. Clear the ENB bit to 0 in registers to which the alarm
does not apply.
When the clock and alarm times match, 1 is set in the AF bit (bit 0) in RCR1. Alarm detection can
be checked by reading this bit, but normally it is done by interrupt. If 1 is placed in the AIE bit (bit
3) in RCR1, an interrupt is generated when an alarm occurs.
Clock running
Set whether to use
alarm interrupt
Disable interrupts for preventing error
interrupts (clear the AIE bit in RCR1 to 0).
Then write 1 to the AIE bit in RCR1.
Set alarm time
Clear alarm flag
Always reset, since the flag may have
been set while the alarm time was being
set (clear the AF bit in RCR1 to 0).
Monitor alarm time
(wait for interrupt or
check alarm flag)
Figure 13.4 Using the Alarm Function
Rev. 5.00, 09/03, page 424 of 760