
Inter-integrated circuit (I
2
C) interface
RM0008
730/1096
Doc ID 13902 Rev 12
Address matched
: the interface generates in sequence:
●
An acknowledge pulse if the ACK bit is set
●
The ADDR bit is set by hardware and an interrupt is generated if the ITEVFEN bit is
set.
●
If ENDUAL=1, the software has to read the DUALF bit to check which slave address
has been acknowledged.
In 10-bit mode, after receiving the address sequence the slave is always in Receiver mode.
It will enter Transmitter mode on receiving a repeated Start condition followed by the header
sequence with matching address bits and the least significant bit set (11110xx1).
The TRA bit indicates whether the slave is in Receiver or Transmitter mode.
Slave transmitter
Following the address reception and after clearing ADDR, the slave sends bytes from the
DR register to the SDA line via the internal shift register.
The slave stretches SCL low until ADDR is cleared and DR filled with the data to be sent
(see
Transfer sequencing EV1 EV3).
When the acknowledge pulse is received:
●
The TxE bit is set by hardware with an interrupt if the ITEVFEN and the ITBUFEN bits
are set.
If TxE is set and some data were not written in the I2C_DR register before the end of the
next data transmission, the BTF bit is set and the interface waits until BTF is cleared by a
read to I2C_SR1 followed by a write to the I2C_DR register, stretching SCL low.
Figure 270. Transfer sequence diagram for slave transmitter
7-bit
s
lave tran
s
mitter
10-bit
s
lave tran
s
mitter
Le
g
end:
S
=
S
t
a
rt,
S
r
= Repe
a
ted
S
t
a
rt, P=
S
top, A= Acknowledge, NA= Non-
a
cknowledge,
EVx= Event (with interr
u
pt if ITEVFEN=1)
EV1:
ADDR=1, cle
a
red
b
y re
a
ding
S
R1 followed
b
y re
a
ding
S
R2
EV
3
-1:
TxE=1,
s
hift regi
s
ter empty, d
a
t
a
regi
s
ter empty, write D
a
t
a
1 in DR.
EV
3
:
TxE=1,
s
hift regi
s
ter not empty, d
a
t
a
regi
s
ter empty, cle
a
red
b
y writing DR
EV
3
-2:
AF=1; AF i
s
cle
a
red
b
y writing
‘
0
’
in AF
b
it of
S
R1 regi
s
ter.
S
Addre
ss
A
D
a
t
a
1
A
D
a
t
a
2
A
.....
D
a
t
a
N
NA
P
EV1 EV
3
-1 EV
3
EV
3
EV
3
EV
3
-2
S
He
a
der
A
Addre
ss
A
EV1
S
r
He
a
der
A
D
a
t
a
1
A
.... D
a
t
a
N
NA P
EV1 EV
3
_1
EV
3
EV
3
EV
3
-2
a
i15
883b
Note
s
: 1- The EV1
a
nd EV
3
_1 event
s
s
tretch
S
CL low
u
ntil the end of the corre
s
ponding
s
oftw
a
re
s
e
qu
ence.
2- The EV
3
s
oftw
a
re
s
e
qu
ence m
us
t complete
b
efore the end of the c
u
rrent
b
yte tr
a
n
s
fer. In c
as
e
the
EV
3
s
oftw
a
re
s
e
qu
ence c
a
n not
b
e m
a
n
a
ged
b
efore the c
u
rrent
b
yte end of tr
a
n
s
fer,
it i
s
recommended to
us
e BTF in
s
te
a
d of TXE with the dr
a
w
ba
ck of
s
lowing the comm
u
nic
a
tion.