EasyManuals Logo

ST STM32F31xx User Manual

ST STM32F31xx
584 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #359 background imageLoading...
Page #359 background image
UM1581
Real-time clock (RTC)
DocID023800 Rev 1
359/584
1. PC14 and PC15 can be used as LSE pins only
2. PC13 can be used as the RTC_AF pin
19.2.2 Backup Domain Reset
The backup domain reset sets all RTC registers and the RCC_BDCR register to their reset
values. A backup domain reset is generated when one of the following events occurs:
1. Software reset, triggered by setting the BDRST bit in the RCC Backup domain control
register (RCC_BDCR). You can use the RCC_BackupResetCmd().
2. VDD or VBAT power on, if both supplies have previously been powered off.
19.2.3 Backup Domain Access
After reset, the backup domain (RTC registers and RTC backup data registers) is
protected against possible unwanted write accesses.
To enable access to the Backup Domain and RTC registers, proceed as follows:
1. Enable the Power Controller (PWR) APB1 interface clock using the
RCC_APB1PeriphClockCmd() function.
2. Enable access to Backup domain using the PWR_BackupAccessCmd() function.
3. Select the RTC clock source using the RCC_RTCCLKConfig() function.
4. Enable RTC Clock using the RCC_RTCCLKCmd() function.
19.2.4 How to use this driver
ï‚· Enable the backup domain access (see description in the section above)
ï‚· Configure the RTC Prescaler (Asynchronous and Synchronous) and RTC hour format
using the RTC_Init() function.
Time and Date configuration
ï‚· To configure the RTC Calendar (Time and Date) use the RTC_SetTime() and
RTC_SetDate() functions.
ï‚· To read the RTC Calendar, use the RTC_GetTime() and RTC_GetDate() functions.
ï‚· To read the RTC subsecond, use the RTC_GetSubSecond() function.
ï‚· Use the RTC_DayLightSavingConfig() function to add or sub one hour to the RTC
Calendar.
Alarm configuration
ï‚· To configure the RTC Alarm use the RTC_SetAlarm() function.
ï‚· Enable the selected RTC Alarm using the RTC_AlarmCmd() function.
ï‚· To read the RTC Alarm, use the RTC_GetAlarm() function.
ï‚· To read the RTC alarm SubSecond, use the RTC_GetAlarmSubSecond() function.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ST STM32F31xx and is the answer not in the manual?

ST STM32F31xx Specifications

General IconGeneral
BrandST
ModelSTM32F31xx
CategoryMicrocontrollers
LanguageEnglish

Related product manuals