DocID025202 Rev 7
780/1080
RM0365
Inter-integrated circuit (I2C) interface
834
Figure 290. Slave initialization flowchart
Slave transmitter
A transmit interrupt status (TXIS) is generated when the I2C_TXDR register becomes
empty. An interrupt is generated if the TXIE bit is set in the I2C_CR1 register.
The TXIS bit is cleared when the I2C_TXDR register is written with the next data byte to be
transmitted.
When a NACK is received, the NACKF bit is set in the I2C_ISR register and an interrupt is
generated if the NACKIE bit is set in the I2C_CR1 register. The slave automatically releases
the SCL and SDA lines in order to let the master perform a STOP or a RESTART condition.
The TXIS bit is not set when a NACK is received.
When a STOP is received and the STOPIE bit is set in the I2C_CR1 register, the STOPF
flag is set in the I2C_ISR register and an interrupt is generated. In most applications, the
SBC bit is usually programmed to ‘0’. In this case, If TXE = 0 when the slave address is
received (ADDR=1), the user can choose either to send the content of the I2C_TXDR
register as the first data byte, or to flush the I2C_TXDR register by setting the TXE bit in
order to program a new data byte.
In Slave Byte Control mode (SBC=1), the number of bytes to be transmitted must be
programmed in NBYTES in the address match interrupt subroutine (ADDR=1). In this case,
D^ϭϵϴϱϬsϮ
,QLWLDOVHWWLQJV
6ODYH
LQLWLDOL]DWLRQ
&OHDU^2$(12$(1`LQ,&B2$5DQG,&B2$5
&RQILJXUH^2$>@2$02'(2$(1
2$>@2$06.>@2$(1*&(1`
&RQILJXUH6%&LQ,&B&5
(QDEOHLQWHUUXSWVDQGRU
'0$LQ,&B&5
(QG
6%&PXVWEHVHWWRVXSSRUW60%XVIHDWXUHV