Rabbit RabbitCore RCM3400 User Manual page 51

C-programmable analog core module with 10/100base-t reference design
Hide thumbs Also See for RabbitCore RCM3400:
Table of Contents

Advertisement

unsigned int anaIn(unsigned int channel,
int opmode, int gaincode);
Reads the value of an analog input channel using the direct method of addressing the A/D converter.
Note that it takes about 1 second to ensure an internal capacitor on the A/D converter is charged when the
function is called the first time.
PARAMETERS
channel is the channel number (0 to 7) corresponding to ADC_IN0 to ADC_IN7
opmode is the mode of operation:
SINGLE—single-ended input
DIFF—differential input
mAMP—4–20 mA input
channel
0
1
2
3
4
5
6
7
* Not accessible on Prototyping Board.
gaincode is the gain code of 0 to 7 (applies only to Prototyping Board):
RETURN VALUE
A value corresponding to the voltage on the analog input channel:
0–2047 for 11-bit A/D conversions (bit 12 for sign)
ADOVERFLOW (defined macro = -4096) if overflow or out of range
ADTIMEOUT (defined macro = -4095) if conversion is incomplete or busy-bit timeout
SEE ALSO
anaIn, anaInConfig, anaInDriver
User's Manual
SINGLE
+AIN0
+AIN1
+AIN2
+AIN3
+AIN4
+AIN5
+AIN6
+AIN7
Gain Code
Multiplier
0
×1
1
×2
2
×4
3
×5
4
×8
5
×10
6
×16
7
×20
DIFF
+AIN0 -AIN1
+AIN1 -AIN0*
+AIN2 -AIN3
+AIN3 -AIN2*
+AIN4 -AIN5
+AIN5 -AIN4*
+AIN6 -AIN7*
+AIN7 -AIN6*
Voltage Range
(V)
0–20
0–10
0–5
0–4
0–2.5
0–2
0–1.25
0–1
mAMP
*
+AIN0
+AIN1*
+AIN2*
+AIN3
+AIN4
+AIN5
+AIN6
+AIN7*
45

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the RabbitCore RCM3400 and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents