Renesas rl78 Manual Do Utilizador

Página de 1004
 
RL78/G1A 
 
CHAPTER  12   SERIAL  ARRAY  UNIT 
R01UH0305EJ0200  Rev.2.00 
 
 
514  
Jul 04, 2013 
Figure 12-82.  Flowchart of UART Transmission (in Continuous Transmission Mode) 
 
Setting transmit data 
Write 1 to STmn bit
For the initial setting, see Figure 12-77.
(Select buffer empty interrupt)
SAU default setting
Yes
No
No
End of communication
Yes
No 
Communication
continued?
Yes 
Number of
communication data > 0?
<2>
<3>
<4>
<5> 
<6>
<1>
Set data for transmission and the number of data.  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 MDmn0 bit to 0 
Writing transmit data to the
SDRmn[7:0] bits (TXDq
register) (8 bits) or the
SDRmn[8:0] bits (9 bits)
Writing transmit data to the 
SDRmn[7:0] bits 
(TXDq register) (8 bits) or 
the SDRmn[8:0] bits (9 bits)
If transmit data is left, read them from storage area then
write into TxDq, and update transmit data pointer and
number of transmit data.
If no more transmit data, clear MDmn bit if it s set.  If not,
finish.
Subtract -1 from number of
transmit data
RETI 
Transmission completed?
Starting UART
communication
When transfer end interrupt is generated, it moves to 
interrupt processing routine.
Buffer empty/transfer end interrupt
Write 1 to MDmn0 bit
Yes
No
MDmn = 1?
Sets communication
completion interrupt flag
Wait for transmit completes
Clear interrupt request flag (XXIF), reset interrupt mask (XXMK) and set 
interrupt enable (EI).
Enables interrupt
Disable interrupt (MASK)
Check completion of transmission by
verifying transmit end flag
Transmission starts by writing 
to the SDRmn[7:0] bits (TXDq 
register) (8 bits) or the 
SDRmn[8:0] bits (9 bits).
Read transmit data from storage area and write it 
to TXDq. Update transmit data pointer.
Main routine 
Main routine
Interrupt processing routine
<2>
 
 
Remarks 1.  <1> to <6> in the figure correspond to <1> to <6> in Figure 12-81  Timing Chart of UART 
Transmission (in Continuous Transmission Mode)
 
2. 
m: Unit number (m = 0, 1), n: Channel number (n = 0, 2), q: UART number (q = 0 to 2) 
 
 
mn = 00, 02, 10 
 
<R> 
<R> 
<R> 
<R>