전자부품 데이터시트 검색엔진
  Korean  ▼
ALLDATASHEET.CO.KR

X  

AN3371 데이터시트(PDF) 11 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
Logo STMICROELECTRONICS - STMicroelectronics

AN3371 데이터시트(HTML) 11 Page - STMicroelectronics

Back Button 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 AN3371 Datasheet HTML 12Page - STMicroelectronics AN3371 Datasheet HTML 13Page - STMicroelectronics AN3371 Datasheet HTML 14Page - STMicroelectronics AN3371 Datasheet HTML 15Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 11 / 45 page
background image
AN3371
Overview of the STM32 advanced RTC
Doc ID 018624 Rev 5
11/45
Configuring the alarm behavior using the MSKx bits
The alarm behavior can be configured using the MSKx bits (x = 1, 2, 3, 4) of the
RTC_ALRMAR register for alarm A (RTC_ALRMBR register for alarm B).
Table 5 shows all the possible alarm settings. As an example, to configure the alarm time to
23:15:07 on Monday (assuming that the WDSEL = 1), MSKx bits must be set to 0000b.
When the WDSEL = 0, all cases are similar, except that the Alarm Mask field compares with
the day number and not the day of the week, and MSKx bits must be set to 0000b.
Table 4.
Steps to configure the alarm
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
Disable alarm A
Clear ALRAE(1) bit in
RTC_CR register.
1.
Respectively ALRBE bit for alarm B.
3
Check that the RTC_ALRMAR
register can be accessed
Poll ALRAWF(2) bit until
it is set in RTC_ISR.
2.
Respectively ALRBWF bit for alarm B.
It takes approximately two
RTCCLK clock cycles (clock
synchronization).
4
Configure the alarm
Configure
RTC_ALRMAR(3)
register.
3.
Respectively RTC_ALRMBR register for alarm B.
The alarm hour format must be
the same(4) as the RTC
Calendar in RTC_ALRMAR.
4.
As an example, if the alarm is configured to occur at 3:00:00 PM, the alarm will not occur even if the
calendar time is 15:00:00, because the RTC calendar is 24-hour format and the alarm is 12-hour format.
5
Re-enable alarm A
Set ALRAE(5) bit in
RTC_CR register.
5.
Respectively ALRBE bit for alarm B.
6.
RTC alarm registers can only be written when the corresponding RTC alarm is disabled or during RTC
Initialization mode.
6
Enable the RTC registers Write
protection
Write "0xFF" into the
RTC_WPR register
RTC registers can no longer be
modified
Table 5.
Alarm combinations
MSK3 MSK2 MSK1 MSK0
Alarm behavior
00
00
All fields are used in alarm comparison:
Alarm occurs at 23:15:07, each Monday.
00
01
Seconds do not matter in alarm comparison
The alarm occurs every second of 23:15, each Monday.
00
10
Minutes do not matter in alarm comparison
The alarm occurs at the 7th second of every minute of 23:XX, each
Monday.
00
11
Minutes and seconds do not matter in alarm comparison
01
00
Hours do not matter in alarm comparison
01
01
Hours and seconds do not matter in alarm comparison



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


링크 URL



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