Ultra Start 23xx Manuale Utente

Navigare online o scaricare Manuale Utente per Alarme antifurto per auto Ultra Start 23xx. Using the hardware real-time clock (RTC) [en] Manuale Utente

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 45
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 0
September 2012 Doc ID 018624 Rev 5 1/45
AN3371
Application note
Using the hardware real-time clock (RTC)
in STM32 F0, F2, F3, F4 and L1 series of MCUs
Introduction
A real-time clock (RTC) is a computer clock that keeps track of the current time. Although
RTCs are often used in personal computers, servers and embedded systems, they are also
present in almost any electronic device that requires accurate time keeping. Microcontrollers
supporting RTC can be used for chronometers, alarm clocks, watches, small electronic
agendas, and many other devices.
This application note describes the features of the real-time clock (RTC) controller embedded
in Ultra Low Power Medium-density, Ultra Low Power High-density, F0, F2 and F4 series
devices microcontrollers, and the steps required to configure the RTC for use with the calendar,
alarm, periodic wakeup unit, tamper detection, timestamp and calibration applications.
Examples are provided with configuration information to enable you to quickly and correctly
configure the RTC for calendar, alarm, periodic wakeup unit, tamper detection, time stamp
and calibration applications.
Note: All examples and explanations are based on the STM32L1xx, STM32F0xx, STM32F2xx
STM32F4xx and STM32F3xx firmware libraries and reference manuals of STM32L1xx
(RM0038), STM32F0xx (RM0091), STM32F2xx (RM0033), STM32F4xx (RM0090),
STM32F37x (RM0313) and STM32F30x(RM0316).
STM32 refers to Ultra Low Power Medium-density, Ultra Low Power High-density, F0, F2
and F4 series devices in this document.
Ultra Low Power Medium (ULPM) density devices are STM32L151xx and STM32L152xx
microcontrollers where the Flash memory density ranges between 64 and 128 Kbytes.
Ultra Low Power High (ULPH) density devices are STM32L151xx, STM32L152xx and
STM32L162xx microcontrollers where the Flash memory density is 384 Kbytes.
F2 series devices are STM32F205xx, STM32F207xx, STM32F215xx and STM32F217xx
microcontrollers.
STM32F3xx refers to STM32F30x, STM32F31x, STM32F37x and STM32F38x devices.
F4 series are STM32F405xx, STM32F407xx, STM32F415xx and STM32F417xx microcontrollers.
F0 series devices are microcontrollers.
Table 1 lists the microcontrollers concerned by this application note.
Table 1. Applicable products
Type Applicable products
Microcontrollers
STM32 F0
STM32 F2
STM32 F3 (STM32F30x, STM32F31x, STM32F37x, STM32F38x)
STM32 F4 (STM32F405xx, STM32F407xx, STM32F415xx, STM32F417xx)
STM32 L1
www.st.com
Vedere la pagina 0
1 2 3 4 5 6 ... 44 45

Sommario

Pagina 1 - Application note

September 2012 Doc ID 018624 Rev 5 1/45AN3371Application noteUsing the hardware real-time clock (RTC) in STM32 F0, F2, F3, F4 and L1 series of MCUsInt

Pagina 2 - Contents

Overview of the STM32 advanced RTC AN337110/45 Doc ID 018624 Rev 51.2 RTC alarms1.2.1 RTC alarm configurationSTM32 RTC embeds two alarms, alarm A and

Pagina 3 - Doc ID 018624 Rev 5 3/45

AN3371 Overview of the STM32 advanced RTCDoc ID 018624 Rev 5 11/45 Configuring the alarm behavior using the MSKx bitsThe alarm behavior can be

Pagina 4 - List of tables

