gauravkothari23
Advanced Member level 2
HI all,
I am using 89S4051 MCR. to make a small project..
my only question is how can i use idle mode in 89S4051.
i Tried Writing the code:
it exits idle mode but within a second it again enter the idle mode.
i have a led connected to it.. which gets on after the idle mode is exited..
but the led gets off within a sec which stats that it has again entered the idle mode
I am using 89S4051 MCR. to make a small project..
my only question is how can i use idle mode in 89S4051.
i Tried Writing the code:
Code:
#include<reg51.h>
#include<stdio.h>
sbit ledon=P1^6;
unsigned char ex0_isr_counter = 0;
void ex0_isr (void) interrupt 0
{
ex0_isr_counter++;
}
void main()
{
ledon=1;
EA = 1;
EX0 = 1;
IE0=1;
PCON |= 0x01;
ledon=0;
}
i have a led connected to it.. which gets on after the idle mode is exited..
but the led gets off within a sec which stats that it has again entered the idle mode