Page 116, section 11.3 of the data sheet for the device you are using (DS30292)says: "The ADCON1, and TRIS registers control the operation of the A/D port pins. The port pins that are desired as analog inputs must have their corresponding TRIS bits set (input). If the TRIS bit is cleared (output), the digital output level (VOH or VOL) will be converted." Page 23-9 of DS31023, The mid range reference manual says the same thing as it happens. This means that if TRIS it output for a pin, it will be outputting the level you set (VOH or VOL). Regards, Kevin > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@mitvma.mit.edu] On Behalf Of Adam > Sent: 05 April 2002 10:37 > To: PICLIST@mitvma.mit.edu > Subject: [PIC] : Quick question regarding PORTA digital > outputs and analog inputs > > > Hi, > > I'm using a PIC16f877 > > Is it possible to configure a pin as an analog input in > ADCON1 yet use as an digital output by setting the > appropriate bits in TRISB? I need two a/d lines but still > want to use the other 4 lines as digital outputs. > > bsf STATUS, RP0 ; Select bank 1 > movlw 0x021 ; RA5,0 inputs, 4-1 outputs, > movwf TRISA > movlw b'00000010' ; set all of port E > movwf ADCON1 ; to Digital I/O, port A to analog > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply > us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > > > > ***************************************************************** > This email has been checked by the altohiway e-Sweeper Service > ***************************************************************** > > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body