Keil Logo

External interrupt

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
robin kendrick
Posted
11-Apr-2011 07:21 GMT
Toolset
ARM
New! External interrupt

My code for external interrupt is not working.Please help me.
I am able to compile the code but nothing happens when i pull down port p0.14

#include "lpc214x.h" // Header file for Phillips LPC2148 controller
void EXTINTVectoredIRQ (void)__irq;
int main(void)
{
       IODIR1=0xFFFFFFFF;
          IODIR0 = 0x00000001;
     //Turn OFF the LED pins

     //Set P0.14 to EINT1
     PINSEL0 = 0x20000000;
            VICVectCntl0 = 0x0000002F;

     VICVectAddr0 = (unsigned)EXTINTVectoredIRQ;


     VICIntEnable = 0x00008000;
         while(1);
}

void EXTINTVectoredIRQ (void)  __irq
{
int z;
z=IO0PIN&0x00000001;
if(z)
{
IO0CLR=0x00000001;

 }
 else
 {
 IO0SET=0x00000001;

  }

     //Clear the peripheral interrupt flag
     EXTINT = 0x00000002;

     //Dummy write to signal end of interrupt
     VICVectAddr = 0x00000000;
}

Next Thread | Thread List | Previous Thread Start a Thread | Settings

  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.