ENDAT-GX201 USER’S MANUAL
UNICORN COMPUTER CORP.
29
z
8 Bits Digital I/O (UBIO1)
I/O type: bidirectional for 8 bits I/O without buffer
Pin definition:
UBIO1: DIGITAL I/O (w/o buffer) Pin Header (2x6 with 2.0mm)
Pin No.
Function
Pin No.
Function
1
+3.3V
2
GND
3
GPIO0
4
GPIO4
5
GPIO1
6
GPIO5
7
GPIO2
8
GPIO6
9
GPIO3
10
GPIO7
11
GND
12
+3.3V
Operating condition:
None, all of the standard types of M/B support this feature.
This feature is sourcing from GPIO pin of super I/O chip (SCH3114 by SMSC).
Please refer to the datasheet of SMSC for detail describe of register or the sample
code of below.
S/W Port address:
Base address (0x800).
Register offset:
Pin No.
Control
Data
Pin No.
Control
Data
GPIO0
0x3A 0x4d/bit7
GPIO4
0x6e 0x85/bit
4
GPIO1
0x39 0x4d/bit
6
GPIO5
0x6f
0x85/ bit 5
GPIO2
0x48 0x50/bit
2
GPIO6
0x72
0x85/ bit 6
GPIO3
0x33 0x4d/bit
1
GPIO7
0x73
0x85/ bit 7
Control register configuration (
GPIO0 to GPIO3
):
Pin No.
Function
0
1
BIT0
Input/Output Output
Input
BIT1
Polarity No
invert Invert
BIT2
GPIO/other function
GPIO
Other function
BIT [7..3]
Reserved
ENDAT-GX201 USER’S MANUAL
UNICORN COMPUTER CORP.
30
Control register configuration (
GPIO4 to GPIO7
):
Pin No.
Function
0
1
BIT0
Input/Output Output
Input
BIT1
Polarity No
invert Invert
BIT2
GPIO/other function
Other function
GPIO
BIT [7..3]
Reserved
Sample code
(using TurboC/C++ 3.0):
#define BASE_ADDR 0x800
//Base address
#define GPIO0_IO_CTRL
0x3a
//Control offset of GPIO0
#define GPIO0_DATA 0x4d
//Data port of GPIO0
#define GPIO0_MASK 0x80
//Data mask of GPIO0
unsigned char tmp;
tmp=inportb(BAGPIO0_IO_CTRL);
tmp=tmp|0x01;
//Set
GPIO0
as
input
; tmp=tmp&0xfe;
//Set
GPIO0
as
output
outportb(BAGPIO0_IO_CTRL,tmp);
tmp=inportb(BAGPIO0_DATA);
//Get data from GPIO0
tmp=tmp&GPIO0_MASK;
//Clear
un-used
bit
;
outportb(BAGPIO0_DATA,0x80);
//Set GPIO0 as logical “1”
;
outportb(BAGPIO0_DATA,0x00);
//Set GPIO0 as logical “0”