Using Harmony v2 to Control the Analog-to-Digital Converter (ADC)

There are two ways to control the Analog-to-Digital Converter (ADC) in Harmony:

Only Static implementation is supported for the ADC Driver Library.

ADC Driver

The ADC Driver Library is a static driver. A device driver provides a simple well-defined interface to a hardware peripheral that can be used without operating system support or that can be easily ported to a variety of operating systems. The ADC driver provides an interface to manage the ADC module. Configuration of the ADC device driver is based on the file system_config.h. This header file contains configuration information for the ADC device driver build. Based on the selections made and the system setup, the ADC device driver will implement the selected features. These configuration settings will apply to all instances of the device driver. The header file can be placed anywhere in the application-specific folders, but the path to this header must be present in the include search for a successful build. Further details for the ADC Driver Library can be found here.


The ADC PLIB provides a low-level abstraction of the ADC module. It can be used to simplify low-level access to the module without the necessity of interacting directly with the module's registers, thus hiding differences from one microcontroller variant to another.

Interface File

The interface to the ADC library is defined in the plib_adc.h header file, which is included by the peripheral.h peripheral library header file. Any C language source (.c) file that uses the ADC library must include peripheral.h.

Please refer to "ADC Peripheral Library (PLIB) for Harmony v2" to learn how to manage the ADC using PLIB.

 Learn More

Example Code and Projects
Learn more >
Entire ADC PLIB Interface
Learn more >
Entire ADC Driver Interface
Learn more >
ADC Hardware Description
Learn more >
© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.