| 数据搜索系统,热门电子元器件搜索 |
|
AN3371 数据表(PDF) 7 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN3371 数据表(HTML) 7 Page - STMicroelectronics |
|
7 / 45 page ![]() AN3371 Overview of the STM32 advanced RTC Doc ID 018624 Rev 5 7/45 the month, day of the week, month and year. This data can be converted to BCD format and displayed on a standard LCD, which is useful in countries that use the 12-hour format with an AM/PM indicator (see Figure 2). Conversion routines use significant program memory space and are CPU-time consuming, which may be critical in certain real-time applications. When using the STM32 RTC calendar, software conversion routines are no longer needed because their functions are performed by hardware. The STM32 RTC calendar is provided in BCD format. This avoids binary to BCD software conversion routines, which use significant program memory space and a CPU-load that may be critical in certain real-time applications. Figure 2. Example of calendar display on an LCD 1.1.1 Initializing the calendar Table 2 describes the steps required to correctly configure the calendar time and date. 11:15:28:09 PM WED OCT 26 2011 Table 2. Steps to initialize the calendar Step What to do How to do it Comments 1 Disable the RTC registers Write protection Write "0xCA" and then "0x53" into the RTC_WPR register RTC registers can be modified 2 Enter Initialization mode Set INIT bit to ‘1’ in RTC_ISR register The calendar counter is stopped to allow update 3 Wait for the confirmation of Initialization mode (clock synchronization) Poll INITF bit of in RTC_ISR until it is set It takes approximately 2 RTCCLK clock cycles for medium density devices 4 Program the prescalers register if needed RTC_PRER register: Write first the synchronous value and then write the asynchronous By default, the RTC_PRER prescalers register is initialized to provide 1Hz to the Calendar unit when RTCCLK = 32768Hz 5 Load time and date values in the shadow registers Set RTC_TR and RTC_DR registers 6 Configure the time format (12h or 24h) Set FMT bit in RTC_CR register FMT = 0: 24 hour/day format FMT = 1: AM/PM hour format 7 Exit Initialization mode Clear the INIT bit in RTC_ISR register The current calendar counter is automatically loaded and the counting restarts after 4 RTCCLK clock cycles 8 Enable the RTC Registers Write Protection Write "0xFF" into the RTC_WPR register RTC Registers can no longer be modified |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |