A/D Converter
What is an A/D Converter?
An A/D (Analog-to-Digital) converter is a circuit that transforms an analog voltage into a digital signal. For example, if an MCU needs to detect temperature rise and activate a fan, it first needs to acquire temperature data. However, most of signals around us, including temperature, are analog, while an MCU can only process digital signals. To bridge this gap, an A/D converter is used to capture analog signals and convert them into a digital format that the MCU can process.
Analog signals have an infinite range of values, making it essential to define specific parameters when converting them into digital signals. These include the reference range within which the analog signal is converted and the resolution that determines how may divisions are used for conversion.
The reference range is set by the positive reference voltage (+VREF) and negative reference voltage (-VREF) that define the limits of the A/D converter's input. In most MCUs, -VREF is set to 0V, meaning the conversion range is expressed as 0V to +VREF.
Resolution indicates how finely an analog signal can be distinguished during A/D conversion. For example, a 10-bit resolution means the VREF voltage is divided into 210=1024 steps. The smallest voltage increment that can be detected, calculated as VREF/1024, is called 1LSB (Least Significant Bit).
A/D converters can have various resolutions such as 8-bit, 10-bit, 12-bit, or 16-bit, with higher numbers allowing for more precise representation of the analog signal. The number of bits also determines the number of digital signal outputs. For example, in an 8-bit A/D converter, there are 8 digital signal outputs, dividing VREF into 28=256 steps.
Principles of Successive Approximation A/D Converters
This section outlines the principles behind successive approximation A/D converters, the most commonly used A/D conversion method in MCUs.
When converting an analog signal into digital, the input analog signal is repeatedly compared to a reference value to determine whether it is larger or smaller. Let's examine a scenario where a resistor ladder is used in the circuit to generate a specific reference voltage.
Suppose the input voltage Vin is set to 1/4VREF as illustrated in the diagram below. If 1/2VREF from the resistor ladder is used as a reference, the comparison circuit receives 1/4VREF and 1/2VREF as inputs. The comparator determines which is larger, and naturally 1/2VREF is greater. If Vin is smaller than the reference voltage, the comparator outputs 0. This indicates that the analog signal 1/4VREF has been converted into a digital signal 0, signifying that 1-bit A/D conversion has been performed.
This process essentially determines whether Vin is above or below the reference voltage.
Now let’s analyze a more detailed example of 3-bit A/D conversion using the circuit shown below, where Vin = 9/16VREF.
The first step is to compare 9/16VREF with the midpoint value 4/8VREF. Since 9/16VREF is larger, the comparator outputs 1.
This result essentially shows that 9/16VREF is higher than 4/8VREF. Therefore, the range of Vin can be further narrowed down.
Next, 9/16VREF is compared with 6/8VREF. Since 6/8VREF is larger, the comparator outputs 0, further refining the possible range of Vin to the lower half of the previous range.
Finally, 9/16VREF is compared with 5/8VREF. As 5/8VREF is larger, the comparison circuit again outputs 0.
This means that when the analog signal 9/16VREF is converted into a digital signal, the result is 100, indicating that 3-bit digital A/D conversion has been performed.
This process can be visualized in the diagram below, where the comparator systematically compares the input Vin voltage, gradually narrowing down the estimated range of Vin.
This type of A/D converter, which performs sequential comparisons, is known as a successive approximation A/D converter.