...the world's most energy friendly microcontrollers
2016-04-28 - Giant Gecko Family - d0053_Rev1.20
426
www.silabs.com
value of I2Cn_STATE will then be 0x57. As seen in the table, the I
2
C module also stops in this state if
the address is not available after a repeated start condition.
To continue, write a byte to I2Cn_TXDATA with the address of the slave in the 7 most significant bits
and the least significant bit cleared (ADDR+W). This address will then be transmitted, and the slave will
reply with an ACK or a NACK. If no slave replies to the address, the response will also be NACK. If the
address was acknowledged, the master now has four choices. It can send a data byte by placing it in
I2Cn_TXDATA (the master should check the TXBL interrupt flag before writing to I2Cn_TXDATA), this
byte is then transmitted. The master can also stop the transmission by sending a STOP, it can send a
repeated start by sending START, or it can send a STOP and then a START as soon as possible.
If a NACK was received, the master has to issue a CONT command in addition to providing data in order
to continue transmission. This is not standard I
2
C, but is provided for flexibility. The rest of the options
are similar to when an ACK was received.
If a new byte was transmitted, an ACK or NACK is received after the transmission of the byte, and the
master has the same options as for when the address was sent.
The master may lose arbitration at any time during transmission. In this case, the ARBLOST interrupt flag
in I2Cn_IF is set. If the arbitration was lost during the transfer of an address, and SLAVE in I2Cn_CTRL
is set, the master then checks which address was transmitted. If it was the address of the master, then
the master goes to slave mode.
After a master has transmitted a START and won any arbitration, it owns the bus until it transmits a
STOP. After a STOP, the bus is released, and arbitration decides which bus master gains the bus next.
The MSTOP interrupt flag in I2Cn_IF is set when a STOP condition is transmitted by the master.
Table 16.5. I
2
C Master Transmitter
I2Cn_STATE
Description
I2Cn_IF
Required
interaction
Response
ADDR
+W ->
TXDATA
ADDR+W will be sent
STOP
STOP will be sent and bus released.
0x57
Start transmitted
START interrupt flag
(BUSHOLD interrupt
flag)
STOP +
START
STOP will be sent and bus released. Then a
START will be sent when bus becomes idle.
ADDR
+W ->
TXDATA
ADDR+W will be sent
STOP
STOP will be sent and bus released.
0x57
Repeated start
transmitted
START interrupt flag
(BUSHOLD interrupt
flag)
STOP +
START
STOP will be sent and bus released. Then a
START will be sent when bus becomes idle.
-
ADDR+W transmitted
TXBL interrupt flag
(TXC interrupt flag)
None
TXDATA
DATA will be sent
STOP
STOP will be sent. Bus will be released
START
Repeated start condition will be sent
0x97
ADDR+W transmitted,
ACK received
ACK interrupt flag
(BUSHOLD interrupt
flag)
STOP +
START
STOP will be sent and the bus released. Then
a START will be sent when the bus becomes
idle
CONT +
TXDATA
DATA will be sent
0x9F
ADDR+W
transmitted,NACK
received
NACK (BUSHOLD
interrupt flag)
STOP
STOP will be sent. Bus will be released
Summary of Contents for Giant Gecko EFM32GG
Page 842: ......