EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

ADC module in PIC16F87

Started by nibnewux January 30, 2004
how is the analog input and the 10 bits digital output related?
i provided a 2V analog into PORTA, pin 0 and the output i obtained
was actually 01 1001 1101 => 413 in decimal!

can anyone provide any enlightenment?



The reference is probably Vdd (+5V).  10bit (2 to the power of 10) means that you have 1024 equal steps between 0 & 5V, each step is approximately 5mV.  Therefore, 413 (steps) is equal to 2V.
 
Regards
 
Ian
-----Original Message-----
From: nibnewux [mailto:n...@yahoo.com]
Sent: 30 January 2004 11:50
To: p...@yahoogroups.com
Subject: [piclist] ADC module in PIC16F87

how is the analog input and the 10 bits digital output related?
i provided a 2V analog into PORTA, pin 0 and the output i obtained
was actually 01 1001 1101 => 413 in decimal!

can anyone provide any enlightenment?



to unsubscribe, go to http://www.yahoogroups.com and follow the instructions
Yahoo! Groups Links
To



Hi Ian,

Thanks a lot for the great reply. Short and sweet, straight to the
point!

I have one more question: What happens if instead of a +2V, I provide
a -2V analog input?
--- In , "I Forse" <i.forse@t...> wrote:
> The reference is probably Vdd (+5V). 10bit (2 to the power of 10)
means
> that you have 1024 equal steps between 0 & 5V, each step is
approximately
> 5mV. Therefore, 413 (steps) is equal to 2V.
>
> Regards
>
> Ian
> -----Original Message-----
> From: nibnewux [mailto:nibnewux@y...]
> Sent: 30 January 2004 11:50
> To:
> Subject: [piclist] ADC module in PIC16F87 > how is the analog input and the 10 bits digital output related?
> i provided a 2V analog into PORTA, pin 0 and the output i obtained
> was actually 01 1001 1101 => 413 in decimal!
>
> can anyone provide any enlightenment? >
> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions > --------------------------------
--------
> --
> Yahoo! Groups Links
>
> a.. To > --
> Outgoing mail is certified Virus Free.
> Checked by AVG Anti-Virus (http://www.grisoft.com).
> Version: 7.0.211 / Virus Database: 261.8.1 - Release Date: 30/01/04





0V = lowest limit = 0 steps
5V = highest limit = 1024 steps

-2V? It's under 0V so you'll get a 0 out of it, or, it'll blow up the pin
if it's not protected. Check the docs on the chip and see what the absolute
minimums are for the circuit. You should protect it around those limits if
it doesn't do so internally.

I think the 16F88 has the ADC on it doesn't it? It also allows programmable
VREF- and VREF+. So you COULD set your low reference under -2V if you
really need to convert voltage under that value. Put your minimum on the
VREF- pin and your maximum on the VREF+ pin. Your steps move appropriately.

> -----Original Message-----
> From: nibnewux [mailto:]
> Sent: Friday, January 30, 2004 6:32 PM
> To:
> Subject: [piclist] Re: ADC module in PIC16F87
>
> Hi Ian,
>
> Thanks a lot for the great reply. Short and sweet, straight
> to the point!
>
> I have one more question: What happens if instead of a +2V, I
> provide a -2V analog input?
> --- In , "I Forse" <i.forse@t...> wrote:
> > The reference is probably Vdd (+5V). 10bit (2 to the power of 10)
> means
> > that you have 1024 equal steps between 0 & 5V, each step is
> approximately
> > 5mV. Therefore, 413 (steps) is equal to 2V.
> >
> > Regards
> >
> > Ian
> > -----Original Message-----
> > From: nibnewux [mailto:nibnewux@y...]
> > Sent: 30 January 2004 11:50
> > To:
> > Subject: [piclist] ADC module in PIC16F87
> >
> >
> > how is the analog input and the 10 bits digital output related?
> > i provided a 2V analog into PORTA, pin 0 and the output i obtained
> > was actually 01 1001 1101 => 413 in decimal!
> >
> > can anyone provide any enlightenment?
> >



The 2024 Embedded Online Conference