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

P89LPC932 External Interrupt 0

Hi, I need to use the external interrupt 0
on the P89LPC932. I know I need to set up the register
TCON = 0x01 for falling edge detection
and then set the P1.3 as an input. and the ISR is number 0. But this interrupt pin active low. This means that a low input like ground will generate the interrupt, even if the micro is sleeping. I tried it this way and it did not work. Do you see anything wrong or missing here? thank you

Parents
  • Erik thanks for getting back to me. I am already using a internal timer and it works fine, but since I'm adding more code, I am missing some of the pulses being received. That is why I need an interrupt instead. Please help me.

    I have declared
    Pulse = P1^3;
    Pulse = 1;

    main calls this fucntion
    Pulses_received();

    //Initialize INT0 as edge triggered
    void Pulses_received(void)
    {
    IT0 = 1; //pulses will be edge triggered
    EX0 = 1;
    }



    void Interrupt_Pulses (void) interrupt 0
    {
    P_Counter++;
    P2 = Liters;
    if (P_Counter == 100)
    {
    Counts--; //decreased every 100 p.
    P2 = Counts; //shown on port 2
    }
    }

    Do I need a loop somewhere?

Reply
  • Erik thanks for getting back to me. I am already using a internal timer and it works fine, but since I'm adding more code, I am missing some of the pulses being received. That is why I need an interrupt instead. Please help me.

    I have declared
    Pulse = P1^3;
    Pulse = 1;

    main calls this fucntion
    Pulses_received();

    //Initialize INT0 as edge triggered
    void Pulses_received(void)
    {
    IT0 = 1; //pulses will be edge triggered
    EX0 = 1;
    }



    void Interrupt_Pulses (void) interrupt 0
    {
    P_Counter++;
    P2 = Liters;
    if (P_Counter == 100)
    {
    Counts--; //decreased every 100 p.
    P2 = Counts; //shown on port 2
    }
    }

    Do I need a loop somewhere?

Children