Rev. 2.00, 09/03, page 371 of 690
15.4.4
Alarm Function
Figure 15.4 shows how to use the alarm function.
Alarms can be generated using seconds, minutes, hours, day of the week, date, month, year, or any
combination of these. Set the ENB or YAEN bit for the register on which the alarm is placed to 1,
and then set the alarm time in the lower bits. Clear the ENB or YAEN bit for the register on which
the alarm is not placed to 0.
When the clock and alarm times match, 1 is set in the AF bit 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 in
RCR1, an interrupt is generated when an alarm occurs.
Disable interrupt to prevent erroneous
interruption.(AIE bit in RCR1 is cleared)
Then write 1.
Clock running
Set alarm time
Cancel alarm interrupt
Always clear, since the flag may have been
set while the alarm time was being set.
(Write 0 to AF of RCR1 to clear it. )
Clear alarm flag
Monitor alarm time
(wait for interrupt or
check alarm flag)
Figure 15.4 Using the Alarm Function
Summary of Contents for SH7705
Page 2: ......
Page 70: ...Rev 2 00 09 03 page 24 of 690 ...
Page 194: ...Rev 2 00 09 03 page 148 of 690 ...
Page 284: ...Rev 2 00 09 03 page 238 of 690 ...
Page 338: ...Rev 2 00 09 03 page 292 of 690 ...
Page 354: ...Rev 2 00 09 03 page 308 of 690 ...
Page 374: ...Rev 2 00 09 03 page 328 of 690 ...
Page 420: ...Rev 2 00 09 03 page 374 of 690 ...
Page 476: ...Rev 2 00 09 03 page 430 of 690 ...
Page 482: ...Rev 2 00 09 03 page 436 of 690 ...
Page 552: ...Rev 2 00 09 03 page 506 of 690 ...
Page 630: ...Rev 2 00 09 03 page 584 of 690 ...
Page 739: ...SH7705 Group Hardware Manual REJ09B0082 0200O ...