HI all,,,, I need a small help from you all.... actually i am new to electronics and programming part. i am making a small project in which i need to enter the idle mode to save the battery consumption done by my 89S52. i have written a code to enter the idle mode...
PCON |=0x01;
my microcontoller has entered the idle mode but not aware of how to exit it... have gone through the data sheet twice but not able to understnad anything... yes.... understood a bit... so in that case i wrote a code to exit idle mode...
EX1=1; EX0=1; ES=1; IE1=1; IE0=1; EA=1;
but ths thing does not work..... i want to exit the idle mode on a keypress... can nybody help me with the code....
it is very easy. keep check keyboard in loop. if you see a key do reset processor to wake up.
how can i do that..... how it ia possible to run a loop in idle mode... idle mode stops the CPU. i have tried using the code above.... but it doesn't work.... do u have any code for that....
Decide what you want to take the processor.
Have that something generate an interrupt.
The interrupt will wake the processor and your main loop can then consider what needs to be done - and potentially sleep the processor again. It's a standard "event-driven" programming model.
View all questions in Keil forum