RM0402
22.5
RTC interrupts
All RTC interrupts are connected to the EXTI controller.
To enable the RTC Alarm interrupt, the following sequence is required:
1.
Configure and enable the EXTI Line 17 in interrupt mode and select the rising edge
sensitivity.
2.
Configure and enable the RTC_Alarm IRQ channel in the NVIC.
3.
Configure the RTC to generate RTC alarms (Alarm A or Alarm B).
To enable the RTC Wakeup interrupt, the following sequence is required:
1.
Configure and enable the EXTI Line 22 in interrupt mode and select the rising edge
sensitivity.
2.
Configure and enable the RTC_WKUP IRQ channel in the NVIC.
3.
Configure the RTC to generate the RTC wakeup timer event.
To enable the RTC Tamper interrupt, the following sequence is required:
1.
Configure and enable the EXTI Line 21 in interrupt mode and select the rising edge
sensitivity.
2.
Configure and Enable the TAMP_STAMP IRQ channel in the NVIC.
3.
Configure the RTC to detect the RTC tamper event.
To enable the RTC TimeStamp interrupt, the following sequence is required:
1.
Configure and enable the EXTI Line 21 in interrupt mode and select the rising edge
sensitivity.
2.
Configure and Enable the TAMP_STAMP IRQ channel in the NVIC.
3.
Configure the RTC to detect the RTC timestamp event.
Alarm A
Alarm B
Wakeup
TimeStamp
Tamper1 detection
1. Wakeup from STOP and Standby modes is possible only when the RTC clock source is LSE or LSI.
Table 113. Interrupt control bits
Interrupt event
Enable
Event flag
control
bit
ALRAF
ALRAIE
ALRBF
ALRBIE
WUTF
WUTIE
TSF
TSIE
TAMP1F
TAMPIE
RM0402 Rev 6
Real-time clock (RTC)
Exit the
Exit the
Sleep
Stop
mode
mode
(1)
yes
yes
(1)
yes
yes
(1)
yes
yes
(1)
yes
yes
(1)
yes
yes
Exit the
Standby
mode
(1)
yes
(1)
yes
(1)
yes
(1)
yes
(1)
yes
633/1163
655
Need help?
Do you have a question about the STM32F412 and is the answer not in the manual?
Questions and answers