BAT32G1x9 user manual | Chapter 19 Universal serial communication unit
677 / 1149
Rev.1.02
Fig. 19-91
Flowchart of Slave transmit and receive (single send and receive mode).
SSPI communication starts
configure transmit and receive
data
enable interrupt
write transmit data into
SIOp(=SDRmn[7:0])
wait for transmitting and reception
completes.
relevant initial configuration, refer to diagram 19-93
(select transmission completion interrupt)
regarding transmit and receive data, configure storage
region and data count (via software, any specified
internal RAM storage region, transmit data pointer
communnication data count)
after clear interrupt request flag(Ifxx) and
release interrupt mask(MKxx), enable
interrupt
start communication via clock
provided by master device.
SCI initial configuration
transmission completion interrupt
RETURN
transmit and receive next data?
disable interrupt (mask).
set STmn bit to 1.
communication completed.
No
Yes
m
a
in
p
ro
g
ra
m
in
te
rr
u
p
t
p
ro
ce
ss
p
ro
g
ra
m
m
a
in
p
ro
g
ra
m
if interrupt generated via
transmission completion, jump to
interrupt process program.
update communication data count, confirm
whether there is next transmit and receive
data.
read transmit data from buffer and write into
SIOp, update transmit data pointer
Transmit and receive completed?
No
Yes
read received data into
SIOp(=SDRmn[7:0])
read receiving data and write into storage
region, update receive data pointer
Note that the SIOp register must be set to send data before the master device starts to output the clock.
Note m: Unit number (m=0)n: Channel number (n=0)p:
SSPI
number (p=00)