当前位置:网站首页>Stm32cubemx (8): RTC and RTC wake-up interrupt

Stm32cubemx (8): RTC and RTC wake-up interrupt

2022-07-05 04:58:00 Shrimp paste

Real time clock (RTC):
it It's an independent BCD Timer / Counter .RTC Provide A calendar clock Two programmable The alarm clock is broken , And one A periodic programmable wake-up flag with interrupt function .RTC Also included for managing low power mode Automatic wake-up unit .
Two 32 Bit registers contain binary decimal format (BCD) Seconds of 、 minute 、 Hours (12 or 24 hourly )、 star
Period 、 date 、 Month and year . Besides , Sub second values in binary format are also available .
The system can automatically compensate the days of the month to 28、29( Leap year )、30 and 31 God . And you can have daylight saving time
compensate .
Other 32 The bit register also contains programmable alarm sub seconds 、 second 、 minute 、 Hours 、 What day and date of the week .
block diagram :
 Insert picture description here
According to the picture above : Work out RTC clock frequency :32.768kHZ/128/256=1HZ
interrupt :
 Insert picture description here
choice LSE As RTC Clock source :
 Insert picture description here

 Insert picture description here
 Insert picture description here
Code :
 Insert picture description here
 Insert picture description here
RTC Wake up interrupt :
There is more configuration in the following step :
 Insert picture description here
Code :
 Insert picture description here

 Insert picture description here

 Insert picture description here
Callback function :
 Insert picture description here

原网站

版权声明
本文为[Shrimp paste]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207050452200716.html