CMOS 4-BIT SINGLE CHIP MICROCOMPUTER S1C63808 Technical Manual NOTICE No part of this material may be reproduced or duplicated in any form or by any means without the written permission of Seiko Epson. Seiko Epson reserves the right to make changes to this material without notice. Seiko Epson does not assume any liability of any kind arising out of any inaccuracies contained in this material or due to its application or use in any product or circuit and, further, there is no representation that this material is applicable to products requiring high level reliability, such as medical products. Moreover, no license to any intellectual property rights is granted by implication or otherwise, and there is no representation or warranty that anything made in accordance with this material will be free from any patent or copyright infringement of a third party. This material or portions thereof may contain technology or the subject relating to strategic products under the control of the Foreign Exchange and Foreign Trade Law of Japan and may require an export license from the Ministry of Economy, Trade and Industry or other approval from another government agency. (c) SEIKO EPSON CORPORATION 2007, All rights reserved. Configuration of product number Devices S1 C 63158 F 0A01 00 Packing specifications 00 : Besides tape & reel 0A : TCP BL 2 directions 0B : Tape & reel BACK 0C : TCP BR 2 directions 0D : TCP BT 2 directions 0E : TCP BD 2 directions 0F : Tape & reel FRONT 0G : TCP BT 4 directions 0H : TCP BD 4 directions 0J : TCP SL 2 directions 0K : TCP SR 2 directions 0L : Tape & reel LEFT 0M : TCP ST 2 directions 0N : TCP SD 2 directions 0P : TCP ST 4 directions 0Q : TCP SD 4 directions 0R : Tape & reel RIGHT 99 : Specs not fixed Specification Package D: die form; F: QFP, B: BGA Model number Model name C: microcomputer, digital products Product classification S1: semiconductor Development tools S5U1 C 63000 A1 1 00 Packing specifications 00: standard packing Version 1: Version 1 Tool type Hx : ICE Ex : EVA board Px : Peripheral board Wx : Flash ROM writer for the microcomputer Xx : ROM writer peripheral board Cx : C compiler package Ax : Assembler package Dx : Utility tool by the model Qx : Soft simulator Corresponding model number 63000: common to S1C63 Family Tool classification C: microcomputer use Product classification S5U1: development tool for semiconductor products CONTENTS CONTENTS CHAPTER 1 OUTLINE ________________________________________________ 1 1.1 1.2 1.3 1.4 1.5 CHAPTER Features ......................................................................................................... 1 Block Diagram .............................................................................................. 2 Pin Layout Diagram ..................................................................................... 3 Pin Description ............................................................................................. 4 Mask Option .................................................................................................. 5 2 POWER SUPPLY AND INITIAL RESET ____________________________ 8 2.1 Power Supply ................................................................................................ 8 2.1.1 Voltage regulator for OSC1 oscillation circuit .......................................... 8 2.1.2 Voltage regulator for the internal logic system ......................................... 8 2.1.3 EPD system voltage circuit ........................................................................ 8 2.2 Initial Reset ................................................................................................... 9 2.2.1 Reset terminal (RESET) ............................................................................. 9 2.2.2 Simultaneous high input to terminals K00-K03 ...................................... 10 2.2.3 Oscillation-detect circuit ........................................................................... 10 2.2.4 Internal register at initial resetting ........................................................... 10 2.2.5 Terminal settings at initial resetting ......................................................... 11 2.3 CHAPTER 3 CPU, ROM, RAM ________________________________________ 12 3.1 3.2 3.3 CHAPTER Test Terminal (TEST) ................................................................................... 11 CPU .............................................................................................................. 12 Code ROM .................................................................................................... 12 RAM ............................................................................................................. 12 4 PERIPHERAL CIRCUITS AND OPERATION __________________________ 14 4.1 4.2 Memory Map ................................................................................................ 14 Watchdog Timer ........................................................................................... 22 4.2.1 Configuration of watchdog timer .............................................................. 22 4.2.2 Interrupt function ...................................................................................... 22 4.2.3 I/O memory of watchdog timer ................................................................. 23 4.2.4 Programming notes ................................................................................... 23 4.3 Oscillation Circuit ....................................................................................... 24 4.3.1 Configuration of oscillation circuit .......................................................... 24 4.3.2 OSC1 oscillation circuit ............................................................................ 24 4.3.3 OSC3 oscillation circuit ............................................................................ 25 4.3.4 Switching of CPU clock ............................................................................ 26 4.3.5 Clock frequency and instruction execution time ....................................... 26 4.3.6 I/O memory of oscillation circuit .............................................................. 27 4.3.7 Programming notes ................................................................................... 27 4.4 Input Ports (K00-K03 and K10-K13) ......................................................... 28 4.4.1 Configuration of input ports ..................................................................... 28 4.4.2 Interrupt function ...................................................................................... 28 4.4.3 Mask option ............................................................................................... 29 4.4.4 I/O memory of input ports ......................................................................... 30 4.4.5 Programming notes ................................................................................... 32 S1C63808 TECHNICAL MANUAL EPSON i CONTENTS 4.5 Output Ports (R00-R03 and R10-R13) ....................................................... 33 4.5.1 Configuration of output ports ................................................................... 33 4.5.2 Mask option ............................................................................................... 33 4.5.3 High impedance control ............................................................................ 34 4.5.4 Special output ............................................................................................ 34 4.5.5 I/O memory of output ports ....................................................................... 36 4.5.6 Programming notes ................................................................................... 38 4.6 I/O Ports (P00-P03, P10-P13, P20-P23, P30-P33 and P40-P43) .......... 39 4.6.1 Configuration of I/O ports ........................................................................ 39 4.6.2 Mask option ............................................................................................... 40 4.6.3 I/O control registers and input/output mode ............................................ 40 4.6.4 Pull-down during input mode ................................................................... 40 4.6.5 I/O memory of I/O ports ............................................................................ 41 4.6.6 Programming note ..................................................................................... 44 4.7 Clock Timer .................................................................................................. 45 4.7.1 Configuration of clock timer ..................................................................... 45 4.7.2 Data reading and hold function ................................................................ 45 4.7.3 Interrupt function ...................................................................................... 46 4.7.4 I/O memory of clock timer ........................................................................ 47 4.7.5 Programming notes ................................................................................... 48 4.8 Stopwatch Timer ........................................................................................... 49 4.8.1 Configuration of stopwatch timer ............................................................. 49 4.8.2 Counter and prescaler ............................................................................... 49 4.8.3 Capture buffer and hold function .............................................................. 50 4.8.4 Stopwatch timer RUN/STOP and reset ..................................................... 51 4.8.5 Direct input function and key mask .......................................................... 51 4.8.6 Interrupt function ...................................................................................... 54 4.8.7 I/O memory of stopwatch timer ................................................................ 56 4.8.8 Programming notes ................................................................................... 59 4.9 Programmable Timer ................................................................................... 60 4.9.1 Configuration of programmable timer ...................................................... 60 4.9.2 Basic count operation ............................................................................... 61 4.9.3 Setting the input clock ............................................................................... 62 4.9.4 Event counter mode (timer 0) ................................................................... 62 4.9.5 16-bit timer (timer 0 + timer 1) ................................................................ 63 4.9.6 Interrupt function ...................................................................................... 64 4.9.7 Control of TOUT output ............................................................................ 64 4.9.8 Transfer rate setting for serial interface ................................................... 65 4.9.9 I/O memory of programmable timer ......................................................... 66 4.9.10 Programming notes ................................................................................. 71 4.10 Serial Interface ............................................................................................ 72 4.10.1 Configuration of serial interface ............................................................ 72 4.10.2 Mask option ............................................................................................. 73 4.10.3 Transfer modes ........................................................................................ 73 4.10.4 Clock source ............................................................................................ 75 4.10.5 Transmit-receive control ......................................................................... 76 4.10.6 Operation of clock synchronous transfer ................................................ 77 4.10.7 Operation of asynchronous transfer ....................................................... 82 4.10.8 Interrupt function .................................................................................... 87 4.10.9 I/O memory of serial interface ................................................................ 89 4.10.10 Programming notes ............................................................................... 96 ii EPSON S1C63808 TECHNICAL MANUAL CONTENTS 4.11 Sound Generator .......................................................................................... 97 4.11.1 Configuration of sound generator .......................................................... 97 4.11.2 Control of buzzer output .......................................................................... 97 4.11.3 Setting of buzzer frequency and sound level ........................................... 98 4.11.4 Digital envelope ...................................................................................... 99 4.11.5 One-shot output ...................................................................................... 100 4.11.6 I/O memory of sound generator ............................................................. 101 4.11.7 Programming notes ................................................................................ 103 4.12 Integer Multiplier ........................................................................................ 104 4.12.1 Configuration of integer multiplier ........................................................ 104 4.12.2 Multiplication mode ............................................................................... 104 4.12.3 Division mode ......................................................................................... 105 4.12.4 Execution cycle ....................................................................................... 106 4.12.5 I/O memory of integer multiplier ........................................................... 107 4.12.6 Programming note .................................................................................. 108 4.13 SVD (Supply Voltage Detection) Circuit ..................................................... 109 4.13.1 Configuration of SVD circuit ................................................................. 109 4.13.2 SVD operation ........................................................................................ 109 4.13.3 I/O memory of SVD circuit ..................................................................... 110 4.13.4 Programming notes ................................................................................ 111 4.14 Power Supply for EPD Driver IC (VC1-VC3) ............................................. 112 4.14.1 Configuration of EPD system voltage circuit ........................................ 112 4.14.2 Mask option ............................................................................................ 112 4.14.3 Turning EPD system voltage circuit on and off ..................................... 112 4.14.4 Adjustment of EPD driver voltages ....................................................... 113 4.14.5 I/O memory of Power supply for EPD driver IC ................................... 114 4.14.6 Programming note .................................................................................. 115 4.15 Interrupt and HALT .................................................................................... 116 4.15.1 Interrupt factor ....................................................................................... 118 4.15.2 Interrupt mask ........................................................................................ 119 4.15.3 Interrupt vector ...................................................................................... 119 4.15.4 I/O memory of interrupt ......................................................................... 120 4.15.5 Programming notes ................................................................................ 121 CHAPTER 5 SUMMARY OF NOTES ______________________________________ 122 5.1 5.2 5.3 Notes for Low Current Consumption .......................................................... 122 Summary of Notes by Function ................................................................... 123 Precautions on Mounting ........................................................................... 127 CHAPTER 6 BASIC EXTERNAL WIRING DIAGRAM ___________________________ 129 CHAPTER 7 ELECTRICAL CHARACTERISTICS _______________________________ 130 7.1 7.2 7.3 7.4 7.5 7.6 7.7 Absolute Maximum Rating .......................................................................... 130 Recommended Operating Conditions ......................................................... 130 DC Characteristics ..................................................................................... 130 Analog Circuit Characteristics and Power Current Consumption ............ 131 Oscillation Characteristics ......................................................................... 133 Serial Interface AC Characteristics ........................................................... 135 Timing Chart ............................................................................................... 136 S1C63808 TECHNICAL MANUAL EPSON iii CONTENTS CHAPTER 8 PACKAGE _______________________________________________ 137 8.1 8.2 CHAPTER Plastic Package ........................................................................................... 137 Ceramic Package for Test Samples ............................................................. 138 9 PAD LAYOUT ____________________________________________ 139 9.1 9.2 APPENDIX Diagram of Pad Layout ............................................................................... 139 Pad Coordinates .......................................................................................... 140 PERIPHERAL CIRCUIT BOARDS FOR S1C63808 ____________________ 141 A.1 Names and Functions of Each Part ............................................................ 141 A.2 Connecting to the Target System ................................................................ 144 A.3 Downloading to S5U1C63000P1 ............................................................... 146 A.3.1 Downloading Circuit Data 1 - when new ICE (S5U1C63000H2) is used ............................................ 146 A.3.2 Downloading Circuit Data 2 - when previous ICE (S5U1C63000H1) is used .................................... 146 A.4 Usage Precautions ...................................................................................... 147 A.4.1 Operational precautions .......................................................................... 147 A.4.2 Differences with the actual IC ................................................................. 147 A.5 Product Specifications ................................................................................ 149 iv EPSON S1C63808 TECHNICAL MANUAL CHAPTER 1: OUTLINE CHAPTER 1 OUTLINE The S1C63808 is a microcomputer which has a high-performance 4-bit CPU S1C63000 as the core CPU, ROM (8,192 words x 13 bits), RAM (2,048 words x 4 bits), multiply-divide circuit, serial interface (2 ports), watchdog timer, programmable timer, time base counters (2 systems), and sound generator built-in. The S1C63808 features low current consumption, this makes it suitable for battery driven portable equipment such as clocks and watches. 1.1 Features OSC1 oscillation circuit ...................... 32.768 kHz (Typ.) crystal oscillation circuit OSC3 oscillation circuit ...................... 4 MHz (Typ.) ceramic, 1.1 MHz (Typ.) CR (external R) or 200 kHz (Typ.) CR (built-in R) oscillation circuit (1) Instruction set ..................................... Basic instruction: 46 types (411 instructions with all) Addressing mode: 8 types Instruction execution time ................... During operation at 32.768 kHz: 61 sec 122 sec 183 sec During operation at 4 MHz: 0.5 sec 1 sec 1.5 sec ROM capacity ..................................... Code ROM: 8,192 words x 13 bits RAM capacity ...................................... Data memory: 2,048 words x 4 bits Input port ............................................. 8 bits (Pull-down resistors may be supplemented 1) Output port .......................................... 8 bits (It is possible to switch the 3 bits to special output 2) I/O port ................................................ 20 bits (It is possible to switch the 8 bits to serial I/F input/output 2) Serial interface .................................... 2 ports(Clock synchronous system or asynchronous system with LSB first or MSB first transfer selectable 2) Time base counter .............................. Clock timer Stopwatch timer (1/1000 sec, with direct key input function) Programmable timer ........................... 8 bits x 2 ch. or 16 bits x 1 ch. with event counter function (K13) (2) Watchdog timer ................................... Built-in Sound generator ................................. With envelope and 1-shot output functions Multiply-divide circuit .......................... 8-bit accumulator x 1 ch. Multiplication: 8 bits x 8 bits 16-bit product Division: 16 bits / 8 bits 8-bit quotient and 8-bit remainder Supply voltage detection (SVD) circuit .. 8 criteria voltages (1.05-1.50 V or 1.70-2.90 V are selectable 2) EPD driver IC power supply circuit ....... VC1 = 1.03-1.23 V (2), VC2 = 2VC1, VC3 = 3VC1 (1/3 bias 1) or VC1 = 1.08-1.84 V (2), VC2 = 2VC1, VC3 = VSS (1/2 bias 1) External interrupt ................................ Input port interrupt: 2 systems Internal interrupt ................................. Clock timer interrupt: 4 systems Stopwatch timer interrupt: 4 systems Programmable timer interrupt: 2 systems Serial interface interrupt: 6 systems Power supply voltage .......................... 1.0 to 3.6 V (when CR (built-in R) oscillation circuit is selected) 2.1 to 3.6 V (when CR (external R) or ceramic oscillation circuit is selected) Operating temperature range ............. -20 to 70C Current consumption (Typ.) ................ Low-speed operation (OSC1 = 32 kHz crystal oscillation, EPD driver IC power supply OFF): During HALT 3.0 V 0.23 A During operation 3.0 V 1.90 A High-speed operation (OSC3, EPD driver IC power supply ON): During operation (4 MHz) 3.0 V 850 A Package .............................................. QFP13-64pin (plastic) or chip 1: Can be selected with mask option 2: Can be selected with software S1C63808 TECHNICAL MANUAL EPSON 1 CHAPTER 1: OUTLINE 1.2 Block Diagram ROM System Reset Control 8,192 words x 13 bits RESET Core CPU S1C63000 OSC1 OSC2 OSC3 OSC4 Interrupt Generator OSC Clock Timer RAM 2,048 words x 4 bits VDD VD1 VOSC VC1-VC3 CA-CB VSS Stopwatch Timer Programmable Timer/Counter Power Controller Input Port K00-K03 K10-K13 TEST I/O Port P00-P03 P10-P13 P20-P23 P30-P33 P40-P43 Output Port R00-R03 R10-R13 SVD Serial Interface Sound Generator Fig. 1.2.1 Block diagram 2 EPSON S1C63808 TECHNICAL MANUAL CHAPTER 1: OUTLINE 1.3 Pin Layout Diagram QFP13-64pin 48 33 32 49 INDEX 17 64 1 No. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Pin name No. N.C. 17 P10/SIN1 18 P11/SOUT1 19 P12/SCLK1 20 P13/SRDY1 21 P20/SIN2 22 P21/SOUT2 23 P22/SCLK2 24 P23/SRDY2 25 P30 26 P31 27 P32 28 P33 29 P40 30 P41 31 N.C. 32 16 Pin name P42 P43 TEST RESET N.C. VDD VOSC OSC1 OSC2 VD1 OSC3 OSC4 VSS VC1 N.C. N.C. No. 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 Pin name VC2 VC3 CB CA K00 K01 K02 K03 K10 K11 K12 K13 N.C. N.C. VDD N.C. No. Pin name 49 N.C. 50 N.C. 51 N.C. 52 VSS 53 R00 54 R01/BZ 55 R02/TOUT 56 R03/FOUT 57 R10 58 R11 59 R12 60 R13 61 P00 62 P01 63 P02 64 P03 N.C. : No Connection Fig. 1.3.1 Pin layout diagram (QFP13-64pin) S1C63808 TECHNICAL MANUAL EPSON 3 CHAPTER 1: OUTLINE 1.4 Pin Description Table 1.4.1 Pin description Pin name VDD VSS VD1 VOSC VC1-VC3 CA, CB OSC1 OSC2 OSC3 OSC4 K00-K03 K10-K13 R00 R01 R02 R03 R10-R13 P00-P03 P10 P11 P12 P13 P20 P21 P22 P23 P30-P33 P40-P43 RESET TEST 4 Pin No. 22, 47 29, 52 26 23 30, 33, 34 36, 35 24 25 27 28 37-40 41-44 53 54 55 56 57-60 61-64 2 3 4 5 6 7 8 9 10-13 14, 15, 17, 18 20 19 I/O - - - - - - I O I O I I O O O O O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I I Function Power (+) supply pin Power (-) supply pin Internal logic system regulated voltage output pin Oscillation system regulated voltage output pin EPD system power supply pins EPD system voltage booster capacitor connecting pins Crystal oscillation input pin Crystal oscillation output pin Ceramic or CR oscillation input pin (selected by mask option) Ceramic or CR oscillation output pin (selected by mask option) Input port pins Input port pins Output port pin Output port or BZ output pin (selected by software) Output port or TOUT output pin (selected by software) Output port or FOUT output pin (selected by software) Output port pins I/O port pins I/O port or serial I/F 1 data input pin (selected by software) I/O port or serial I/F 1 data output pin (selected by software) I/O port or serial I/F 1 clock I/O pin (selected by software) I/O port or serial I/F 1 ready signal output pin (selected by software) I/O port or serial I/F 2 data input pin (selected by software) I/O port or serial I/F 2 data output pin (selected by software) I/O port or serial I/F 2 clock I/O pin (selected by software) I/O port or serial I/F 2 ready signal output pin (selected by software) I/O port pins I/O port pins Initial reset input pin Testing input pin EPSON S1C63808 TECHNICAL MANUAL CHAPTER 1: OUTLINE 1.5 Mask Option Mask options shown below are provided for the S1C63808. Several hardware specifications are prepared in each mask option, and one of them can be selected according to the application. The function option generator winfog, that has been prepared as the development software tool of S1C63808, is used for this selection. Mask pattern of the IC is finally generated based on the data created by winfog. Refer to the "S5U1C63000A Manual" for winfog. (1) OSC3 oscillation circuit The OSC3 oscillator type can be selected from ceramic oscillation, CR oscillation (external R) and CR oscillation (built-in R). Refer to Section 4.3.3, "OSC3 oscillation circuit", for details. (2) Input port pull-down resistor The mask option is used to select whether the pull-down resistor is supplemented to the input ports Kxx or not. It is possible to select for each bit of the input ports. Refer to Section 4.4.3, "Mask option", for details. (3) RESET terminal pull-down resistor The mask option is used to select whether the pull-down resistor is supplemented to the RESET terminal or not. Refer to Section 2.2.1, "Reset terminal (RESET)", for details. (4) I/O port pull-down resistor The mask option is used to select whether the pull-down resistor working in the input mode is supplemented to the I/O ports Pxx or not. It is possible to select for each bit of the input ports. Refer to Section 4.6.2, "Mask option", for details. (5) Output specification of the output port Either complementary output or P-channel open drain output can be selected as the output specification for the output ports Rxx. The selection is done in 1-bit units. Refer to Section 4.5.2, "Mask option", for details. (6) Output specification of the I/O port For the output specification when the I/O ports Pxx are in the output mode, either complementary output or P-channel open drain output can be selected in 1-bit units. Refer to Section 4.6.2, "Mask option", for details. (7) External reset by simultaneous high input to the input port (K00-K03) This function resets the IC when several keys are pressed simultaneously. The mask option is used to select whether this function is used or not. Further when the function is used, a combination of the input ports (K00-K03), which are connected to the keys to be pressed simultaneously, can be selected. Refer to Section 2.2.2, "Simultaneous high input to terminals K00-K03", for details. (8) Synchronous clock polarity in the serial interface The polarity of the synchronous clock SCLKx and the SRDYx signal in slave mode of the serial interface is selected by mask option. Either positive polarity or negative polarity can be selected. Refer to Section 4.10.2, "Mask option", for details. (9) Bias in the EPD system voltage circuit Either 1/2 bias or 1/3 bias can be selected to configure the outputs from the EPD system voltage circuit. Refer to Section 4.14.2, "Mask option", for details. S1C63808 TECHNICAL MANUAL EPSON 5 CHAPTER 1: OUTLINE