Data Reception - Epson S1C17W12 Technical Manual

Cmos 16-bit single chip microcontroller
Table of Contents

Advertisement

12 UART (UART2)

12.5.3 Data Reception

A data receiving procedure and the UART2 Ch.n operations are shown below. Figures 12.5.3.1 and 12.5.3.2 show a
timing chart and flowcharts, respectively.
Data receiving procedure (read by one byte)
1. Wait for a UART2 interrupt when using the interrupt.
2. Check to see if the UAnINTF.RB1FIF bit is set to 1 (receive buffer one byte full).
3. Read the received data from the UAnRXD register.
4. Repeat Steps 1 to 3 (or 2 and 3) until the end of data reception.
Data receiving procedure (read by two bytes)
1. Wait for a UART2 interrupt when using the interrupt.
2. Check to see if the UAnINTF.RB2FIF bit is set to 1 (receive buffer two bytes full).
3. Read the received data from the UAnRXD register twice.
4. Repeat Steps 1 to 3 (or 2 and 3) until the end of data reception.
UART2 data receiving operations
The UART2 Ch.n starts data receiving operations when a start bit is input to the USINn pin.
After the receive circuit has detected a low level as a start bit, it starts sampling the following data bits and
loads the received data into the receive shift register. The UAnINTF.RBSY bit is set to 1 when the start bit is
detected.
The UAnINTF.RBSY bit is cleared to 0 and the receive shift register data is transferred to the receive data buf-
fer at the stop bit receive timing.
The receive data buffer consists of a 2-byte FIFO and receives data until it becomes full. When the receive data
buffer receives the first data, it sets the UAnINTF.RB1FIF bit to 1 (receive buffer one byte full). If the second
data is received without reading the first data, the UAnINTF.RB2FIF bit is set to 1 (receive buffer two bytes full).
USINn
UAnINTF.RB1FIF
UAnINTF.RB2FIF
UAnINTF.RBSY
Software operations
Data reception (1 byte read)
Wait for an interrupt request
(UAnINTF.RB1FIF = 1)
Read receive data (1 byte) from
the UAnRXD register
Receive data remained?
NO
12-6
data 1
st D0
···
p sp st D0
Figure 12.5.3.1 Example of Data Receiving Operations
YES
End
Figure 12.5.3.2 Data Reception Flowcharts
Seiko Epson Corporation
data 2
data 3
···
p sp st D0
···
p sp st D0
UAnRXD → data 1 (R)
(st: start bit, sp: stop bit, p: parity bit)
Data reception (2 bytes read)
Wait for an interrupt request
(UAnINTF.RB2FIF = 1)
Read receive data (1 byte) from
the UAnRXD register
Read receive data (1 byte) from
the UAnRXD register
Receive data remained?
NO
End
S1C17W12/W13 TECHNICAL MANUAL
data 4
···
p sp
UAnRXD → data 3 (R)
UAnRXD → data 2 (R)
YES
(Rev. 1.2)

Advertisement

Table of Contents
loading

This manual is also suitable for:

S1c17w13

Table of Contents