20 GENERAL-PURPOSE SERIAL INTERFACE (FSIO)
S1C33L26 TECHNICAL MANUAL
Seiko Epson Corporation
20-9
After the port function select bits are set for the serial inputs/outputs, the I/O direction of the #SRDY
x
and
SCLK
x
pins are changed at follows:
#SRDY
x
: When slave mode is set, a switch is made to output mode.
Otherwise, input mode is maintained.
SCLK
x
: When master mode is set, a switch is made to output mode.
Otherwise, input mode is maintained.
Note: In clock-synchronized transfers, the clock line is shared between the transmit and receive units,
so the communication mode is half-duplex. Therefore, RXEN and the transmit-enable bit (TXEN/
FSIO_CTL
x
register) cannot be enabled simultaneously. When receiving data, fix TXEN at 0 and
do not change it during a receive operation. In addition, make sure RXEN is not set to 0 during a
receive operation.
(2) Receive procedure
This serial interface has a receive shift register, receive data buffer and a receive data register that are provided
independently of those used for transmit operations.
The received data enters the received data buffer. The receive data buffer is a 4-byte FIFO and can receive data
until it becomes full unless the received data is not read out.
The received data in the buffer can be read by accessing RXD[7:0]/FSIO_RXD
x
register. The older data is out-
put first and cleared by reading.
The number of data in the receive data buffer can be checked by reading RXDNUM[1:0]/FSIO_STATUS
x
regis-
ter. When RXDNUM[1:0] is 0, the buffer contains 0 or 1 data. When RXDNUM[1:0] is 1–3, the buffer contains
2–4 data.
Furthermore, RDBF/FSIO_STATUS
x
register is provided for indicating whether the receive data buffer is emp-
ty or not. This flag is set to 1 when the receive data buffer contains one or more received data, and is reset to 0
when the receive data buffer becomes empty by reading all the received data.
When the receive data buffer has received the specified number or more data (one in standard mode or one to
four in advanced mode), a cause of the receive-buffer full interrupt occurs. Since an interrupt can be generated
by setting the interrupt control bits, the received data can be read by an interrupt processing routine.
In addition, a DMA can be invoked every time the received data is written to the receive-buffer, allowing the
received data to be transferred successively to the specified memory location through DMA transfers.
For details on how to control interrupts/DMA, refer to Section 20.9, “FSIO Interrupts and DMA.”
The following describes a receive operation in the master and slave modes.
Clock-synchronized master mode
Figure 20.6.3.3 shows a receive timing chart in the clock-synchronized master mode.
Receive-buffer full interrupt request
(FIFOINT[1:0] = 2)
Overrun error
interrupt request
DMA trigger timings
SCLK
x
SIN
x
Receive data buffer
RXDNUM[1:0]
RDBF
#SRDY
x
(SRDYCTL = 0)
data 1
D0 D1 ··· D6 D7
data 2
D0 D1 ··· D6 D7
data 3
D0 D1 ··· D6 D7
data 4
D0 D1 ··· D6 D7
data 5
D0 D1 ··· D6 D7
data 6
D0 D1 ··· D6 D7
data 7
D0 D1 ··· D6 D7
data 1
1, 2
2, 3, 4, 5
2, 3, 4
1, 2, 3
2, 3
1
3
2
2
1
0
Data read
6.3.3 Receive Timing Chart in Clock-Synchronized Master Mode
Figure 20.