PDA

View Full Version : How to calculate ADC resolution (pic12f683)



peu
- 18th April 2007, 17:50
I have a doubt: how can I calculate the maximum detail I can get from an ADC reading.

In my case I have these parameters:

Vcc: 4v
Lower value to be read: 1.90v
Higher value to be read: 2.10v

How many different values can I read between these levels using the pic12f683 ?


Thanks in advance!

skimask
- 18th April 2007, 17:51
I have a doubt: how can I calculate the maximum detail I can get from an ADC reading.

In my case I have these parameters:

Vcc: 4v
Lower value to be read: 1.90v
Higher value to be read: 2.10v

How many different values can I read between these levels using the pic12f683 ?


Thanks in advance!

All of them...

peu
- 18th April 2007, 17:55
WOW, that was fast, you were looking over my shoulders? :D

maybe I didn't used the right words to formulate my question, what would be the resolution?

1.9001, 1.901 or 1.91? or how many steps.

I don't know how to calculate this. Thanks!

skimask
- 18th April 2007, 17:58
I have a doubt: how can I calculate the maximum detail I can get from an ADC reading.

In my case I have these parameters:

Vcc: 4v
Lower value to be read: 1.90v
Higher value to be read: 2.10v

How many different values can I read between these levels using the pic12f683 ?


Thanks in advance!

Well, let's see....
Vcc = 4v
Vdd = 0v
Difference between Vcc and Vdd = 4v

PIC12F683 has a 10 bit A/D converter, 1024 possible values to read between 0 and 4v.
1.9v - 2.1v = .2v
4v maximum value / 1024 = 3.90625mv/bit
Therefore,
.2v = 200mv
200mv / 3.90625 = 51.2
So, you can read 51.2 values between 1.9 and 2.1 volts.
How 'bout that math...

OR....
You could set VRef to 2.2v...
2.2v maximum value / 1024 = 2.1484375mv/bit
Therefore,
.2v = 200mv
200mv / 2.1484375 = 93.09
If you had a VRef of 2.2v, you could read 93.09 values between your limits...

peu
- 18th April 2007, 18:28
AHA! that was the info I was after, thanks again skimask.

So, after reading the datasheet I see that I can set the internal Vref for this purpose, but I dont understand something, from the datasheet:


VRR = 1 (Low Range): CVREF = (VR3:VR0/24) x VDD
VRR = 0 (High Range): CVREF = (VDD/4) + (VR3:VR0 X VDD/32)

So in my example, if I set VR3:0 say at 1101 I get these values:

VRR=1 2.167v
VRR=0 2.625v

or if I use VR3:0 at 1001 I get these

VRR=1 1.5v
VRR=0 2.125v


So what should I use, VRR=1 or 0 ?

skimask
- 18th April 2007, 18:32
VR=9, VRR=0

Closest to 2.1v without going under...

peu
- 18th April 2007, 18:39
Thanks skimask for your fast and accurate replies! http://picbasic.co.uk/forum/images/icons/icon14.gifhttp://picbasic.co.uk/forum/images/icons/icon14.gifhttp://picbasic.co.uk/forum/images/icons/icon14.gif