PDA

View Full Version : 16f628 / 16f628a



azmax100
- 26th January 2009, 14:26
Hi all,

Just to ask is this two the same. I try to get the datasheet for 16f628 but all the link direct me to the 16f628a/ 16f627a datasheet. May be I am asking stupid question but I need the answer.

Thanks.

Melanie
- 26th January 2009, 14:41
Yes they are pretty much the same.

You can use the HEX for one and load it into another.

There may be some differences in programming alogrythms, so use the correct selection for the PIC you are using in your programmer.

azmax100
- 26th January 2009, 15:22
Thanks Mel.

I need to use the analog pin for Sharp distance sensor. eggman (in other thread) told me that I cant do that with 16f628 but looking at the 16f628a datasheet there's 4 analog I/O trough RA0 - RA3.

Is it possible for me to do that?

Melanie
- 26th January 2009, 15:49
The 16F628 has Analog COMPARATORS not A-D Convertors.

You can use those Comparators for Voltage Measurement, and there are a number of ways to do that, but none are really for the inexperienced and the very easy solutions give poor results.

For better results, try the Sigma-Delta method.... here is a paper describing it...

http://www.numerix-dsp.com/appsnotes/APR8-sigma-delta.pdf

...if you can understand it, then you can move forward. If you can't then you have a choice...

(a) Use the Comparators with the Internal Voltage Reference which will give you roughly 16 steps over a very small voltage range - always assuming your input signal is reasonably unchanging over a rather long sampling period (say about 180mS).

(b) Add an external programmable voltage reference your PIC can control.

(c) Use an external A-D Convertor as a 'front-end' input to your PIC.

(d) Chose a PIC which has internal AD convertors - the PIC16F628 doesn't.

mister_e
- 26th January 2009, 22:48
In case you want to use the Delta-Sigma way

From microchip
http://ww1.microchip.com/downloads/en/AppNotes/00700a.pdf

And someone here used it
http://www.picbasic.co.uk/forum/showthread.php?t=5631&highlight=delta+sigma

azmax100
- 27th January 2009, 03:37
Thanks Mel & Mister_e.

For the time being I am not going to dive into the 70 pages guide of the delta sigma.

I will choose option C. why? because I already have experience using ADC 0831 with Basic Stamp2. I will try it today.

For the past three weeks I have learn how to blink Led, servo and serial LCD with PIC. All with the help of forum members and by reading post in this forum.
You guys and gurl (Mel Of course) are superb.

Thanks for the time and effort.