Rabbit RabbitCore RCM4200 User Manual page 62

C-programmable analog core module with serial flash and etherne
Table of Contents

Advertisement

int anaInDriver(unsigned int cmd);
DESCRIPTION
Reads the voltage of an analog input channel by serial-clocking an 8-bit command to
the A/D converter by its Direct Mode method. This function assumes that Mode1 (most
significant byte first) and the A/D converter oscillator have been enabled. See anaIn-
Config() for the setup.
The conversion begins immediately after the last data bit has been transferred. An ex-
ception error will occur if Direct Mode bit D7 is not set.
An exception error will occur if Direct Mode bit D7 is not set.
PARAMETERS
cmd
56
anaInDriver
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 = 0x80 | (gain_code*16) + channel_code
Gain Code
0
1
2
3
4
5
6
7
Gain
Multiplier
×1
×2
×4
×5
×8
×10
×16
×20
cmd:
RabbitCore RCM4200

Advertisement

Table of Contents
loading

Table of Contents