42.1.2 Programmable Gain Options
The gain of the OPA module can be controlled either using external components to provide feedback, or internally using a built-in resistor ladder. When using the built-in programmable gain options of the OPA module, the internal resistor ladder must be enabled by setting the RESON bit. Once enabled, the nominal gain of the amplifier can be selected using the GSEL bits.
The internal sources to the operational amplifier must be configured based on the OPA mode of operation, when using the built-in programmable gain options. The PCH and NCH bits can be used to connect the internal resistor ladder to the positive or negative input of the operational amplifier, respectively, creating the feedback network needed to control the gain of the circuit.