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

Interrput Handling with LPC2378

Hi,

We are using LPC2378 controller for our application.

we written the ISR for power fail, when ever the voltage reduces the below certain voltage, it generates the IRQ, and interrupt handler completing it's functionality.

Upto now it is OK.

after completing the ISR, And the power still is available to the contoller than it is not going to main loop.

after serving the IRQ it has go back to the main routuine,can anbody inform me what might be the problem?

Regards,
P.Mahesh

Parents
  • Here is the code which i am using for initialization of EINT3 for Raising edge,P2.8 is used for IRQ*/

    void Spoi_InitPowerFail()
    {

    /* To Enable FIQ on P2.8 */
    VICIntSelect |= 0x00000100;

    /* Disable all interrupts */
    VICIntEnable = 0x00000000;

    /* Set EINT3 to edge sensitive */ EXTMODE = 8;

    /* Set EINT3 to Raising-edge sensitive */
    EXTPOLAR = 8;

    /* Need to clear this bit acording to the manual */ EXTINT = 8;

    /* Enable Raising edge interrupt on Port2.8 */
    IO2IntEnR |= 0x100;

    /* Highest Priority (1) For Powerfail IRQ Interrupt */
    VICVectCntl17 = 0x00000001;

    /* set interrupt vector */
    VICVectAddr17 = (unsigned long)Spoi_PowerFailISR;

    /* Enable Interrupt */
    VICIntEnable = (1 << 17);

    }

    and the isr is as follows
    void Spoi_PowerFailISR(void)__irq
    {

    printf("In ISR\n");

    /* Clear Interrupt */ IO2IntClr = 0x100; VICVectAddr = ZERO; /* Acknowledge Interrupt */
    }

    i removed the file closing operations in ISR, then also the same problem is occured.

    I explianed the code with comments.

    Regards,
    P.Mahesh

Reply
  • Here is the code which i am using for initialization of EINT3 for Raising edge,P2.8 is used for IRQ*/

    void Spoi_InitPowerFail()
    {

    /* To Enable FIQ on P2.8 */
    VICIntSelect |= 0x00000100;

    /* Disable all interrupts */
    VICIntEnable = 0x00000000;

    /* Set EINT3 to edge sensitive */ EXTMODE = 8;

    /* Set EINT3 to Raising-edge sensitive */
    EXTPOLAR = 8;

    /* Need to clear this bit acording to the manual */ EXTINT = 8;

    /* Enable Raising edge interrupt on Port2.8 */
    IO2IntEnR |= 0x100;

    /* Highest Priority (1) For Powerfail IRQ Interrupt */
    VICVectCntl17 = 0x00000001;

    /* set interrupt vector */
    VICVectAddr17 = (unsigned long)Spoi_PowerFailISR;

    /* Enable Interrupt */
    VICIntEnable = (1 << 17);

    }

    and the isr is as follows
    void Spoi_PowerFailISR(void)__irq
    {

    printf("In ISR\n");

    /* Clear Interrupt */ IO2IntClr = 0x100; VICVectAddr = ZERO; /* Acknowledge Interrupt */
    }

    i removed the file closing operations in ISR, then also the same problem is occured.

    I explianed the code with comments.

    Regards,
    P.Mahesh

Children