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 microcontoller stops responding

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 smal project on password based door locking system...
components used are...
3.7v battery, step up circuit, 89s52, 20x4 lcd, 4x4 keypad..
i am using power down mode when system not in use have to press off button from matrix keypad to enter power down mode and to exit power down mode external interrupt (INT0) is being used.
my problem is when i try to exit the interrupt using the button as shown in the circuit diagram.... the 89S52 gets Hanged and stops responding and the only way to get out of it is RESET. i happens normally after every 30 to 35 on/off attempts....
code is...
Code:
#include<reg51.h>

unsigned char ex0_isr_counter = 0;

void ex0_isr (void) interrupt  0
{
	 ex0_isr_counter++;
	 
}
	
void main()
{
 while(1)                
     {	
	 IT0=0;
	 EX0 = 1;
	 EA = 1;
	 PCON |= 0x01; 
	 while (1)
	 {
	    \\ program after exiting power down mode\\
	 }
     }
}
 

Attachments

  • untitled.JPG
    untitled.JPG
    72.7 KB · Views: 58

In any circuit like that, I would recommend add a small resistor in series with the INT0 input.
Don't ask me why, but this apparently solved a similar issue for me.
 
In any circuit like that, I would recommend add a small resistor in series with the INT0 input.
Don't ask me why, but this apparently solved a similar issue for me.

do you mean this way....??
will this 220 ohms resistor work...??

- - - Updated - - -

and the problem is somewhat like when i press INT0 button to exit idle mode.. the system gets on just for a half a second and again enters Idle mode..... and then only exit is RESET....
sorry i had mentioned power down mode in earlier post.... sorry its idle mode and not power down mode....

- - - Updated - - -

In any circuit like that, I would recommend add a small resistor in series with the INT0 input.
Don't ask me why, but this apparently solved a similar issue for me.

i had used 1 ohms resitor.... but still the problem continues.....

- - - Updated - - -

do you mean this way....??
will this 220 ohms resistor work...??

- - - Updated - - -

and the problem is somewhat like when i press INT0 button to exit idle mode.. the system gets on just for a half a second and again enters Idle mode..... and then only exit is RESET....
sorry i had mentioned power down mode in earlier post.... sorry its idle mode and not power down mode....

- - - Updated - - -



i had used 1 ohms resitor.... but still the problem continues.....

i have noticed that the error occurs between every 22 and 27 attempt

- - - Updated - - -

In any circuit like that, I would recommend add a small resistor in series with the INT0 input.
Don't ask me why, but this apparently solved a similar issue for me.

i have tried changing the code....
Code:
#include<reg51.h>

unsigned char ex0_isr_counter = 0;

void ex0_isr (void) interrupt  0
{
	 ex0_isr_counter++;
	 
}

void idlemode()
{	
while(1)                
     {	
	 IT0=0;
	 EX0 = 1;
	 EA = 1;
	 PCON |= 0x01; 
	 while (1)
	 {
	    main();
	 }
     }
}
void main()
{
   now here if off button is pressed from keypad then program enter idlemode() function and enter idle mode
}
so now in this case the 89S52 does not gets hanged or stops responding but it automatically restarts after every 33rd attempt....
what wrong with it.... why such things are happing
 

Attachments

  • Interrupt.GIF
    Interrupt.GIF
    47.3 KB · Views: 53

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top