Starting setting
End of communication
Disable interrupt (MASK)
Set the data pointer for transmission and the number of data items. Clear
communication end flag (Storage area, Transmission data pointer, Number
of communication data and Communication end flag are optionally set on
the internal RAM by the software)
Clear interrupt request flag (xxIF), reset interrupt mask (xxMK) and
set interrupt enable (EI).
Read transmit data from storage area and write it to
SIOp. Update transmit data pointer.
Setting transmit data
Enables interrupt
Wait for transmit completes
Writing transmit data to SIOp
(= SDRmn [7:0])
Transmission completed?
RETI
Number of
communication data
> 0?
No
Buffer empty/transfer end interrupt
Writing transmit data to SIOp
(= SDRmn [7:0])
SAU initial setting
Writing to SIOp makes SOp
and SCKp signals out
(communication starts)
When buffer empty/transfer end interrupt is
generated, it moves to interrupt processing
routine.
No
If transmit data is left, read them from storage area then
write into SIOp, and update transmit data pointer and
number of transmit data.
If no more transmit data, clear MDmn0 bit if its set. If not,
finish.
Check completion of transmission by
verifying transmit end flag
Set STmn bit to 1
Communication continued?
Set MDmn0 bit to 1
Yes
Yes
No
Sets communication
completion interrupt flag
Subtract –1 from number of
communication data
MDmn0 = 1?
Yes
Clear MDmn0 bit to 0
No
Main routine Interrupt processing routine Main routine
<1>
<2>
<3> <5>
<4>
<6>
Yes