How to use some PIC12 GPIO pins as output and some as input?

General discussion on mikroC.
Post Reply
Author
Message
tol87
Posts: 16
Joined: 08 Jul 2011 17:36

How to use some PIC12 GPIO pins as output and some as input?

#1 Post by tol87 » 04 Aug 2011 21:28

I am trying to write a c program that would alow me to use four GPIO pins of PIC12F615 as output and two remaining pins as inputs for push buttons.

I attempted to assign individual values to the output pins of GPIO so they wouldn't interfere with the input pins by typing statements like(GPIO & 0b010000)=1;
or (GPIO & 0b01000000)=1;
That didn't work.

How can I assign a value to the output pins in such way that this value wouldn't interfere with the input pins on my PIC12?
Otherwise I am automatically assigning zeros to the two input pins, triggering the code.

Keep in mind that GP3 is input only so I am trying to use it as an input for the pushbutton.
What circuit would you advisem me to use with that pin.

Thank you.

Post Reply

Return to “mikroC General”