beautypg.com

7 programmable gain amplifier (pga) – Texas Instruments MSC1210 User Manual

Page 145

background image

Programmable Gain Amplifier (PGA)

12-9

Analog-to-Digital Converter

12.7 Programmable Gain Amplifier (PGA)

The Programmable Gain Amplifier (PGA) can be set to gains of 1, 2, 4, 8, 16,
32, 64, or 128. Using the PGA can actually improve the effective resolution of
the ADC.

For example, with a PGA of 1 on a 5V full-scale range, the ADC can resolve
to 1

µ

V. With a PGA of 128 on a 40mV full-scale range, the ADC can resolve

to 75nV. With a PGA of 1 on a 5V full-scale range, it would require a 26-bit ADC
to resolve 76nV.

Another way of obtaining gain is by reducing the reference voltage. However,
this approach quickly runs into noise limitations (at about 1V), whereby the
noise itself becomes a larger component of the sample, thus reducing the
benefit of the improved resolution from the lower reference voltage.

The PGA setting is set by modifying the three LSBs of the ADCON0 SFR.
These three bits allow the software to set the PGA to any of the eight possible
PGA settings listed in Table 12−1.

Table 12−1.PGA Settings

PGA2

PGA1

PGA0

GAIN

0

0

0

1 (default)

0

0

1

2

0

1

0

4

0

1

1

8

1

0

0

16

1

0

1

32

1

1

0

64

1

1

1

128

For example, the following instructions would have the following effects:

ADCON0 = 0x03; // Set PGA to 8

ADCON0 = 0x05; // Set PGA to 32

Notice that in both of these examples, the instruction will also clear all of the
other bits of ADCON0, which may or not be desirable. To set the PGA as in the
two previous examples without altering the other ADCON0 bits, the following
instructions may be substituted:

ADCON0 = (ADCON0 & ~0x07) | 0x03; // Set PGA to 8

ADCON0 = (ADCON0 & ~0x07) | 0x05; // Set PGA to 32