lpcware

求解:LPC1114/302的deep sleep模式下电流=800uA,deep power down模式下电流=1.5mA?

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by xumeixiaoz on Sun Aug 25 19:05:03 MST 2013
Hi,all
  最近在做的一个项目用到LPC1114/302,需要电池供电,所以在空闲的时候,要省电。从lpc11xx的datasheet上,看到lpc11xx/302进入deep sleep模式之后,工作电流可以达到2uA,而deep power down模式下可以达到220nA。于是,我用一块只有LPC1114/302,其他外接电路都断开的板子,把程序配置成启动之后即进入deep sleep模式,代码如下:

void PMU_Init( void )
{
  uint32_t regVal;
  LPC_SYSCON->PDRUNCFG &= ~(IRC_OUT_PD|IRC_PD|FLASH_PD);

  LPC_SYSCON->PDRUNCFG |= (BOD_PD|ADC_PD|SYS_OSC_PD|WDT_OSC_PD|SYS_PLL_PD);
  LPC_PMU->PCON = (0x1<<11);
  NVIC_EnableIRQ((IRQn_Type)(WAKEUP2_IRQn));
  NVIC_EnableIRQ((IRQn_Type)(WAKEUP3_IRQn));
  NVIC_EnableIRQ((IRQn_Type)(WAKEUP6_IRQn));
  NVIC_EnableIRQ((IRQn_Type)(WAKEUP12_IRQn));

  LPC_SYSCON->STARTAPRP0 = 0x00000000;
  LPC_SYSCON->STARTRSRP0CLR = 0xFFFFFFFF;
  LPC_SYSCON->STARTERP0 = ((0x1<<2)|(0x1<<3)|(0x1<<6)|(0x1<<12));
  return;
}
void PMU_Sleep( uint32_t SleepMode)
{
  uint32_t regVal;

  /* Enable all clocks, even those turned off at power up. */
  LPC_SYSCON->PDRUNCFG = ~(IRC_OUT_PD|IRC_PD|FLASH_PD);

  LPC_SYSCON->SYSPLLCLKSEL  = 0;   /* Select PLL Input         */
  LPC_SYSCON->SYSPLLCLKUEN  = 0x01;               /* Update Clock Source      */
  LPC_SYSCON->SYSPLLCLKUEN  = 0x00;               /* Toggle Update Register   */
  LPC_SYSCON->SYSPLLCLKUEN  = 0x01;
  while (!(LPC_SYSCON->SYSPLLCLKUEN & 0x01));     /* Wait Until Updated       */

  LPC_PMU->PCON = (1<<11);
  LPC_PMU->PCON |= (1<<8);
  LPC_SYSCON->PDAWAKECFG = LPC_SYSCON->PDRUNCFG;
  LPC_SYSCON->PDSLEEPCFG = 0x000018FF;
  /* If normal sleep, not deep sleep, don't do anything to SCR reg. */
  if ( SleepMode )
  {
  SCB->SCR |= NVIC_LP_SLEEPDEEP;
  }
  __WFI();
  return;
}
结果,用万用表测得工作电流是800uA,远达不到2uA。
然后,我又把程序配置成启动之后即进入deep power down模式,代码如下:
void PMU_PowerDown( void )
{
    LPC_PMU->PCON = (1<<1)|(1<<11);
SCB->SCR |= NVIC_LP_SLEEPDEEP;
LPC_SYSCON->PDRUNCFG &= ~(IRC_OUT_PD|IRC_PD);
    __WFI();
  return;
}
结果,用万用表测得电流是1.5mA,电流反而更大了。
请各位帮帮忙,看看是哪里出了问题。

Outcomes