BX-S959SD Series User’s Manual
65
Usage method
When controlling the general purpose I/O ports GPIO0 to GPIO5 and when using I/O, set the data to I/O
port addresses 02A8h to 02AAh.
Usage procedure
(1)
GPIO selection
…
Set port 02A8h to "04h" in order to enable the control of GPIO0 to GPIO5
with port 02A9h.
(2)
I/O mode setting …
Input data to port 02A9h to set the I/O mode of GPIO0 to GPIO5.
(3)
I/O
…
Use port 02AAh to perform I/O.
Register supplemental explanation
*
02A8h port : General purpose I/O selection register
GPIO0 to GPIO5 use ports GP40 to GP45 of the NCT6106D Super I/O chip (NUVOTON).
Set "06h" to control I/O of GPIO0 to GPIO5.
*
02A9h port : General purpose I/O switch register
D7
D6
D5
D4
D3
D2
D1
D0
w
―
―
IOR5
IOR4
IOR3
IOR2
IOR1
IOR0
*
02AAh port: General purpose I/O register
D7
D6
D5
D4
D3
D2
D1
D0
R/W
―
―
GPIO5
GPIO4
GPIO3
GPIO2
GPIO1
GPIO0
Figure 5.4. General purpose I/O (02AAh)
Input mode
: Read the data from GPIO0 to GPIO5. Even if you set values on GPIO ports Specified
as input mode, these values will be ignored.
Output mode
: Set the data to output from GPIO0 to GPIO5.
Example : With GPIO0 to GPIO2 set to input mode and GPIO3 to GPIO5 set to output mode, to set GPIO3
output and GPIO4 output to "1" and GPIO5 output to "0," specify "0001 1000" ("18h") or "0001
1111" ("1Fh").
Figure 5.5. General purpose I/O switch (02A9h)
Input mode : Set IOR0 to IOR5 to "1".
Output mode
: Set IOR0 to IOR5 to "0".
Example 1 : To set GPIO4 to input mode and all the other GPIO ports to output mode, specify "0001 0000"
("10h").
Example 2 : To set GPIO2 and GPIO5 to input mode and all the other GPIO ports to output mode, specify
"0010 0100" ("24h").
Содержание BX-S959SD Series
Страница 7: ...vi BX S959SD Series User s Manual ...