20 GENERAL-PURPOSE SERIAL INTERFACE (FSIO)
20-4
Seiko Epson Corporation
S1C33L26 TECHNICAL MANUAL
The baud-rate timer is configured with a 12-bit presettable down counter (BRTCD[11:0]/FSIO_BRTCDH
x
and
FSIO_BRTCDL
x
registers) and a 12-bit reload data register (BRTRD[11:0]/FSIO_BRTRDH
x
and FSIO_BR-
TRDL
x
registers) for setting an initial value to the counter.
The baud-rate timer uses the PCLK1 clock (Ch.0)/PCLK2 clock (Ch.1) supplied from the CMU as the count clock.
For details on how to set and control the PCLK1/PCLK2 clock, see the “Clock Management Unit (CMU)” chapter.
The following procedure generates the clock by the baud-rate timer.
1. Set an initial value to the reload data register BRTRD[11:0].
2. Set BRTRUN/FSIO_BRTRUN
x
register to 1.
The baud-rate timer loads the initial value set in the reload data register to the counter when 1 is written to
BRTRUN, and then starts counting down. When the counter underflows, it outputs an underflow pulse and loads
the reload data again to continue counting.
The underflow occurs in the cycle determined by the reload data. The clock generator reverses its output signal lev-
el using the underflow signal to generate a clock with 50% duty ratio and 1/2 the frequency of the underflow signal.
The baud-rate timer should be stopped (set BRTRUN to 0) when serial communication is not needed to reduce cur-
rent consumption.
Calculating the reload data
The initial value for the reload data register is determined by the expressions shown below. Note that the expres-
sion depends on the transfer mode.
Clock-synchronized master mode
f
PCLK
BRTRD = ————— - 1
2
×
bps
BRTRD: Reload data register setup value of the baud-rate timer
f
PCLK
: Baud-rate timer operating clock (PCLK1 or PCLK2) frequency
bps:
Transfer rate (bits/second)
Asynchronous mode
f
PCLK
×
DIVMD
BRTRD = —————————— - 1
2
×
bps
BRTRD: Reload data register setup value of the baud-rate timer
f
PCLK
: Baud-rate timer operating clock (PCLK1 or PCLK2) frequency
bps:
Transfer rate (bits/second)
DIVMD: Internal division ratio (1/16 or 1/8 selected by DIVMD/FSIO_IRDA
x
register)
Note: Be aware that a certain period of time is required before serial data transfer can be started after
starting the baud-rate timer, as there is a delay between start of the baud-rate timer and output of
the first underflow pulse, especially when a low baud-rate is set.
Clock-Synchronized Interface
20.6
Outline of Clock-Synchronized Interface
20.6.1
In the clock-synchronized transfer mode, 8 bits of data are synchronized to the common clock on both the transmit
and receive sides when the data is transferred. Since the transmit unit has 2-byte buffer and the receive unit has
4-byte buffer (FIFO), successive transmit and receive operations are possible. This transfer mode supports half-
duplex communication, as the clock line is shared between the transmit and receive units.
Master and slave modes
Either the clock-synchronized master mode or the clock-synchronized slave mode can be selected using
SMD[1:0]/FSIO_CTL
x
register.