I am using a LPC802 in deep power down mode, the current should be 0.15uA, but I have a 13,8uA current consumption.
Following the example "power_mode_switch_lpc.c":
I configure the wakeup pin:
POWER_DeepPowerDownWakeupSourceSelect(kPmu_Dpd_En_Pio0_17);
where:
static inline void POWER_DeepPowerDownWakeupSourceSelect(uint32_t wakeup_pin)
{
PMU->WUENAREG |= wakeup_pin;
}
and to enter deep power down mode call the function:
POWER_EnterDeepPowerDownMode();
where:
void POWER_EnterDeepPowerDownMode(void)
{
uint32_t pmsk;
pmsk = __get_PRIMASK();
__disable_irq();
/* make sure NODPD is cleared */
PMU->PCON = (PMU->PCON & (~(PMU_PCON_PM_MASK | PMU_PCON_NODPD_MASK))) | PMU_PCON_PM(kPmu_Deep_PowerDown);
/* enable Deepsleep mode in the ARM-CORTEX M0+ SCR register */
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
/*clear wake up pin status flag*/
PMU->WUSRCREG |= PMU_WUSRCREG_WUSRCREG_MASK;
/* Enter powerdown mode */
__WFI();
/* disable Deepsleep mode in the ARM-CORTEX M0+ SCR register */
SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk;
__set_PRIMASK(pmsk);
}
All the pins are without external connections, except wakeup pin, where I have an external pullup