我现在使用STM32L151进入STOP模式,测试程序运行后电流72uA,按钮按下后电流为331uA,LED灯也不闪烁。按钮松开后电流有变为0.5uA。 好像没有从STOP模式唤醒,理论上唤醒后应该在while(1)的循环里面灯闪烁。 希望使用过这个模式的人指点一下,谢谢! void LEDInit(void) { GPIO_InitTypeDef GPIO_InitStructure; /* Enable the GPIO_LED Clock */ RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, ENABLE); /* Configure the GPIO_LED pin */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_40MHz; GPIO_Init(GPIOB, &GPIO_InitStructure); GPIOB->BSRRL= GPIO_Pin_4; } int main(void) { uint16_t i=0,j=0; GPIO_InitTypeDef GPIO_InitStructure; RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA | RCC_AHBPeriph_GPIOB | RCC_AHBPeriph_GPIOC | RCC_AHBPeriph_GPIOD | RCC_AHBPeriph_GPIOE | RCC_AHBPeriph_GPIOH, ENABLE); /* config all IO to Analog Input to reduce parasite power consumption */ GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_400KHz; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOC, &GPIO_InitStructure); GPIO_Init(GPIOD, &GPIO_InitStructure); GPIO_Init(GPIOE, &GPIO_InitStructure); GPIO_Init(GPIOH, &GPIO_InitStructure); GPIO_Init(GPIOA, &GPIO_InitStructure); GPIO_Init(GPIOB, &GPIO_InitStructure); /* Enable PB7 as external PVD input so as to set it as AIN_IN */ RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE); /* Configure the PVD Level to 3 (2.5V) */ PWR_PVDLevelConfig(PWR_PVDLevel_7); /* Enable the PVD Output */ PWR_PVDCmd(ENABLE); RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA | RCC_AHBPeriph_GPIOB | RCC_AHBPeriph_GPIOC | RCC_AHBPeriph_GPIOD | RCC_AHBPeriph_GPIOE | RCC_AHBPeriph_GPIOH, DISABLE); LEDInit(); /* Enable WKUP pin 1 */ PWR_WakeUpPinCmd(PWR_WakeUpPin_1, ENABLE); /* Clear WakeUp flag */ PWR_ClearFlag(PWR_FLAG_WU); PWR_UltraLowPowerCmd(ENABLE); PWR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI); while(1) { LEDInit(); <span style="color: rgb(68, 68, 68); font-family: Tahoma, Helvetica, SimSun, sans-serif; font-size: 11.818181991577148px; line-height: 16.363636016845703px; background-color: rgb(238, 238, 238);"> for(i=0;i |
RE:STM32L151 STOP模式唤醒程序跑哪儿了
请指教!!??
回复:STM32L151 STOP模式唤醒程序跑哪儿了
请指教!!??
没看到你程序中有外部中断的配置,停止模式下需要一个外部总断去唤醒
RE:STM32L151 STOP模式唤醒程序跑哪儿了
RE:STM32L151 STOP模式唤醒程序跑哪儿了
RE:STM32L151 STOP模式唤醒程序跑哪儿了
一句话,处理器是依靠中断才反应的,包括复位都是一种中断,看看中断设置正确不??