13 SeRial inTeRFaCe
S1C63003/004/008/016 TeChniCal Manual
Seiko epson Corporation
13-5
(Rev. 1.1)
Data input/Output and interrupt Function
13.6
The serial interface of S1C63004/008/016 can input/output data via the internal 8-bit shift register. The shift register
operates by synchronizing with either the synchronous clock output from the SCLK (P30) terminal (master mode),
or the synchronous clock input to the SCLK (P30) terminal (slave mode).
The serial interface generates an interrupt on completion of the 8-bit serial data input/output. Detection of serial data
input/output is done by counting of the synchronous clock SCLK; the clock completes input/output operation when
8 counts (equivalent to 8 cycles) have been made and then generates an interrupt.
The serial data input/output procedure is explained below:
Serial Data Output Procedure and interrupt
13.6.1
The S1C63004/008/016 serial interface is capable of outputting parallel data as serial data, in units of 8 bits. By set-
ting the parallel data to the data registers SD[3:0] and SD[7:4], and writing "1" to SCTRG, it synchronizes with the
synchronous clock and the serial data is output to the SOUT (P31) terminal. The synchronous clock used here is as
follows: in master mode, internal clock which is output to the SCLK (P30) terminal while in slave mode, external
clock which is input from the SCLK (P30) terminal.
Shift timing of serial data is as follows:
• When positive polarity (SCPS1 = "0") is selected for the synchronous clock:
The serial data output to the SOUT (P31) terminal changes at the rising edge of the clock input or output from/to
the SCLK (P30) terminal. The data in the shift register is shifted at the rising edge of the SCLK signal when the
SCPS0 register is "0" or at the falling edge of the SCLK signal when the SCPS0 register is "1."
• When negative polarity (SCPS1 = "1") is selected for the synchronous clock:
The serial data output to the SOUT (P31) terminal changes at the falling edge of the clock input or output from/
to the SCLK (P30) terminal. The data in the shift register is shifted at the falling edge of the SCLK signal when
the SCPS0 register is "0" or at the rising edge of the SCLK signal when the SCPS0 register is "1."
When the output of the 8-bit data from SD0 to SD7 is completed, the interrupt factor flag ISIF is set to "1" and an
interrupt occurs. Moreover, the interrupt can be masked by the interrupt mask register EISIF. However, regardless of
the interrupt mask register setting, the interrupt factor flag is set to "1" after output of the 8-bit data.
Serial Data input Procedure and interrupt
13.6.2
The S1C63004/008/016 serial interface is capable of inputting serial data as parallel data, in units of 8 bits. The se-
rial data is input from the SIN (P32) terminal, synchronizes with the synchronous clock, and is sequentially read in
the 8-bit shift register. The synchronous clock used here is the internal clock in master mode or the external clock in
slave mode.
Shift timing of serial data is as follows:
• When positive polarity (SCPS1 = "0") is selected for the synchronous clock:
The serial data is read into the built-in shift register at the rising edge of the SCLK signal when the SCPS0 register
is "0" or at the falling edge of the SCLK signal when the SCPS0 register is "1." The shift register is sequentially
shifted as the data is fetched.
• When negative polarity (SCPS1 = "1") is selected for the synchronous clock:
The serial data is read into the built-in shift register at the falling edge of the SCLK signal when the SCPS0 regis-
ter is "0" or at the rising edge of the SCLK signal when the SCPS0 register is "1." The shift register is sequentially
shifted as the data is fetched.
When the input of the 8-bit data from SD0 to SD7 is completed, the interrupt factor flag ISIF is set to "1" and an inter-
rupt is generated. Moreover, the interrupt can be masked by the interrupt mask register EISIF. However, regardless of
the interrupt mask register setting, the interrupt factor flag is set to "1" after input of the 8-bit data.
The data input in the shift register can be read from data registers SD[7:0] by software.