
ACROSSER TECHNOLOGY
27
3.5.3 Programming With The C Driver
The AR-B3001's driver for C language is provided with
source program. This program can be compiled without
any modification by TURBO C compiler. To use this
driver with MSC, user has to replace the inport() and
outport() functions in the program with inp() and outp().
The C driver routine is saved as the file name of
"C3001lib.C" in the "C_LIB" sub-directory. The syntax of
this routine is described as bellow:
int c3001lib(int port, int channel);
Where:
int port;
/* Base port address */
int channel; /* Channel number */
The returned data is within the range of -4095 to +4095.
If the analog input is out of the range of -5V to +5V, the
returned data will be -4096 or +4096.
Example:
data = c3001lib(0x3e0,0);
printf("Data = %d\n",data);
printf("Voltage = %f\n",data*5.00/4096);
Summary of Contents for AR-B3001
Page 4: ...ACROSSER TECHNOLOGY 4 This page is intentionally left blank...
Page 6: ...ACROSSER TECHNOLOGY 6 Figure 2 1 Board Layout of AR B3001...
Page 14: ...ACROSSER TECHNOLOGY 14 This page is intentionally left blank...
Page 28: ...ACROSSER TECHNOLOGY 28 This page is intentionally left blank...
Page 41: ...ACROSSER TECHNOLOGY 41...