20 GENERAL-PURPOSE SERIAL INTERFACE (FSIO)
S1C33L26 TECHNICAL MANUAL
Seiko Epson Corporation
20-7
(2) Transmit procedure
The serial interface contains a transmit shift register and a transmit data register, which are provided indepen-
dently of those used for a receive operation.
Transmit data is written to TXD[7:0]/FSIO_TXD
x
register. The data written to TXD[7:0] enters the transmit
data buffer and waits for transmission.
The transmit data buffer is a 2-byte FIFO and up to two data can be written to it successively if empty. Older
data will be transmitted first and cleared after transmission. The next transmit data can be written to the trans-
mit data register, even during data transmission. A transmit data buffer status flag (TDBE/FSIO_STATUS
x
register) is provided to check whether this buffer is full or not. This flag is set to 1 when the transmit data buf-
fer has a free space for transmit data to be written and reset to 0 when the transmit data buffer becomes full by
writing transmit data.
The serial interface starts transmitting when data is written to the transmit data register. The transmit shift regis-
ter status can be checked using the transmit-completion flag (TEND/FSIO_STATUS
x
register). This flag goes 1
after the first bit is shifted out from the shift register and goes 0 after the last bit is shifted out.
When data is transmitted successively in clock-synchronized master mode, TEND maintains 1 until all data is
shifted out (Figure 20.6.3.1). In slave mode, TEND goes 0 every time 1-byte data is shifted out (Figure 20.6.3.2).
Note: TEND goes 0 at the falling edge of SCLK
x
to indicate that all the transmit data bits in the transmit
shift register are shifted out. Be aware that there is a half SCLK
x
cycle interval between setting
TEND to 0 and latching the last bit by the receiver.
When all the data in the transmit data buffer are transferred, a cause of the transmit-data empty interrupt oc-
curs. Since an interrupt can be generated by setting the interrupt control bits, the subsequent transmit data can
be written using an interrupt processing routine. In addition, since this cause of interrupt 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 Section 20.9, “FSIO Interrupts and DMA.”
The following describes transmit operation in both the master and slave modes.
Clock-synchronized master mode
The timing at which the device starts transmitting in the master mode is as follows:
When #SRDY
x
is on a low level while the transmit-data buffer contains data written to it or when data has
been written to the transmit-data buffer while #SRDY
x
is on a low level.
Figure 20.6.3.1 shows a transmit timing chart in the clock-synchronized master mode.
A
B
Slave device receives the LSB.
Slave device receives the MSB.
C
D
First data is written. (2 bytes)
Next data is written. (2 bytes)
Transmit-buffer empty
interrupt request
Slave device
receives the last bit.
SCLK
x
#SRDY
x
SOUT
x
TDBE
TEND
A
*
*
: 1 PCLK cycle
*
B
D0 D1 D2 D3 D4 D5 D6 D7 D0 D1 D2 D3 D4 D5 D6 D7 D0 D1 D2 D3 D4 D5 D6 D7 D0
D6 D7
B
A
B
A
B
C
D
6.3.1 Transmit Timing Chart in Clock-Synchronized Master Mode
Figure 20.
1. If the #SRDY
x
signal from the slave is on a high level, the master waits until it is on a low level (ready
to receive).
2. If #SRDY
x
is on a low level, the synchronizing clock input to the serial interface begins. The synchro-
nizing clock is also output from the SCLK
x
pin to the slave device.