you have to disable the a/d converters, sharing the pins of port a. they are enabled by default. so port a works well as digital output, but you will always read a 0, until you disable the a/d's (took me about 2 days of debugging a driver, that worked well on a 16f84 before...) tino ADCON1 = 0x06; //set 16f872 port a to digital Quentin Gesendet von: pic microcontroller discussion list 28.02.02 08:23 Bitte antworten an pic microcontroller discussion list An: PICLIST@MITVMA.MIT.EDU Kopie: Thema: Re: [PIC]: Experimenting with F872 -- can't read from PORTA ??? Pic Dude wrote: > > What am I doing wrong here? I tried to configure port A as all digital > inputs, but can't read from it. If I replace port A with port C, it works. > Here's the init/main part of my code... The dreaded old bank select problem. Read piclist.com and the data sheets about register banks and bank switching. Quentin -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.