# calculating step size in ADC

1. ## calculating step size in ADC

Hi,

how to calculate step size when the information provided is Vcc=4V and input signal is from 0V to 1V and adc is 10 bits..

should i do like

Vcc / 1024 = 0.00390625 = 3.9 mV

or

1V / 1024 = 0.0009765625 = 0.976 mV

thanks
sawaak

•

2. ## Re: calculating step size in ADC

It depends on the ADC and reference voltage being used. ADCs often have a separate input where you can feed an external reference of your choice. There are limits to the range of reference voltage though and 1V is unlikely.

Keith

3. ## Re: calculating step size in ADC

Originally Posted by sawaak
Hi,

how to calculate step size when the information provided is Vcc=4V and input signal is from 0V to 1V and adc is 10 bits..
there is usually a separate reference voltage (internal or external) and in microcontrollers there is also the option (usually) to use the Vcc as reference.
In any case the 0 to 1v is your input and it shouldn't be used as a reference voltage.
If your reference voltage is the Vcc then Vcc / 1024 = 0.00390625 = 3.9 mV is correct
if not then a reference voltage should be defined.

Alex

1 members found this post helpful.

4. ## Re: calculating step size in ADC

I agree with the above.
Just one little thing:
The step size of a 10 bits ADC is Uref/1023 , not Uref/1024 !!

1 members found this post helpful.

•

5. ## Re: calculating step size in ADC

Originally Posted by zuisti
I agree with the above.
Just one little thing:
The step size of a 10 bits ADC is Uref/1023 , not Uref/1024 !!
Yes, that is correct, there are 1024 possible values, 0 to 1023 (0000000000 to 1111111111)

Alex

1 members found this post helpful.

•

6. ## Re: calculating step size in ADC

Actually, I think it depends on the ADC. A lot divide by 2^n such as AD7658. It is the reason voltage references such as 4.096V exist.

Keith.

7. ## Re: calculating step size in ADC

Hi my dear friends;

On this issue (step size of an ADC), I am also a long ago uncertain:

Which is correct: Ustep is equal to Uref/2^n or Uref/(2^n-1)

I was looking for a lot longer on the net, but I did not get a clear answer.
For example take a look on this site:

Please discuss this here, if possible.

One comment:
In my PIC projects (10 bits ADC) I use always the second method (2^n-1),
with good results.

Thanks
zuisti

8. ## Re: calculating step size in ADC

I have just checked the PIC24H and that uses 1024 for the 10 bit ADC. I must admit I tend to think of 2^n as being more common, although there are some older 8 bit ADCs that use 2^(n-1) I think. Even the ADC0808 has a 20mV step from a 5.12V reference.

Which PIC are you using?

Keith.

9. ## Re: calculating step size in ADC

I was using Vref/1023 until now because this was what i have read in "embedded C programming and the atmel AVR" and i actually thoughtit was a standard to use Vref/((2^n)-1) but a quick look in the ATMega8 datasheet shows that is is actually (Vref/(2^n)) which is Vref/1024 for the 10bit ADC of AVRs

Alex

10. ## Re: calculating step size in ADC

Yes, the ADC0808 is using a "pious fraud":

(from the datasheet, page 5)
"The bottom resistor and the top resistor of the ladder network
in Figure 1 are not the same value as the remainder of the
network. The difference in these resistors causes the output
characteristic to be symmetrical with the zero and full-scale
points of the transfer curve. The first output transition occurs
when the analog signal has reached +˝ LSB and succeeding
output transitions occur every 1 LSB later up to full-scale."

However, I did not find such a detailed description of the PICs
ADC circuit, at least I did not. Perhaps it is also applied this solution?

I'm using PIC18Fxxxx uCs, for ex. last a PIC18F2620 ...

---------- Post added at 14:03 ---------- Previous post was at 13:19 ----------

Dealt with elsewhere also:
View topic - A/D equation :: AVR Freaks
and a Microchip forum:

In any event, it really looks that the Vref/2^n is the good, but the "full-scale value"
is not equal to Vref, but it's equal to Vref x 1023 / 1024 (in case of a 10 bits ADC).

Thanks
zuisti

•

11. ## Re: calculating step size in ADC

Originally Posted by zuisti
In any event, it really looks that the Vref/2^n is the good, but the "full-scale value"
is not equal to Vref, but it's equal to Vref x 1023 / 1024 (in case of a 10 bits ADC).
I think that has to be the case otherwise you would never reach the full scale value. i.e. you want full scale to be when the voltage is above 1023/1024 * 5V for a 10 bit ADC on a 5V reference/supply voltage.

Keith.

12. ## Re: calculating step size in ADC

Well, yes, this is the mysticism of the numbers 8) :

Vstep = Vref / 1024 = Vfullscale / 1023, and not Vref / 1023 !!
since
Vfullscale = Vref * 1023 / 1024, and not Vref !!!!
so
Vstep = Vref * 1023 / 1024 / 1023 = Vref / 1024

It's clear (?)