How to wake up LPC11u68 from Deep Sleep Mode via GPIO interrupt?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to wake up LPC11u68 from Deep Sleep Mode via GPIO interrupt?

1,110件の閲覧回数
leechen
Contributor III

I'm able to make my LPC11u68 into deep sleep mode, but i cannot wake it up. Please help.

this is how I make it to sleep:

crntPowerSetting = PMU_MCU_DEEP_SLEEP;

ProcessPowerState(crntPowerSetting);

ラベル(1)
タグ(3)
0 件の賞賛
返信
2 返答(返信)

822件の閲覧回数
bernhardfink
NXP Employee
NXP Employee

Before you go into deep sleep mode you need to prepare the potential wakeup sources. For example a GPIO pin, the WAKEUP pin (if there is one), the RTC etc. Otherwise how should a GPIO know that it is supposed to act as a wakeup pin?

Regards,

Bernhard.

0 件の賞賛
返信

822件の閲覧回数
leechen
Contributor III

This is what I did on the code. If I don’t do ProcessPowerState which puts MCU into sleep, I’m able to get the GPIO interrupt into PININT_IRQ_HANDLER. However, I cannot wake up the MCU.

#define GPIO_PININT_PIN 0

#define GPIO_PININT_PORT 1

#define GPIO_PININT_INDEX 0

#define PININT_IRQ_HANDLER PIN_INT0_IRQHandler

#define PININT_NVIC_NAME PIN_INT0_IRQn

void PININT_IRQ_HANDLER(void)

{

Chip_PININT_ClearIntStatus(LPC_PININT, PININTCH(GPIO_PININT_INDEX));

}

int main(void)

{

CHIP_PMU_MCUPOWER_T crntPowerSetting;

SystemCoreClockUpdate();

Board_Init();

SysTick_Config(SystemCoreClock / 10000 / 30);

Chip_IOCON_PinMuxSet(LPC_IOCON, GPIO_PININT_PORT, GPIO_PININT_PIN,

(IOCON_FUNC0 | IOCON_MODE_PULLUP | IOCON_CLKDIV(0) | IOCON_S_MODE(3)));

Chip_GPIO_SetPinDIRInput(LPC_GPIO, GPIO_PININT_PORT, GPIO_PININT_PIN);

Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_PINT);

Chip_SYSCTL_SetPinInterrupt(GPIO_PININT_INDEX, GPIO_PININT_PORT, GPIO_PININT_PIN);

Chip_PININT_ClearIntStatus(LPC_PININT, PININTCH(GPIO_PININT_INDEX));

Chip_PININT_SetPinModeEdge(LPC_PININT, PININTCH(GPIO_PININT_INDEX));

Chip_PININT_EnableIntLow(LPC_PININT, PININTCH(GPIO_PININT_INDEX));

NVIC_ClearPendingIRQ(PININT_NVIC_NAME);

NVIC_EnableIRQ(PININT_NVIC_NAME);

Chip_SYSCTL_EnablePeriphWakeup(SYSCTL_WAKEUP_GPIOINT1);

crntPowerSetting = PMU_MCU_DEEP_SLEEP;

while (1) {

ProcessPowerState(crntPowerSetting);

}

return 0;

}

0 件の賞賛
返信