
III PERIPHERAL BLOCK: SERIAL INTERFACE
S1C33L01 FUNCTION PART
EPSON
B-III-8-9
Successive transmit operations
When the data in the transmit data register is transferred to the shift register, TDBEx is reset to "1" (buffer
empty). Once this occurs, the next transmit data can be written to the transmit data register, even during data
transmission.
This allows data to be transmitted successively. The transmit procedure is described above.
When TDBEx is set to "1", a transmit-data empty interrupt factor occurs. Since an interrupt can be generated as
set by the interrupt controller, the next piece of transmit data can be written using an interrupt processing routine.
In addition, since this interrupt factor can be used to invoke DMA, the data prepared in memory can be
transmitted successively to the transmit-data register through DMA transfers.
For details on how to control interrupts and DMA requests, refer to "Serial Interface Interrupts and DMA".
(3) Terminating transmit operation
Upon completion of data transmission, write "0" to the transmit-enable bit TXENx to disable transmit
operation.
Receive control
(1) Enabling receive operation
Use the receive-enable bit RXENx for receive control.
Ch.0 receive-enable: RXEN0 (D6) / Serial I/F Ch.0 receive-enable register (0x401E3)
Ch.1 receive-enable: RXEN1 (D6) / Serial I/F Ch.1 receive-enable register (0x401E8)
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 by writing "0" to RXENx.
After the P0 function select register is set for the serial interface, the I/O direction of the #SRDY and #SCLK
pins are changed at follows:
#SRDY: When the slave mode is setting, P03 (P07) enters output mode.
Otherwise, P03 (P07) stays in input mode.
#SCLK: When the master mode is setting, P02 (P06) enters output mode.
Otherwise, P02 (P06) stays in input mode.
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 and transmit-enable bit TXENx cannot
be enabled simultaneously. When receiving data, fix TXENx at "0" and do not change it during a
receive operation. In addition, make sure RXENx is not set to "0" during a receive operation.
(2) Receive procedure
This serial interface has a receive shift register and a receive data register (receive data buffer) that are
provided independently of those used for transmit operations.
Ch.0 receive data: RXD0[7:0] (D[7:0]) / Serial I/F Ch.0 receive data register (0x401E1)
Ch.1 receive data: RXD1[7:0] (D[7:0]) / Serial I/F Ch.1 receive data register (0x401E6)
The receive data can be read out from this register.
A status bit is also provided that indicates the status of the receive data register.
Ch.0 receive data buffer full: RDBF0 (D0) / Serial I/F Ch.0 status register (0x401E2)
Ch.1 receive data buffer full: RDBF1 (D0) / Serial I/F Ch.1 status register (0x401E7)
This bit is set to "1" (buffer full) when the MSB of serial data is received and the data in the shift register is
transferred to the receive data register, indicating that the received data can be read out. When the data is read
out, the bit is reset to "0".
The following describes a receive operation in the master and slave modes.