The ANSEL (91h) and CMCON (19h) registers must be initialized to configure an analog channel as a digital input. Pins configured as analog inputs will read ‘0’. The ANSEL register is defined for the PIC16F676.
</code> bcf STATUS,RP0 ;Bank 0 clrf PORTA ;Init PORTA movlw 05h ;Set RA<2:0> to movwf CMCON ;digital I/O bsf STATUS,RP0 ;Bank 1 clrf ANSEL ;digital I/O movlw 0Ch ;Set RA<3:2> as inputs movwf TRISA ;and set RA<5:4,1:0> ;as outputs bcf STATUS,RP0 ;Bank 0 </code>