MAX7321
Accessing the MAX7321
I2C interface access to the MAX7321 is summarized as
follows (Table 2).
A single-byte read from the MAX7321 returns the sta-
tus of the eight I/O ports, and clears both the internal
transition flags and the INT output when the master
acknowledges the slave address byte.
A 2-byte read returns first the status of the eight I/O
ports (as for a single-byte read), followed by the transi-
tion flags. Again, the internal transition flags and the
INT output are cleared automatically when the master
acknowledges the slave address byte (but the previous
transition flag data is sent as the second byte).
A multibyte (more than 2 bytes before the I2C STOP
bit) read repeatedly returns the port data, followed by
the transition flags. As the port data is resampled for
each transmission, and the transition flags are reset
each time, a multibyte read continuously returns the
current data and identifies any changing input ports.
If a port input data change occurs during the read
sequence, then INT is reasserted during the I2C STOP
bit. The MAX7321 does not generate another interrupt
during a single-byte or multibyte read.
Input port data is sampled during the preceding I2C
acknowledge bit (the acknowledge bit for the I2C slave
address in the case of a single-byte or 2-byte read).
A single-byte write to the MAX7321 sets the logic state
of all eight I/O ports.
A multibyte write to the MAX7321 repeatedly sets the
logic state of all eight I/O ports.
Reading the MAX7321
A read from the MAX7321 starts with the master trans-
mitting the MAX7321’s slave address with the R/Wbit
set high. The MAX7321 acknowledges the slave
address, and samples the input ports (takes a snap-
shot) during the acknowledge bit. INT goes high (high
impedance if an external pullup resistor is not fitted)
during the slave address acknowledge. The master can
then issue a STOP condition after the acknowledge
(Figure 6). The snapshot is not taken, and INT status
remains unchanged if the master terminates the serial
transaction with a no acknowledge.
Typically, the master reads 1 or 2 bytes from the
MAX7321, each byte being acknowledged by the mas-
ter upon reception.
The master can read 1 byte from the MAX7321 and
then issue a STOP condition (Figure 7). In this case, the
MAX7321 transmits the current port data, clears the
change flags, and resets the transition detection. INT
goes high (high impedance if an external pullup resis-
tor is not fitted) during the slave address acknowledge.
The new snapshot data is the current port data trans-
mitted to the master; therefore, port changes ocurring
during the transmission are detected. INT remains high
until the STOP condition.
The master can read 2 bytes from the MAX7321 and
then issue a STOP condition (Figure 8). In this case, the
MAX7321 transmits the current port data, followed by
the change flags. The change flags are then cleared,
and transition detection resets. INT goes high (high
impedance if an external pullup resistor is not fitted)
during the slave address acknowledge. The new snap-
shot data is the current port data transmitted to the
master; therefore, port changes occurring during the
transmission are detected. INT remains high until the
STOP condition.
I2C Port Expander with 8 Open-Drain I/Os
10 ______________________________________________________________________________________