This repository provides example configurations for the OPAMP peripheral on the PIC16F17576 family of microcontrollers. PIC16F17576 features four internal operational amplifiers, each supporting multiple preset and custom configurations.
The following configurations are available from MPLAB® Code Configurator (MCC):
Figure 1. Direct Connect to Pins
- Direct Connect to Pins – (all OPAMPS)
Configures the opamp to be used on its own with external discrete components, this configuration can also be used for custom feedback circuits.
- Unity Gain – (all OPAMPS)
Sets the op-amp as a voltage follower (unity gain buffer), providing high input impedance and low output impedance
Figure 3. Non-inverting Gain Amplifier
- Non-Inverting Programmable Gain Buffer – (OPAMPs 1 and 2)
Utilizes the internal resistor ladder to set up the op-amp as a non-inverting amplifier with programmable gain
Figure 4. Inverting Gain Amplifier
- Inverting Programmable Gain Buffer – (OPAMPs 1 and 2)
Enables the internal resistor ladder to configure the op-amp as an inverting amplifier with programmable gain
-
MPLAB X IDE 6.25.0 or newer
-
MPLAB XC8 3.0.0 or newer
-
MPLAB Code Configurator (MCC) 5.71.0 or newer
-
MPLAB Code Configurator (MCC) Device Libraries PIC10/PIC12/PIC16/PIC18 MCUs
- PIC16F17576 Curiosity Nano Board
- 1x Breadboard
- 2x Potentiometer
- 1x 1000Ω Resistor
- 1x LED
Connect the hardware as follows:
- Each potentiometer provides an input signal to the OPAMP
- The LED is used to indicate the output voltage
• On startup, the application displays a UART prompt
• The default configuration is "Direct Connect to Pins"
• Pressing the on-board button cycles through the following OPAMP modes:
- Direct Connect
- Unity Gain Buffer
- Non-Inverting Gain Amplifier
- Inverting Gain Amplifier
Refer to the descriptions above for details on each configuration. For further information, consult the PIC16F17576 data sheet, or watch the PIC16F17576 CNANO Unboxing Video.
This guide provides example configurations for using the Operational Amplifier (OPAMP) module on the PIC16F17576 microcontroller family. The examples use the MPLAB X IDE, XC8 compiler, and MPLAB Code Configurator (MCC) for setup. The application allows users to cycle through different OPAMP configurations using the on-board button, with each mode providing different signal processing capabilities. The setup and operation instructions, along with schematics, help users quickly implement and test the OPAMP features.