Hi,
I'm new at this forum and didn't have much time to examine it thoroughly, so sorry if this post does not really belong here.
I have a very simple question: I'm using a 16f877 microcontroller. It needs to receive inputs from 3 switches and send output to 3 LEDs. The datasheet says that all ports are bidirectional I/O, so I thought it wouldn't matter which port I used for input or output, namely A, B, C or D. I connected the input switches to ports A1, A2 and A3; and the LEDs to B1, B2 and B3. However, it could not receive input from the A ports.
Then I wrote a program to see if the various ports on 16f877 could light LEDs. The B ports worked fine, but with A ports, only A2 worked. When I tried the same thing for C and D ports, I was able to get very small voltages and thus very dim lights (only seen in dark). (I used three different pics and each time it was the same, so I guess it's not that there's anything wrong with the pics)
Finally, my question: Are not all ports suitable for both input or output? How can I know if a port is suitable for either input or output?
Any help would be appreciated.. Thanks in advance...
Bookmarks