>> 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. > No. I assumed you said no because of the TRISB reference! Actually, there is an r-m-w implication here that, in my opinion, goes beyond the normal caveat, because it WILL happen every time. Say PORTA.0 and PORTA.1 are both configured as analog in ADCON1, but are used as a digital outputs (this can be necessary because only certain combinations of analog and digital pins are possible). Both will always READ as a low. If PORTA.0 is set high, then (even a long time) later PORTA.1 is changed, PORTA.0 WILL be set low because of the r-m-w fact that the entire port is read and re-written when changing a single pin. A shadow register solves this problem - but, as was stated recently, it's better to understand why you need the shadow register rather than just blindly using one. This is a bigger implication to me because it does not require tris changes, or successive bcf, bsf's which depend on pin capacitance - this will always happen! The mistake I made when first tracking down a problem caused by this was not understanding the data sheet: "When reading the port register, any pin configured as an analog input channel will read as cleared (a low level)." I focused on the word "input" - I thought I was ok because I had the pin configured as an "output" with the tris register. However, the key word is "analog" - as configured by ADCON1. So, I would have written that part of the data sheet: "When reading the port register, any pin configured as analog by ADCON1 will read as cleared, regardless of the TRIS setting." The original data sheet statement was probably obvious to most of you, but perhaps this explanation will help the original poster. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body