Home Articles operating benefits

operating benefits

Mary Tamar Tan of Microchip Technology explains how using op amp modules with other peripherals in 8-bit microcontrollers can reduce production costs and make circuits more efficient.
One of the fundamental elements of analog circuits, the operational amplifier, performs two basic functions: mathematical operations and amplification of differential input signals. This versatile and widely used analog circuit can be found in an enormous number of analog and digital applications for signal conditioning and processing. Some microcontrollers, such as Microchip's 8-bit PIC microcontroller devices, have an op amp module that provides the basic functions of an op amp. When integrated with other smart embedded analog peripherals such as A/D converters, comparators, D/A converters, fixed voltage references, zero crossing detection, slope compensators, and programmable ramp generators, they enable many analog applications to be addressed. Additionally, these microcontrollers make it easy to integrate analog and digital peripherals for many more complex applications.
op amp module
 The op amp module can be implemented in single power supply op amp circuits for increased flexibility and reliability. Features of 8-bit PIC modules include external connections to I/O ports, low-leakage inputs, rail-to-rail I/O, calibrated input offset voltage Factory-installed 3 MHz gain-bandwidth product, unity gain control, programmable positive and negative source selection, and override controls for forcing a unity-gain tri-state output. The block diagram of the op amp module, which has been divided into five sections. Not all microcontrollers offer all sections and functions. An op amp is a very high gain electronic amplifier with a differential input and a single ended output.
It has two inputs, called non-inverting (positive) and inverting (negative). The sources for the positive and negative inputs may vary depending on the device; they can be used as external sources via the device pins or from internal analog sources such as other microcontroller peripherals. Since the op amp is designed to work with feedback, external feedback components must be connected to the module pins depending on the application. These external components are what fundamentally determine the response to the output of the module. The output can be taken from the pins of the device and can directly feed other integrated analog peripherals. The module can also operate in single gain mode by setting the corresponding bit of the register. This allows the inverting input to be connected internally to the output, leaving one pin free for general purpose input and output. Several microcontrollers have an output override in which the output of the op amp is forced to tri-state or to respond in unity gain mode. These modes can be selected by the bits in the register.
The module works between rails to increase the dynamic range of the operational amplifier. The linear region lies between VSS and VDD. Since PIC microcontrollers are designed to work on a single supply, VSS is generally tied to ground, allowing for a rough variation of the maximum voltage between 0 and VDD. The module exhibits linear behavior between VDD and 0. The designer must ensure that the input signal is not above VDD or below VSS, otherwise the microcontroller may operate unexpectedly. Like a typical op amp, the module can be configured for a wide variety of applications by manipulating the connections of external control elements such as resistors, capacitors, and diodes. Since the module has been designed for linear operation, the user must always take electrical specifications and limitations into account to optimize performance.
unity gain mode
Some applications only require isolation between subsequent circuit stages due to load impedance variations. This can be accomplished by adding an isolation circuit that draws no current from the first circuit but supplies the desired current to the next circuit. This isolation circuit can also be used for power amplification. The same voltage is obtained from a lower impedance source but a higher power output can be achieved at the output. An op amp shows very high input impedance and very low output impedance, making it suitable for such applications.
The op amp can also be configured so that it does not have to amplify or attenuate the input signal. This type of op amp circuit is known as a unity gain buffer or voltage follower. The unity gain buffer is simply a non-inverting amplifier with the output connected directly to the inverting input. On PIC microcontrollers, the module can be set to unity gain mode without adding external components by setting the correct bit in the register. When unity gain is selected, the output is internally tied to the inverting input, which also frees the inverting output pin to function as a general purpose I/O pin.
Output Override Mode
 Several microcontrollers have an output null mode in which output pulses from other modules can provide switching control on the output of the op amp. There are two selectable modes for output override: forced tri-state and forced unity gain. Fig. 2 shows some output waveforms for the two modes using PWM as the nulling source.
