![background image](http://html2.mh-extra.com/html/rabbit/rabbitcore/rabbitcore_user-manual_3112756047.webp)
User’s Manual
41
Reads the voltage of an analog input channel by serial-clocking an 8-bit command to the ADS7870 A/D
converter by the Direct Mode method. This function assumes that Mode1 (most significant byte first) and
the A/D converter oscillator have been enabled. See
anaInConfig()
for the setup.
The conversion begins immediately after the last data bit has been transferred. An exception error will
occur if Direct Mode bit D7 is not set.
PARAMETERS
cmd
contains a gain code and a channel code as follows.
D7—1; D6–D4—Gain Code; D3–D0—Channel Code
Use the following calculation and the tables below to determine
cmd
:
cmd = 0x80 | (gain_code*16) + channel_code
len
, the output bit length, is always 12 for 11-bit conversions
RETURN VALUE
unsigned int anaInDriver(unsigned int cmd,
unsigned int len);
Gain Code
Multiplier
0
x1
1
x2
2
x4
3
x5
4
x8
5
x10
6
x16
7
x20
Channel Code
Differential Input
Lines
Channel Code
Single-Ended
Input Lines
*
* Negative input is ground.
4–20 mA
Lines
0
+AIN0 -AIN1
8
AIN0
1
+AIN2 -AIN3
9
AIN1
2
+AIN4 -AIN5
10
AIN2
AIN2*
3
†
† Not accessible on RCM3700 Prototyping Board
+AIN6 -AIN7
11
AIN3
AIN3
4
-AIN0 +AIN1
12
AIN4
AIN4
5
-AIN2 +AIN3
13
AIN5
AIN5
6
-AIN4 +AIN5
14
AIN6
AIN6
-AIN6 +AIN7
15
AIN7
AIN7*
Summary of Contents for RabbitCore
Page 6: ...RabbitCore RCM3750...
Page 40: ...34 RabbitCore RCM3750...
Page 64: ...58 RabbitCore RCM3750...
Page 126: ...120 RabbitCore RCM3750...
Page 162: ...156 RabbitCore RCM3750...
Page 172: ......