LPC1768 wake up from DeepSleep using a GPIO IRQ

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

LPC1768 wake up from DeepSleep using a GPIO IRQ

ソリューションへジャンプ
639件の閲覧回数
laurianussss
Contributor II

Hi

 

I am trying to wake up an LPC1768 using a GPIO IRQ from Deep sleep. Now it works but only using WDT and it resets the MCU. Also need help with what should I do the program to be resumed when IRQ is detected and not reset.

When I try to use a GPIO intrerupt it does not even reset it.

 

PINSEL_CFG_Type PinCfg;
PinCfg.Funcnum = 1;
PinCfg.OpenDrain = 0;
PinCfg.Pinmode = PINSEL_PINMODE_PULLUP;
PinCfg.Portnum = 2;

PinCfg.Pinnum = 10;
PINSEL_ConfigPin(&PinCfg);

NVIC_SetPriority(EINT0_IRQn, 0);
NVIC_ClearPendingIRQ(EINT0_IRQn);


LPC_PINCON->PINSEL4 |= (0x01 << 20); // function: EINT0
LPC_SC->EXTMODE |= ~(1 << 0); // Edge sensitive
//LPC_SC->EXTPOLAR &= ~(1 << 0); // falling-edge sensitive
LPC_SC->EXTPOLAR &= 1 << 0; // falling-edge sensitive

LPC_SC->EXTINT = (1 << 0); // clear flag

NVIC_EnableIRQ(EINT0_IRQn);

//---------- Disable and disconnect the main PLL0 before enter into Deep-Sleep
// or Power-Down mode <according to errata.lpc1768-16.March.2010> ------------

LPC_SC->PLL1CON = 2; // Turn off the main PLL (PLL0)
LPC_SC->PLL1FEED = 0xAA; // Feed
LPC_SC->PLL1FEED = 0x55; // Feed
while ((LPC_SC->PLL1STAT & (1<<9)) == 0); // Check connect bit status

LPC_SC->PLL0CON &= ~(1<<1); // Disconnect the main PLL (PLL0)
LPC_SC->PLL0FEED = 0xAA; // Feed
LPC_SC->PLL0FEED = 0x55; // Feed

while ((LPC_SC->PLL0STAT & (1<<25)) != 0x00); // Wait for main PLL (PLL0) to disconnect
LPC_SC->PLL0CON &= ~(1<<0); // Turn off the main PLL (PLL0)
LPC_SC->PLL0FEED = 0xAA; // Feed
LPC_SC->PLL0FEED = 0x55; // Feed
while ((LPC_SC->PLL0STAT & (1<<24)) != 0x00); // Wait for main PLL (PLL0) to shut down
//------------Then enter into PowerDown mode ----------------------------------


CLKPWR_DeepSleep();

 

 

void EINT0_IRQHandler(void)
{
NVIC_SystemReset();
}

 

 

ラベル(2)
0 件の賞賛
返信
1 解決策
592件の閲覧回数
laurianussss
Contributor II

Thanks for reply. I found the problem after all. I was just need to disconnect debuger and make a power cycle. I was confused because watch dog wake up reset was working with debuger connected. Anyway GPIO wake up and continue the code was not working with debuger connected even after a power cycle. I think this was is not so clear explained in datasheet even now when I read it says something about this.

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
593件の閲覧回数
laurianussss
Contributor II

Thanks for reply. I found the problem after all. I was just need to disconnect debuger and make a power cycle. I was confused because watch dog wake up reset was working with debuger connected. Anyway GPIO wake up and continue the code was not working with debuger connected even after a power cycle. I think this was is not so clear explained in datasheet even now when I read it says something about this.

0 件の賞賛
返信
602件の閲覧回数
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @laurianussss 

How about testing the low - power demo under LPCopen on your side first?

 

88889999.jpg

It uses timer as wake up source.

 

BR

Alice

0 件の賞賛
返信