BL4S100 User’s Manual
81
anaInCalib
int anaInCalib(int channel, int opmode, int gaincode,
int value1, float volts1, int value2, float volts2);
FUNCTION DESCRIPTION
Calibrates the response of a given A/D converter channel as a linear function using the
two conversion points provided. Gain and offset constants are calculated and placed
into the user block in the flash memory.
NOTE:
The 10 and 90% points of the maximum voltage range are recommended when
calibrating a channel.
PARAMETERS
channel
analog input channel number (0 to 7) corresponding to AIN0–AIN7
opmode
the mode of operation for the specified channel. Use one of the
following macros to set the mode for the channel being configured.
SE0_mode
= single-ended unipolar (0–20 V)
DIFF_MODE
= differential bipolar (±20 V)
mAMP_mode
= 4–20 mA
channel
Single-Ended
Differential
4–20 mA
0
+AIN0
+AIN0 -AIN1
+AIN0
1
+AIN1
—
+AIN1
2
+AIN2
+AIN2 -AIN3
+AIN2
3
+AIN3
—
+AIN3
4
+AIN4
+AIN4 -AIN5
5
+AIN5
—
6
+AIN6
+AIN6 -AIN7
7
+AIN7
—