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.

ADC with PIC 16f628A

Status
Not open for further replies.

Thuria

New Member
I want to construct A to D converter using PIC 16F628A. I want to use on chip comparator module and on chip voltage reference module. Plz help me.

Thanks

Thu Rein
 
Check the MicroChip application notes, I think there's one there somewhere?.

However, I presume you are aware that it's VERY low resolution?, only 16 steps compared to the 1024 of normal PIC A2D. Far better to use a 16F819 or 16F88 instead!.
 
Thanks Nigel,
If I don't use on chip voltage reference module, Can I get higher resolution?
I successfully construct a 8 bit D2A with 16F628, 74HC595 and a R2R ladder. I want to use your prefer models. But I can't buy them. I can buy only 16F84A and 16F628.

Thanks
Thuria
 
Thuria said:
Thanks Nigel,
If I don't use on chip voltage reference module, Can I get higher resolution?
I successfully construct a 8 bit D2A with 16F628, 74HC595 and a R2R ladder. I want to use your prefer models. But I can't buy them. I can buy only 16F84A and 16F628.

Yes, if you use an external D2A you can get higher resolution - but it's so much easier (and gives even better resolution) to use a more modern device - you should be able to get them shipped from another country easily enough. Although if you had your location filled in we might be able to advise further, even getting them as a free sample from MicroChip.
 
Hi Nigel,
I'm from Myanmar ( Burma ), South East Asia country. I can't get anymore than I write above. We can't order to other country. Let it be.
I use external D2A and a comparator from 16F628. I connect the output of D2A to RA2 of 16F628 and Analog voltage to RA1. Then I increase D2A value 0 to 255. In each step I check Bit 6 of CMCOM register (Later I say "Result"). If Result is 0 then increase the reference. When result is 1, I think I will get the Digital value of Analog voltage. Where I wrong. Plz help me.

Thanks
 
An alternative is a resistor from your signal source to an input pin and a capacitor from pin to ground. You read it by driving the pin low to discharge the capacitor and then timing how long it takes until you see a high again on the pin. The disadvantage of this method are you need a slow moving signal which has to be lowish impedance and it's not linear.

Another alternative which you may have already considered from your earlier post is a R2R on port B feeding into one of the comparators inputs with your signal on the other input.

As Nigel points out, a more modern device such as a 16F88 would make this a trivial task. Where are you based that you can't get a more modern device?

Mike.
 
look at the joystick tutorial for the cap discharge method Pommie mentioned.

I have used it, hitting the window took me a couple tries, but when I hit it, it worked well. I was running at 31Khz on the project.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top