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.

[PIC] PIC16F676 INPUT OUTPU Coding help

Status
Not open for further replies.

joynal

Newbie level 6
Newbie level 6
Joined
Apr 2, 2012
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,370
I want to use PIC16F676, & programing mikroc

i don't understand how to coding input and output.

input port
RA0/AN0
RA2/AN2
RC0/AN4
RA3


And other port want output port
RA5
RA4
RC5
RC4
RC3/AN7
RC1/AN5
RC2AN6
 

Always refer to the datasheet of the micro controller when coding and you are most likely to find your answers there.
Although your question is not absolutely clear still if you want to set the direction of port pins (Input and Output) you can find how to do that in the datasheet:
Link to datasheet : https://ww1.microchip.com/downloads/en/DeviceDoc/40039F.pdf

Your solution:
Refer 3.1 PORTA and the TRISA Registers

PORTA is an 6-bit wide, bidirectional port. The corresponding
data direction register is TRISA. Setting a
TRISA bit (= 1) will make the corresponding PORTA pin
an input (i.e., put the corresponding output driver in a
High-Impedance mode). Clearing a TRISA bit (= 0) will
make the corresponding PORTA pin an output (i.e., put
the contents of the output latch on the selected pin).

Similarly Refer for TRISC
Capture.GIF

I hope this helps you clear basic doubts, finding out solutions yourself is the best way of learning new things. :)
Cheers.
 
Last edited:
  • Like
Reactions: joynal

    joynal

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

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top