/* Includes ------------------------------------------------------------------*/ #include "stm32l1xx.h" /* Private function prototypes -----------------------------------------------*/ void RCC_Configuration(void); void GPIO_Configuration(void); /* Private functions ---------------------------------------------------------*/ /** * @brief Main program * @param None * @retval None */ int main(void) { /* System Clocks Configuration **********************************************/ RCC_Configuration(); GPIO_Configuration(); #ifdef VECT_TAB_RAM /* Set the Vector Table base location at 0x20000000 */ NVIC_SetVectorTable(NVIC_VectTab_RAM, 0x0); #else /* VECT_TAB_FLASH */ /* Set the Vector Table base location at 0x08000000 */ NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x0); #endif NVIC_InitTypeDef NVIC_InitStructure; /* Enable the RTC Wakeup Interrupt */ NVIC_InitStructure.NVIC_IRQChannel = RTC_WKUP_IRQn; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_Init(&NVIC_InitStructure); /* RTC Wakeup Interrupt Generation: Clock Source: RTCDiv_16, Wakeup Time Base: 4s */ RTC_WakeUpClockConfig(RTC_WakeUpClock_RTCCLK_Div16); RTC_SetWakeUpCounter(0x1FFF); /* Enable the Wakeup Interrupt */ RTC_ITConfig(RTC_IT_WUT, ENABLE); RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, DISABLE); PWR_UltraLowPowerCmd(ENABLE); PWR_EnterSTOPMode(PWR_Regulator_LowPower,PWR_STOPEntry_WFI); // RCC_MCOConfig(RCC_MCOSource_LSE, RCC_MCODiv_1); // while (1) { } } /** * @brief Configures the different system clocks. * @param None * @retval None */ void RCC_Configuration(void) { /* Enable The PWR Clock */ RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE); /* Allow access to RTC */ PWR_RTCAccessCmd(ENABLE); /*! |
STM32L151RDT6 SDIO读写SD卡 FIFO下溢错误,不知是什么原因
STM32L152 RTC唤醒STOP mode问题
STM32L152系列自带LCD驱动段码液晶屏,怎么驱动想要亮的段亮
STM32L151为何FLASH擦除后全是是0x00?
求助!!STM32L151中的RTC唤醒(wake up)中断问题
STM32L152普通I/O模拟SPI驱动W25Q16问题
STM32L152开发板原理图及说明文档
STM32L1系列,如何释放PA15为普通GPIO端口
STM32L151读取W25Q16的ID错误,请帮忙看看是什么原因
STM32L151 STOP模式唤醒程序跑哪儿了
RE:求助 STM32L152RBT6功耗测试
回复:求助 STM32L152RBT6功耗测试
只能通过RTC或者外部中断唤醒来判断。
再请教一下
我在用外部中断唤醒的时候测到从STOP或者sleep模式唤醒到正常工作所需要的时间为2.5ms,觉得时间有些长啊,又找不到资料里有这个数据的,请问下这个时间正常吗?
注:我用的内部默认RC,MSI(2M),开始PA12置高,中断里取反