AnsweredAssumed Answered

Deep power down on LPC1517

Question asked by Martin Pelletier on Dec 14, 2018
Latest reply on Dec 20, 2018 by Martin Pelletier

I try to use the deep power down. 

 

i use this code on xxx.h:

#define DEEP_POWER_DOWN 3
typedef struct PWRD_API {
void (*set_pll)(uint32_t cmd[], uint32_t resp[]); /*!< Set PLL function */
void (*set_power)(uint32_t cmd[], uint32_t resp[]); /*!< Set power function */
/*!< Sets the chip in low power modes */
void (*power_mode_configure)(unsigned int mode, unsigned int peripheral);
void (*reserved1)();
void (*reserved2)();
} PWRD_API_T;
typedef struct _ROM {
const PWRD_API_T * pPWRD;
} ROM;

#define ROM_DRIVER_BASE (0x03000200UL)
#define LPC_PWRD_API ((PWRD_API_T *) ((*(ROM * *) (ROM_DRIVER_BASE))->pPWRD))

 

and this code on file.c: to put on deep power down

if (analogValueLen > 0xC00)
{
//deep power down
LPC_PWRD_API->power_mode_configure(DEEP_POWER_DOWN,0);
__WFI();
}

main.c file:

 

int main (void) 

{

//GPIO init

LPC_SYSCON->SYSAHBCLKCTRL0 |= (1UL << 13); /* enable clock for IOCON0 */
LPC_SYSCON->SYSAHBCLKCTRL0 |= (1UL << 14); /* enable clock for GPIO0 */
LPC_SYSCON->SYSAHBCLKCTRL0 |= (1UL << 15); /* enable clock for GPIO1 */
LPC_SYSCON->SYSAHBCLKCTRL0 |= (1UL << 16); /* enable clock for GPIO2 */

LPC_GPIO_PORT->DIR[0] = 0; //input

...

if (LPC_PMU->PCON & 0x00800) //bit 11
{
LPC_PMU->PCON |= 0x00800; //reset le flag!!!!
PDownDetected = 1;
}
else
PDownDetected = 0;

...

}

 

My question is : i cant wake up the deep power down!!!

The wake up pin (pin #28) has a pullup resistor and if i send a ground pulse or a ground level, it is supposed to wake up the lpc1517 by the POR and the chip re-boots!!!! But nothing happens!!! Am i missing something!!!!

 

thx in advance for your help!!!!

Outcomes