Data Sheet

MPR121 Sensor
25 Freescale Semiconductor
Write Format
A write to the MPR121 comprises the transmission of the MPR121s slave address with the R/W bit set to 0, followed by at
least one byte of information. The first byte of information is the command byte. The command byte determines which
register of the MPR121 is to be written by the next byte, if received. If a STOP condition is detected after the command byte
is received, the command byte is just stored in the register pointer and the MPR121 takes no further action (Figure 11)
beyond storing the command byte.
Acknowledge from MPR121
S
SLAVE
ADDRESS
0 A
COMMAND
BYTE
A P
R/W
Figure 11. Write format with command byte only
Acknowledge from MPR121
Any bytes received after the command byte are data bytes. The first data byte goes into the internal register of the MPR121
selected by the command byte (Figure 12). If multiple data bytes are transmitted before a STOP condition is detected, these
bytes are generally stored in subsequent MPR121 internal registers because the command byte address generally auto-
increments (see Table 1) for the address auto-increment change.
Acknowledge from
MPR121
Acknowledge
from
MPR121
Acknowledge
from
MPR121
S
SLAVE ADDRESS
0 A
COMMAND BYTE A
DATA
BYTE A P
R/W
n
bytes +n-A from MPR121
Figure 12. Write format with command and data byte(s)
Auto-increment
memory word
address
Read Format
MPR121 is read using MPR121's internally register pointer, the same way the stored register address is used as address
pointer for a write. The pointer generally auto-increments after each data byte is read using the same rules as for a write.
Thus, a read is initiated by first configuring MPR121's register address by performing a write command byte (Figure 13)
followed by a repeated start (Sr). The master can now read 'n' consecutive bytes from MPR121, with first data byte being read
from the register addressed by the initialized register address, and ending the read be a not-acknowledge (NA) before a
STOP (P).
the last is non-Acknowledge from master
Acknowledge from MPR121
Repeated Start
Acknowledge from MPR121
S SLAVE ADDRESS 0 A
COMMAND BYTE A
Sr
SLAVE
ADDRESS
1 A
DATA BYTE NA P
R/W
Acknowledge from MPR121
Figure 13. Read format with command adn and data
and data byte(s)
R /W
n
bytes + n-A from master
auto-increment
memory
word
address