R01UH0136EJ0210 Rev.2.10
Page 485 of 800
Jul 31, 2012
M16C/64A Group
23. Serial Interface UARTi (i = 0 to 2, 5 to 7)
23.3.2.5
CTS
/
RTS
Function
The
CTS
function is used to start transmit operation when a low signal is applied to the
CTSi
/
RTSi
(i =
0 to 2, 5 to 7) pin. Transmit operation begins when input to the
CTSi
/
RTSi
pin becomes low. If the input
level is switched from low to high during transmit operation, the operation stops after the ongoing
transmit/receive operation is completed.
When the
RTS
function is selected, the
CTSi
/
RTSi
pin outputs a low signal when the MCU is ready to
receive. The output level becomes high when a start bit is detected.
See Table 23.10 “I/O Pin Functions in UART Mode”.
23.3.2.6
CTS
/
RTS
Separate Function (UART0)
This function separates
CTS0
and
RTS0
, outputs
RTS0
from the P6_0 pin, and inputs
CTS0
from the
P6_4 pin. To use this function, set the register bits as follows:
•
The CRD bit in the U0C0 register is 0 (enable
CTS
/
RTS
of UART0)
•
The CRS bit in the U0C0 register is 1 (output
RTS
of UART0)
•
The CRD bit in the U1C0 register is 0 (enable
CTS
/
RTS
of UART1)
•
The CRS bit in the U1C0 register is 0 (input
CTS
of UART1)
•
The RCSP bit in the UCON register is 1 (inputs
CTS0
from the P6_4 pin)
•
The CLKMD1 bit in the UCON register is 0 (CLKS1 not used)
Note that when using the
CTS
/
RTS
separate function,
CTS
/
RTS
function of UART1 cannot be used.
Figure 23.17
CTS
/
RTS
Separate Function
23.3.2.7
Processing When Terminating Communication or When an Error Occurs
If communication is terminated in UART mode, or a communication error occurs, use following
procedure reset communication:
(1) Set the TE bit in the UiC1 (i = 0 to 2, 5 to 7) register to 0 (transmission disabled) and the RE bit to
0 (reception disabled).
(2) Set bits SMD2 to SMD0 in the UiMR register to 000b (serial interface disabled).
(3) Set bits SMD2 to SMD0 in the UiMR register to 100b (UART mode character bit length is 7 bits),
101b (UART mode character bit length is 8 bits), and 110b (UART mode character bit length is 9
bits).
(4) Set the TE bit in the UiC1 register to 1 (transmission enabled) and the RE bit to 1 (reception
enabled).
MCU
TXD0 (P6_3)
RXD0 (P6_2)
IN
OUT
CTS
RTS
CTS0 (P6_4)
RTS0 (P6_0)
IC
Содержание M16C/60 Series
Страница 853: ...M16C 64A Group R01UH0136EJ0210...