User’s Manual
19
2-6. Digital I/O
1) Pin out of digital I/O header (CN6):
Pin No.
Function
Pin No.
Function
1
DIO-O2
2
DIO-O4
3
DIO-O3
4
DIO-O5
5
GND
6
+5V
7
+12V
8
+3.3V
9
GND
10
KEY
11
+3.3V
12
+12V
13
+5V
14
GND
15
DIO-I2
16
DIO-I4
17
DIO-I3
18
DIO-I5
This function is supported 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” “2Fh”. Please see the
sample code of below for implement.
Voltage tolerance: +/- 5% with 0V to +5V.
2) Digital I/O control port (2E,2Fh):
Register configuration:
Bit
No
7 6 5 4 3 2 1 0
Map
IN5 IN4
OUT5
OUT4
OUT3
OUT2 IN3 IN2
Sample code for input bit 0~3 (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,0x09);
//Set Logic Device number
outportb(0x2e,0xF5); //Set active register is CRF2
read_data=inportb(input_port); // Read digital input data
printf("DIO-Input=%02X\n",read_data); //Show digital input data on screen
Sample code for output bit 0~3 (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,0x00);
//Write data to digital output