User`s manual
ENDAT-K1001 USERS MANUAL
UNICORN COMPUTER CORP.
24
2-5. Digital I/O
1) Pin out of digital I/O header (GPIO1):
Pin No. Function Pin No. Function
1 +5V 2 +3.3V
3 DIO-P30 4 DIO-P31
5 DIO-P32 6 DIO-P33
7 DIO-P34 8 DIO-P35
9 DIO-P36 * 10 DIO-P37
11 GND 12 GND
Notice: The DIO-P36 (pin-9 of GPIO1) is an alternate pin of chipsets. It’ll output a
low frequency clock till the BIOS finished the boot operation.
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. (Power On Default High)
Sample code for digital Input (using Turbo C/C++ 3.0):
#define input_port 0xf42
outportb(0x2e,0x87); // Unlock register
outportb(0x2e,0x01); // Unlock register
outportb(0x2e,0x55); // Unlock register
outportb(0x2e,0x55); // Unlock register
outportb(0x2e,0x07); // Set Logic Device number pointer
outportb(0x2f,0x07); // Set Logic Device number
outportb(0x2e,0x27); // Set GPIO 3
outportb(0x2f,0xff); // GP30~37 (Default 00)
outportb(0x2e,0xC2); // Set Enable Simple GPIO
outportb(0x2f,0xff); // GP30~37 (Default 00)
outportb(0x2e,0xCA); // Set GPIO Input Mode / Output Mode
outportb(0x2f,0x00); // 0: Inputer ; 1: Output (Default 00)
read_data=inportb(input_port); // Read digital input data IO Base Address 0F42
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 P37 P36 P35 P34 P33 P32 P31 P30