Friday, February 27, 2009

Counting Type ADCs - 1

Analog to Digital Converts
By Ibrahim Kamal

Overview In this article, we will discuss a very common type of digital to analog converters called the counting type ADC. Based on our previous simple tutorial about DACs (digital to analog converters), this article presents a technique of building ADCs that you can use to learn and master the process of analog to digital conversion, but also use it in many of you projects, adding an incredible feature to basic microcontrollers like the 8051 that don't have integrated ADCs.

The principle of operation
While there are many ways of building and implementing a counting type ADC, they all rely on the same basic idea. I am going to use a micro-controller by default to perform all the required logical operations, because in most cases, where an ADC is found, a microcontroller is also present. As you can see in figure 1A, the counting type ADC is based on Digital to analog converter (DAC). An R/2R DAC is very suitable for this task, and it can offer more precision by adding more branches to the R/2R network, consequently adding more bit depth to the converter, or you may call it "more resolution". To understand how an analog input is converted to digital data, you have to think in the reverse direction, because that's what really happens, the microcontroller tries to mimic the analog input by producing the closest analog input through the DAC. More precisely.



Fig. 1A: Principle of operation of a counting type ADC


The microcontroller generates a digital ramp (a signal increasing from 0 to max scale) on the input of the DAC, which in case of an 8-bit DAC with a 5V maximum output voltage, would be a counting from 0 to 255, generating an increasing analog voltage (0v to 5V) at the output of the DAC, which is then fed to a comparator to be compared with analog input signal being converted.



Fig. 1B: Principle of operation of a counting type ADC


While the analog output voltage from the DAC is smaller than the measured input, the comparator will output logic 0. Once the DAC output a voltage that is slightly bigger than the analog input, the comparator will output logic 1 indicating the end of the conversion (refereed to as EOC). The job of the microcontroller is to monitor the output of the comparator, and record the value of the data that was sent to the DAC just before, or just after the comparator' output flipped form 0 to 1. Figure 1B may help you to imagine the relation between the 3 major signals: The analog input being measured, the Analog output from the DAC and the EOC signal. The resolutions - which are the smallest change in the input that can be detected - depend on the number of data line 'n'. That means that you can build your own ADC with any precision you may need. That becomes interesting sometimes when you need very low or very high precision ADCs.


References:
  1. Counting Type ADC, Analog to Digital Converter, http://www.ikalogic.com/
  2. http://en.wikipedia.org