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
Visit site
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.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…