
V PeRiPheRaL MoDuLes 3 (inteRFaCe): GeneRaL-PuRPose seRiaL inteRFaCe (eFsio)
s1C33L17 teChniCaL ManuaL
ePson
V-1-29
V
EFSIO
V.1.6.2 setting iso7816 interface
When performing transfer in ISO7816 mode, 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 retransmit count for error recovery and time guard function
6. Setting the receive FIFO level
7. Setting interrupt/IDMA/HSDMA
The following describes how to set each of the above. 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 (TXEN1 (D7/0x300B13) and RXEN1 (D6/
0x300B13) = 0) before making these settings. A change in settings during operation may result in
a malfunction.
tXen1: Serial I/F Ch.1 Transmit Enable Bit in the Serial I/F Ch.1 Control Register (D7/0x300B13)
RXen1: Serial I/F Ch.1 Receive Enable Bit in the Serial I/F Ch.1 Control Register (D6/0x300B13)
setting input/output pins
In ISO7816 mode, three pins—SIN1, SOUT1, and #SCLK1—are used. Configure the Port Function Select
Registers to enable these pin functions. 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
Set 7816MD1[1:0] (D[1:0]/0x300B1A) to 0b10 when T = 1 protocol is used or 0b01 when T = 0 protocol is
used.
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 SMD1[1:0] (D[1:0]/0x300B13) to set the transfer mode of the serial interface as described earlier. When
performing asynchronous transfer, set SMD1[1:0] to 0b11, when performing clock synchronized transfer, set
SMD1[1:0] to 0b00.
sMD1[1:0]: Serial I/F Ch.1 Transfer Mode Select Bits in the Serial I/F Ch.1 Control Register (D[1:0]/0x300B13)
setting the input clock
This mode operates using the internal clock generated by the baud-rate timer. Setup the Ch.1 baud-rate timer
according to the transfer rate. For how to control the baud-rate timer, see Section V.1.2, “Baud-Rate Timer (Set-
ting Baud Rate).”
asynchronous transfer
The transfer rate in ISO7816 mode is expressed by the following equation:
D
bps = ——
× fSIO_CLK
F
bps:
Bit rate (bits/second)
D:
Bit rate adjustment value
1, 2, 4, 8, 16, 1/2, 1/4, 1/8, 1/16, 1/32, 1/64
F:
Clock frequency divide value
372 (5 MHz), 558 (6 MHz), 744 (8 MHz), 1116 (12 MHz), 1488 (16 MHz), 1860 (20 MHz),
512 (5 MHz), 768 (7.5 MHz), 1024 (10 MHz), 1536 (15 MHz), 2048 (20 MHz)
( ) indicates the maximum output clock frequency.
fSIO_CLK: ISO7816 clock frequency (baud-rate timer output, which is also output from the #SCLK1 pin
to clock a card)