274
Figure 14.5 shows an example of a flowchart for initializing SCI3.
Start
End
Clear bits TE and
RE to 0 in SCR3
1
2
3
Set bits CKE1
and CKE0
Set data transfer
format in SMR
Set value in BRR
No
Wait
Yes
4
Has 1-bit period
elapsed?
Set clock selection in SCR3. Be sure to
clear the other bits to 0. If clock output
is selected in asynchronous mode, the
clock is output immediately after setting
bits CKE1 and CKE0. If clock output is
selected for reception in synchronous
mode, the clock is output immediately
after bits CKE1, CKE0, and RE are
set to 1.
Set the data transfer format in the serial
mode register (SMR).
Write the value corresponding to the
transfer rate in BRR. This operation is
not necessary when an external clock
is selected.
1.
2.
3.
4.
Wait for at least the interval required to
transmit or receive one bit, then set TE or
RE in the serial control register (SCR3).
Setting RE enables the RxD pin to be used,
and when transmitting, setting bit TXD in
PMR7 enables the TXD output pin to be
used.
Also set the RIE, TIE, TEIE, and MPIE bits
as necessary to enable interrupts. The
initial states are the mark transmit state
and the idle receive state (waiting for a
start bit).
Set bit TE or RE to
1 in SCR3, set bits
RIE, TIE, TEIE, and
MPIE as necessary,
and when transmitting
(TE = 1), set bit TXD
to 1 in PMR7
Figure 14.5 Example of SCI3 Initialization Flowchart
Summary of Contents for H8/3660
Page 4: ......
Page 26: ...10 ...
Page 82: ...66 ...
Page 152: ...136 ...
Page 154: ...138 ...
Page 260: ...244 ...