14
The ENDAT-7301M System Board
2-6. Digital I/O
1) Pin out of digital I/O header (JP4):
Pin No.
Function
Pin No.
Function
1
+5V
2
+5V
3
DIO-O0
4
DIO-I0
5
DIO-O1
6
DIO-I1
7
GND
8
GND
9
DIO-O2
10
DIO-I2
11
DIO-O3
12
DIO-I3
13
+3.3V
14
+3.3V
2) Digital I/O port address:
This function is support by onboard super I/O chip; it can be control easily by
change the register of super I/O chip via I/O port “2Eh” and “2Fh”. Please see
the sample code of below for implement.
Voltage tolerance: +/- 5% with 0V to +5V.
Sample code for input (using Turbo C/C++ 3.0):
#define input_port 0x2f
outportb(0x2e,0x87); //Unlock register
outportb(0x2e,0x87); //Unlock register
outportb(0x2e,0x07); //Set Logic Device number pointer
outportb(0x2f,0x07); //Set Logic Device number
outportb(0x2e,0xF1); // Set active register is CRF1
read_data=inportb(input_port); // Read digital input data
printf("DIO-Input=%02X\n",read_data); //Show digital input data on screen
Register configuration:
Bit
No
7 6 5 4 3 2 1 0
Map
IN3
IN2
Out 3
Out 2 Out 1
Out 0
IN1
IN0
Sample code for Output (using Turbo C/C++ 3.0):
outportb(0x2e,0x87); //Unlock register
outportb(0x2e,0x87); //Unlock register
outportb(0x2e,0x07); //Set Logic Device number pointer
outportb(0x2f,0x07); //Set Logic Device number
outportb(0x2e,0xF1); //Set active register is CRF1
outportb(0x2f,0xnn); //Write data to digital output
Содержание ENDAT-7301M
Страница 6: ......
Страница 10: ...4 The ENDAT 7301M System Board 1 4 ENDAT 7301M Motherboard Layout...