Max7359, Table 11. autoincrement rules, Message format for writing the key-scan controller – Rainbow Electronics MAX7359 User Manual

Page 16: Message format for reading the key-scan controller, Operation with multiple masters

Advertising
background image

MAX7359

2-Wire Interfaced Low-EMI
Key Switch Controller/GPO

16

______________________________________________________________________________________

S

A

A

P

0

SLAVE ADDRESS

COMMAND BYTE

D7

D6

D5

D4

D3

D2

D1

D0

COMMAND BYTE IS STORED ON RECEIPT OF

ACKNOWLEDGE CONDITION

ACKNOWLEDGE FROM MAX7359

ACKNOWLEDGE FROM MAX7359

R/W

Figure 6. Command Byte Received

S

A

A

A

P

0

SLAVE ADDRESS

COMMAND BYTE

DATA BYTE

1 BYTE

AUTOINCREMENT

COMMAND BYTE ADDRESS

D7

D6

D5

D4

D3

D2

D1

D0

D1

D0

D3

D2

D5

D4

D7

D6

ACKNOWLEDGE FROM MAX7359

ACKNOWLEDGE FROM MAX7359

ACKNOWLEDGE FROM MAX7359

R/W

Figure 7. Command and Single Data Byte Received

MAX7359

Message Format for Writing the

Key-Scan Controller

A write to the MAX7359 comprises the transmission of the
slave address with the R/

W bit set to zero, followed by at

least 1 byte of information. The first byte of information is
the command byte. The command byte determines which
register of the MAX7359 is to be written by the next byte,
if received. If a STOP condition is detected after the com-
mand byte is received, the MAX7359 takes no further
action (Figure 6) beyond storing the command byte.

Any bytes received after the command byte are data
bytes. The first data byte goes into the internal register of
the MAX7359 selected by the command byte (Figure 7).

If multiple data bytes are transmitted before a STOP
condition is detected, these bytes are generally stored
in subsequent MAX7359 internal registers (Table 7)
because the command byte address generally autoin-
crements (Table 11).

Message Format for Reading the

Key-Scan Controller

The MAX7359 is read using the MAX7359’s internally
stored command byte as an address pointer, the same
way the stored command byte is used as an address
pointer for a write. The pointer generally autoincrements
after each data byte is read using the same rules as for
a write (Table 11). Thus, a read is initiated by first con-
figuring the MAX7359’s command byte by performing a

write (Figure 6). The master can now read n consecu-
tive bytes from the MAX7359, with the first data byte
being read from the register addressed by the initial-
ized command byte. When performing read-after-write
verification, remember to reset the command byte’s
address because the stored command byte address is
generally autoincremented after the write (Figure 8,
Table 11).

Operation with Multiple Masters

If the MAX7359 is operated on a 2-wire interface with mul-
tiple masters, a master reading the MAX7359 should use
a repeated start between the write that sets the
MAX7359’s address pointer, and the read(s) that takes
the data from the location(s). This is because it is possible
for master 2 to take over the bus after master 1 has set up
the MAX7359’s address pointer but before master 1 has
read the data. If master 2 subsequently resets the
MAX7359’s address pointer, master 1’s read may be from
an unexpected location.

REGISTER

FUNCTION

ADDRESS

CODE (hex)

AUTOINCREMENT

ADDRESS (hex)

Keys FIFO

0x00

0x00

Autoshutdown

0x06

0x00

All other

0x01 thru 0x05

Addr + 0x01

Table 11. Autoincrement Rules

Advertising