Robert Kiely wrote: > 2008/11/24 Jan-Erik Soderholm : >> Tamas Rudnai wrote: >> >> All pins set as analog input (such as RA4 in this case) will >> always read as "0". RA5 does not have any analog function and >> therefore wortks OK even with the analog (comparators) enabled... >> >> It's all in the datasheet, and it's cleary documented in the "PORT" >> section, even in the specific code example (example 4-2). >> >> Jan-Erik. > > Jackpot ! I presumed that ANSEL would default to all zeroes after > power-on-reset but reading the datasheet shows it defaults to all ones > i.e. analog inputs. It's *always* so on *all* PICs... Pins that have analog functions always deafults as analog pins. And, as you say, this is something that is particular clear in the datasheet... :-) Jan-Erik. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist