Rabbit Core RCM3700 User Manual page 46

C-programmable core module with ethernet, serial flash, and enhanced software
Hide thumbs Also See for Core RCM3700:
Table of Contents

Advertisement

unsigned int anaInDriver(unsigned int cmd,
unsigned int len);
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
Channel Code
0
1
2
3
4
5
6
7*
* Negative input is ground.
† Not accessible on RCM3700 Prototyping Board
len, the output bit length, is always 12 for 11-bit conversions
RETURN VALUE
RabbitCore RCM3700 User's Manual
Gain Code
0
1
2
3
4
5
6
7
Differential Input
Channel Code
Lines
+AIN0 -AIN1
+AIN2 -AIN3
+AIN4 -AIN5
+AIN6 -AIN7
-AIN0 +AIN1
-AIN2 +AIN3
-AIN4 +AIN5
-AIN6 +AIN7
Multiplier
x1
x2
x4
x5
x8
x10
x16
x20
Single-Ended
Input Lines
8
AIN0
9
AIN1
10
AIN2
11
AIN3
12
AIN4
13
AIN5
14
AIN6
15
AIN7
4–20 mA
*
Lines
AIN0*
AIN1*
AIN2*
AIN3
AIN4
AIN5
AIN6
AIN7*
44

Advertisement

Table of Contents
loading

Table of Contents