V PERIPHERAL MODULES 3 (INTERFACE): GENERAL-PURPOSE SERIAL INTERFACE (EFSIO)
S1C33E07 TECHNICAL MANUAL
EPSON
V-1-9
V
EFSIO
V.1.3.2 Setting Clock-Synchronized Interface
When performing clock-synchronized transfers via the serial interface, the following settings must be made before
data transfer is actually begun:
1. Setting input/output pins
2. Setting the interface mode
3. Setting the transfer mode
4. Setting the clocks
5. Setting the receive FIFO level
6. Setting interrupts and IDMA/HSDMA
The following explains the content of each setting. For details on interrupt/DMA settings, refer to Section V.1.7,
“Serial Interface Interrupts and DMA.”
Note: Always make sure the serial interface is inactive (TXENx (D7/0x300Bx3) and RXENx (D6/
0x300Bx3) = 0) before these settings are made. A change of settings during operation may cause
a malfunction.
TXENx: Serial I/F Ch.x Transmit Enable Bit in the Serial I/F Ch.x Control Register (D7/0x300Bx3)
RXENx: Serial I/F Ch.x Receive Enable Bit in the Serial I/F Ch.x Control Register (D6/0x300Bx3)
Setting input/output pins
All four pins—SINx, SOUTx, #SCLKx, and #SRDYx—are used in the clock-synchronized mode. Configure the
Port Function Select Registers to enable these pin functions according to the channel to be used (two or more
channel can be used simultaneously). For details of pin functions and how to switch over, see Section I.3.3,
“Switching Over the Multiplexed Pin Functions.”
Setting the interface mode
Write 0b00 to IRMDx[1:0] (D[1:0]/0x300Bx4) to choose the ordinary interface. Since IRMDx[1:0] (D[1:0]/
0x300Bx4) becomes indeterminate at initial reset, it must be initialized.
IRMDx[1:0]: Serial I/F Ch.x Interface Mode Select Bits in the Serial I/F Ch.x IrDA Register (D[1:0]/0x300Bx4)
Also 7816MD1[1:0] (D[1:0]/0x300B1A) must be set to 0b00 in Ch.1.
7816MD1[1:0]: Serial I/F Ch.1 ISO7816 Mode Select Bits in the Serial I/F Ch.1 ISO7816 Mode Control
Register (D[1:0]/0x300B1A)
Setting the transfer mode
Use SMDx[1:0] (D[1:0]/0x300Bx3) to set the transfer mode of the serial interface as described earlier. When
using the serial interface as the master for clock-synchronized transfer, set SMDx[1:0] to 0b00; when using the
serial interface as a slave, set SMDx[1:0] to 0b01.
SMDx[1:0]: Serial I/F Ch.x Transfer Mode Select Bits in the Serial I/F Ch.x Control Register (D[1:0]/0x300Bx3)
Setting the input clock
Clock-synchronized master mode
This mode operates using the internal clock generated by the baud-rate timer. Setup the baud-rate timer accord-
ing to the transfer rate for each channel. For how to control the baud-rate timer, see Section V.1.2, “Baud-Rate
Timer (Setting Baud Rate).”
The serial-interface control register contains SSCKx (D2/0x300Bx3) to select the clock source used for the
asynchronous mode. Although this bit does not affect the clock in the clock-synchronized mode, its content
becomes indeterminate at initial reset. Therefore, be sure to initialize this bit by writing 0 (Internal clock), even
when using the serial interface in the clock-synchronized master mode.
SSCKx: Serial I/F Ch.x Input Clock Select Bit in the Serial I/F Ch.x Control Register (D2/0x300Bx3)
Clock-synchronized slave mode
This mode operates using the clock that is output by the external master. This clock is input from the #SCLKx
pin. Therefore, there is no need to control the baud-rate timer.
Initialize SSCKx by writing 1 (#SCLKx).