DocID018909 Rev 11
879/1731
RM0090
Serial peripheral interface (SPI)
918
Figure 253. TXE/RXNE/BSY behavior in Master / full-duplex mode (BIDIMODE=0 and
RXONLY=0) in the case of continuous transfers
Figure 254. TXE/RXNE/BSY behavior in Slave / full-duplex mode (BIDIMODE=0,
RXONLY=0) in the case of continuous transfers
MI
S
O/MO
S
I (in)
Tx b
u
ffer
DATA1 = 0xA1
TXE fl
a
g
0xF2
B
S
Y fl
a
g
0xF
3
s
oftw
a
re
write
s
0xF1
into
S
PI_DR
s
oftw
a
re w
a
it
s
u
ntil TXE=1
a
nd
write
s
0xF2 into
S
PI_DR
s
oftw
a
re w
a
it
s
u
ntil RXNE=1
a
nd re
a
d
s
0xA1
from
S
PI_DR
s
et by h
a
rdw
a
re
cle
a
red by
s
oftw
a
re
s
et by h
a
rdw
a
re
cle
a
red by
s
oftw
a
re
s
et by h
a
rdw
a
re
s
et by h
a
rdw
a
re
S
CK
DATA 2 = 0xA2
DATA
3
= 0xA
3
re
s
et by h
a
rdw
a
re
Ex
a
mple in M
as
ter mode with CPOL=1, CPHA=1
0xF1
RXNE fl
a
g
(write
S
PI_DR)
Rx b
u
ffer
s
et by h
a
rdw
a
re
MI
S
O/MO
S
I (o
u
t)
DATA1 = 0xF1
DATA2 = 0xF2
DATA
3
= 0xF
3
(re
a
d
S
PI_DR)
0xA1
0xA2
0xA
3
s
oftw
a
re w
a
it
s
u
ntil TXE=1
a
nd
write
s
0xF
3
into
S
PI_DR
s
oftw
a
re w
a
it
s
u
ntil RXNE=1
a
nd re
a
d
s
0xA2
from
S
PI_ DR
s
oftw
a
re w
a
it
s
u
ntil RXNE=1
a
nd re
a
d
s
0xA
3
from
S
PI_DR
b0 b1 b2 b
3
b4 b5 b6 b7 b0 b1 b2 b
3
b4 b5 b6 b7 b0 b1 b2 b
3
b4 b5 b6 b7
b0 b1 b2 b
3
b4 b5 b6 b7 b0 b1 b2 b
3
b4 b5 b6 b7 b0 b1 b2 b
3
b4 b5 b6 b7
cle
a
red by
s
oftw
a
re
a
i17
3
4
3
0xF1
s
et by cle
a
red by
s
oftw
a
re
MI
S
O/MO
S
I (in)
Tx b
u
ffer
DATA 1 = 0xA1
TXE fl
a
g
0xF2
B
S
Y fl
a
g
0xF
3
software
writes 0xF1
into SPI_DR
software waits
until TXE=1 and
writes 0xF2 into
SPI_DR
software waits
until RXNE=1
and reads 0xA1
from SPI_DR
s
et by h
a
rdw
a
re
cle
a
red by
s
oftw
a
re
s
et by h
a
rdw
a
re
cle
a
red by
s
oftw
a
re
s
et by h
a
rdw
a
re
S
CK
DATA 2 = 0xA2
DATA
3
= 0xA
3
re
s
et by h
a
rdw
a
re
Ex
a
mple in
S
l
a
ve mode with CPOL=1, CPHA=1
RXNE fl
a
g
(write to
S
PI_DR)
Rx b
u
ffer
s
et by h
a
rdw
a
re
MI
S
O/MO
S
I (o
u
t)
DATA 1 = 0xF1
DATA 2 = 0xF2
DATA
3
= 0xF
3
(re
a
d from
S
PI_DR)
0xA1
0xA2
0xA
3
software waits
until TXE=1 and
writes 0xF3 into
SPI_DR
software waits
until RXNE=1
and reads 0xA2
from SPI_ DR
software waits
until RXNE=1
and reads 0xA3
from SPI_DR
b0 b1 b2 b
3
b4 b5 b6 b7 b0 b1 b2 b
3
b4 b5 b6 b7 b0 b1 b2 b
3
b4 b5 b6 b7
b0 b1 b2 b
3
b4 b5 b6 b7 b0 b1 b2 b
3
b4 b5 b6 b7 b0 b1 b2 b
3
b4 b5 b6 b7
cle
a
red by
s
oftw
a
re
a
i17
3
44