16f628, RA0 not working

2camjohn said:
The RA0 pin on my pic16f628 is only outputting 1.9V (5v supply).

I have checked all the solder joints and I am not using the comparator at all.


Can anyone shed some light on this??

It's not enough to 'not use' the comparators, you have to actively disable them, they are turned ON by default (a stupid idea!). If you check my tutorials I have the code that does this in all my 16F628 tutorials.

Failing that, are you setting TRISA correctly, making them outputs?.

Other options are the actual connections you have to the pin, there could be a low resistance to ground pulling the pin low - you can obviously check this be disconnecting the pin and measuring directly on the pin.
 
don't feel bad, it's happened to me; I was using PICs for a few weeks before I found the spot in the datasheet where it says you actually have to disable them to use the associated I/O pins...
 
2camjohn said:
I have another question:

Is there any way to use one comparator input with the reference module and free up some or all of the other pins (RA0 - RA3) as digital IOs ?

Have a look at chapter 9.1 of the datasheet (page 54 of the one I'm looking at), it explains the various modes available, you can have one comparator enabled and the other disabled - setting RA0 and RA3 as digital I/O and RA1 and RA2 as comparator inputs.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…