beautypg.com

Rainbow Electronics MAX7311 User Manual

Page 9

background image

Eight of the MAX7311’s nine registers are configured to
operate as four register pairs: input ports, output ports,
polarity inversion ports, and configuration ports. After
sending 1 byte of data to one register, the next byte is
sent to the other register in the pair. For example, if the
first byte of data is sent to output port 2, then the next
byte of data is stored in output port 1. An unlimited
number of data bytes can be sent in one write transmis-
sion. This allows each 8-bit register to be updated inde-
pendently of the other registers.

Reading Port Registers

To read the device data, the bus master must first send
the MAX7311 address with the R/W bit set to zero, fol-
lowed by the command byte, which determines which
register is accessed. After a restart, the bus master
must then send the MAX7311 address with the R/W bit
set to 1. Data from the register defined by the com-
mand byte is then sent from the MAX7311 to the master
(Figures 8, 9).

MAX7311

2-Wire-Interfaced 16-Bit I/O Port Expander

with Interrupt

_______________________________________________________________________________________

9

S

0 A

A S

1 A

A

NA P

SLAVE ADDRESS

SLAVE ADDRESS

MSB

DATA

LSB

MSB

DATA

LSB

COMMAND BYTE

R/W

R/W

ACKNOWLEDGE

FROM SLAVE

ACKNOWLEDGE

FROM SLAVE

ACKNOWLEDGE

FROM SLAVE

MASTER TRANSMITTER BECOMES

MASTER RECEIVER AND SLAVE

RECEIVER BECOMES SLAVE TRANSMITTER

DATA FROM LOWER OR

UPPER BYTE OF REGISTER

DATA FROM LOWER OR

UPPER BYTE OF REGISTER

TRANSFER OF DATA CAN BE STOPPED AT ANY TIME BY A STOP CONDITION.

Figure 8. Read from Register

1

2

3

4

5

6

7

8

9

SCL

SLAVE ADDRESS

PORT 1 DATA

PORT 2 DATA

PORT 1 DATA

PORT 2 DATA

S

1

7

7

7

7

0

0

0

0

1

P

A

A

A

A

R/W

ACKNOWLEDGE

FROM SLAVE

ACKNOWLEDGE

FROM MASTER

ACKNOWLEDGE

FROM MASTER

ACKNOWLEDGE

FROM MASTER

NONACKNOWLEDGE

FROM MASTER

t

IV

t

IR

READ FROM PORT 1

READ FROM PORT 2

DATA INTO PORT 1

DATA INTO PORT 2

INT

TRANSFER OF DATA CAN BE STOPPED ANYTIME BY A STOP CONDITION. WHEN THE
STOP CONDITION OCCURS, DATA PRESENT AT THE LAST ACKNOWLEDGE PHASE IS
VALID (OUTPUT MODE) AND COMMAND BYTE HAS PREVIOUSLY BEEN SET TO REGISTER 00.

Figure 9. Read from Input Registers