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

Interrupt exit problem

hi all...
i am using 89s52 with 3.7v li-io battery.
i have made a small circuit in which i want to exit idle mode....
as soon as the power is switch on my 89s52 with enter the idle mode. so to exit the idle mode the code is....

unsigned char ex0_isr_counter = 0;

void ex0_isr (void) interrupt  0
{
         ex0_isr_counter++;
}

void main()
{
 EA = 1;
 EX0 = 1;
 IT0=1;
 PCON |= 0x01;

}


now my problem is..... it easily exits in proteus stimulation but when i build my cirucit i am not able to exit idle mode
for testing if it works or not.... i have placed an led between interrupt pin(INT 0) and GND.... led glows.... but when i press the button to exit idle mode.... the led stops.... it means that my connection are proper.... if i am not wrong....

Parents
  • Hey.

    I am in final year of my software engineering course and I saw your problem before. Check main and look what it does when it exits or returns. My lecturer told me it must not quit. Put a goto at the end to loop. it fixed my bug. don't understand why.

    Respect for your nice code dude.

Reply
  • Hey.

    I am in final year of my software engineering course and I saw your problem before. Check main and look what it does when it exits or returns. My lecturer told me it must not quit. Put a goto at the end to loop. it fixed my bug. don't understand why.

    Respect for your nice code dude.

Children