89S52 External Interrupts. Hi all... i am making a project for driving a dc motor clock and anticlock wise using L293D which is connected to port 3^3(pin 2 of L293D) and port3^4(Pin 7 of L293D) and 89s52, 20x4 character lcd, keypad, 7.4v li-ion battery. using 7805 to stepdown 7.4v to 5v which is futher applied to my circuit. at initial stage i have kept my lcd off, so as button 1 is pressed from keypad the lcd goes on and again waits for user input from keypad to drive dc motor clock or anticlock wise. but when i even put my lcd to off, my 89s52 is in active mode which consumes my battery. to solve this problem i want to add power down mode to my controller. so i added Code:
PCON |= 0x02; // Enter Power Down Mode count++; // External Interrupt or Reset Wakes-up MCU
to enter power down mode. but now i am not aware of how to exit power down mode as i am very new to electronics and programming. can anybody please help me with the code to exit Power down mode.
i want something like as if when button 1 is pressed to on the lcd, it should exit power down mode and lcd gets on.
// External Interrupt or Reset Wakes-up MCU you have answered your own question if you need more, read "the bible"
www.danlhenry.com/.../80C51_FAM_ARCH_1.pdf www.danlhenry.com/.../80C51_FAM_HARDWARE_1.pdf www.danlhenry.com/.../80C51_FAM_PROG_GUIDE_1.pdf
yes i agree that i have answered to my own question. but i am not aware to how to use and execute external interrupt. what type of code is written to exit power down mode.... i have gone through many datasheets and articals, but not able to digest it. everything goes above my head... so i need a help for code.
i need a help for code no, you don't, I could easily give you the code, but that would get you nowhere. find out how to create an external interrupt (hint look at TCON and IE)
thanks a lot... but sorry what is TCON and IE
read the documentation I gave you the links to
i have go e through this TCON and IE. it shows that its an register.... what are this registers....
to be very frank with you.... the link you have provided me is quite difficult to understand. it reads something like 0003H or FFFFH and all like that.... i am not getting exactly what it mean...
hi,,,, i had the same problem,,,,, but made some good clever code,,,,,, but now i struggle,,,,,,, code puts processor cpu in sleeping,,,,,, but what code to wake processor cpu?????? i see no example for it!!!!!!
what i must do,,,,,,, i give example,,,,,,
<example> stopcpuprocessor () ; doidlestuff () ; wakecpuprocessor ();
Why do you post disinformation?
You don't call any function to wake up the processor.
If properly configured, it will wake up by itself when it sees the configured (in this case external) event.