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.

push button problem mega8535

Status
Not open for further replies.

auto_mitch

Full Member level 3
Joined
Oct 14, 2004
Messages
172
Helped
16
Reputation
32
Reaction score
3
Trophy points
1,298
Activity points
1,240
mega8535 reset pin connect

Hi everyone!
I am working on a project using the mega8535 mcu. I have calibrate its internal oscillator at 8MHz and i have written a few lines of code to control a relay with one push button. When the bush button be pressed once the relay is activated. When the button be pressed again the relay is deactivated. The problem is that i have to press the button for almost or more of 1 sec to activate or deactivate the relay. when i press it fast i can see that the output is going low or high but the relay does not working. I have to press the button again and again to succeed the relay operation each time. The code seems to work but with the upper problem. Is the problem caused by the oscillator i need more MHz or i have made a code problem? Could you please give me an example of set reset in c code?
Thanx
 

bush button problem with microcontroller

Hi

sensing the button does not depend on speed of the mcu.

Your debounce part is the problem.

check your codes debounce part.

Regards
Nandhu
 

Could you please give me an example code of using one input (e.g. push button) of mcu to control one output (e.g. relay). One press activate second press deactivate.
Thanx
 

this is due to key debouncing.

do one thing, connect this way

vcc to one end of switch, other end and a 1K resistor are shorted and given to microcontroller pin, then other end of 1k resistor to ground. So when you are not pressing key the i/p=0 and when you press then i/p = voltage across resistor i.e Vcc


Bibin John
www.bibinjohn.tk
 

Goto:
**broken link removed**
In MILLIER.ZIP look for sub called "Getswitch()" ..
This will show you how 8535 can read switches ..

Regards,
IanP
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top