首先,这个板子在halt下,功耗正常;
下面是我的active-halt的程序,今天刚测是618ua,
main()
{
CLK_MasterPrescalerConfig(CLK_MasterPrescaler_HSIDiv1);
CLK_PeripheralClockConfig(CLK_Peripheral_SPI, ENABLE);
GPIO_Init(Swim_Mod, Control1, GPIO_Mode_Out_PP_Low_Fast);
GPIO_Init(PortB_Func, Control2, GPIO_Mode_Out_PP_Low_Fast);
GPIO_Init(PortB_Func, nIRQ , GPIO_Mode_In_PU_No_IT);
GPIO_Init(PortB_Func, Mod2, GPIO_Mode_Out_PP_Low_Fast);
GPIO_Init(PortB_Func, Busy, GPIO_Mode_Out_PP_Low_Fast);
GPIO_ResetBits(Swim_Mod, Control1);
GPIO_SetBits(PortB_Func, Control2);
GPIO_Init(PortD_Func, Mod1, GPIO_Mode_Out_PP_Low_Fast);
spi_init();
GPIO_Init(PortB_Func, SPI_nCS, GPIO_Mode_Out_PP_High_Fast);
SPI_nCS_High;
CLK_PeripheralClockConfig(CLK_Peripheral_TIM2, ENABLE);
CLK_PeripheralClockConfig(CLK_Peripheral_AWU, ENABLE);
/* Initialization of AWU */
/* LSI calibration for accurate auto wake up time base*/
AWU_LSICalibrationConfig(LSIMeasurment());
/* The delay corresponds to the time we will stay in Halt mode */
AWU_Init(AWU_Timebase_12s);
MyRFInit();
RFSetIdleMode();
/* Enable interrupts*/
enableInterrupts();
while(1)
{
halt(); /* Program halted */
GPIO_ResetBits(PortB_Func, Busy);
}
}
|