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.

AVR Push button problem

Status
Not open for further replies.

nzkunal

Member level 2
Joined
Mar 11, 2004
Messages
52
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
377
push button avr

I am having some problem using a push button with an AT90S8535.

Basically the PB is connected to supply negative (GND) and the other end to an input pin PORTB.2. PORT B direction is input and initial value 1 (High)

When I prees the PB my code doesn;t seem to respond. I have checked the hardware connection i.e PORTB.2 does actually go to GND when PB is pressed, cant figure out why code doesn't respond. Is checking if PORTB.2 = 0 or 1 the right way to do it can anybody suggest some simple test code.
 

avr push button

Hi nzkunal,

I have no exprience with AVRs.
But Does PORTB have internal pullup resistor? If yes?

If No, you must connect a resistor (~ 4.7k) from the PORTB.2 pin to VCC

So the PB in open state the PORTB.2 is High , when you press the PB the PORTB.2 be LOW

So just read the input of the PORTB.2 to know if it's close or open.


Bye
 

avr push

Sorry, problem solved... before anyone points it out I just realised to read input ports in AVR u have to use PIN not PORT.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top