English
Language : 

HD6417750RF240DV Datasheet, PDF (384/1132 Pages) Renesas Technology Corp – Renesas 32-Bit RISC Microcomputer SuperH™ RISC engine Family / SH7750 Series
Section 11 Realtime Clock (RTC)
11.3.3 Alarm Function
The use of the alarm function is illustrated in figure 11.4.
SH7750, SH7750S, SH7750R Group
Clock running
Disable alarm interrupts
Clear RCR1.AIE to prevent erroneous interrupts
Set alarm time
Clear alarm flag
Enable alarm interrupts
Be sure to reset the flag as it may have been
set during alarm time setting
Set RCR1.AIE to 1
Monitor alarm time
(Wait for interrupt or check
alarm flag)
Figure 11.4 Example of Use of Alarm Function
An alarm can be generated by the second, minute, hour, day-of-week, day, month, or year (year is
available only with the SH7750R) value, or a combination of these. Write 1 to the ENB bit in the
alarm registers involved in the alarm setting, and set the alarm time in the lower bits. Write 0 to
the ENB bit in registers not involved in the alarm setting.
When the counter and the alarm time match, RCR1.AF is set to 1. Alarm detection can be
confirmed by reading this bit, but normally an interrupt is used. If 1 has been written to
RCR1.AIE, an alarm interrupt is generated in the event of alarm, enabling the alarm to be
detected.
The alarm flag remains set while the counter and alarm time match. If the alarm flag is cleared by
writing 0 during this period, it will therefore be set again immediately afterward. This needs to be
taken into consideration when writing the program.
Page 332 of 1076
R01UH0456EJ0702 Rev. 7.02
Sep 24, 2013