15.3.7.6 Master Receiver
To receive data from a slave, the master must operate as a master receiver, see
Table 15.4 I2C Master Receiver on page 410
. This is
done by transmitting ADDR+R as the address byte instead of ADDR+W, which is transmitted to become a master transmitter. The ad-
dress byte loaded into the data register thus has to contain the 7-bit slave address in the 7 most significant bits of the byte, and have
the least significant bit set.
When the address has been transmitted, the master receives an ACK or a NACK. If an ACK is received, the ACK interrupt flag in
I2Cn_IF is set, and if space is available in the receive shift register, reception of a byte from the slave begins. If the receive buffer and
shift register is full however, the bus is held until data is read from the receive buffer or another interaction is made. Note that the STOP
and START interactions have a higher priority than the data-available interaction, so if a STOP or START command is pending, the
highest priority interaction will be performed, and data will not be received from the slave.
If a NACK was received, the CONT command in I2Cn_CMD has to be issued in order to continue receiving data, even if there is space
available in the receive buffer and/or shift register.
After a data byte has been received the master must ACK or NACK the received byte. If an ACK is pending or AUTOACK in
I2Cn_CTRL is set, an ACK is sent automatically and reception continues if space is available in the receive buffer.
If a NACK is sent, the CONT command must be used in order to continue transmission. If an ACK or NACK is issued along with a
START or STOP or both, then the ACK/NACK is transmitted and the reception is ended. If START in I2Cn_CMD is set alone, a repea-
ted start condition is transmitted after the ACK/NACK. If STOP in I2Cn_CMD is set, a stop condition is sent regardless of whether
START is set. If START is set in this case, it is set as pending.
As when operating as a master transmitter, arbitration can be lost as a master receiver. When this happens the ARBLOST interrupt flag
in I2Cn_IF is set, and the master has a possibility of being selected as a slave given the correct conditions.
Table 15.4. I2C Master Receiver
I2Cn_STATE
Description
I2Cn_IF
Required in-
teraction
Response
0x57
START transmitted
START interrupt flag
(BUSHOLD interrupt
flag)
ADDR+R ->
TXDATA
ADDR+R will be sent
STOP
STOP will be sent and bus released.
STOP +
START
STOP will be sent and bus released. Then a
START will be sent when bus becomes idle.
0x57
Repeated START trans-
mitted
START interrupt
flag(BUSHOLD inter-
rupt flag)
ADDR+R ->
TXDATA
ADDR+R will be sent
STOP
STOP will be sent and bus released.
STOP +
START
STOP will be sent and bus released. Then a
START will be sent when bus becomes idle.
-
ADDR+R transmitted
TXBL interrupt flag
(TXC interrupt flag)
None
0x93
ADDR+R transmitted,
ACK received
ACK interrupt flag(BUS-
HOLD)
RXDATA
Start receiving
STOP
STOP will be sent and the bus released
START
Repeated START will be sent
STOP +
START
STOP will be sent and the bus released. Then a
START will be sent when the bus becomes idle
0x9B
ADDR+R transmit-
ted,NACK received
NACK(BUSHOLD)
CONT +
RXDATA
Continue, start receiving
STOP
STOP will be sent and the bus released
START
Repeated START will be sent
STOP +
START
STOP will be sent and the bus released. Then a
START will be sent when the bus becomes idle
EFM32JG1 Reference Manual
I2C - Inter-Integrated Circuit Interface
silabs.com
| Smart. Connected. Energy-friendly.
Preliminary Rev. 0.6 | 410