数据搜索系统,热门电子元器件搜索
  Chinese  ▼
ALLDATASHEETCN.COM

X  

AN3371 数据表(PDF) 7 Page - STMicroelectronics

部件名 AN3371
功能描述  Using the hardware real-time clock
PDF  45 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  STMICROELECTRONICS [STMicroelectronics]
网页  http://www.st.com
标志 STMICROELECTRONICS - STMicroelectronics

AN3371 数据表(HTML) 7 Page - STMicroelectronics

Back Button AN3371 Datasheet HTML 3Page - STMicroelectronics AN3371 Datasheet HTML 4Page - STMicroelectronics AN3371 Datasheet HTML 5Page - STMicroelectronics AN3371 Datasheet HTML 6Page - STMicroelectronics AN3371 Datasheet HTML 7Page - STMicroelectronics AN3371 Datasheet HTML 8Page - STMicroelectronics AN3371 Datasheet HTML 9Page - STMicroelectronics AN3371 Datasheet HTML 10Page - STMicroelectronics AN3371 Datasheet HTML 11Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 7 / 45 page
background image
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



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45


数据表 下载

Go To PDF Page


链接网址



ALLDATASHEET是否为您带来帮助?  [ DONATE ] 

关于 Alldatasheet   |   广告服务   |   联系我们   |   隐私政策   |   数据表链接    |   链接交换   |   制造商名单
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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