Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

16f628, RA0 not working

Status
Not open for further replies.
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.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top