Setting ADCON1 to 6 makes the AN0, 1, and 4 inputs active as analog rather than digital. It also makes AN2's pin Vref- and AN3 Vref+. These are respectively Port A pins 0, 1, 5, 2, and 3. Port E would be all digital in this case. I think they typo'ed and meant ";Load value to make ports A analog & E digital I/O". If you wanted to make Ports A and E all analog inputs, you would use a value of 0, not 6. Then, AN0-AN7 would be all analog inputs. These are on Port A pins 0/1/2/3/5 and Port E pins 0/1/2. Details on the PIC16F87xA datasheet page 128 (DS39582B). (Chapter 11) Joe M. Joseph Bento wrote: > I'm looking at Table 4-2 (page 43) in the 16F877A datasheet. I am apparently > missing something in understing WHY 0x06 is used, and what I would choose if > I wanted an analog I/O. What configuration chart am I overlooking that > describes the settings? > > This is a portion of my code: (I apologize ahead of time for any formatting > issues.) > > start bsf STATUS,RP0 ;Switch to Bank1 for ADCON1 > bcf STATUS,RP1 ;Make sure in Bank1 > movlw 0x06 ;Load value to make ports A > & E digital I/O > movwf ADCON1 ;as opposed to Analog inputs > > Thanks for any clarification anyone can offer. > > Joe -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist