Forum: µC & Digital Electronics LPC1768 does not wakeup from deepsleep

von Sven (Guest)

Attached files:

Rate this post
0 useful
not useful
I am useing some examples from Keil and I am working with the LPC1768.

I am trying to put the controller into deepsleep or power down ect. pp.
My problem is, that the controller does not wake up from deep sleep and 
power down mode.
In the Attachment you can find my Code, it would be great if you can 
help me.

thanks =)

: Moved by Admin
von Sven (Guest)

Rate this post
0 useful
not useful
so here in an easier way, but the problem is the same the µC does not 
wakeup from deepsleep, powerdown or deep power down.
#include "lpc17xx.h"
#include "type.h"
#include "extint.h"

void main(void)
/***********PINs einstellen**********/


  LPC_GPIO2 -> FIODIR |= 0xFF;    // P2[0..7] Ausgänge
  LPC_GPIO2 -> FIOCLR |= 0xFF;    // alle Pins ausschalten


  LPC_GPIO3 -> FIODIR &= (1<<25);   // P3[25] Eingang


LPC_PINCON->PINSEL4 &= ~(0x03<<20);   // Reset des Pins
LPC_PINCON->PINSEL4 |=  (0x01<<20);  // Config P2.10 = EINT0
LPC_GPIOINT->IO2IntEnF = 0x200;    // Port2.10 is falling edge. 
LPC_SC->EXTMODE = EINT0_EDGE;    // INT0 edge trigger 
LPC_SC->EXTPOLAR = 0;      // INT0 is falling edge by default
NVIC_EnableIRQ(EINT0_IRQn);       // Enable IRQ for EINT0

    if (!(LPC_GPIO3 -> FIOPIN & (1<<25)))
      LPC_GPIO2 -> FIOPIN = 0xFF;
      SCB -> SCR = 0x04;



void EINT0_IRQHandler (void)
  LPC_SC->EXTINT = EINT0;  //clear interrupt 

von Sven (Guest)

Rate this post
0 useful
not useful

von Lutz (Guest)

Rate this post
0 useful
not useful
>LPC_GPIO3 -> FIODIR &= (1<<25);   // P3[25] Eingang
Reset value of this register is 0x0. Your code doesn't change anything 
in this case, but take care if the value of FIODIR differs from 0x0. 
You've probably forgotten the '~'.

>LPC_PINCON->PINSEL4 &= ~(0x03<<20);   // Reset des Pins
Unneccessary, because the reset value of PINSEL4[21:20] is 00. And this 
value is also overwritten with
>LPC_PINCON->PINSEL4 |=  (0x01<<20);  // Config P2.10 = EINT0
but that's not a problem; you can make it sure or obvious by this way.

>LPC_GPIOINT->IO2IntEnF = 0x200;    // Port2.10 is falling edge.
0x200 codes a falling edge interrupt enable for P2.9, not for P2.10. 
Take care of the bitposition when bitshifting or when making an absolut 
assignment. This seems to be the problem and my "analysis" stops at this 
line of code.

von Lutz (Guest)

Rate this post
0 useful
not useful
P.S.: When you change your language to German your name is Jannik? 
Strange ...


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.