Overview of the STM32 advanced RTC AN337112/45 Doc ID 018624 Rev 5Caution: If the seconds field is selected (MSK0 bit reset in RTC_ALRMAR or RTC_ALRMB

Pagina 5 - List of figures

AN3371 Overview of the STM32 advanced RTCDoc ID 018624 Rev 5 13/45The Alarm sub-second can be configured using the mask ss bits in the alarm sub-secon

Pagina 6 - 1.1 RTC calendar

Overview of the STM32 advanced RTC AN337114/45 Doc ID 018624 Rev 51.3 RTC periodic wakeup unitLike many STMicroelectronics microcontrollers, the STM3

Pagina 7 - WED OCT 26 2011

AN3371 Overview of the STM32 advanced RTCDoc ID 018624 Rev 5 15/451.3.2 Maximum and minimum RTC wakeup periodThe wakeup unit clock is configured thro

Pagina 8 - 1.1.2 RTC clock configuration

Overview of the STM32 advanced RTC AN337116/45 Doc ID 018624 Rev 5Periodic timebase/wakeup configuration for clock configuration 2Figure 9 shows the p

Pagina 9 - MS19527V1

AN3371 Overview of the STM32 advanced RTCDoc ID 018624 Rev 5 17/45Summary of timebase/wakeup period extremaWhen RTCCLK= 32768 Hz, the minimum and maxi

Pagina 10 - 1.2 RTC alarms

Overview of the STM32 advanced RTC AN337118/45 Doc ID 018624 Rev 5Consequently, the coarse calibration is not adequate for a dynamic calibration (such

Pagina 11 - MSK3 MSK2 MSK1 MSK0

AN3371 Overview of the STM32 advanced RTCDoc ID 018624 Rev 5 19/45A smooth calibration can be performed on the fly so that it can be changed when the

Pagina 12

Contents AN33712/45 Doc ID 018624 Rev 5Contents1 Overview of the STM32 advanced RTC . . . . . . . . . . . . . . . . . . . . . . . . . . 61.1 RTC cale

Pagina 13 -

Overview of the STM32 advanced RTC AN337120/45 Doc ID 018624 Rev 51.6 RTC reference clock detectionThe reference clock (at 50 Hz or 60 Hz) should have

Pagina 14

AN3371 Overview of the STM32 advanced RTCDoc ID 018624 Rev 5 21/451.7 Time-stamp functionThe Time-stamp feature provides the means to automatically sa

Pagina 15 - 16-bit wakeup

Overview of the STM32 advanced RTC AN337122/45 Doc ID 018624 Rev 51.8 RTC tamper detection functionThe RTC includes n tamper detection inputs. The ta

Pagina 16 - Wakeup period resolution

AN3371 Overview of the STM32 advanced RTCDoc ID 018624 Rev 5 23/45Figure 15. Tamper with edge detectionNote: With tamper events, sampling and precharg

Pagina 17

Overview of the STM32 advanced RTC AN337124/45 Doc ID 018624 Rev 5Figure 16. Tamper with level detectionUsing the level detection (tamper filter set t

Pagina 18

AN3371 Overview of the STM32 advanced RTCDoc ID 018624 Rev 5 25/45 1.8.3 Active time-stamp on tamper detection eventBy setting the TAMPTS bit

Pagina 19 - Doc ID 018624 Rev 5 19/45

Overview of the STM32 advanced RTC AN337126/45 Doc ID 018624 Rev 5The RTC keeps working in reset mode and its registers are only reset by a VDD or VBA

Pagina 20 - Shadow registers

AN3371 Overview of the STM32 advanced RTCDoc ID 018624 Rev 5 27/45Setting 1 Hz as the output signal1. Select LSE “32768 Hz” as the RTC clock source.2.

Pagina 21 - 1.7 Time-stamp function

Overview of the STM32 advanced RTC AN337128/45 Doc ID 018624 Rev 51.11.2 RTC_ALARM outputThe RTC_ALARM output can be connected to the RTC alarm unit A

Pagina 22

AN3371 Overview of the STM32 advanced RTCDoc ID 018624 Rev 5 29/45Figure 20. Periodic wakeup routed to RTC_ALARM pinout1.12 RTC security aspects1.12.

Pagina 23 - MS30113V1

AN3371 ContentsDoc ID 018624 Rev 5 3/453.1 Start with the RTC driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333.

Pagina 24 - MS30114V1

Overview of the STM32 advanced RTC AN337130/45 Doc ID 018624 Rev 5calendar year field is set to 0x00 (power-on reset value), meaning that the calendar

Pagina 25 - 1.10 RTC and low-power modes

AN3371 Advanced RTC featuresDoc ID 018624 Rev 5 31/452 Advanced RTC features Table 15. Advanced RTC featuresRTC features F0 series F3 series

Pagina 26 - 1.11.1 RTC_CALIB output

Advanced RTC features AN337132/45 Doc ID 018624 Rev 5Time StampConfigurable input mapping X X X XTimeHours, minutes and secondsXXXXXXSub-seconds X XXX

Pagina 27 - MS30116V1

AN3371 RTC firmware driver APIDoc ID 018624 Rev 5 33/453 RTC firmware driver APIThis driver provides a set of firmware functions to manage the follow

Pagina 28 - 1.11.2 RTC_ALARM output

RTC firmware driver API AN337134/45 Doc ID 018624 Rev 5Note: After a reset, the backup domain (RTC registers, RTC backup data registers and backup SRA

Pagina 29 - 1.12 RTC security aspects

AN3371 RTC firmware driver APIDoc ID 018624 Rev 5 35/453.1.4 Outputs configurationThe RTC has two different outputs:● AFO_ALARM, used to manage the RT

Pagina 30 - 30/45 Doc ID 018624 Rev 5

RTC firmware driver API AN337136/45 Doc ID 018624 Rev 53.1.8 Backup data registers configurationTo write to the RTC backup data registers, use the RT

Pagina 31 - 2 Advanced RTC features

AN3371 RTC firmware driver APIDoc ID 018624 Rev 5 37/452Initialization and Configuration RTC_InitInitializes the RTC registers according to the specif

Pagina 32 - Advanced RTC features AN3371

RTC firmware driver API AN337138/45 Doc ID 018624 Rev 54RTC alarms functionsRTC_SetAlarmSets the RTC specified alarm configuration:“Alarm time fields,

Pagina 33 - 3 RTC firmware driver API

AN3371 RTC firmware driver APIDoc ID 018624 Rev 5 39/458RTC digital coarse calibration functionsRTC_DigitalCalibConfigConfigures the coarse calibratio

Pagina 34 - 3.1.2 Alarm configuration

List of tables AN33714/45 Doc ID 018624 Rev 5List of tablesTable 1. Applicable products and tools. . . . . . . . . . . . . . . . . . . . . . . . . . .

Pagina 35 - 3.1.7 Tamper configuration

RTC firmware driver API AN337140/45 Doc ID 018624 Rev 511RTC backup registers functionsRTC_WriteBackupRegisterWrites data in a specified RTC backup da

Pagina 36

AN3371 Application examplesDoc ID 018624 Rev 5 41/454 Application examplesThe RTC firmware driver is provided with a set of examples, so that you can

Pagina 37

Application examples AN337142/45 Doc ID 018624 Rev 5Ta mp er detectionThis example shows how to write/read data to/from RTC backup data registers and

Pagina 38

AN3371 Revision historyDoc ID 018624 Rev 5 43/455 Revision history Table 18. Document revision historyDate Revision Changes20-May-2011 1 Initi

Pagina 39

Revision history AN337144/45 Doc ID 018624 Rev 524-May-2012 4Updated the title.Added F0 series devices and STM32F0xx in the Introduction.Added a new d

Pagina 40

AN3371Doc ID 018624 Rev 5 45/45 Please Read Carefully:Information in this document is provided solely in connection with ST products. STMicro

Pagina 41 - 4 Application examples

AN3371 List of figuresDoc ID 018624 Rev 5 5/45List of figuresFigure 1. RTC calendar fields . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Pagina 42

Overview of the STM32 advanced RTC AN33716/45 Doc ID 018624 Rev 51 Overview of the STM32 advanced RTCThe real-time clock (RTC) embedded in STM32 micr

Pagina 43 - 5 Revision history

AN3371 Overview of the STM32 advanced RTCDoc ID 018624 Rev 5 7/45the month, day of the week, month and year. This data can be converted to BCD format

Pagina 44 - Section 3.1: Start

Overview of the STM32 advanced RTC AN33718/45 Doc ID 018624 Rev 51.1.2 RTC clock configurationRTC clock sourceThe RTC calendar can be driven by three

Pagina 45 - Doc ID 018624 Rev 5 45/45

AN3371 Overview of the STM32 advanced RTCDoc ID 018624 Rev 5 9/45Figure 5. Prescalers from RTC clock source to calendar unitNote: The length of the sy

Commenti su questo manuale

Nessun commento