Starting setting
End of communication
Disable interrupt (MASK)
Set storage area and the number of data for transmit data
(Storage area, Transmission data pointer, and Number of communication
data are optionally set on the internal RAM by the software)
Clear interrupt request flag (xxIF), reset interrupt mask (xxMK) and
set interrupt enable (EI)
Wait for transmit completes
Reading transmit data
Number of
communication data
= –1?
RETI
Number of
communication data
> 1?
Buffer empty/transfer end interrupt
SAU initial setting
No
Set STmn bit to 1
Communication continued?
Set MDmn0 bit to 1
Yes
Yes
No
Main routineInterrupt processing routine
<1>
<3> <5>
<6>
Yes
Writing transmit data to SIOp
(= SDRmn[7:0])
Enables interrupt
Setting transmit data
When buffer empty /transfer end interrupt is generated,
it moves to interrupt processing routine
<2>
Clear MDmn0 bit to
0
Writing transmit data to SIOp
(= SDRmn [7:0])
<4>
No
Read transmit data from buffer and write it to SIOp.
Update transmit data pointer.
If transmit data is left, read them from storage area then
write into SIOp, and update transmit data pointer.
If not, change the interrupt to transmission end interrupt.
Subtract –1 from number of
communication data
It is determined as follows depending on the number of communication data.
+1: Transmission of data is completed
0:
During the last data being transmitted
–1: Transmission of all data is completed
Start communication when master start providing
the clock
Main routine