初级会员

- 积分
- 56
- 金钱
- 56
- 注册时间
- 2013-4-3
- 在线时间
- 4 小时
|
5金钱
我的系统目前只焊接了8M和32768hZ晶振电路和复位电路,采用3.6V电池供电,测试ST官方例程的WakeUpTiming例程进入停止模式电流为0.6ma,MCU为STM32F101RC ,代码非常简单:请各位高手帮忙!谢谢!!!!
int main(void)
{
/* Clock configuration */
SystemInit();
/* Enable PWR and BKP clock */
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR | RCC_APB1Periph_BKP, ENABLE);
/* Desable the SRAM and FLITF clock in Stop mode */
RCC_AHBPeriphClockCmd(RCC_AHBPeriph_SRAM|RCC_AHBPeriph_FLITF, DISABLE);
GPIO_Config_ALL_AIN();
  WR_EnterSTOPMode(PWR_Regulator_LowPower, PWR_STOPEntry_WFI);
}
void GPIO_Config_ALL_AIN(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
/* Disable the Serial Wire Jtag Debug Port SWJ-DP */
GPIO_PinRemapConfig(GPIO_Remap_SWJ_Disable, ENABLE);
/* PA */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
GPIO_Init(GPIOA, &GPIO_InitStructure);
/* PB */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
GPIO_Init(GPIOB, &GPIO_InitStructure);
/* PC */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
GPIO_Init(GPIOC, &GPIO_InitStructure);
/* PD */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
GPIO_Init(GPIOD, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_All;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
GPIO_Init(GPIOE, &GPIO_InitStructure);
/* Enable GPIOD and GPIOE clock */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOB
| RCC_APB2Periph_GPIOC | RCC_APB2Periph_GPIOD
| RCC_APB2Periph_AFIO, DISABLE);
}
|
最佳答案
查看完整内容[请看2#楼]
已解决!程序没有问题,换了一片MCU就OK了,现在还不清楚这片MCU是不是个体差异。实测STOPMode电流24uA,standby模式2.2uA,如果standby模式唤醒后也能从下一条指令执行就更加完美了!
|