Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

89S52 External Interrupts.

Status
Not open for further replies.

gauravkothari23

Advanced Member level 2
Joined
Mar 21, 2015
Messages
640
Helped
5
Reputation
10
Reaction score
4
Trophy points
1,298
Activity points
6,922
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.

- - - Updated - - -

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.
 
Last edited by a moderator:

sorry.. but as i am fresher and not familiar with such things.. did not get your point.
how should i do it...
is it a hardware or software part...??
 

if you use PowerDown mode of 8952 , the only way to come out of this mode is Hardware reset.
 

is it not possible to use external interrupt to come out of PDM...????
Some articals shows that using external interrupt you can exit PDM.
Article From Keil page:
Peripheral Simulation
For Atmel AT89S52 — Power Saving Modes (Idle and Power Down)

Simulation support for this peripheral or feature is comprised of:

Example code which helps you get started quickly.
These simulation capabilities are described below.

Idle Mode Example Program

The Keil Debugger fully simulates the effects of Idle Mode. When your target program initiates Idle Mode program execution stops until the next interrupt is triggered. The following example code shows how to enter Idle Mode.


Code C - [expand]
1
2
3
4
5
while (1)          // Repeat Forever
  {
  PCON |= 0x01;    // Enter IDLE Mode
  count++;         // Interrupt Wakes-up MCU
  }



Power Down Mode Example Program

The Keil Debugger fully simulates the effects of Power Down Mode. When your target program initiates Power Down Mode program execution stops until the next external interrupt is triggered or until the MCU is reset. The following example code shows how to enter Power Down Mode.


Code C - [expand]
1
2
3
4
5
while (1)          // Repeat Forever
  {
  PCON |= 0x02;    // Enter Power Down Mode
  count++;         // External Interrupt or Reset Wakes-up MCU
  }

 
Last edited by a moderator:

you are mixing Powerdown mode and Idle mode.In idle mode , you can wakeup controller thro interrupt.
 

I want to use power down mode.....
and it is clearly mentioned in the article above i posted from keil that.....
from coming out of power down mode you have to use external interrupt.
is using external interrupt and resetting the MCU the same...????

- - - Updated - - -

Power Down Mode Example Program

The Keil Debugger fully simulates the effects of Power Down Mode. When your target program initiates Power Down Mode program execution stops until the next external interrupt is triggered or until the MCU is reset. The following example code shows how to enter Power Down Mode.


Code C - [expand]
1
2
3
4
5
while (1) // Repeat Forever
{
PCON |= 0x02; // Enter Power Down Mode
count++; // External Interrupt or Reset Wakes-up MCU
}

 
Last edited by a moderator:

from intel manual :

...The only exit from Power Down for the 8OC51 is a
hardware reset. Reset redefines all the SFRs, but does
not change the on-chip RAM....
 

so only option for me idle mode....
so can u please tell me how can i get out of it once i entered IM

- - - Updated - - -

have written this code to enter idle mode
Code:
PCON |= 0x01;    // Enter idle Mode
.
but do t know the code or any idea to exit from it.

- - - Updated - - -

@srizbf.... the keil page shows that power down mode can be used for 89s52 and to exit you need a external interrupt. as u you Can read the post i have posted above from keil page.
 

@srizbf.... the keil page shows that power down mode can be used for 89s52 and to exit you need a external interrupt. as u you Can read the post i have posted above from keil page.

atmel 89s52 manual agrees what you have posted.

... Exit from Power-down mode can be initiated
either by a hardware reset or by an enabled external interrupt. Reset redefines the SFRs but
does not change the on-chip RAM......

80c51 PD mode and 89s52 PD mode are not same:bang:
 

@srizbf.... i agree with you.....
but i dont want to reset the system....
my concept is just to put the system in power down mode only when the user is not using the system.
my project is something based on password. to gain access you need to enter the enter the password stored in system input by user at initial stage when systems starts for the first time....
user on's the lcd and inputs the password and gain access and then he can drive the motor clockwise or anticlock wise or even he can light up the bulb or many such things.
when the user finishes his work he just presses the off button which off the lcd. but in this case MCR stays active when no action is performed from the user and it consumes the battery a lot.
so for that reason i want to usw power down mode or idle mode in which if the user off the lcd the system goes to power down mode and lcd also gets off and again when he presses on button the System becomes active and lcd goes on.
i cant reset mysystem because there is a password stored in tge system.
so my question is will PDM work or have to use Idle mode
 

If the system is to be woken up when you press any key after power saving ,
-you can connect the keys using intr method of transfer
and write the keyboard driver as isr.

though you can use PD mode , Idlemode also can be used using the above method.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top