Simultaneous Serial Data Transmission And Reception (Clock Synchronous Mode) - Renesas RX100 Series User Manual

32-bit mcu
Hide thumbs Also See for RX100 Series:
Table of Contents

Advertisement

RX13T Group
23.5.6
Simultaneous Serial Data Transmission and Reception (Clock Synchronous
Mode)
Figure 23.31 shows a sample flowchart for simultaneous serial transmit and receive operations in clock synchronous
mode.
After initializing the SCI, the following procedure should be used for simultaneous serial data transmit and receive
operations.
To switch from transmit mode to simultaneous transmit and receive mode, check that the SCI has finished transmission
by reading that the TEND flag in the SSR register is 1, and then initialize the SCR register. Then set the TIE, RIE, TE,
and RE bits in the SCR register to 1 simultaneously by a single instruction.
To switch from receive mode to simultaneous transmit and receive mode, check that the SCI has finished reception, and
then set the RIE and RE bits to 0. Then check that the receive error flags (ORER, FER, and PER in the SSR register) are
0, and then set the TIE, RIE, TE, and RE bits in the SCR register to 1 simultaneously by a single instruction.
Start data transmission/reception
No
Write transmit data to TDR
Read ORER flag in SSR
SSR.ORER = 1
No
Read receive data in RDR
No
All data received?
Clear TIE, RIE, TE, RE, and TEIE
bits in SCR to 0
Note:
When switching from transmit or receive operation to simultaneous transmit and receive operations first set
the TIE, RIE, TE, RE, and TEIE bits in SCR to 0, and then set TIE, RIE, TE, and RE bits to 1 simultaneously.
Figure 23.31
Example Flowchart of Simultaneous Serial Transmission and Reception in Clock Synchronous
Mode
R01UH0822EJ0100 Rev.1.00
Jul 31, 2019
[ 1 ]
Initialization
TXI interrupt
Yes
[ 2 ]
Yes
No
Error processing
RXI interrupt
Yes
[ 4 ]
[ 5 ]
Yes
End
23. Serial Communications Interface (SCIg, SCIh)
[ 1 ]
SCI initialization:
The TXDn pin can act as the output pin for
transmitted data and the RXDn pin can act as the
input pin for received data at the same time.
[ 2 ]
Transmit data write:
Write transmit data to TDR once in the TXI
interrupt handling routine.
[ 3 ]
Receive error processing:
If a receive error occurs, read the ORER flag in
the SSR register, perform the relevant error
processing, and then set the ORER flag to 0.
Data reception cannot be resumed while the
ORER flag is 1.
[ 4 ]
Reading receive data:
Read the receive data in the RDR register once in
[ 3 ]
the RXI interrupt request handling routine.
[ 5 ]
Serial transmission/reception continuation
procedure:
To continue serial transmission and reception,
before the MSB (bit 7) of the current frame is
received, finish reading the receive data in the
RDR register by the RXI interrupt. Also, before
the MSB (bit 7) of the current frame is transmitted,
write data to the TDR register by the TXI interrupt.
Transmit data can also be written to the TDR
register by activating the DTC by a transmit data
empty interrupt (TXI) request. Similarly, the RDR
data can also be read by activating the DTC by a
receive data full interrupt (RXI) request.
Page 666 of 1041

Advertisement

Table of Contents
loading

Table of Contents