5.4 Analog and Touch

Analog-to-Digital Converter (ADC)

The PIC16F, PIC18F and PIC32CM MCUs provide ADCs that convert analog signals to digital values, supporting a range of resolutions and input channels. All ADCs offer features suitable for applications requiring sensor interfacing, analog signal monitoring, and precise measurement.

There are different variations of the ADC peripheral for specific family of devices of each architecture. These variations include the PIC16F/PIC18F’s ADCC, and PIC32CM’s Sigma-Delta ADCs (SDADC). ADCC is an enhanced ADC module that adds built-in computation features, while SDADC provides higher resolution and better noise performance for precision applications.

The following table provides a comparison of features of the PIC16F, PIC18F and PIC32CM MCUs.

Table 5-13. PIC16F, PIC18F, and PIC32CM ADC Features
FeaturePIC16F ADC/ADCCPIC18F ADC/ADCC/ADC3PIC32CM ADC/SDADC
VariantsStandard ADC

ADC with Computation (ADCC)

Standard ADC

ADC with Computation (ADCC)

Standard ADC Sigma-Delta ADC
Resolution8-10 bits (standard), 12 bits (ADCC)8-10 bits (standard), 12 bits (ADCC and ADC3, 16-bit (through decimation)8-12 bits (SAR), 16 bits (SDADC)
Input ChannelsUp to 45, varies per device Up to 45, varies per device Up to 32, varies per device
Max Sampling Rate Up to 300 ksps (typical)Up to 1 Msps Up to 4.5 Msps

SDADC: Up to 1.5 Msps

Computation FeaturesADCC: filtering, averaging, threshold, etc.ADCC: filtering, averaging, threshold, etc.

ADC3: improved computation engine, faster sampling, etc.

Window comparator, Event triggers, Oversampling
Differential InputsSupported in some familiesSupported in some familiesSupported (SDADC)
Programmable GainRequires external op amp or FVRRequires external op amp or FVRSupported (SDADC)
Reference OptionsVDD, FVR, or external VREFVDD, FVR, or external VREFVDD, INTREF, or external VREF
Internal Inputs Varies per device family: Temp indicator, DAC output, FVR, VDDCORE, op ampVaries per device family: Temp indicator, DAC output, FVR, VDDCORE, VBAT/2Varies per device family: Temperature sensor Band gap VREF DAC Scaled supplies
AccumulationUp to 256 samples Up to 256 samples Up to 1024 samples
Window ComparatorSupportedSupportedSupported
Conversion ModesSingle, Continuous, and Double Sample (for hardware CVD)Single, Continuous, Basic, Accumulate, Average, Burst Average, Low-Pass FilterSingle, Continuous, Pin-Scan, and Sequencing
Auto-Trigger/Event SystemSupported (ADCC)Supported (ADCC)Supported (EVSYS, advanced triggering)
Low PowerSupported (ADCC)Supported (ADCC, Deep Sleep ADC)Supported (sleepwalking, event-driven)
Self-CalibrationSupported (ADCC)Supported (ADCC)Supported (auto-calibration)

Digital-to-Analog Converter (DAC)

The PIC16F, PIC18F, and PIC32CM DAC peripherals generate analog voltages from digital values. DAC features, such as high drive capabilities, the ability to route DAC output to other internal analog peripherals (like comparators), and support for real-time analog signal generation. These DACs are suitable for applications, such as waveform generation, audio output, and analog control.

Some PIC32CM family of devices have 12-bit DAC controllers with higher speed, dual-channel, and differential output options. The table below provides a comparison of the features of the PIC16F, PIC18F, and PIC32CM MCUs.

Table 5-14. PIC16F, PIC18F, and PIC32CM DAC Features
FeaturePIC16F DACPIC18F DACPIC32CM DAC
Resolution5-bit/8-bit or 10-bit8-bit/10-bit/12-bit10-bit

12-bit (16-bit with dithering)

Max Conversion Rate Supports up to 300 kspsSupports up to 300 ksps10-bit: Up to 350 ksps

12-bit: Up to 1 Msps

Number of Channels1-21-3 1-2
Output Range Rail-to-rail; typically VSS to VDD or VREF+GND to selected VREF, VDD, or FVRGND to selected VREF
Trigger SourcesSoftware, Timers, or Auto-Conversion Triggers from peripheralsSoftware, Enable bitEnable bit

Event-driven

Internal RoutingConnects to ADC, Comparators, op amps, and FVRRoutes to ADC, Comparators, and op ampsOutput can be used by other analog blocks
Voltage Reference OptionsVdd, FVRVdd, FVR, external VrefVdd, external/internal Vref
Waveform GenerationBasic (manual update)Basic (manual update, with auto-trigger)Advanced (event system, auto-trigger)
Event System IntegrationN/AN/ASupported
Low Power OperationSupportedSupportedSupported (sleepwalking, event system)

Analog Comparator (AC/CMP)

Analog Comparators (AC/CMP) compare the voltage levels of two inputs and provide a digital output based on the comparison. The PIC16F, PIC18F, and PIC32CM ACs offer features suitable for zero-cross detection, threshold monitoring, and windowed analog signal analysis. The following table provides a comparison of the features of the PIC16F, PIC18F, and PIC32CM MCUs.

Table 5-15. PIC16F, PIC18F, and PIC32CM AC Features
FeaturePIC16F CMPPIC18F CMPPIC32CM AC
Number of Comparators2-82-32–4
Output on Pin SupportedSupportedSupported
Input Selection 4 external inputs

DAC

FVR

VSS

4 external inputs

DAC

FVR

VSS

internal ground

Four pins (positive/negative)

ground band gap

DAC

AVDD scaler (64-level)

Internal ReferenceFVR, DACFVR, DACBand gap, DAC, AVDD scaler
Hysteresis SelectableSelectableSelectable
Output Inversion Supported Supported Supported
Interrupt GenerationRising, Falling, or Any edgeRising, Falling, or Any edgeRising, falling, toggle, end of comparison Window function
Window ModeN/A

through software

N/A

through ADC

Yes (window function, window

interrupts/events)

Event GenerationTriggers ADC, Timers, or PWM shutdown (CWG)Triggers ADC, Timers, or PWM shutdown (CWG)Comparator output, window function (in/out)
Response TimeSelectableSelectableSelectable
Digital FilterSupported for some devicesN/ASupported
Output OptionsDigital output, interrupt, PWM shutdownDigital output, interrupt, PWM shutdownDigital output, interrupt, event trigger
Window/Zero-Cross DetectionSupportedSupportedSupported (window mode, zero-cross, advanced)
Filtering/DebounceSupportedSupportedSupported (programmable filtering)
Low Power OperationSupportedSupportedSupported (sleepwalking, event-driven)
Interrupt on Output ChangeSupportedSupportedYes

Voltage References (VREF)

The PIC16F, PIC18F and PIC32CM MCUs provide programmable fixed voltage references (VREF/FVR) that supply stable reference voltages to analog peripherals, such as ADCs, DACs, and ACs. The PIC16F, PIC18F, and PIC32CM VREFs are designed to enhance measurement precision, support low-power operation, and allow easy configuration of the reference source for different application needs. The following table provides a comparison of the features of the PIC16F, PIC18F and PIC32CM MCUs .

Table 5-16. PIC16F, PIC18F, and PIC32CM VREF Features
FeaturePIC16F FVR/VREFPIC18F FVR/VREFPIC32CM VREF
IntegrationStand-alone FVR/VREF peripheralStand-alone FVR/VREF peripheralIntegrated into the Supply Controller (SUPC) peripheral
Reference Voltage Options Multiple internal voltagesMultiple internal voltagesMultiple internal voltages

External VREF pin

Target PeripheralsADC, DAC, Analog ComparatorADC, DAC, Analog Comparator, HLVD, CTMU, OPAADC, DAC, Analog Comparator
Programmable Levels 1.024V, 2.048V, and 4.096V1.024V, 2.048V, and 4.096VVaries per device family:

1–4.096V

Low-Power OperationSupportedSupportedSupported
ConfigurationSoftware registersSoftware registersSoftware registers
Additional FeaturesStabilization ready flags (RDY/FVRRDY)Stabilization ready flags (RDY/FVRRDY)May include advanced supply management features
Output to PinSupportedSupportedSupported

Operational Amplifiers (op amp)

Some PIC16F, PIC18F, and PIC32CM MCUs have integrated operational amplifier (op amp) peripherals designed for flexible, low-power analog signal conditioning. The op amp peripherals provide up to three individually configurable op amps with rail-to-rail inputs, internal resistor ladders for feedback and gain control, and a wide range of selectable configurations. The PIC16F, PIC18F, and PIC32CM op amps enable complex analog signal processing with minimal or no external components. The table below provides a comparison of the features of the PIC16F, PIC18F, and PIC32CM.

Table 5-17. PIC16F, PIC18F, and PIC32CM OPAMP Features
Feature/AspectPIC16F OPAPIC18F OPAPIC32CM op amp
Number of op ampsUp to fourUp to twoUp to three
Input SelectionI/O pins, DAC,

Basic OPA: FVR

Enhanced OPA: internal resistor ladder

I/O pins, DAC, internal resistor ladderI/O pins, DAC, ground

Other op amps

Internal resistor ladder

Output SelectionI/O pinI/O pins, ADC, ACI/O pins, ADC, AC

Other op amps

Internal Resistor LadderConfigurable for internal feedback/programmable gainConfigurable for internal feedback/programmable gainConfigurable for internal feedback/programmable gain
ConfigurationsStand-alone

Unity gain buffer

Inverting/non-inverting PGA

Comparator

Stand-alone

Unity gain buffer

Inverting/non-inverting PGA

Comparator

Stand-alone

Unity gain buffer

Inverting/non-inverting PGA

Cascaded PGAs

Instrumentation amplifier

Comparator with hysteresis

CalibrationAutomatic input or adjustable input offset voltage calibrationAutomatic input or adjustable input offset voltage calibrationOffset/gain measurement with ADC
Power ModesStandardStandardFour selectable modes (speed vs. power), on-demand start-up
Event System IntegrationN/AN/AOn-demand start-up for ADC/AC
Special FeaturesBuilt-in hardware peak detectVoltage doubler

Programmable hysteresis

Low Power OperationSupported Supported Supported
Output to PinSupported Supported Supported

Touch Controllers

The PIC16F/PIC18F MCU provides touch support through software and hardware CVD (Capacitive Voltage Divider) in their latest families, while the PIC32CM MCU delivers advanced, hardware-accelerated touch sensing for modern, high-performance user interfaces through the Peripheral Touch Controller (PTC). The following table provides a comparison of features of the PIC16F, PIC18F, and PIC32CM.

Table 5-18. PIC16F, PIC18F, and PIC32CM Touch Features
FeaturePIC16F ADC+CVDPIC18F ADC+CVDPIC32CM PTC
Self-Capacitance ButtonsAny analog I/OsAny analog I/OsStandard: Up to 16

Enhanced: Up to 36, mix-and-match

Mutual-Capacitance Buttons Through Guard ring outputs Through Guard ring outputs Up to 256, mix-and-match with self capacitance
Driven Shield+Includes "Guard ring digital output drive"Includes "Guard ring digital output drive"Enhanced: Any X/Y line
Boost ModeSupportedSupportedSupported
Window Monitor SupportedSupportedSupported
Analog/Digital Accumulation SupportedSupportedSupported
Polarity ControlSupportedSupportedSupported
Channel Change DelaySelectableSelectableSelectable
Noise FilteringDifferential CVD

Hardware digital filters

Differential CVD

Hardware digital filters

Hardware filtering

Desynchronization

Enhanced: Driven Shield

Auto-Calibration SupportedSupportedSupported
Touch LibraryMTouchTMMTouchQTouch®
Touch Types SupportedButtons, sliders, wheels (software/PTL)Buttons, sliders, wheels (software/PTL)Buttons, sliders, wheels, proximity, advanced gestures
Low Power OperationSupported Supported Supported (sleepwalking, event system integration)