Discussion in 'Embedded Systems and Microcontrollers' started by polinde, Oct 16, 2008.
i use pic microcontroller pic16f877a the port A pin 5 not work
Pin 5 can be used as one of these below:
Analog input 3.
A/D reference voltage (High) input.
You have to choose which by programming. If you set pin 5 as an analog input then you cant use it as a digital I/O for example.
thank you to reply
i want to use it as digital I/O
all other pins runs but this pin 5 not run
please tell me if any intilization to make it digital I/O
We seem to have this thread elsewhere but...
You need to set register ADCON1 to 0b_0000_011x for all the port A pins to be digital. then TRISA = 0 will set them to be outputs.
Have a look at the datasheet for other settings. You don't have the option of setting A3 to digital and the rest of PORTA to analogue.
I have tested the above with a 16f877; I do not have the "A" version.
I use JAL for most of my programming.