
V PERIPHERAL MODULES 3 (INTERFACE): GENERAL-PURPOSE SERIAL INTERFACE (EFSIO)
S1C33E07 TECHNICAL MANUAL
EPSON
V-1-13
V
EFSIO
Receive control
(1) Enabling receive operation
Use the receive-enable bit RXENx (D6/0x300Bx3) for receive control.
When receive operations are enabled by writing 1 to this bit, clock input to the shift register is enabled (ready
for input), thereby starting a data-receive operation. The synchronizing clock input/output on the #SCLKx pin
also is enabled (ready for input/output). Receive operations are disabled and the receive data buffer (FIFO) is
cleared by writing 0 to RXENx (D6/0x300Bx3).
RXENx: Serial I/F Ch.x Receive Enable Bit in the Serial I/F Ch.x Control Register (D6/0x300Bx3)
After the port function select register is set for the serial input/output, the I/O direction of the #SRDYx and
#SCLKx pins are changed at follows:
#SRDYx: When slave mode is set, a switch is made to output mode.
Otherwise, input mode is maintained.
#SCLKx: 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, RXENx (D6/0x300Bx3) and transmit-enable
bit TXENx (D7/0x300Bx3) cannot be enabled simultaneously. When receiving data, fix TXENx
(D7/0x300Bx3) at 0 and do not change it during a receive operation. In addition, make sure RX-
ENx (D6/0x300Bx3) is not set to 0 during a receive operation.
TXENx: Serial I/F Ch.x Transmit Enable Bit in the Serial I/F Ch.x Control Register (D7/0x300Bx3)
(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 RXDx[7:0] (D[7:0]/0x300Bx1). The older data is out-
put first and cleared by reading.
RXDx[7:0]: Serial I/F Ch.x Receive Data Bits in the Serial I/F Ch.x Receive Data Register (D[7:0]/0x300Bx1)
The number of data in the receive data buffer can be checked by reading RXDxNUM[1:0] (D[7:6]/0x300Bx2).
When RXDxNUM[1:0] (D[7:6]/0x300Bx2) is 0, the buffer contains 0 or 1 data. When RXDxNUM[1:0] (D[7:6]/
0x300Bx2) is 1–3, the buffer contains 2–4 data.
RXDxNUM[1:0]: Number of Ch.x Receive Data in FIFO in the Serial I/F Ch.x Status Register (D[7:6]/0x300Bx2)
Furthermore, RDBFx (D0/0x300Bx2) is provided for indicating whether the receive data buffer is empty 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.
RDBFx: Serial I/F Ch.x Receive Data Buffer Full Flag in the Serial I/F Ch.x Status Register (D0/0x300Bx2)
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
as set by the interrupt controller, the received data can be read by an interrupt processing routine. In addition,
since this cause of interrupt can be used to invoke DMA, the received data can be received successively in loca-
tions prepared in memory through DMA transfers.
For details on how to control interrupts/DMA, refer to Section V.1.7, “Serial Interface Interrupts and DMA.”