3.5.1.5 Gain Self-Check with the Operational Amplifier

To protect against accidental software misconfiguration or an analog fault, the system performs an operational amplifier self-test on start-up. This test calculates the gain of the op amp and verifies that it is within a programmed tolerance.

Note: Any noise in the ADC readings will affect the gain measurement. The MCU is placed in Sleep mode during these measurement steps to minimize noise.

To measure gain (AV), first consider the formula:

A V = V O U T V I N

From this expression, it is clear the input and output conditions must be measured to determine the gain. For safety and performance reasons, the Peltier current-sense circuit cannot be used for calibration. Instead, the OPAMP input is temporarily connected to DAC 2, which can be programmed to generate an arbitrary voltage.

Next, the output of the DAC must be measured. With the DAC connected to the op amp internally, disable the internal resistor ladder of the op amp and enable unity gain to output the DAC value from the op amp. The output is expressed as:

V O U T @ U G = V D A C + V O S

In this formula, VOS is the offset voltage of the operational amplifier, VOUT@UG is the measured output at unity gain, and VDAC is the input signal. Error from VOS is not an issue, as it divides out later. Next, reconnect the resistor ladder and set the desired gain. The output becomes:

V O U T @ A V = ( V D A C + V O S ) * A V

Where VOS is the offset voltage of the operational amplifier, VOUT@AV is the measured output with an unknown gain, AV is the gain of the operational amplifier and VDAC is the input signal. To calculate AV, divide the signals:

A V = V O U T @ A V V O U T @ U G

Since the ADC was kept in the same configuration during both measurements, the digital values from the ADC can be used directly instead of converting to the floating-point voltages for the division.