...the world's most energy friendly microcontrollers
2016-04-28 - Giant Gecko Family - d0053_Rev1.20
424
www.silabs.com
16.3.7.2 Interactions
Whenever the I
2
C module is waiting for interaction from software, it holds the bus clock SCL low, freezing
all bus activities, and the BUSHOLD interrupt flag in I2Cn_IF is set. The action(s) required by software
depends on the current state the of the I
2
C module. This state can be read from the I2Cn_STATE register.
As an example, Table 16.5 (p. 426) shows the different states the I
2
C goes through when operating
as a Master Transmitter, i.e. a master that transmits data to a slave. As seen in the table, when a start
condition has been transmitted, a requirement is that there is an address and an R/W bit in the transmit
buffer. If the transmit buffer is empty, then the BUSHOLD interrupt flag is set, and the bus is held until
data becomes available in the buffer. While waiting for the address, I2Cn_STATE has a value 0x57,
which can be used to identify exactly what the I
2
C module is waiting for.
Note
The bus would never stop at state 0x57 if the address was available in the transmit buffer.
The different interactions used by the I
2
C module are listed in Table 16.4 (p. 424) in prioritized order. If
a set of different courses of action are possible from a given state, the course of action using the highest
priority interactions, that first has everything it is waiting for is the one that is taken.
Table 16.4. I
2
C Interactions in Prioritized Order
Interaction
Priority
Software action
Automatically continues if
STOP*
1
Set the STOP command bit
in I2Cn_CMD
PSTOP is set (STOP
pending) in I2Cn_STATUS
ABORT
2
Set the ABORT command bit
in I2Cn_CMD
Never, the transmission is
aborted
CONT*
3
Set the CONT command bit
in I2Cn_CMD
PCONT is set in
I2Cn_STATUS (CONT
pending)
NACK*
4
Set the NACK command bit
in I2Cn_CMD
PNACK is set in
I2Cn_STATUS (NACK
pending)
ACK*
5
Set the ACK command bit in
I2Cn_CMD
AUTOACK is set in
I2Cn_CTRL or PACK is
set in I2Cn_STATUS (ACK
pending)
ADDR+W -> TXDATA
6
Write an address to the
transmit buffer with the R/W
bit set
Address is available in
transmit buffer with R/W bit
set
ADDR+R -> TXDATA
7
Write an address to the
transmit buffer with the R/W
bit cleared
Address is available in
transmit buffer with R/W bit
cleared
START*
8
Set the START command bit
in I2Cn_CMD
PSTART is set in
I2Cn_STATUS (START
pending)
TXDATA
9
Write data to the transmit
buffer
Data is available in transmit
buffer
RXDATA
10
Read data from receive
buffer
Space is available in receive
buffer
None
11
No interaction is required
The commands marked with a * in Table 16.4 (p. 424) can be issued before an interaction is required.
When such a command is issued before it can be used/consumed by the I
2
C module, the command is
Summary of Contents for Giant Gecko EFM32GG
Page 842: ......