1. polinde

    Thread Starter New Member

    Sep 2, 2008
    3
    0
    i use pic microcontroller pic16f877a the port A pin 5 not work
     
  2. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    Pin 5 can be used as one of these below:

    Digital I/O.
    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.
     
  3. polinde

    Thread Starter New Member

    Sep 2, 2008
    3
    0
    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
     
  4. boff1

    Member

    Oct 15, 2008
    26
    0
    We seem to have this thread elsewhere but...

    http://ww1.microchip.com/downloads/en/DeviceDoc/39582b.pdf
    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.
    [​IMG]
     
Loading...