PIC16F630, no inputs RA0 and RA1?

Sep 17, 2004 5 Replies

I'm trying to use RA0 and RA1 as inputs, but I can't get it to work.



They work fine as outputs, no problem. They go high-z when programmed as inputs. As input I have a pullup and switch to ground. I also have a problem turning on the weak pullups on RA0 and RA1 - can't get it to work.



The others, RA2, RA4, RA6 work fine as inputs. I can turn on the weak pullups, no problem. Tried an other 16F630, same picture.



Is there a flaw in the 16F630 or its datasheet? Or something I have overlooked?


Thanks, Frank. (remove 'x' and 'invalid' when replying by email)

Perhaps too obvious, but have you set up CMCON correctly?

Best regards, Spehro Pefhany

"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com

Turn off the comparator. CMCON register. Page 39. 6.2.

HTHs GtG

"Spehro Pefhany" schreef in bericht news: snipped-for-privacy@4ax.com...

Bingo! I came across CMCON earlier today, but never gave it a try - it's not very obvious from the PORT A0,A1 'schematic' that CMCON has an effect on using A0,A1 as digital inputs.

Thanks a lot ;)

Thanks, Frank. (remove 'x' and 'invalid' when replying by email)

"Grog" schreef in bericht news:D%A2d.33989$ snipped-for-privacy@news-server.bigpond.net.au...

That did the trick. I'll never forget now ;)

Thanks, Frank. (remove 'x' and 'invalid' when replying by email)

No problem. PICs generally power up with any port pins that *can* be analog inputs in analog mode (ADC or comparator).

Best regards, Spehro Pefhany

"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required