20 GENERAL-PURPOSE SERIAL INTERFACE (FSIO)
S1C33L26 TECHNICAL MANUAL
Seiko Epson Corporation
20-15
Setting the receive FIFO level (advanced mode)
This serial interface incorporates a 4-byte receive FIFO allowing up to 4 bytes of data to be received without
an error even when the receive data register is not read. This serial interface can generate a receive-buffer full
interrupt when the specified number of data are received in the receive FIFO. Use FIFOINT[1:0]/FSIO_IRDA
x
register to set this number of data. Writing 0–3 to FIFOINT[1:0] sets the number of data to 1–4. The default
setting at initial reset is 0 so that a receive-buffer full interrupt will generate when one data is received.
Control and Operation of Asynchronous Transfer
20.7.3
Transmit control
(1) Enabling transmit operation
Use the transmit-enable bit TXEN/FSIO_CTL
x
register for transmit control.
When transmit is enabled by writing 1 to this bit, the clock input to the shift register is enabled (ready for in-
put), thus allowing data to be transmitted.
Transmit is disabled and the transmit data buffer (FIFO) is cleared by writing 0 to TXEN.
Note: Do not set TXEN to 0 during a transmit operation.
(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.
In the 7-bit asynchronous mode, bit 7 (MSB) in each register is ignored.
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. The 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 transfer status can
be checked using the transmit-completion flag (TEND/FSIO_STATUS
x
register). This flag goes 1 when data is
being transmitted and goes 0 when the transmission has completed.
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 as set by the interrupt control bits, the next piece of 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.”
Figure 20.7.3.1 shows a transmit timing chart in the asynchronous mode.