LPC11C24 can't wake up from Deep-Sleep

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC11C24 can't wake up from Deep-Sleep

1,147 次查看
ruifengzhang
Contributor I

I am using the LPC11C24 board OM13093 to test the deep-sleep mode. 

According to the manual of LPC11xx and the application note AN11027,   I set three pins (p0.6, p0.11, p1.0)  connect the start logic.  But the chip couldn't wake up when I triggered the pins.  I tried to set the main clock to the IRC and  WDTOSC, but both didn't work.  I didn't go into the Wakeup_IRQhandler ever when I set 'SCB->SCR |= (1<<2); '(let the chip be deep-sleep). But when I comment this line, I can enter the wakeup_IRQHandler.

Please help me find the reasons if you have experience with this problem.

Thanks in advance.

There are related configurations:

//Deep-Sleep according to the manual UM10398 3.9.3.2
//1 SET PMU PCON register to 0
Chip_PMU_SleepState(LPC_PMU);

//2 BOD is powered down but WTD is powered up
Chip_SYSCTL_SetDeepSleepPD(SYSCTL_DEEPSLP_BOD_PD);
//LPC_SYSCTL->PDSLEEPCFG = 0x000018BF;

//2 WTD oscillator is powered up
Chip_SYSCTL_PowerUp(SYSCTL_POWERDOWN_IRC_PD);
Chip_SYSCTL_PowerUp(SYSCTL_POWERDOWN_IRCOUT_PD);
Chip_SYSCTL_PowerUp(SYSCTL_POWERDOWN_WDTOSC_PD);
Chip_Clock_SetWDTOSC(WDTLFO_OSC_0_60, 20);

// switch the clock source
//Chip_Clock_SetMainClockSource(SYSCTL_MAINCLKSRC_WDTOSC);
Chip_Clock_SetMainClockSource(SYSCTL_MAINCLKSRC_IRC);

//select the power configuration after wakeup
Chip_SYSCTL_SetWakeup(SYSCTL_SLPWAKE_IRC_PD|SYSCTL_SLPWAKE_IRCOUT_PD|SYSCTL_SLPWAKE_FLASH_PD|SYSCTL_SLPWAKE_SYSPLL_PD|SYSCTL_SLPWAKE_WDTOSC_PD);

// Disable all peripherals except WDT
Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_I2C); //!< 5: I2C clock, not on LPC110x
Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_CT16B0); //!< 7: 16-bit Counter/timer 0 clock
Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_CT16B1); //!< 8: 16-bit Counter/timer 1 clock
Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_CT32B0); //!< 9: 32-bit Counter/timer 0 clock
Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_CT32B1); //!< 10: 32-bit Counter/timer 1 clock
Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SSP0); //!< 11: SSP0 clock
Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_UART0); //!< 12: UART0 clock
Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_ADC); //!< 13: ADC clock
Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_CAN); //!< 17: CAN clock, LPC11Cxx only
Chip_Clock_DisablePeriphClock(SYSCTL_CLOCK_SSP1); //!< 18: SSP1 clock, LPC11A/C/E/Uxx//1125 only

/*set external pins for wakeup*/


Chip_SYSCTL_SetStartPin(PIO1_0_WKUP, EDGE_FALL);
Chip_SYSCTL_ResetStartPin(PIO1_0_WKUP);
Chip_SYSCTL_EnableStartPin(PIO1_0_WKUP);

Chip_SYSCTL_SetStartPin(PIO0_6_WKUP, EDGE_FALL);
Chip_SYSCTL_ResetStartPin(PIO0_6_WKUP);
Chip_SYSCTL_EnableStartPin(PIO0_6_WKUP);

Chip_SYSCTL_SetStartPin(PIO0_11_WKUP, EDGE_FALL);
Chip_SYSCTL_ResetStartPin(PIO0_11_WKUP);
Chip_SYSCTL_EnableStartPin(PIO0_11_WKUP);

NVIC_ClearPendingIRQ(PIO1_0_IRQn);
NVIC_EnableIRQ(PIO1_0_IRQn);

NVIC_ClearPendingIRQ(PIO0_6_IRQn);
NVIC_EnableIRQ(PIO0_6_IRQn);

NVIC_ClearPendingIRQ(PIO0_11_IRQn);
NVIC_EnableIRQ(PIO0_11_IRQn);

// Specify Deep Sleep mode before entering mode 
SCB->SCR |= (1<<2); //Set SLEEPDEEP bit

__WFI();

void WAKEUP_IRQHandler(void){

Board_LED_Toggle(1);

Chip_SYSCTL_ResetStartPin(PIO1_0_WKUP);
Chip_SYSCTL_ResetStartPin(PIO0_6_WKUP);
Chip_SYSCTL_ResetStartPin(PIO0_11_WKUP);
}

0 项奖励
4 回复数

739 次查看
f_fiorini
Contributor III

Hey, I have a similar problem with LPC11C24 that it can't wake up when in deep sleep mode. 
Did you figure out how to solve the issue? 

0 项奖励

739 次查看
ruifengzhang
Contributor I

Yes, I did.

It works by correcting the mistake: Chip_SYSCTL_SetWakeup(~(SYSCTL_SLPWAKE_IRC_PD|SYSCTL_SLPWAKE_IRCOUT_PD|SYSCTL_SLPWAKE_FLASH_PD|SYSCTL_SLPWAKE_SYSPLL_PD|SYSCTL_SLPWAKE_WDTOSC_PD)) 

Good luck.

0 项奖励

739 次查看
f_fiorini
Contributor III

Hey Ruifeng!
Sorry to bother you, I have tried the same setup (in my case I use pin 0.2 instead) but apparently it gets stuck in IntDefaultHandler(). 
Do you have any idea on how to solve this issue?

Concerning the setup, how do you send the interrupt on the falling edge for the wakeup pins? Do you use something particular?

Thanks in advance!

0 项奖励

739 次查看
converse
Senior Contributor V

IntDefaultHandler is the default interrupt handler, meaning an interrupt has been taken for which a specific handler has not been setup in theVector Table. You need to check which interrupt has fired and make sure that a handler has been correctly located in the vector table.

0 项奖励