資源簡介
stm32f103rtc配置
代碼片段和文件信息
#include?“includes.h“
#include?“rtc.h“? ????
//第一次配置的時候更改這個值,并且斷開電池和電源一段時間,保證電容電量也放完,或者短接vbat和GND
/*
????其實,在32.768K的晶振引腳上并個上1M(>1m也可以)的電阻就沒事了,哪有那么多問題啊。
????主要是STM32的LSE反饋電阻有點大,并個電阻,就能減小反饋電阻,提高啟振系數。相應的,LSE的功耗就會大一點。
????不過,沒關系,STM32在使用外部電源時,內部軟開關會把LSE的電源切換到外部電源的。
????1個40mAH的小電池,用3年應該沒問題。
????3年,你這個產品還會不會還在使用都是個問題了。說不定早升級了。
*/
#define?data_change?0x4456
#define?RTCAlarm_Way?0??//0中斷線方案,1?原子方案
_calendar_obj?calendar;//時鐘結構體?
?
static?void?RTC_NVIC_Config(void)
{
?NVIC_InitTypeDef?NVIC_InitStructure;
?NVIC_InitStructure.NVIC_IRQChannel?=?RTC_IRQn;??//RTC全局中斷
?NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority?=?2;?
?NVIC_InitStructure.NVIC_IRQChannelSubPriority?=?1;?
?NVIC_InitStructure.NVIC_IRQChannelCmd?=?ENABLE;??//使能該通道中斷
?NVIC_Init(&NVIC_InitStructure);
#if??(RTCAlarm_Way==0)
?NVIC_InitStructure.NVIC_IRQChannel?=?RTCAlarm_IRQn;??//鬧鐘中斷
?NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority?=?1;?//比RTC全局中斷的優先級高
?NVIC_InitStructur
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????10571??2018-07-23?14:56??RTC\app\rtc.c
?????文件???????1109??2017-05-23?12:24??RTC\app\rtc.h
????.......?????23437??2018-07-23?14:49??RTC\moban.uvoptx
????.......?????21184??2018-07-23?14:49??RTC\moban.uvprojx
?????文件??????15523??2018-07-23?15:03??RTC\output\moban.hex
?????文件???????7046??2015-12-04?15:57??RTC\stm32f103\libraries\misc.c
?????文件???????8982??2015-12-04?15:57??RTC\stm32f103\libraries\misc.h
?????文件??????47201??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_adc.c
?????文件??????21690??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_adc.h
?????文件???????8463??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_bkp.c
?????文件???????7555??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_bkp.h
?????文件??????45103??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_can.c
?????文件??????27559??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_can.h
?????文件??????11656??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_cec.c
?????文件???????6573??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_cec.h
?????文件???????3347??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_crc.c
?????文件???????2162??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_crc.h
?????文件??????19087??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_dac.c
?????文件??????15233??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_dac.h
?????文件???????5149??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_dbgmcu.c
?????文件???????3818??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_dbgmcu.h
?????文件??????29607??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_dma.c
?????文件??????20754??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_dma.h
?????文件???????6959??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_exti.c
?????文件???????6824??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_exti.h
?????文件??????62551??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_flash.c
?????文件??????25445??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_flash.h
?????文件??????35484??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_fsmc.c
?????文件??????27016??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_fsmc.h
?????文件??????23221??2015-12-04?15:57??RTC\stm32f103\libraries\stm32f10x_gpio.c
............此處省略52個文件信息
- 上一篇:OBLOQ物聯網
- 下一篇:STM32_HI2C_OLED硬件方式驅動OLED
評論
共有 條評論