12.2 Basics of A/D Conversion

<aside> <img src="/icons/map-pin_gray.svg" alt="/icons/map-pin_gray.svg" width="40px" /> In midterm, there’s usually a question dedicated just for analog to digital converter, so we will cover it in this section.

</aside>

An analog to digital converter (ADC) converts electrical voltage to a digital value. This was briefly introduced in lab 3.

Figure 12.1 The A/D conversion process.

Figure 12.1 The A/D conversion process.

The process is described in the figure above, but the main takeaway you want to get from this section is the following:

Optimal Voltage Range for A/D Conversion

As mentioned, an A/D converter needs a low reference voltage $V_{\textrm{RL}}$ and a high reference voltage $V_{\textrm{RH}}$ to perform the conversion. The ADC provides an $n$-bit code. Typically, a question may ask you determine the voltage $V_{\textrm{k}}$ given the digital code of $k$.

<aside> <img src="/icons/help-alternate_gray.svg" alt="/icons/help-alternate_gray.svg" width="40px" /> The value of $k$ is the just decimal equivalent of the possible output codes in a $n$-bit ADC. So, for a 10-bit ADC, the range of $k$ is from $0$ to $1024$ in decimal.

</aside>

We can do so, by using the following formula to determine this voltage:

$$ V_{\textrm{k}} = V_{\textrm{RL}} + \bigg(\frac{k}{2^n}\bigg)(V_{\textrm{RH}} - V_{\textrm{RL}}) $$

<aside> <img src="/icons/help-alternate_gray.svg" alt="/icons/help-alternate_gray.svg" width="40px" /> This formula can actually be derived using linear interpolation if you know it, so it’s not necessarily needed to memorize.

$$ \frac{y - y_0}{x - x_0} = \frac{y_1 - y_0}{x_1 - x_0} $$

In this case, we set $y$ as our voltage and $x$ as our output code value. Equivalently, it becomes,

$$ \frac{V_{\textrm{k}} - V_{\textrm{RL}}}{k - 0} = \frac{V_{\textrm{RH}}- V_{\textrm{RL}}}{2^n - 0} $$

</aside>

In most cases, $V_{\textrm{RL}} = 0\ V$ and $V_{\textrm{RH}} = V_{\textrm{DD}}$, thus simplifies to:

$$ V_{\textrm{k}} = \bigg(\frac{k}{2^n}\bigg)V_{\textrm{DD}} $$

Refer to example below, which was a question from a previous midterm.

12.3 The HCS12 A/D Converter