Advantech ITA-1611 Series User Manual page 61

Fanless embedded celeron dual core compact industrial computer
Table of Contents

Advertisement

PCA9554 register 3:
This register configures directions of I/O pins. If value of a certain bit of this register
is set, pin of corresponding port will be defined as inputs with high impedance output
driver. If the value is cleared, then the port will be defined as outputs. When reset, ini-
tial definition of I/O will be inputs with weak pull-up to VDD.
Register 3 is used to set GPIO to Input or Output:
If the corresponding bit is '0', then GPIO pin is enabled as Output;
If the corresponding bit is '1?then GPIO pin is enabled as Input.
Examples:
Take ITA-1610 as example,. Suppose GPIO 00 is set to Output, GPIO 07 is set to
Input, both pins are connected, then how to set the corresponding registers?
GPIO 00 corresponds to PCA9554 0x40 IO0, while GPIO 07 corresponds to
PCA9554 0x40 IO7.
Set GPIO 00 to Output:
1.
Read value of SMBUS slave 0x40 register 3 byte,
2.
Set bit 0 the value read in step 1 to 0 and write it to SMBUS slave 0x40 register
3,
3.
Read value of SMBUS slave 0x40 register 1 byte,
4.
Depending on the output value is Low or High, set bit 0 the value read in step 3
to 0 or 1 and write it to SMBUS slave 0x40 register 1.
Set GPIO 07 to Input value:
1.
Read value of SMBUS slave 0x40 register 3 byte,
2.
Set bit 7 the value read in step 1 to 1 and write it to SMBUS slave 0x40 register
3,
Read value of SMBUS slave 0x40 register 0 byte,
3.
Determine Input value to be Low or High according to value of step 3 bit7.
51
ITA-1611 User Manual

Advertisement

Table of Contents
loading

Table of Contents