That's interesting. Maybe I'm still just misunderstanding the data sheet. Still, when I use MPLAB's simulator, it shows the power up state of the CMCON bits as 0, and when I actually program the PIC, it behaved the same way. (No PORTA digital I/O unless I explicitely set the CMCON bits.) Oh well, at least I found something that works. Thanks, Nick > -----Original Message----- > From: piclist-bounces@mit.edu > [mailto:piclist-bounces@mit.edu] On Behalf Of michael brown > Sent: Saturday, April 02, 2005 1:30 AM > To: Microcontroller discussion list - Public. > Subject: Re: [PIC] Configuring RA2 for digital I/O on 16F88--solved > > > > From: "Nick Kennedy" > > > > OK, finally figured it out. > > > > Bits <2:0> of CMCON must be set to 111 if RA0, RA1, RA2 are > to be used > > as digital I/O. I fell for the table in the data sheet that says > these > > bits are set (111) on POR and other resets. That doesn't seem to be > the > > case. > > Hmmm.....this would certainly be interesting. I've been > using the 16F88 with those pins as digital i/o and I don't > initialize CMCON. I just go with the POR value and it seems > to be working fine. I do have to init ANSEL though. > > The thing about this that intrigues me is that I had some > trouble at first something like you describe. I attributed > it to a RMW issue since I had the pins somewhat loaded and > was using the 8MHz INTOSC. I started using a shadow register > to manipulate the pins and all was fine after that. > > > So table 5-1 titled "Initializing PORTA" should add a little CMCON > > action to go along with the TRISA and ANSEL stuff. > > Since I also use sleep mode, I don't think the comparators > could possibly be on or I would have seen the excessive sleep > current. (I did have a sleep current issue at first but it > was due to another unrelated > matter) > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclis> t > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist