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

problem in lpc2138 external interrupt

hai
i am doing basic programs in lpc2138 ARM controller
problem is exter nal interrupt is only once generates
but again it is not generate.send me what is the problem.this is my code

//*****************************************************

#include<lpc213x.h> #include <stdio.h>

extern void init_serial(void); unsigned char temp; void EXTINTVectoredIRQ (void)__irq;

void EXTINTVectoredIRQ (void)__irq { unsigned int temp; IOCLR1=0XFFFFFFFF; EXTINT=0X00000020; temp = VICIRQStatus; printf("isr_temp=%x\n",temp); VICVectAddr15=0; }

int main() { init_serial(); //printf("temp\n"); IODIR1=0X00FF0000; IODIR0=0X20000000; PINSEL1=0X00000000; PINSEL0=0X200000C5; //interrupt pin p0.14
EXTMODE = 0; // LEVEL sensitive mode on EINT1
EXTPOLAR = 0;
VICDefVectAddr = 0x0000002f;
VICIntSelect |=0x00000000;
VICVectAddr15 |=(unsigned int)EXTINTVectoredIRQ;
VICVectCntl15 |= 0x0000002f;
VICIntEnable |=0x00008000;
PINSEL0=0X20000005;
temp = VICIRQStatus; printf("temp=%x\n",temp); while(1) { IO1CLR =0X00FF0000; IOSET1 =0x00FF0000;

} }

//*******************************************

Parents
  • Hello Per Westermark

    i removed printf statement then also it generate only once a interrupt.VICVectAddr15=0x0000002f;I had passed vector address like this.
    #include<lpc213x.h>
    #include <stdio.h>
    extern void init_serial(void);
    unsigned char temp;
    void EXTINTVectoredIRQ (void)__irq;
    unsigned int x=0;

    void EXTINTVectoredIRQ (void)__irq
    {

    x++;
    x=x<<16;
    IO1SET=x;
    EXTINT=0X00000020;
    VICVectAddr15=0x0000002f;

    }

    int main()
    {

    IODIR1=0X00FF0000;
    IODIR0=0X20000000;
    PINSEL1=0X00000000;
    PINSEL0=0X200000C5; //interrupt pin p0.14
    EXTMODE = 0; // LEVEL sensitive mode on EINT1
    EXTPOLAR = 0;
    VICDefVectAddr = 0x0000002f;
    VICIntSelect |=0x00000000;
    VICVectAddr15 |=(unsigned int)EXTINTVectoredIRQ;
    VICVectCntl15 |= 0x0000002f;
    VICIntEnable |=0x00008000;
    while(1)
    {

    IO1CLR =0X000000ff;
    IOSET1 =0x000000ff;

    }

    }

Reply
  • Hello Per Westermark

    i removed printf statement then also it generate only once a interrupt.VICVectAddr15=0x0000002f;I had passed vector address like this.
    #include<lpc213x.h>
    #include <stdio.h>
    extern void init_serial(void);
    unsigned char temp;
    void EXTINTVectoredIRQ (void)__irq;
    unsigned int x=0;

    void EXTINTVectoredIRQ (void)__irq
    {

    x++;
    x=x<<16;
    IO1SET=x;
    EXTINT=0X00000020;
    VICVectAddr15=0x0000002f;

    }

    int main()
    {

    IODIR1=0X00FF0000;
    IODIR0=0X20000000;
    PINSEL1=0X00000000;
    PINSEL0=0X200000C5; //interrupt pin p0.14
    EXTMODE = 0; // LEVEL sensitive mode on EINT1
    EXTPOLAR = 0;
    VICDefVectAddr = 0x0000002f;
    VICIntSelect |=0x00000000;
    VICVectAddr15 |=(unsigned int)EXTINTVectoredIRQ;
    VICVectCntl15 |= 0x0000002f;
    VICIntEnable |=0x00008000;
    while(1)
    {

    IO1CLR =0X000000ff;
    IOSET1 =0x000000ff;

    }

    }

Children