Inter-integrated circuit (I2C) interface
For N >2 -byte reception, from N-2 data reception
•
Wait until BTF = 1 (data N-2 in DR, data N-1 in shift register, SCL stretched low until
data N-2 is read)
•
Set ACK low
•
Read data N-2
•
Wait until BTF = 1 (data N-1 in DR, data N in shift register, SCL stretched low until a
data N-1 is read)
•
Set STOP high
•
Read data N-1 and N
23.3.4
Error conditions
The following are the error conditions which may cause communication to fail.
Bus error (BERR)
This error occurs when the I
an address or a data transfer. In this case:
•
the BERR bit is set and an interrupt is generated if the ITERREN bit is set
•
in Slave mode: data are discarded and the lines are released by hardware:
–
–
•
In Master mode: the lines are not released and the state of the current transmission is
not affected. It is up to the software to abort or not the current transmission
Acknowledge failure (AF)
This error occurs when the interface detects a nonacknowledge bit. In this case:
•
the AF bit is set and an interrupt is generated if the ITERREN bit is set
•
a transmitter which receives a NACK must reset the communication:
–
–
Arbitration lost (ARLO)
This error occurs when the I
•
the ARLO bit is set by hardware (and an interrupt is generated if the ITERREN bit is
set)
•
the I
the I
transfer, but it can acknowledge it after a repeated Start from the winning master.
•
lines are released by hardware
610/1378
2
C interface detects an external Stop or Start condition during
in case of a misplaced Start, the slave considers it is a restart and waits for an
address, or a Stop condition
in case of a misplaced Stop, the slave behaves like for a Stop condition and the
lines are released by hardware
If Slave: lines are released by hardware
If Master: a Stop or repeated Start condition must be generated by software
2
C interface detects an arbitration lost condition. In this case,
2
C Interface goes automatically back to slave mode (the MSL bit is cleared). When
2
C loses the arbitration, it is not able to acknowledge its slave address in the same
RM0033 Rev 8
RM0033
Need help?
Do you have a question about the STM32F205 series and is the answer not in the manual?
Questions and answers