Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
stm32:peripherals:rtc_wakeup [2017/08/24 13:01] – [Wake Up Timer] ruan | stm32:peripherals:rtc_wakeup [2017/10/24 10:41] – [Setup wakeup timer] kjaz | ||
---|---|---|---|
Line 9: | Line 9: | ||
The wakeup timer clock input can be | The wakeup timer clock input can be | ||
- | * RTCCLK (usually 32.768 kHz) divided by 2, 4, 8 or 16\\ | + | * RTCCLK (usually 32.768 kHz) divided by 2, 4, 8 or 16. \\ As a result this allows wakeup interrupt periods |
- | | + | * ck_spre (usually 1 Hz internal clock). \\ As a result this allows wakeup interrupt periods from 1 s to around 36 hours. |
===== Programming Instructions ===== | ===== Programming Instructions ===== | ||
==== RTC register write protection ==== | ==== RTC register write protection ==== | ||
- | After a reset the backup domain is write protected. \\ | + | After a reset the backup domain is write protected. The backup domain encompasses: |
Unlock access to backup domain: | Unlock access to backup domain: | ||
* Set the '' | * Set the '' | ||
Line 37: | Line 37: | ||
* Disable wakeup timer in '' | * Disable wakeup timer in '' | ||
* Wait until configuration of RTC is allowed. \\ Check corresponding bit in '' | * Wait until configuration of RTC is allowed. \\ Check corresponding bit in '' | ||
- | * Program reload value in '' | ||
* Program prescaler value in '' | * Program prescaler value in '' | ||
+ | * Program reload value in '' | ||
* Enable wakeup interrupt in '' | * Enable wakeup interrupt in '' | ||
+ | * Clear any pending wakeup interrupt flag in '' | ||
To use the wakeup interrupt, you need to configure the EXTI channel \\ | To use the wakeup interrupt, you need to configure the EXTI channel \\ | ||
and enable it in the NVIC: | and enable it in the NVIC: | ||
- | * Clear any pending wakeup interrupt flag in '' | ||
* Configure the dedicated [[exti|EXTI interrupt]] channel for the RTC. \\ I.e. select edge and enable. | * Configure the dedicated [[exti|EXTI interrupt]] channel for the RTC. \\ I.e. select edge and enable. | ||
* Enable the RTC wakeup interrupt in the [[nvic|NVIC]]. | * Enable the RTC wakeup interrupt in the [[nvic|NVIC]]. |