gauravkothari23
Advanced Member level 2
Hi all...
i am making a smal project on password based door locking system...
components used are...
3.7v battery, step up circuit, 89s52, 20x4 lcd, 4x4 keypad..
i am using power down mode when system not in use have to press off button from matrix keypad to enter power down mode and to exit power down mode external interrupt (INT0) is being used.
my problem is when i try to exit the interrupt using the button as shown in the circuit diagram.... the 89S52 gets Hanged and stops responding and the only way to get out of it is RESET. i happens normally after every 30 to 35 on/off attempts....
code is...
i am making a smal project on password based door locking system...
components used are...
3.7v battery, step up circuit, 89s52, 20x4 lcd, 4x4 keypad..
i am using power down mode when system not in use have to press off button from matrix keypad to enter power down mode and to exit power down mode external interrupt (INT0) is being used.
my problem is when i try to exit the interrupt using the button as shown in the circuit diagram.... the 89S52 gets Hanged and stops responding and the only way to get out of it is RESET. i happens normally after every 30 to 35 on/off attempts....
code is...
Code:
#include<reg51.h>
unsigned char ex0_isr_counter = 0;
void ex0_isr (void) interrupt 0
{
ex0_isr_counter++;
}
void main()
{
while(1)
{
IT0=0;
EX0 = 1;
EA = 1;
PCON |= 0x01;
while (1)
{
\\ program after exiting power down mode\\
}
}
}