This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Can†t wake LPC2364 from Sleep mode by external interrupt

I have a problem with waking the LPC2364 from Sleep mode with an External interrupt
I can bring the LPC2364 to sleep mode but I cant wake it when I generate an interrupt on P2-10(EINT0)
Its possible to wake it if I set RTCWAKE bit in INTWAKE register (INTWAKE|=0x8000) and generate interrupt on P2-10.
What I am doing wrong?


int main(void)
{
  U32 volatile start;
  for (start = 0; start < 1000000; start++) { ; }
  os_sys_init_prio(init, 254);
}/*End main*/

void init (void) __task
{
  SCS = 1; /*enable FIO*/

  os_itv_set (5);               /*delay  50ms*/
  while(1)
  {
    cnt++;
    os_itv_wait ();/*delay*/
    if (cnt==60) go_to_sleep();

  }
}/*End init*/

void  go_to_sleep (void)
{
  FIO2DIR &=_ZEROMASK(1, 10); /* set P2-10 as input*/
  VICIntEnClr |=0x00004000;
  EXTMODE       |= (1<<0);/* EINT0 - set as Edge sensitive */
  EXTPOLAR = 0; /* EINT0 polarity : falling edge*/
  PINSEL4 = _ONEMASK(1, 20);/*select pin as EINT0*/
  PINSEL4 &=_ZEROMASK(1, 21);
  VICVectAddr14 =(U32) int_extInt0;
  VICIntEnable |= 0x00004000;  /*(1<<14)*/
  INTWAKE|=0x0001;
  PCON|=1; //(1<<0)|(1<<2)|(1<<3);/* first go to Idel Mode*/
  for (i = 0; i < 1000; i++);    /*short delay*/
  PCON|=(1<<0)|(1<<7);//129;    /* go to Sleep mode*/
 } /* End  go_to_sleep*/

void int_extInt0 (void) __irq
{
   EXTINT |= (1<<0);/* Clear the interrupt */
   INTWAKE|=0x0001;
   PCONP|=0xFFFFFFFF;
   Power_On();//init_power_pins();
   VICVectAddr = 0;/* Ack the VIC */
   cnt=0;
}


0