Analog circuits - ADC inside microcontroller

Analog circuits - ADC inside microcontroller

A small effort to help you remember all the parameters of the ADC inside a micro controller.



Many of us work on the sensors and with IoT boom there are lot of sensors interfaced to the embedded electronics today. Sensors are interfaced to the micro controller and processor through ADC interface. Based on the resolution requirements of the sensor data to be read, designers take different approaches.  If ADC resolution of processor/micro controller are enough, then sensors are interfaced directly to ADC of these master chips. If resolution is not enough, external ADC is used and interfaced to processor/micro controller via digital interfaces like I2C/SPI. One has to remember that ADC is not high speed interface and even the requirements of reading a sensor also in the same manner. So, a simple I2C/SPI will work rather than high speed interfaces. 

Considering a case where sensor is interfaced directly to the processor/microcontroller, following are the main points to be considered from their datasheet.

1. ADC type - mostly Successive Approximation Register type is internal to the processor/micro controller as they provide the best resolution, accuracy and consume low power.  LPC2148 has SAR type ADC.
2. Resolution of ADC - For LPC2148, the resolution is 10-bit
3. Number of ADC channels - Generally, ADC channels are multiplexed with other interfaces and select a channel among all the channels. LPC2148 supports 2 ADC  converters with a total of 14 analog channels. 
4. ADC Samples/Second
5. ADC supply voltage - Sometimes, even though micro controller is operated at 3.3V, ADC interface can be operated at 5V. Most of the real world sensors operate at 5V. So, this is very helpful. Check the electrical specifications of the micro controller.
6. Reference voltage to be applied - Some modern micro controllers generate this internally. Generating stable reference voltage is very important to achieve ADC accuracy.
7. Full-scale voltage range - this is the maximum voltage that can be applied to the ADC input. This will generally be equal to ADC supply voltage.
8. Conversion time, Acquisition time - These are defined in terms of clock cycles. Conversion time for LPC2148 ADC channel if 2.44us per channel.
9. Channel-to-channel isolation - indicated in dB and this helps the designer to estimate the amount of coupling that can happening between the channels.
10. Input impedance of the ADC channel - This helps the designers to determine the matching requirements. The input impedance is a very important parameter and designer can get a clarity on the interfacing circuitry based on this parameter.
11. Pin capacitance
12. Supply current of the ADC - Increases as the number of channels increase.
13. ADC clock frequency - this is a scaled version of the PLL output clock. Selectable through internal registers of the micro controller.
14. Settling time - This is the time taken for the ADC to be ready to capture an input after the power is provided to the ADC pin of micro controller.

If there is a pre-amplifier inside the micro controller/processor, parameters like Gain error, offset error, non-linearity error will be provided in the datasheet.

Other than above prameters designers has to finlize on the following inputs,
1. whether the input needs to be single ended or differential
2. Selecting the multiplexed channel
3. Adjusting the gain of the pre-amplifier
4. Selecting the ADC resolution,if adjustable
5. Appropriate filter to be applied at the ADC power supply input

Other considerations in using ADC of microcontroller:
1. The sampling time should be atleast 4-times the clock cycle time.
2. Generally, due to Gain error and non-linearity error the LSB bit of the ADC cannot be considered. So, the actual resolution rating is not what we get in reality.

Post a Comment

0 Comments