gauravkothari23
Advanced Member level 2
Hi all....
i am making a small project on 89S52 and trying to exit power down mode using Keil...
i am using a 4x4 keyad which has a off Button... which on pressed enter the power down mode....
i am using INT0 in which connection a button to exit power down mode....
system is battery operated....
code
but i am not able to exit the power down mode in this case....
but if i write
PCON |= 0x01; (Enters the Idle Mode)
in which it easily exits idle mode....
reading the datasheet... says me to reset the WDT... how can it be done....
i am making a small project on 89S52 and trying to exit power down mode using Keil...
i am using a 4x4 keyad which has a off Button... which on pressed enter the power down mode....
i am using INT0 in which connection a button to exit power down mode....
system is battery operated....
code
Code:
#include <REG52.H>
unsigned char ex0_isr_counter = 0;
void ex0_isr (void) interrupt 0
{
ex0_isr_counter++; // Increment the count
}
void main (void)
{
IT0 = 1; // Configure interrupt 0 for falling edge on /INT0 (P3.2)
EX0 = 1; // Enable EX0 Interrupt
EA = 1; // Enable Global Interrupt Flag
PCON |= 0x02;
while (1)
{
}
}
but if i write
PCON |= 0x01; (Enters the Idle Mode)
in which it easily exits idle mode....
reading the datasheet... says me to reset the WDT... how can it be done....