The PIC4321 MCU has a 10-bit analog-to-digital converter (ADC). The high and low referencevoltages of this MCU can be set to be either the MCU’s positive and ground supply voltage
or an external voltage. This reference voltage determines the ADC’s resolution. Theresolution per bit of the 10-bit AD is given by (1).
(1)To increase the resolution,
has to be made small but the minimum requirement for theexternal reference voltages of the PIC4321 MCU is
which sets the resolution to
. Formeasuring small voltages less than
, this resolution will not provide accurate measurements.One other way to increase the ADC’s resolution is amplifying the input voltage to be comparablewith the reference voltages. This can be done with a Programmable Gain Ampliﬁer (PGA) thatis controlled by the MCU. A PGA has a predeﬁned set of gains that are set by the data it receivesfrom an external controller.In this project, Microchip’s
, an 8-input SPI PGA, was used with PIC4321 to scanthe PGA’s output voltage with ADC to ﬁnd an optimum PGA gain to measure the PGA’s inputvoltage in the
range and display the voltage and its unit (
) on a LCD.
2.1 Circuit Set-Up
Figure 1 shows the circuit diagram of the circuit diagram of the auto-range voletmeter implementedwith a PIC4321 MCU and a MCP6S28 PGA. Of the 8 input channels of the PGA only
was used for the chip select digital signal. The input voltage was applied to