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 with pic16f887

Status
Not open for further replies.

charu2539211

Junior Member level 3
Joined
Jul 22, 2013
Messages
31
Helped
1
Reputation
2
Reaction score
1
Trophy points
8
Activity points
200
hi

i am using a push button connect to the pic16f887. this is my code in assembly language

i have intialised portd0 as input port and portb as output port.

BANKSEL PORTD
BTFSS PORTD,0
GOTO LEDSEL

;;; delay????;;;
BTFSC PORTD,0
GOTO LEDSEL
GOTO DEC1


LEDSEL
...

DEC1
....

so when i press the push button it should go to DEC1, else it should go to LEDSEL
is my program right???
and do i need to add a delay in between?? if so how much???
 

Your code is not compelete, from what I see, it will run only once and doesn't loop.
Depends on your application, use an interrupt and connect the button to the interrupt pin, or use a loop (resource hogger) if you're connecting it to an IO pin.
Otherwise your code is ok.
 

    V

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top