4
\$\begingroup\$

I'm still not sure about info I read on the internet. It said that to get the analog value also known as output bits of ADC use this formula:

Analog Value=(Analog Input*Max Value of ADC bit)/Analog Reference

Do you think the analog reference is the same as the voltage reference?

My real question is, do you think "Max Value of ADC bits" is same as 2^b where b is the number of bits?

I'm sure its maximum value of ADC bit must be (2^b)-1

I read in this article:

enter image description here

I cropped that picture from here, that article assumes a 10-bit ADC so it uses a maximum value of 1024, while I think it must be 1023. I think what they mean with 1024 is the possibilites not maximum value of an n-bit ADC.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ \$\left(2^{b}\right)\text{-1}\$ \$\endgroup\$ – rdtsc May 14 at 11:57
  • \$\begingroup\$ If it's 1023 at the denominator, you expect 1023 to be generated at EXACTLY Vref at input. But it is not the case in ADCs. \$\endgroup\$ – Mitu Raj May 14 at 12:34
4
\$\begingroup\$

There is a simple relationship between the voltages and digital values involved in a ADC: $$\frac{V_{IN}}{V_{REF}} = \frac{DigitalOutput}{2^N}$$ where \$N\$ is the number of bits.

If \$V_{IN} = 0\$ you would certainly expect the digital output to be integer 0.

The step size (voltage equivalent of a change in LSB) is $$V_{LSB} = \frac{1}{2^N} \times V_{REF}$$

So the voltage that will produce the largest digital output value is $$V_{MAX} = \frac{2^N-1}{2^N} \times V_{REF}$$

So, for a 10-bit ADC with a reference voltage of \$3.3\,\text{V}\$, the integer output value of 1023 (0x3FF) corresponds to a voltage of approximately \$3.297\,\text{V}\$. Any voltage above this value will also give a digital output of 1023.

There is one additional wrinkle. Some ADCs will offset the switching thresholds by \$\frac{1}{2}V_{LSB}\$ to reduce the quantization error. These ADCs have slightly different behavior; check the datasheet for details.

\$\endgroup\$
1
  • \$\begingroup\$ As an extension to that wrinkle, some ADCs are designed so that if they repeatedly read a signal that would yield a value of e.g. 123.4, they'll consistently read 123 (which would be off by 0.4 LSB), while others are designed so that they'll read 123 about 60% of the time and 124 about 40% of the time. Taking ten readings and averaging them together might yield a value less than 1233 or greater than 1235, but it would usually yield a value that was closer to the ideal one than an individual reading would be. \$\endgroup\$ – supercat May 15 at 3:59
4
\$\begingroup\$

10 bit can represent the numbers from 0 to 1023 OR from -512 to +511. That really depends whether the signal you are sampling is bi-polar (like audio) or just positive (like video).

The quantization step is the same in both cases, it's \$V_{ref}/2^b\$ where \$V_{ref}\$ is the reference voltage of the ADC and \$b\$ the number of bits.

To make things easy, let's assume we have 3 bit ADC and a reference Voltage of 8V. Then the output will increment in 1V steps representing either 0V to +7V OR -4V to +3V.

\$\endgroup\$
2
  • \$\begingroup\$ ee.se uses \$. I vaguely remember it's because of the dollar sign, \$\endgroup\$ – a concerned citizen May 14 at 15:02
  • 1
    \$\begingroup\$ Thanks. It seems to be different for ever stack exchange site which can be confusing \$\endgroup\$ – Hilmar May 14 at 22:58
1
\$\begingroup\$

10 bits leads to $$2^{10}$$ values, i.e. 1024. But one of them has to be zero. Thus the maximum value equating to 3.30 V must be 1023. If you exclude zero, you'd need a 10.0014 bit ADC.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.