- did you banksel ADCON1 before you set it to 0x6 ? - assuming you've properly disabled ADC on the pins, are you sure they're inputs? TRISC bits are High for inputs on PORTA on F877. - what is connected to PORTA? are you sure any of the lines are *ever* going high? - are you sure your LEDs are wired up properly?? > -----Original Message----- > From: Aubrey McIntosh, Ph.D. > [mailto:Aubrey.McIntosh@ALUMNI.UTEXAS.NET] > Sent: 09 February 2004 16:32 > To: PICLIST@MITVMA.MIT.EDU > Subject: [PIC:] Reading PortA on 16F877 > > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > I want to read either PortA or PortE on a 16F877 chip as > digital input. > > I have read the PortA, PortE, and A/D sections of 30292c.pdf > In particular, I have read p113. > On page 218, there is an example to use PortA. I have not > done the CLRF PortA shown in the example, but otherwise > comply. I will try this in the next cycle. > > I have set ADCON1 to 0x06 and verified this with read and > display to LEDs. I have set and verified TRISA to 0x3F > > I do a very simple > banksel PORTA > movf PORTA,w > banksel PORTD ;home of the LEDs. > movwf PORTD > > The LEDs are always dark. I have success with PORTC as an input. > > Thoughts? > > > - -- > Aubrey McIntosh, Ph.D. > > > -----BEGIN PGP SIGNATURE----- > Version: PGPfreeware 7.0.3 for non-commercial use > > iQA/AwUBQCe2FwKlSw8yssF7EQKtwgCeJkH1LfsMeQzKfAIbhTNbV22kqvQAn3bS > eZLvXCkZhjwOSI+CpLj8fz3n > =kizK > -----END PGP SIGNATURE----- > > -- > http://www.piclist.com#nomail Going offline? Don't AutoReply > us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body