Page 1 of 1

Re: Configuring External Interrupt in LPC2148

Posted: Sun Mar 04, 2018 7:18 am
by paulvha
I am not sure there is a pull-up as they call out those situations specifically in the datasheet, but there are important remarks around setting EXTMODE and EXTPOLAR

(page29)
Software should only change a bit in this register when its interrupt is disabled in the VICIntEnable register, and should write the corresponding 1 to the EXTINT register before enabling (initializing) or re-enabling the interrupt, to clear the EXTINT bit that could be set by changing the mode

Software should only change a bit in this register when its interrupt is disabled in the VICIntEnable register, and should write the corresponding 1 to the EXTINT register before enabling (initializing) or re-enabling the interrupt, to clear the EXTINT bit that could be set by changing the polarity

Maybe that can do the trick.

regards,
Paul

Re: Configuring External Interrupt in LPC2148

Posted: Mon Mar 05, 2018 3:06 am
by paulvha
did you move them in your code to before the line VICIntEnable = (1 << 14); to something like this :
Code: Select all
#define BUZZER (1<<18)

__irq void isr()
{
   IOSET1 |= BUZZER;
   delay_ms(1000);
   IOCLR1 |= BUZZER;
   EINT = 0X01;
   VICVectAddr = 0;
}

int main()
{
   PINSEL1 |= 0X01;
   PINSEL2 |= 0;
   IODIR1 |= BUZZER;

   VICIntSelect = (0 << 14);
   VICVectcntl0 = 0X2E;
   VICVectAddr0 = (unsigned)isr;

   INTWAKE = 0;
   EXTMODE = 0X01;
   EXTPOLAR = 0X01;

   EINT = 0X01;    // clear any pending interrupt

   VICIntEnable = (1 << 14);

   while(1)
   {
          /*main codes*/
   }
}