BL4S200 User’s Manual
110
4.4.6 A/D Converter Inputs
anaInConfig
void anaInConfig(int channel, int opmode);
FUNCTION DESCRIPTION
Configures an A/D converter input channel for a given mode of operation. This func-
tion must be called before accessing the A/D converter chip.
The configuration of the A/D converter is complicated because channels AIN0–AIN3
are offset independently, but channels AIN4–AIN7 are biased in pairs. When config-
ured for the differential mode, the A/D converter will return differential readings for all
the channel pairs indicated below, with calibration constants reducing the effect of any
bias differences.
AIN0 — biased by D/A converter internal channel 2
AIN1 — biased by D/A converter internal channel 3
AIN2 — biased by D/A converter internal channel 4
AIN3 — biased by D/A converter internal channel 5
AIN4 — biased by D/A converter internal channel 6
AIN5 — biased by D/A converter internal channel 6
AIN6 — biased by D/A converter internal channel 7
AIN7 — biased by D/A converter internal channel 7
When the differential mode is selected, this function call configures both the selected
channel and its differential mate. The differential mode will always configure pairs. For
all of the pairs indicated above, both or neither will be configured for the differential
mode, depending on the mode selected for the channel being configured.
The AIN4–AIN7 pairs are allowed to be configured as paired differential mode or as
either unipolar or bipolar single-ended, but because the AIN4–AIN7 pairs share a D/A
converter bias channel, if a pair has mismatched configurations, they will incur extra
delays as the common D/A converter offset switches with reads from each. The same
is true if they are both bipolar single-ended, but are read with different gains
NOTE:
If you plan to configure the D/A converter chip using
anaOutConfig
, you must
call
anaOutConfig()
before executing
anaInConfig()
. This is because the A/D
converter uses internal channels 2–7 on the D/A converter chip to bias the A/D
converter input circuit.