STM32L151 RTC Summary

Publisher:美人如玉剑如虹Latest update time:2017-11-07 Source: eefocusKeywords:STM32L151  RTC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1. IO port related to RTC: PC13 (TAMPER-RTC) cannot be set to GPIO_Mode_AN state, otherwise it will not enter the RTC interrupt. (It can be set to GPIO_Mode_IN).

2. RTC_WakeUpCmd(DISABLE) is required before setting the RTC clock. This sentence is not in the official example. If this sentence is not there, the RTC will only be reset when the power is turned on again, and the RTC will not be reset when the program is run again.

STM32L151 RTC Summary

3. Before setting the RTC timer wake-up interrupt, be sure to clear the corresponding interrupt, otherwise the phenomenon will be that the RTC interrupt can sometimes be entered but sometimes cannot be entered.

 RTC_ClearITPendingBit(RTC_IT_WUT);

  RTC_ITConfig(RTC_IT_WUT, ENABLE);

 4. When the RTC periodic interrupt wakes up the CPU from stop mode, the Wake-Up flag must be cleared, otherwise the RTC interrupt can only be entered once and cannot be entered subsequently.

 

 if(PWR_GetFlagStatus(PWR_FLAG_WU) != RESET) // Check if the wakeup flag is set 

 {

PWR_ClearFlag(PWR_FLAG_WU);

 }  

Unresolved issues: After the RTC wakes up the CPU, if MSI is configured as the clock source, when entering low power consumption again, the power consumption remains at 60-70ua, and the reason is unknown; when HSE is used as the interrupt source, the RTC interrupt will no longer be entered after three or four times. Currently, HSI is used as the interrupt source after RTC wakes up.


Keywords:STM32L151  RTC Reference address:STM32L151 RTC Summary

Previous article:Level control of 485 transceiver control angle of STM32 serial port
Next article:STM32F051 Comparator

Recommended ReadingLatest update time:2024-11-16 19:59

Songhan MCU RTC Application Notes
Some SN MCU models have RTC function (real-time clock) inside, which is a major feature of dual-clock chips! It also provides convenience for projects that need to use RTC. I have used the RTC function of chips such as SN8P2501A/B, SN8P2308, SN8P2612/13 (early versions), sn8p2614, etc., and the results are good. Issu
[Microcontroller]
Design and implementation of RTC module driver for S3C2440 Windows CE
    introduction   The time display function of the desktop Windows system is well known to everyone. It is implemented through the clock module on the BIOS. Users can modify the current time, time zone, and synchronize with the Internet time by clicking the time on the lower right corner of the desktop system taskba
[Microcontroller]
Design and implementation of RTC module driver for S3C2440 Windows CE
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号