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.

Can anybody help me how to write a program to monitor a port pin in PIC 16F628A

Status
Not open for further replies.

slaskar

Newbie level 6
Joined
Jun 20, 2013
Messages
12
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
85
How to program the PIC 16F628A to monitor an input port pin for a high and send a digital high to the output port pin when it is high
 

Are you using assembly?

Use the BTFSC to check the input port pin and assign the same bit to the output pin.

For example:

Code:
PIN_LOW:
BTFSS PORTC,0 ; assuming PortC.0 is the input
GOTO PIN_LOW
BSF PORTC,7 ; assuming PortC.7 is the output 

PIN_HIGH:
BTFSC PORTC,0
GOTO PIN_HIGH
BCF PORTC,7
GOTO PIN_LOW
 

can anybody help me with the whole program written in assembly to monitor a port pin for high and low
 

Hi,

What input signal are you monitoring, digital or analogue ?

EC.engineer has shown you the core code of how to do it, its not likely anyone will do the whole project for you when you show no signs of trying yourself.

There are basic assembly Template Files in MPlab designed to help get you going on a particular chip, use the one for the 628A and ECs code and see what you come up with.
Then if you are still stuck come back and post the code you have done so far.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top