SNIU028D February 2016 – September 2020 UCD3138 , UCD3138064 , UCD3138064A , UCD3138128 , UCD3138A , UCD3138A64
The Front End gain (the gain before the EADC) can be adjusted to 1X, 2X, 4X, and 8X. This gives an EADC resolution of 8mV, 4mV, 2mV, and 1mV respectively.
To set a fixed front end gain, the gain value is written to the AFE_GAIN bits in the EADC Control register.
FeCtrl0Regs.EADCCTRL.bit.AFE_GAIN = 2; //set AFE gain to 4X
In addition, there are 2 automatic gain setting modes, available only on Front End 0. They are enabled by setting the AUTO_GAIN_SHIFT_ENABLE bit in the EADC control register.
FeCtrl0Regs.EADCCTRL.bit.AUTO_GAIN_SHIFT_EN = 1; //enable auto gain shift mode.
In the simpler mode, the gain is shifted to the next lower mode whenever the EADC over or underflows. The gain is increased if the EADC output is less than +-1/4 of its range at the current gain.
By setting the AUTO_GAIN_SHIFT_MODE bit in the EADCCTRL register, the second auto gain mode can be enabled. In this mode, the shift points are set by the Filter nonlinear mode thresholds. These thresholds are described in Section 4.6. There are 3 Filters with non linear thresholds. The FECTRLxMUX register in Chapter 5 selects which set of nonlinear thresholds are used with each Front End.