![Silicon Laboratories EFR32xG14 Wireless Gecko Reference Manual Download Page 485](http://html1.mh-extra.com/html/silicon-laboratories/efr32xg14-wireless-gecko/efr32xg14-wireless-gecko_reference-manual_1271728485.webp)
17.3.5 Arbitration
Arbitration is enabled by default, but can be disabled by setting the ARBDIS bit in I2Cn_CTRL. When arbitration is enabled, the value
on SDA is sensed every time the I
2
C module attempts to change its value. If the sensed value is different than the value the I
2
C module
tried to output, it is interpreted as a simultaneous transmission by another device, and that the I
2
C module has lost arbitration.
Whenever arbitration is lost, the ARBLOST interrupt flag in I2Cn_IF is set, any lines held are released, and the I
2
C device goes idle. If
an I
2
C master loses arbitration during the transmission of an address, another master may be trying to address it. The master therefore
receives the rest of the address, and if the address matches the slave address of the master, the master goes into either slave transmit-
ter or slave receiver mode.
Note:
Arbitration can be lost both when operating as a master and when operating as a slave.
17.3.6 Buffers
17.3.6.1 Transmit Buffer and Shift Register
The I
2
C transmitter has a 2-level FIFO transmit buffer and a transmit shift register as shown in
Figure 17.1 I2C Overview on page 479
.
A byte is loaded into the transmit buffer by writing to I2Cn_TXDATA or 2 bytes can be loaded simultaneously in the transmit buffer by
writing to I2Cn_TXDOUBLE.
Figure 17.13 I2C Transmit Buffer Operation on page 485
shows the basics of the transmit buffer. When
the transmit shift register is empty and ready for new data, the byte from the transmit buffer is then loaded into the shift register. The
byte is then kept in the shift register until it is transmitted. When a byte has been transmitted, a new byte is loaded into the shift register
(if available in the transmit buffer). If the transmit buffer is empty, then the shift register also remains empty. The TXC flag in I2Cn_STA-
TUS and the TXC interrupt flags in I2Cn_IF are then set, signaling that the transmit shift register is out of data. TXC is cleared when
new data becomes available, but the TXC interrupt flag must be cleared by software.
TX buffer element 1
TX buffer element 0
Shift register
Peripheral bus
TXDOUBLE
TXDATA
Figure 17.13. I2C Transmit Buffer Operation
The TXBL flags in the I2Cn_STATUS and I2Cn_IF are used to indicate the level of the transmit buffer. TXBIL in I2Cn_CTRL controls the
level at which these flag bits are set. If TXBIL is cleared, the flags are set whenever the transmit buffer becomes empty (used when
transmitting using I2Cn_TXDOUBLE). If TXBIL is set, the flags are set whenever the transmit buffer goes from full to half-empty or emp-
ty (used when transmitting with I2Cn_TXDATA). Both the TXBL status flag and the TXBL interrupt flag are cleared automatically when
the condition becomes false.
If an attempt is made to write more bytes to the transmit buffer than the space available, the TXOF interrupt flag in I2Cn_IF is set,
indicating the overflow. The data already in the buffer remains preserved, and no new data is written.
The transmit buffer and the transmit shift register can be cleared by setting command bit CLEARTX in I2Cn_CMD. This will prevent the
I
2
C module from transmitting the data in the buffer and the shift register, and will make them available for new data. Any byte currently
being transmitted will not be aborted. Transmission of this byte will be completed.
Reference Manual
I2C - Inter-Integrated Circuit Interface
silabs.com
| Building a more connected world.
Rev. 1.1 | 485