The simple ADC in the figure 1 is perfect for getting analog signals into a purely digital microcontroller. Using just five surface-mount parts, you can assemble it for less than 50 cents (1000), which is approximately half the cost of a single chip-ADC approach in the same volume. Moreover, this design takes only one pin from the microcontroller to operate. Although you can purchase many microcontrollers with built-in ADCs, in some circumstances, this solution is impractical. For example, you might have an all-digital microcontroller already designed in. In this design, a USB-compatible, digital-only microcontroller needed analog input at low cost for a consumer application.
The basic operations are as follows:
Set the ADC pin as a low output to discharge C1. Reset a suitable timer-counter in the microcontroller. Set the ADC pin as an input. Allow the timer to count until it reads as logic 1 in the microcontroller, or let the timer count to some suitably long value, which suggests that the input is essentially zero. Stop the timer counter. Convert to the timer count by some suitable scaling factor to an ADC reading. Start over for the next conversion.
The basic operations are as follows:
Set the ADC pin as a low output to discharge C1. Reset a suitable timer-counter in the microcontroller. Set the ADC pin as an input. Allow the timer to count until it reads as logic 1 in the microcontroller, or let the timer count to some suitably long value, which suggests that the input is essentially zero. Stop the timer counter. Convert to the timer count by some suitable scaling factor to an ADC reading. Start over for the next conversion.