STM8L101在首次进入HALT,测试功耗是0.82ua,awu唤醒后再次进入HALT,测试功耗是1.35ma,这是什么情况? void GPIO_LowPower_Config(void) { GPIO_Init(GPIOA, GPIO_Pin_All, GPIO_Mode_Out_PP_High_Slow); GPIO_Init(GPIOB, GPIO_Pin_All, GPIO_Mode_Out_PP_High_Slow); GPIO_Init(GPIOC, GPIO_Pin_All, GPIO_Mode_Out_PP_High_Slow); GPIO_Init(GPIOD, GPIO_Pin_All, GPIO_Mode_Out_PP_High_Slow); } void Enter_Halt(void) { AWU_DeInit(); AWU_Cmd(ENABLE); AWU_Init(AWU_Timebase_30s); GPIO_LowPower_Config(); asm("halt"); } void main(void) { asm("sim"); //关中断 GPIO_LowPower_Config(); CLK_DeInit(); CLK_MasterPrescalerConfig(CLK_MasterPrescaler_HSIDiv2); //时钟8分频,2MHz CLK_PeripheralClockConfig(CLK_Peripheral_AWU, ENABLE); enableInterrupts();/* 开所有中断 */ Enter_Halt(); while (1) { delay_ms(1); Enter_Halt(); } } INTERRUPT_HANDLER(AWU_IRQHandler,4) { /* In order to detect unexpected events during development, it is recommended to set a breakpoint on the following instruction. */ AWU->CSR = AWU->CSR; } |
评分
查看全部评分
#pragma vector= AWU_vector//0x03
__interrupt void AWU_IRQHandler(void)
{
AWU_CSR1=AWU_CSR1;
}