Yep. I got it mixed up with port bits which start at 0 for the LSB. Maybe that brings up a good point: Use binary when specifying the value. It's easier to see which bits are set and which are not set. I do that with the TRIS values which makes it easy to see since 1=Input and 0=Output. IOW, MOVLW B'00000110' The value of 6 makes everything digital and nothing analog. At least I still had a good reference. :-) Joe M. Mark Perri wrote: > Joe, > I think you're shifted 1 bit to the left due to the late hour :) > Mark > > On 2/16/2010 11:43 PM, MCH wrote: >> 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 >>> > > > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > Checked by AVG - www.avg.com > Version: 9.0.733 / Virus Database: 271.1.1/2693 - Release Date: 02/17/10 02:35:00 > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist