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

unable to wake up from power down mode in lpc2148 using external interrupt

Hello Community,

I am trying to execute the power down mode in lpc2148 (ARM7) controller. The power down mode instruction executes properly but after that it fails to wake due to EINT0 (external interrupt 0). This is the code I have written. I would be very glad if someone could tell me the problem.

#include <lpc214x.h>

volatile int f;

void delayMS(unsigned int msec)
{
  unsigned int i,j;
  for(i=0;i<msec;i++)
    for(j=0;j<7500;j++);
}

__irq void EXT0_ISR()
{
  f = 0;
  PLL0CON = 0x01; PLL0CFG = 0x24;
  PLL0FEED = 0xAA; PLL0FEED = 0x55;
  while((PLL0STAT & 0x00000400)==0);
  PLL0CON = 0x03; PLL0FEED = 0xAA;
  PLL0FEED = 0x55; VPBDIV = 0x00000000;
  EXTINT = 0x01; VICVectAddr = 0x00000000;
}

int main()
{
  int i = 0;
  f = 0; PINSEL0 = 0x0000000C;
  IO0DIR = 1<<11; IO0CLR = 1<<11;
  EXTMODE = 0x01; EXTPOLAR = 0x00;
  EXTINT = 0x01; INTWAKE = 0x0001;
  VICVectAddr0 = (unsigned)EXT0_ISR;
  VICVectCntl0 = (1<<5)|14;
  VICIntSelect = 0x00000000;
  VICIntEnable = 1<<14;
  VPBDIV = 0x00000000;
  while(1)
  {
    while(f==0)
    {
      for(i=0;i<4;i++)
      {
        IO0PIN ^= (1<<11);
        delayMS(500);
      }
      f = 1;
   }
   PCON = 0x02;
  }

}