[STM8] stm8l101f3p6的功耗问题,急

[复制链接]
5714|6
 楼主| gradzz 发表于 2012-6-20 15:23 | 显示全部楼层 |阅读模式
在halt模式下,功耗正常,0.3ua,基本上不费电
但是在active-halt模式下,我用的是awu唤醒,电流高达705ua,请问这正常吗?问题出在哪?请高手指点,谢谢!
香水城 发表于 2012-6-20 16:35 | 显示全部楼层
当然不正常

先试试ST提供的例程,看看是软件问题还是硬件问题
 楼主| gradzz 发表于 2012-6-21 09:43 | 显示全部楼层
首先,这个板子在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);
   }
}
IJK 发表于 2012-6-21 10:38 | 显示全部楼层
active-halt模式下,测到的平均电流取决于active多长时间、halt又是多长时间,active时间:halt时间不同【比如1:1 跟 5:1】 那么平均电流肯定也不同。
qianguiyi 发表于 2012-6-21 12:42 | 显示全部楼层
无用引脚要上拉,可以减少噪声功耗
 楼主| gradzz 发表于 2012-6-21 14:15 | 显示全部楼层
5楼得答案符合我的问题,就是IO的问题,已解决,谢谢大家!
tcdj5430 发表于 2012-8-25 09:32 | 显示全部楼层
无用引脚 设置PP 输出低电平
您需要登录后才可以回帖 登录 | 注册

本版积分规则

7

主题

42

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部