
III PERIPHERAL BLOCK: SERIAL INTERFACE
S1C33T01 FUNCTION PART
EPSON
B-III-8-13
Setting Asynchronous Interface
When performing asynchronous transfer via the serial interface, the following must be done before data transfer can
be started:
1. Setting input/output pins
2. Setting the interface mode
3. Setting the transfer mode
4. Setting the input clock
5. Setting the data format
6. Setting interrupt/IDMA/HSDMA
The following describes how to set each of the above. For details on interrupt/DMA settings, refer to "Serial
Interface Interrupts and DMA".
Note: Always make sure the serial interface is inactive (TXENx and RXENx = "0") before making these
settings. A change in settings during operation may result in a malfunction.
Setting input/output pins
In the asynchronous mode, two pins–SINx and SOUTx–are used. When external clock input is used, one more
pin, #SCLKx, is also used.
Set CFP0[7:0] (D[7:0]) / P0 function select register (0x402D0) according to the pins used. (Both channels can
be used, if necessary.) Since the #SRDYx pins are not used, P03, CFP4[7:0] (D[7:0]) in the P4 function select
register (0x40300), P07, P43, and P47 can be used as shared function I/O ports.When operated from an internal
clock, P03, P06, P43, and P46 can also be used as shared function I/O ports.
Setting the interface mode
The IRMDx[1:0] (D[1:0]) field in the serial interface IrDA registers (Ch. 0: 0x401E4, Ch. 1: 0x401E9, Ch. 2:
0x401F4, and Ch. 3: 0x401F9) are provided to set up the IrDA interface. Since IRMDx[1:0] becomes
indeterminate at initial reset, initialize it by writing "00" when using the serial interface as a normalinterface, or
"10" when using the serial interface as an IrDA interface. This setting must be made before a transfer mode is
set.
Setting the transfer mode
Use SMDx to set the transfer mode of the serial interface as described earlier.When using the serial interface in
the 8-bit asynchronous mode, set SMDx[1:0] to "11", when using the serial interface in the 7-bit asynchronous
mode, set SMDx[1:0] to "10".
Setting the input clock
In the asynchronous mode, the operating clock can be selected between the internal clock and an external clock.
Ch.0 input clock selection: SSCK0 (D2) / Serial I/F Ch.0 control register (0x401E3)
Ch.1 input clock selection: SSCK1 (D2) / Serial I/F Ch.1 control register (0x401E8)
Ch.2 input clock selection: SSCK2 (D2) / Serial I/F Ch.2 control register (0x401F3)
Ch.3 input clock selection: SSCK3 (D2) / Serial I/F Ch.3 control register (0x401F8)
The external clock is selected (input from the #SCLKx pin) by writing "1" to SSCKx, and an internal clock is
selected by writing "0".
Note: SSCKx becomes indeterminate at initial reset, so be sure to reset it in the software.
Internal clock
When the internal clock is selected, the serial interface is clocked by a clock generated using an 8-bit
programmable timer. The clock source for each channel is as follows:
Ch.0: Clock output by 8-bit programmable timer 2
Ch.1: Clock output by 8-bit programmable timer 3
Ch.2: Clock output by 8-bit programmable timer 4
Ch.3: Clock output by 8-bit programmable timer 5