Quote Originally Posted by peu View Post
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...