📄 readme.txt
字号:
/******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
* File Name : readme.txt
* Author : MCD Application Team
* Date First Issued : 02/05/2007
* Description : Description of the RTC Example.
********************************************************************************
* History:
* 05/21/2007: V0.3
* 04/02/2007: V0.2
* 02/05/2007: V0.1
********************************************************************************
* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
* AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT,
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*******************************************************************************/
Example description
===================
This example demonstrates and explains how to use the RTC peripheral.
As an application example, it demonstrates how to setup the RTC peripheral, in terms
of prescaler and interrupts, to be used to keep time and to generate Second interrupt.
The RTC clock source can be the LSI or LSE, to select the clock to be used uncomment
the corresponding line: '#define RTCClockSource_LSI', '#define RTCClockSource_LSE'
in 'main.c' file.
The RTC clock can be output on the tamper pin (PC.13), to enable this functionality
uncomment the corresponding line: 'RTCClockOutput_Enable' in 'main.c' file.
The RTC is in the Back-up (BKP) domain, still powered by Vbat when Vdd is switched off,
so the RTC configuration is not lost if a battery is connected to Vbat pin. A key value
is written in BKP data register1 to indicate if the RTC is already configured.
The program behaves as follows:
1. After start-up the program checks the BKP data register1 value:
- register1 value not correct: (BKP data register1 value is not correct or not yet
programmed, when the first time the program is executed) the RTC is configured
and user is asked to adjust time (entered on HyperTerminal)
- register1 value correct: this mean that the RTC is configured and the time is displayed
on HyperTerminal.
2. When External Reset occurs the BKP domain is not reset and the RTC configuration is not lost
3. When Power On Reset occurs:
- if a battery is connected to Vbat pin: the BKP domain is not reset and the RTC
configuration is not lost
- if no battery is connected to Vbat pin: the BKP domain is reset and the RTC
configuration is lost
In the RTC ISR a led connected to PC.06 is toggling each 1s.
The C library printf function is retarget to the USART1, i.e the printf message is output
to the HyperTerminal using USART1.
Directory contents
==================
stm32f10x_conf.h Library Configuration file
stm32f10x_it.h Interrupt handlers header file
stm32f10x_it.c Interrupt handlers
main.c Main program
Hardware environment
====================
- Connect a led to pin PC.06 (LD1 on STM32F10x-EVAL board).
- The USART1 signals (Rx, Tx) must be connected to a DB9 connector using a RS232
transceiver.
- Connect a null-modem female/female RS232 cable between the DB9 connector
(CN6 on STM32F10x-EVAL board) and PC serial port.
- Hyperterminal configuration:
- Word Length = 8 Bits
- One Stop Bit
- No parity
- BaudRate = 115200 baud
- flow control: None
- Connect a 3V battery on Vbat pin (already mounted on STM32F10x-EVAL board)
How to use it
=============
In order to make the program work, you must do the following :
- Create a project and setup all your toolchain's start-up files
- Compile the directory content files and required Library files :
+ stm32f10x_lib.c
+ stm32f10x_gpio.c
+ stm32f10x_rcc.c
+ stm32f10x_rtc.c
+ stm32f10x_bkp.c
+ stm32f10x_pwr.c
+ stm32f10x_nvic.c
+ stm32f10x_usart.c
+ stm32f10x_flash.c
- Link all compiled files and load your image in Flash
- Run the example
******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE******
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -