Learn About the PIC18F56Q71 Operational Amplifier Module

Last modified by Microchip on 2025/05/19 11:05

The PIC18F56Q71 microcontroller features an integrated operational amplifier (op amp) module designed to enhance analog signal processing capabilities. This module includes differential inputs, a rail-to-rail input voltage range, and a tri-stateable output, making it versatile for various applications. Example applications of the integrated op amp module include over-current detection in motor control systems, where the op amp can be used in conjunction with comparators to monitor and respond to current levels. Additionally, an op amp can be utilized in precision analog signal conditioning, such as filtering and amplification, to improve the accuracy and reliability of sensor data in embedded systems. In this lesson, we’ll cover the features of the PIC18F56Q71 op amp module.

Features

  • 5.5 MHz gain bandwidth
  • Dedicated external output
  • Multiple inverting and noninverting input pins
  • Direct connections to input and output pins and common peripherals such as Digital-to-Analog Converter (DAC) and Analog-to-Digital Converter (ADC)
  • Programmable and automatic input offset calibration
  • Hardware-controlled drive with override controls for multiple modes:
    • Unity gain
    • Rail drive
    • Peak detection
    • Trough detection
    • Tri-state outputs
  • Configurable positive and negative source selections
  • Programmable gain options using a programmable internal resistance ladder

Architecture

Functions of the PIC18F56Q71 Op Amp Module

This block diagram is colored to indicate various functions of the PIC18F56Q71 op amp module:

  • Purple: These are source selection multiplexers (muxes) that select one of five inputs for the negative op amp input and another mux that selects one of four inputs for the positive input. The Negative Source Selection bits (NSS) control the negative input selection and the Positive Source Selection bits (PSS) control the positive selection. Both muxes can select any of the four op amp input pins, OPAxINx- and the negative mux has an additional input to choose VSS.
  • Green: These two muxes provide additional input options from internal sources to both the positive and negative op amp inputs. These additional sources include DAC peripherals and a VDD/2 reference voltage. The negative op amp input mux is controlled by the Operational Amplifier Inverting Input Channel Selection bits (NCH) and the positive is controlled by the Operational Amplifier Noninverting Input Channel Selection bits (PCH).
  • Orange: These three muxes control the feedback signals to the op amp. Let’s review them separately:
    • The Operational Amplifier Gain Selection bits (GSEL) can select the resistance ratio for the feedback network to either the negative or positive op amp input via the NCH and/or the PCH muxes.
    • A second mux controlled by the Feedback Mode Select bits (FMS) sources the GSEL resistor ladder with the op amp output signal or VDD. The feedback feature can be bypassed or enabled using the Resistor Ladder Enable bit (RESON).
    • The last mux of this group, Unity Gain, can connect the op amp output to the negative op amp input for a unity gain configuration. This MUX is controlled by the UG bit in an op amp control register.
  • Yellow: This identifies the op amp module and its fundamental function.
  • Grey: Finally, the Internal Output Enable bit (INTOE) can steer the op amp output using a demultiplexer (dmux) to another peripheral, such as the DAC or ADC for additional conditioning or to the OPAxOUT pin for an external connection. The op amp output can be effectively disabled by selecting a peripheral using the INTOE bit and not using the signal as an input to the peripheral.

Back to Top

Associated Special Function Registers (SFRs)

These are the registers specifically for the PIC18F56Q71 and specific details may vary. Please refer to your device’s data sheet for specific information. Before continuing, note that the letter x is used in all register names going forward to replace the number of the corresponding peripheral for devices with multiple op amps. In use, these values will appear as numbers rather than the letter x. Additionally, the corresponding bits in each register for each setting have been labelled for convenience.

OPAxCON0

OPAxCON0

  • OPAxCON0 is the main control register of the op amp
  • EN enables the op amp
  • CPON turns on the charge pump for the op amp, which can improve performance in low operating voltages
  • UG puts the op amp into Unity Gain Mode

OPAxCON1

OPAxCON1

  • OPAxCON1 contains the internal resistor ladder settings and the negative source select
  • GSEL sets the ratio of resistance on the resistor ladder
  • RESON enables the resistor ladder
  • NSS selects the negative source

OPAxCON2

OPAxCON2

  • OPAxCON2 contains the negative and positive channel selects for the op amp
  • NCH sets the negative channel
  • PCH sets the positive channel

OPAxCON3

OPAxCON3

  • OPAxCON3 contains settings for feedback, the internal output, and positive sources
  • FMS sets the Feedback Mode of the Internal Resistor Ladder, or in other words, what signal is connected to the top of the ladder
  • INTOE enables the Internal Output
  • PSS selects the positive source

OPAxCON4

OPAxCON4

  • OPAxCON4 is for resetting the Peak/Trough detector and for input offset voltage calibration
  • PTRES resets the capacitor in the Peak/Trough detection modes
  • OFCST starts an automatic input offset voltage calibration
  • OFCSEL sets the input offset calibration source, or in other words, is the factory default, the automatic calibration results, or a manual user input being used for calibration

OPAxHWC

OPAxHWC

  • OPAxHWC configures the Hardware Override features
  • OREN enables the Hardware Override
  • HWCH sets the op amp configuration when the input is HIGH
  • ORPOL sets the polarity of the input signal
  • HWCL sets the op amp configuration when the input is LOW

OPAxOFFSET

OPAxOFFSET

  • OPAxOFFSET holds the offset value for the op amp
  • When this register is written to, the factory-calibrated value of this register will be replaced and can only be restored on a reset

OPAxORS

OPAxORS

  • OPAxORS sets the signal source used by the hardware override

Back to Top

Summary

The PIC18F56Q71 op amp module enhances your application’s analog signal processing capabilities. It is designed to provide high performance and flexibility for various applications, including sensor interfacing, signal conditioning, and analog computation. The inclusion of this op amp module makes it a versatile choice for embedded systems requiring robust analog functionality.

Back to Top

Learn More

Back to Top