BL4S200 User’s Manual
121
anaInDriver
int anaInDriver(char cmd);
FUNCTION DESCRIPTION
Low-level driver to read the ADS7870 A/D converter chip.
PARAMETER
cmd
The
cmd
parameter contains a gain code and channel code, and the
MSB is set high for direct-mode access. The format is as follows:
Use the following calculation and tables to determine
cmd
:
cmd = 0x80 | (gain_code<<4) + channel_code
D7
D6–D4
D3–D0
1
gain_code
channel_code
gain_code
Multiplier
0
1
1
2
2
4
3
5
4
8
5
10
6
16
7
20
channel_code
Differential
Input Lines
channel_code
Single-Ended
Input Lines
mA
Input Lines
0
+AIN0 -AIN1
8
+AIN0
+AIN0
1
+AIN2 -AIN3
9
+AIN1
+AIN1
2
+AIN4 -AIN5
10
+AIN2
+AIN2
3
+AIN6 -AIN7
11
+AIN3
+AIN3
4
Reserved
12
+AIN4
Reserved
5
Reserved
13
+AIN5
Reserved
6
Reserved
14
+AIN6
Reserved
7
Reserved
15
+AIN7
Reserved
electronic components distributor