Cascaded internal modules
Microcontrollers such as Microchip's PIC16F1769 allow programmable connection of the output of one op amp to the output of another op amp. These internal cascaded modules are useful if you need to isolate the output of the op amp from the load. The output of cascaded op amps depends primarily on the gain of each stage. Fig. 3 shows two circuit configurations with cascaded internal op amp modules. Part A of Fig. 3 is made up of two non-inverting amplifier stages to generate a very high gain output.
This setting is useful for high-frequency circuits because of the inverse relationship between amplifier gain and frequency below the -3 dB point. In addition, higher resistive values ​​also generate more thermal noise in the resistors. Cascaded amplifiers would be the best option to eliminate thermal noise and achieve the desired gain. On the other hand, part B of Fig. 3 is constituted by an inverting amplifier with a non-inverting positive reference that basically produces an amplified differential signal between the inverting input and the reference voltage, and a unity gain amplifier that offers isolation. between the output of the previous stage and the load to eliminate load effects.
Cascaded modules can be implemented by firmware by configuring the output of one module as the negative or positive input of another module.
Basic signal conditioning
One of the most common applications for an op amp is basic signal conditioning when input signals need to be manipulated to meet the requirements of downstream stages. Fig. 4 shows a basic signal conditioning circuit that needs to convert a signal with a 0,6 to 1 V input into a 0 to 5 V range for optimized resolution before powering the A/D converter module.
This circuit performs two functions: scaling and level variation. The op amp module is of inverting configuration, which means that it will supply an amplified, inverted replica of the differential input signal. The output signal range depends on the gain of the inverting amplifier. The product of the input signal and the gain determines the scale of the output stage. However, the 5 V scaled result does not exactly belong to the 0 to 5 V range, so it is necessary to vary the output voltage to the desired level by adding a positive reference voltage at the non-inverting input of the amplifier. operational. To obtain a more accurate output, this reference voltage must be varied. If external voltage sources are to be suppressed, Fixed Voltage Reference (FVR) modules and D/A converter modules can be used. The FVR is configured to provide a stable voltage reference to the D/A converter, which divides this fixed voltage into 512 software-configurable output levels that serve as a reference to the non-inverting input of the op amp module.
Once the signal is scaled and has varied its level to the desired output, it feeds the A/D converter module for digital processing. The optimized signal from the op amp module results in a significant reduction in the A/D conversion step size and generates a much higher effective resolution when compared to the unconditioned signal. The output of the op amp can feed other analog peripherals to add analog processing.
Feedback circuit for LED dimming with PWM
Fig. 5 shows a current mode boost driver for constant current PWM LED dimming. In this circuit, a boost converter supplies a constant current to LEDs connected in series. It is important to keep the current constant from the variation of the input voltage and the total resistance of the LEDs so that the color of the LEDs is true. The current is primarily dependent on the duty cycle of the Complementary Output Generator (COG) output.
The output of the COG feeds the data signal modulator and is used to switch the Q1 power MOSFET. Its switching period is determined by the Compare/Capture/PWM (CCP) module, which serves the COG as the upstream event source and the Comparator module as the downstream event source. The CCP is configured in PWM mode to provide a fixed frequency pulse train typically in the range of 100 to 500 kHz. On the other hand, the comparator generates an output pulse whenever the voltage at RSENSE1 exceeds the output of the PRG module. The input to the PRG module is obtained from the output of the op amp module in the feedback loop.
The PRG is configured as a slope compensator to counteract the inherent subharmonic oscillations when the duty cycle is greater than 50%. PWM3 controls dimming to provide the average effective current to control LED brightness without affecting color. Provides a 200 Hz PWM output for modulating the COG output, load switching, and nulling the op amp output. The PWM3 duty cycle determines the dimming factor of the LED, which when on determines the light intensity of the LED. A higher duty cycle factor means a longer conducting Q2 MOSFET, and thus a brighter LED. When the PWM3 output goes low, the COG output is disabled via the DSM, Q2 turns off, and the op amp output is forced to tri-state.
The DSM uses PWM3 as the modulation source to provide synchronized switching with Q2 and the op amp output. It also ensures that the COG pulse is completed before the output switches low. Disabling the COG prevents an overvoltage from appearing at the output while forcing the op amp to tri-state to keep the LED current stable. When Q2 stops conducting, the feedback goes to zero and the op amp module increases its output to maximum and overloads the compensation network. When PWM3 turns back on, it takes several switching cycles for the compensator to recover when a high current spike arrives through the LEDs. This often causes excessive current to be drawn to the LED, which shortens the operating life of the LED.
In this application, the op amp module has been configured with the PWM3 as the null source and the output tri-states when the PWM output is low to decrease excess current in the LED and prevent color change.
Conclusion
The op amp module of 8-bit PIC microcontrollers not only provides the basic functions of a single-supply op amp but also offers other enhanced functions to increase flexibility in op amp circuit designs. As portable equipment becomes increasingly popular, there is increasing demand for single-powered op amp circuits. The integration of an op amp module and other integrated analog peripherals reduces production costs and board space, and provides more efficient circuit performance in many applications.
www.microchip.com