lpcware

LPC11Exx power down mode.

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by sicotc on Fri Jan 09 07:26:05 MST 2015
Hello,
I configured the LPC11E14 for working with IRC oscillator :

file system_LPC11Exx.c in CMSIS_CORE_LPC11Exx library :


#define CLOCK_SETUP           1
#define SYSOSCCTRL_Val        0x0              // Reset: 0x000
#define WDTOSCCTRL_Val        0x0              // Reset: 0x000
#define SYSPLLCTRL_Val        0x0              // Reset: 0x000
#define SYSPLLCLKSEL_Val      0x0              // Reset: 0x000
#define MAINCLKSEL_Val        0x0              // Reset: 0x000
#define SYSAHBCLKDIV_Val      0x1              // Reset: 0x001


(I used CMSIS_Configuration_Wizard software)
So the main clock is 12 MHz.
see clock_configuration.pdf for more details.

the main software for going to power down mode :


int main(void) {
SystemCoreClockUpdate();
Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_GPIO);

LPC_IOCON->PIO0[1]=0 | (1<<7);
//put all port 0 pin in output except GPIO0_1 ISP pin with external pull up for ISP programmer
LPC_GPIO->DIR[0] = 0xFFFFFF & ~(1<<1);
//put all output LOW (no pin connected to load)
LPC_GPIO->PIN[0] = 0;

//put all port 1 pin in output
LPC_GPIO->DIR[1] = 0xFFFFFFFF; //(no pin connected to load for the test)
//put all output LOW
LPC_GPIO->PIN[1] = 0;

//UM10518 manual page 40
LPC_WWDT->MOD=0; //to be sure lock bit 5 in the WWDT MOD register is not set.
LPC_PMU->PCON  = (1<<11);//clear DPDFLAG if set
LPC_PMU->PCON |= (1<<8);//clear deep sleep flag
LPC_PMU->PCON = 2;//power down config
// power down configuration
LPC_SYSCTL->PDSLEEPCFG = ( 0x37 //  reserved bit
| (0x1FF << 7)// reserved bit : see http://docs.lpcware.com/lpc800um/RegisterMaps/syscon/r-PDSLEEPCFG.html
| SYSCTL_DEEPSLP_BOD_PD/* BOD power-down control in Deep-sleep mode, powered down */
| SYSCTL_DEEPSLP_WDTOSC_PD /* Watchdog oscillator power control in Deep-sleep, powered down */
);
// peripheral power down

LPC_SYSCTL->PDRUNCFG= (0xED00//  reserved bit
//| SYSCTL_POWERDOWN_IRCOUT_PD /* IRC oscillator output power down */
//| SYSCTL_POWERDOWN_IRC_PD    /* IRC oscillator not power-down */
//| SYSCTL_POWERDOWN_FLASH_PD  /* Flash not power down */
| SYSCTL_POWERDOWN_BOD_PD    /* BOD power down */
| SYSCTL_POWERDOWN_ADC_PD    /* ADC power down */
| SYSCTL_POWERDOWN_SYSOSC_PD /* System oscillator power down */
| SYSCTL_POWERDOWN_WDTOSC_PD /* Watchdog oscillator power down */
| SYSCTL_POWERDOWN_SYSPLL_PD /* System PLL power down */
);

LPC_SYSCTL->PDWAKECFG= ( 0xED00//  reserved bit
//| SYSCTL_SLPWAKE_IRCOUT_PD /* IRC oscillator output wake-up configuration */
//| SYSCTL_SLPWAKE_IRC_PD    /* IRC oscillator power-down wake-up configuration */
//| SYSCTL_SLPWAKE_FLASH_PD  /* Flash wake-up configuration */
| SYSCTL_SLPWAKE_BOD_PD    /* BOD wake-up configuration */
| SYSCTL_SLPWAKE_ADC_PD    /* ADC wake-up configuration */
| SYSCTL_SLPWAKE_SYSOSC_PD /* System oscillator wake-up configuration */
| SYSCTL_SLPWAKE_WDTOSC_PD /* Watchdog oscillator wake-up configuration */
| SYSCTL_SLPWAKE_SYSPLL_PD /* System PLL wake-up configuration */
);
// Enter sleep mode
SCB->SCR |= (1 << 2);//SLEEPDEEP = 1 in system control register
__WFI(); //will never wake up
while(1);
}


I removed all pin wakeup configuration in the code (it work fine).
I use an empty PCB with :
[list]
  [*]LPC11E14
  [*]ISP connector for programmation
  [*]external pull up for the reset.
  [*]external pull up for ISP pin
[/list]

When I am in low power mode, I measure 2,4 mA !!!!
I measure the same thing on 2 differents boards.

during the reset, the current decrease to around 1,3 mA.
The clock seems to work again in power down mode.
If I put an output pin state at 1 after __WFI() instruction, the output stay in 0 which prove __WFI() works.
what's wrong ?

Find attached the workspace for the test.
thanks for your Help.

SicotC





Original Attachment has been moved to: testLowPower.zip

Attachments

Outcomes