- PIC MCUs
- AVR MCUs
- 8051 MCUs
- Angular Timer
- Configurable Logic Cell
- Cyclic Redundancy Check
- Complementary Waveform Generator
- Direct Memory Access
- Event System
- High Endurance Flash
- Math Accelerator
- Numerically Controlled Oscillator
- Peripheral Pin Select
- Pulse-Width Modulation
- Temperature Indicator
- Timer Peripheral
- Windowed Watch Dog Timer
- Intelligent Analog
- Input and Output Features
- Core Independent
- Functional Safety
- Development Tools
8-bit Development Tools
Analog-to-Digital Converter with Enhanced Features
What is an ADC with Enhanced Features?
It is often necessary to run some type of computation or analysis on your Analog-to-Digital Converter (ADC) results, whether it is filtering or verifying if a value falls within a certain range or not. Software is normally needed to handle these computations which ties up your Central Processing Unit (CPU). Using an Analog-to-Digital Converter with Computation and Context Saving provides the ability to do complex operations on the data collected by the ADC, as well as ADC channel sequencing and configuration management with zero CPU intervention.
These on-chip features eliminate the need for you to write code to see if your readings fall inside or outside of a certain window. You also will not need to average sample readings, filter sample readings or even manage contextual channel configurations for your application. The intelligent analog ADC peripheral functions independently instead of tying up CPU resources.
How are ADCs with Enhanced Features Used?
- Programmable Gain Amplifier (PGA)
- Operational Amplifier (Op Amp)
- Differential Inputs
- Operation During Sleep
- Continuous Operation
- Auto-Trigger Conversion
- Thresholding/Window Comparison
- Accumulation and Averaging
- Low-Pass Filtering
- Capacitive Voltage Divider
The ADCs equipped with a PGA can apply a selective gain (2x, 4x, … 16x) to the input voltage prior to the ADC sampling, which enables the measurement of small amplitude signals. Some MCUs feature one or more integrated op amps which can also be internally connected to the ADC to create a more flexible gain stage.
Context saving and channel sequencing on PIC MCUs automates the management of multiple input channels to the ADC by eliminating the need to reconfigure the ADC registers every time a new channel is selected. This reduces software overhead and simplifies firmware design when developing sensor interfaces.
Conceptually, this can be thought of as an integrated Direct Memory Access (DMA), within the ADC tasked solely with managing channel context mapped directly from program memory. Although similar functionality can be achieved by using DMA in conjunction with more generic ADC modules, incorporating these capabilities within the ADC module permits operation in sleep mode. This makes it an ideal solution for developing low-power analog interfaces and sensor applications that have stringent real-time performance constraints.
Recommended Device Families: PIC18-Q84
Free Running mode (for AVR MCUs) and Continuous Operation mode (for PIC MCUs) are available for most ADCs on recent PIC and AVR devices. In this mode, the ADC only needs to be triggered once. After being initialized, the ADC will continue to trigger itself until stopped. This enables the ADC to continuously monitor your system without needing CPU intervention.
The following strategies can be used to improve the signal-to-noise ratio present in analog signal readings. This can provide more precise measurements and reduce the potential for false positives within your system.
Accumulation on PIC Devices
In accumulation mode for PIC devices, each time the ADC is triggered the output is added to an accumulated value. After each ADC trigger, a threshold comparison is performed on the aggregate and if the threshold criteria are met, an interrupt may trigger based on user initialization.
Accumulation on AVR Devices
Accumulation mode on AVR devices behaves differently than that of PIC devices. This mode allows for the ADC to take samples in bursts. Therefore, each time an ADC read is triggered, it takes a user-defined number of samples and adds them together automatically.
Averaging is available on PIC devices. In this behavior mode, each time the ADC is triggered the result is added to an accumulated value until a user-defined number of ADC samples has been taken. The resulting value is then divided by the total number of samples, resulting in an average.
When in Burst Averaging mode, whether the device is operating in Free Running/Continuous Operation mode or not, ADC reads will continuously be sampled one after another and accumulated until a user-defined number of samples has been taken. The resulting value is then divided by the total number of samples, resulting in an average.
Low-Pass Filtering mode gathers data until a user-defined number of samples has been collected. A customizable digital low-pass filter within the ADC is then applied to the accumulated value. This enables you to reduce the amount of high-frequency noise on the average.
Threshold Comparison (for PIC MCUs) and Window Comparison (for AVR MCUs) are features that allow you to generate interrupts under certain conditions. An interrupt can be generated if an ADC read falls inside, outside, above or below a configured threshold or window. With this advanced capability, ADC values can be monitored and can alert your system when certain criteria is met without needing CPU intervention.
Some PIC MCU ADCs offer a Capacitive Voltage Divider, which is extremely useful in capacitive touch applications. It executes the capacitance measurement sequence within the module, so the ADC output can be directly used as the touch sensing data. This feature greatly reduces the code size and execution time compared to using a basic software library.
Most on-chip ADCs on PIC and AVR MCUs can be triggered by an external or internal signal. This feature allows you to precisely control the sampling period of your ADC without any CPU intervention.