t echnical manual cmos 4 - bit single chip microcomputer s1c63808
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 produc t 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. ? sei ko epson corporation 2007, all rights reserved.
devices s1 c 63158 f 0a01 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 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 00 00 configuration of product number
s1c63808 technical manual epson i contents c ontents chapter 1o utline ________________________________________________ 1 1.1 featur es ......................................................................................................... 1 1. 2b loc k di agram .............................................................................................. 2 1.3 pin layout diagram ..................................................................................... 3 1.4 pin description ............................................................................................. 4 1.5 mask option .................................................................................................. 5 chapter 2p o wer s upply and i nitial r eset ____________________________ 8 2.1 power supply ................................................................................................ 8 2.1.1 voltage regulator for osc1 oscillation cir cuit .......................................... 8 2.1.2 voltage regulator for the internal lo gic system ......................................... 8 2.1.3 epd system volta ge circuit ........................................................................ 8 2.2 initial reset ................................................................................................... 9 2.2.1 reset terminal (reset) ............................................................................. 9 2.2.2 simultaneous high input to term inals k00? 03 ...................................... 10 2.2.3 oscillation-detect cir cuit ........................................................................... 10 2.2.4 internal register at initial r esetting ........................................................... 10 2.2.5 terminal settings at initial r esetting ......................................................... 11 2.3 test t erminal (test) ................................................................................... 11 chapter 3 cpu, rom, ram ________________________________________ 12 3. 1 cpu .............................................................................................................. 12 3.2 code ro m .................................................................................................... 12 3. 3 ram ............................................................................................................. 12 chapter 4p eripheral c ircuits and o peration __________________________ 14 4.1 memory map ................................................................................................ 14 4. 2w at ch do g ti me r ........................................................................................... 22 4.2.1 configuration of watchdog timer .............................................................. 22 4.2.2 interrupt function ...................................................................................... 22 4.2.3 i/o memory of w atchdog tim er ................................................................. 23 4.2.4 progr amming notes ................................................................................... 23 4.3 oscillation ci rc uit ....................................................................................... 24 4.3.1 configuration of oscillation ci r cuit .......................................................... 24 4.3.2 osc1 oscillation cir cuit ............................................................................ 24 4.3.3 osc3 oscillation cir cuit ............................................................................ 25 4.3.4 switching of cpu clock ............................................................................ 26 4.3.5 clock frequency and instruction execution tim e ....................................... 26 4.3.6 i/o memory of oscillation cir cuit .............................................................. 27 4.3.7 progr amming notes ................................................................................... 27 4.4 input ports (k00? 03 and k10? 13) ......................................................... 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 progr amming notes ................................................................................... 32
ii epson s1c63808 technical manual contents 4.5 output ports (r00?03 and r10?13) ....................................................... 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 me mo ry of out put po rts ....................................................................... 36 4.5.6 progr amming notes ................................................................................... 38 4.6 i/o ports (p00?03, p10?13, p20?23, p30?33 and p40?43) .......... 39 4.6.1 configuration of i/o ports ........................................................................ 39 4.6.2 mask option ............................................................................................... 40 4.6.3 i/o control register s and input/out put 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 progr amming not e ..................................................................................... 44 4.7 clock t imer .................................................................................................. 45 4.7.1 configuration of clock tim er ..................................................................... 45 4.7.2 data reading and hold function ................................................................ 45 4.7.3 interrupt function ...................................................................................... 46 4.7.4 i/o memory of clock tim er ........................................................................ 47 4.7.5 progr amming notes ................................................................................... 48 4.8 stopwatch ti mer ........................................................................................... 49 4.8.1 configuration of stopw atch tim er ............................................................. 49 4.8.2 counter and pr escaler ............................................................................... 49 4.8.3 capture buffer and hold function .............................................................. 50 4.8.4 stopwatch timer r un/stop and r eset ..................................................... 51 4.8.5 direct input function and ke y mask .......................................................... 51 4.8.6 interrupt function ...................................................................................... 54 4.8.7 i/o memory of stopwatch tim er ................................................................ 56 4.8.8 progr amming notes ................................................................................... 59 4.9 programm able time r ................................................................................... 60 4.9.1 configuration of prog ra mmable tim er ...................................................... 60 4.9.2 basic count oper ation ............................................................................... 61 4.9.3 setting the input clock ............................................................................... 62 4.9.4 event counter mode (timer 0) ................................................................... 62 4.9.5 16-bit timer (ti mer 0 + ti mer 1) ................................................................ 63 4.9.6 interrupt function ...................................................................................... 64 4.9.7 control of t out output ............................................................................ 64 4.9.8 transfer rate setting for serial interface ................................................... 65 4.9.9 i/o memory of pr ogrammable timer ......................................................... 66 4.9.10 programm ing 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 m odes ........................................................................................ 73 4.10.4 clock sour ce ............................................................................................ 75 4.10.5 transmit-recei ve contro l ......................................................................... 76 4.10.6 operation of clock synchronous tr ansfer ................................................ 77 4.10.7 operation of asynchronous tr ansfer ....................................................... 82 4.10.8 interrupt function .................................................................................... 87 4.10.9 i/o memory of seri al int erface ................................................................ 89 4.10.10 programm ing notes ............................................................................... 96
s1c63808 technical manual epson iii contents 4.11 sound g enerator .......................................................................................... 97 4.11.1 configuration of sound gener ator .......................................................... 97 4.11.2 control of b uzzer output .......................................................................... 97 4.11.3 setting of buzzer frequency and sound le vel ........................................... 98 4. 11. 4 di g ita l en vel ope ...................................................................................... 99 4.11.5 one-shot output ...................................................................................... 100 4.11.6 i/o memory of sound gener ator ............................................................. 101 4.11.7 program ming notes ................................................................................ 103 4.12 integer multiplier ........................................................................................ 104 4.12.1 configuration of inte g er multiplier ........................................................ 104 4.12.2 multiplication m ode ............................................................................... 104 4.12.3 div ision mode ......................................................................................... 105 4.12.4 execution cycle ....................................................................................... 106 4.12.5 i/o memory of in teger multip lier ........................................................... 107 4.12.6 progr amming note .................................................................................. 108 4.13 svd (supply voltage detection) cir cuit ..................................................... 109 4.13.1 configuration of svd circuit ................................................................. 109 4.13.2 svd oper ation ........................................................................................ 109 4.13.3 i/o memory of svd cir cuit ..................................................................... 110 4.13.4 program ming notes ................................................................................ 111 4.14 power supply for epd driver ic (v c1 ? c3 ) ............................................. 112 4.14.1 configuration of epd system voltage circuit ........................................ 112 4.14.2 mask option ............................................................................................ 112 4.14.3 turning epd system volta ge 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 progr amming 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 memo ry of interrupt ......................................................................... 120 4.15.5 program ming notes ................................................................................ 121 chapter 5s ummary of n o tes ______________________________________ 122 5.1 notes for low curre nt consump tion .......................................................... 122 5.2 summary of notes by function ................................................................... 123 5.3 precautions on mounting ........................................................................... 127 chapter 6b asic e xternal w iring d iagram ___________________________ 129 chapter 7e lectrical c haracteristics _______________________________ 130 7.1 absolute maximum rating .......................................................................... 130 7.2 recommended operati ng conditi ons ......................................................... 130 7.3 dc char acteristics ..................................................................................... 130 7.4 analog circuit characteris tics and power current consumptio n ............ 131 7.5 oscillation char acteristics ......................................................................... 133 7.6 serial interface ac characteristics ........................................................... 135 7.7 timing chart ............................................................................................... 136
iv epson s1c63808 technical manual contents chapter 8p a ckage _______________________________________________ 137 8.1 plastic pack age ........................................................................................... 137 8.2 ceramic packag e for test samples ............................................................. 138 chapter 9p ad l ay out ____________________________________________ 139 9.1 diagram of p ad layout ............................................................................... 139 9.2 pad coordi nates .......................................................................................... 140 appendix p eripheral c ircuit b o ards for s1c63808 ____________________ 141 a.1 names and functions of each p art ............................................................ 141 a.2 connecting to the ta rg et 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 pre vious ice (s5u1c630 00h1) is u sed .................................... 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
s1c63808 technical manual epson 1 chapter 1: outline chapter 1o utline the s1c63808 is a microcomputer which has a high-performance 4-bit cpu s1c63000 as the core cpu, rom (8,192 words 13 bits), ram (2,048 words 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 circui t ...................... 32.768 khz (typ.) crystal oscillation circuit osc3 oscillation circui t ...................... 4 mhz (typ.) ceramic, 1.1 mhz (typ.) cr (external r) or 200 khz (typ.) cr (built-in r) oscillation circuit ( ? 1) i nst r uc ti on set ..................................... basic instruction: 46 types (411 instructions with all) addressing mode: 8 types instruction execution time ................... during operation at 32.768 khz: 61 ?ec 122 ?ec 183 ?ec during operation at 4 mhz: 0.5 ?ec 1 ?ec 1.5 ?ec r om capac ity ..................................... code rom: 8,192 words 13 bits ram capacity ...................................... data memory: 2,048 words 4 bits input por t ............................................. 8 bits (pull-down resistors may be supplemented ? 1) out put por t .......................................... 8 bits (it is possible to switch the 3 bits to special output ? 2) i/o por t ................................................ 20 bits (it is possible to switch the 8 bits to serial i/f input/output ? 2) ser ia l in te rf ace .................................... 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) p rog rammable timer ........................... 8 bits 2 ch. or 16 bits 1 ch. with event counter function (k13) ( ? 2) w atchdog tim er ................................... built-in sound gener ator ................................. w ith envelope and 1-shot output functions multiply-divi de circui t .......................... 8-bit accumulator 1 ch. multiplication: 8 bits 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?.50 v or 1.70?.90 v are selectable ? 2) epd driver ic power supply circuit ....... v c1 = 1.03?.23 v ( ? 2), v c2 = 2v c1 , v c3 = 3v c1 (1/3 bias ? 1) or v c1 = 1.08?.84 v ( ? 2), v c2 = 2v c1 , v c3 = v ss (1/2 bias ? 1) e xte r nal in te rr upt ................................ input port interrupt: 2 systems in te r nal in te rr upt ................................. clock timer interrupt: 4 systems stopwatch timer interrupt: 4 systems programmable timer interrupt: 2 systems serial interface interrupt: 6 systems po w er supply v oltage .......................... 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 temper ature r ange ............. -20 to 70? current consumpti on (typ .) ................ low-speed operation (osc1 = 32 khz crystal oscillation, epd driver ic power supply off): during halt 3.0 v 0.23 ? during operation 3.0 v 1.90 ? high-speed operation (osc3, epd driver ic power supply on): during operation (4 mhz) 3.0 v 850 ? pa ckage .............................................. qfp13-64pin (plastic) or chip ? 1: can be selected with mask option ? 2: can be selected with software
2 epson s1c63808 technical manual chapter 1: outline 1.2 block diagram osc1 osc2 osc3 osc4 k00?03 k10?13 test reset p00?03 p10?13 p20?23 p30?33 p40?43 r00?03 r10?13 v dd v d1 v osc v c1 ? c3 ca?b v ss core cpu s1c63000 rom 8,192 words 13 bits system reset control interrupt generator osc ram 2,048 words 4 bits power controller svd serial interface sound generator clock timer stopwatch timer programmable timer/counter input port i/o port output port fi g. 1.2.1 block diagram
s1c63808 technical manual epson 3 chapter 1: outline 1.3 pin layout diagram qfp13-64pin 33 48 17 32 index 16 1 64 49 no. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 no. 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 no. 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 no. 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 pin name n.c. p10/sin1 p11/sout1 p12/sclk1 p13/srdy1 p20/sin2 p21/sout2 p22/sclk2 p23/srdy2 p30 p31 p32 p33 p40 p41 n.c. pin name p42 p43 test reset n.c. v dd v osc osc1 osc2 v d1 osc3 osc4 v ss v c1 n.c. n.c. pin name v c2 v c3 cb ca k00 k01 k02 k03 k10 k11 k12 k13 n.c. n.c. v dd n.c. pin name n.c. n.c. n.c. v ss r00 r01/bz r02/tout r03/fout r10 r11 r12 r13 p00 p01 p02 p03 n.c. : no connection fi g. 1.3.1 pin layout diagram (qfp13-64pin)
4 epson s1c63808 technical manual chapter 1: outline 1.4 pin description t able 1.4.1 pin description pin name v dd v ss v d1 v osc v c1 ? c3 ca, cb osc1 osc2 osc3 osc4 k00?03 k10?13 r00 r01 r02 r03 r10?13 p00?03 p10 p11 p12 p13 p20 p21 p22 p23 p30?33 p40?43 reset test 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 pin no. 22, 47 29, 52 26 23 30, 33, 34 36, 35 24 25 27 28 37?0 41?4 53 54 55 56 57?0 61?4 2 3 4 5 6 7 8 9 10?3 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
s1c63808 technical manual epson 5 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 specifica- tion 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?03) 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?03), 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?03", 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.
6 epson s1c63808 technical manual chapter 1: outline the following is the option list for the s1c63808. multiple selections are available in each option item as indicated in the option list. select the specifica- tions that meet the target system and check the appropriate box. be sure to record the specifications for unused functions too. 1. osc3 system clock 1. ceramic 2. cr (external r) 3. cr (built-in r) 2. input port pull down resistor ?k00 1. with resistor 2. gate direct ?k01 1. with resistor 2. gate direct ?k02 1. with resistor 2. gate direct ?k03 1. with resistor 2. gate direct ?k10 1. with resistor 2. gate direct ?k11 1. with resistor 2. gate direct ?k12 1. with resistor 2. gate direct ?k13 1. with resistor 2. gate direct 3. reset port pull down resistor ?reset 1. with resistor 2. gate direct 4. i/o port pull down resistor ?p00 1. with resistor 2. gate direct ?p01 1. with resistor 2. gate direct ?p02 1. with resistor 2. gate direct ?p03 1. with resistor 2. gate direct ?p10 1. with resistor 2. gate direct ?p11 1. with resistor 2. gate direct ?p12 1. with resistor 2. gate direct ?p13 1. with resistor 2. gate direct ?p20 1. with resistor 2. gate direct ?p21 1. with resistor 2. gate direct ?p22 1. with resistor 2. gate direct ?p23 1. with resistor 2. gate direct ?p30 1. with resistor 2. gate direct ?p31 1. with resistor 2. gate direct ?p32 1. with resistor 2. gate direct ?p33 1. with resistor 2. gate direct ?p40 1. with resistor 2. gate direct ?p41 1. with resistor 2. gate direct ?p42 1. with resistor 2. gate direct ?p43 1. with resistor 2. gate direct 5. output port output specification ?r00 1. complementary 2. pch-opendrain ?r01 1. complementary 2. pch-opendrain ?r02 1. complementary 2. pch-opendrain ?r03 1. complementary 2. pch-opendrain ?r10 1. complementary 2. pch-opendrain ?r11 1. complementary 2. pch-opendrain ?r12 1. complementary 2. pch-opendrain ?r13 1. complementary 2. pch-opendrain
s1c63808 technical manual epson 7 chapter 1: outline 6. i/o port output specification ?p00 1. complementary 2. pch-opendrain ?p01 1. complementary 2. pch-opendrain ?p02 1. complementary 2. pch-opendrain ?p03 1. complementary 2. pch-opendrain ?p10 1. complementary 2. pch-opendrain ?p11 1. complementary 2. pch-opendrain ?p12 1. complementary 2. pch-opendrain ?p13 1. complementary 2. pch-opendrain ?p20 1. complementary 2. pch-opendrain ?p21 1. complementary 2. pch-opendrain ?p22 1. complementary 2. pch-opendrain ?p23 1. complementary 2. pch-opendrain ?p30 1. complementary 2. pch-opendrain ?p31 1. complementary 2. pch-opendrain ?p32 1. complementary 2. pch-opendrain ?p33 1. complementary 2. pch-opendrain ?p40 1. complementary 2. pch-opendrain ?p41 1. complementary 2. pch-opendrain ?p42 1. complementary 2. pch-opendrain ?p43 1. complementary 2. pch-opendrain 7. multiple key entry reset combination 1. not use 2. use (k00, k01) 3. use (k00, k01, k02) 4. use (k00, k01, k02, k03) 8. serial interface polarity 1. negative 2. positive 9. epd driver ic power supply bias 1. 1/3 bias 2. 1/2 bias
8 epson s1c63808 technical manual chapter 2: power supply and initial reset chapter 2p o wer s upply and i nitial r eset 2.1 power supply the s1c63808 operating power voltage is as follows: t able 2.1.1 operating voltage osc3 oscillation circuit cr (built-in r) ceramic or cr (external r) osc1 oscillation circuit crystal operating voltage 1.0 v to 3.6 v 2.1 v to 3.6 v the s1c63808 operates by applying a single power supply within the above range between v dd and v ss . the s1c63808 generates the voltages necessary for all the internal circuits and exclusive epd driver ic by the built-in power supply circuits shown in table 2.1.2. t able 2.1.2 power supply circuits circuit osc1 circuit osc3 and internal circuits external epd driver ic power supply voltage regulator for osc1 oscillation circuit voltage regulator for internal logic circuit epd system voltage circuit output voltage v osc v d1 v c1 ? c3 notes: do not drive external loads with the output voltage from the internal power supply circuits except f or the exclusive epd driver ic. see chapter 7, "electrical characteristics", for voltage values and drive capability. lpwr external power supply epd system voltage regulator v dd v c1 v c2 v c3 ca cb v osc v d1 v ss v c1 v osc v d1 voltage booster epd system voltage circuit voltage regulator for osc1 oscillation circuit osc1 oscillation circuit osc3 oscillation circuit voltage regulator for internal logic circuits + cpu, internal circuits fi g. 2.1.1 configuration of power supply 2.1.1 voltage regulator for osc1 oscillation circuit this voltage regulator generates the v osc voltage for driving the osc1 oscillation circuit and is provided separately with the voltage regulator for the internal logic system to stabilize the oscillation. 2.1.2 voltage regulator for the internal logic system this voltage regulator generates the v d1 voltage for driving the osc3 oscillation circuit and the internal logic circuits. 2.1.3 epd system voltage circuit the epd system voltage circuit generates the voltages for an epd driver ic. this circuit allows the software to turn on and off. turn this circuit on before starting display on the epd. the epd system voltage circuit generates v c1 with the voltage regulator built-in, and generates v c2 (v c2 = 2v c1 ) and v c3 (v c3 = 3v c1 for 1/3 bias, v c3 = v ss for 1/2 bias) by boosting v c1 . the v c1 voltage can be adjusted to 8 steps (1.03?.23 v) for 1/3 bias or 16 steps (1.08?.84 v) for 1/2 bias (bias can be selected by mask option). refer to section 4.14, "power supply for epd driver ic", for control of the epd driver ic voltages.
s1c63808 technical manual epson 9 chapter 2: power supply and initial reset 2.2 initial reset to initialize the s1c63808 circuits, initial reset must be executed. there are three ways of doing this. (1) external initial reset by the reset terminal (2) external initial reset by simultaneous high input to terminals k00?03 (mask option setting) (3) internal initial reset by the oscillation-detect circuit when the power is turned on, be sure to initialize using the reset function (1) or (2). it is not guaranteed that the circuits are initialized by only turning the power on. figure 2.2.1 shows the configuration of the initial reset circuit. reset k00 k01 k02 k03 osc2 osc1 osc1 oscillation circuit noise reject circuit internal initial reset time authorize circuit oscillation detect circuit v ss mask option fi g. 2.2.1 configuration of initial reset circuit 2.2.1 reset terminal (reset) initial reset can be executed externally by setting the reset terminal to a high level (v dd ). after that the initial reset is released by setting the reset terminal to a low level (v ss ) and the cpu starts operation. the reset input signal is maintained by the rs latch and becomes the internal initial reset signal. the rs latch is designed to be released by a 2 hz signal (high) that is divided by the osc1 clock. therefore in normal operation, a maximum of 250 msec (when f osc1 = 32.768 khz) is needed until the internal initial r eset is released after the reset terminal goes to low level. be sure to maintain a reset input of 0.1 msec or more. however, when turning the power on, the reset terminal should be set at a high level as in the timing shown in figure 2.2.1.1. note that a reset pulse shorter than 100 nsec is rejected as noise. v dd reset 2.0 msec or more 1.8 v 0.5? dd 0.9? dd or more (high level) power on fi g. 2.2.1.1 initial reset at power on the reset terminal should be set to 0.9? dd or more (high level) until the supply voltage becomes 1.8 v or more. after that, a level of 0.5 v dd or more should be maintained more than 2.0 msec. the reset terminal incorporates a pull-down resistor and a mask option is provided to select whether the re sistor is used or not.
10 epson s1c63808 technical manual chapter 2: power supply and initial reset further, the reset circuit has incorporated a time authorize circuit that checks the input time of the simultaneous high input and performs initial reset if that time is the defined time (1 to 2 sec) or more. if using this function, make sure that the specified ports do not go high at the same time during ordinary operation. 2.2.3 oscillation-detect circuit the oscillation-detect circuit outputs the initial reset signal at power-on until the osc1 oscillation circuit starts oscillating, or when the osc1 oscillation circuit stops oscillating for some reason. however, for the initial reset at power-on, use a simultaneous high input of the input ports (k00?03) or r eset terminal, but do not execute it by this function alone. 2.2.4 internal register at initial resetting initial reset initializes the cpu as shown in table 2.2.4.1. the registers and flags which are not initialized by initial reset should be initialized in the program if necessary. in particular, the stack pointers sp1 and sp2 must be set as a pair because all the interrupts including nmi are masked after initial reset until both the sp1 and sp2 stack pointers are set with software. when data is written to the ext register, the e flag is set and the following instruction will be executed in the extended addressing mode. if an instruction which does not permit extended operation is used as the following instruction, the operation is not guaranteed. therefore, do not write data to the ext register for initialization only. refer to the "s1c63000 core cpu manual" for extended addressing and usable instructions. t able 2.2.4.1 initial values name data register a data register b extension register ext index register x index register y program counter stack pointer sp1 stack pointer sp2 zero flag carry flag interrupt flag extension flag queue register cpu core symbol a b ext x y pc sp1 sp2 z c i e q number of bits 4 4 8 16 16 16 8 8 1 1 1 1 16 setting value undefined undefined undefined undefined undefined 0110h undefined undefined undefined undefined 0 0 undefined name ram display memory other peripheral circuits peripheral circuits number of bits 4 4 setting value undefined undefined ? 2.2.2 simultaneous high input to terminals k00?03 another way of executing initial reset externally is to input a high signal simultaneously to the input ports (k00?03) selected with the mask option. since this initial reset passes through the noise reject circuit, maintain the specified input port terminals at high level for at least 1.5 msec (when the oscillation frequency f osc1 is 32.768 khz) during normal operation. the noise reject circuit does not operate immediately after turning the power on until the oscillation circuit starts oscillating. therefore, maintain the specified input port terminals at high level for at least 1.5 msec (when the oscillation frequency f osc1 is 32.768 khz) after oscillation starts. t able 2.2.2.1 shows the combinations of input ports (k00?03) that can be selected with the mask option. t able 2.2.2.1 combinations of input ports not use k00 ? k01 k00 ? k01 ? k02 k00 ? k01 ? k02 ? k03 1 2 3 4 when, for instance, mask option 4 (k00 ? k01 ? k02 ? k03) is selected, initial reset is executed when the signals input to the four ports k00?03 are all high at the same time. when 2 or 3 is selected, the initial reset is done when a key entry including a combination of selected input ports is made. ? see section 4.1, "memory map".
s1c63808 technical manual epson 11 chapter 2: power supply and initial reset 2.2.5 terminal settings at initial resetting the output port (r) terminals and i/o port (p) terminals are shared with special output terminals and input/output terminals of the serial interface. these functions are selected by the software. at initial r eset, these terminals are set to the general purpose output port terminals and i/o port terminals. set them according to the system in the initial routine. in addition, take care of the initial status of output terminals when designing a system. t able 2.2.5.1 shows the list of the shared terminal settings. t able 2.2.5.1 list of shared terminal settings terminal name r00 r01 r02 r03 r10?13 p00?03 p10 p11 p12 p13 p20 p21 p22 p23 p30?33 p40?43 terminal status at initial reset r00 (low output) r01 (low output) r02 (low output) r03 (low output) r10?13 (low output) p00?03 (input & pulled down ? ) p10 (input & pulled down ? ) p11 (input & pulled down ? ) p12 (input & pulled down ? ) p13 (input & pulled down ? ) p20 (input & pulled down ? ) p21 (input & pulled down ? ) p22 (input & pulled down ? ) p23 (input & pulled down ? ) p30?33 (input & pulled down ? ) p40?43 (input & pulled down ? ) ? when "with pull-down" is selected by mask option (high impedance when "gate direct" is selected) serial i/f special output bz r00 bz r10?13 p00?03 p30?33 p40?43 tout r00 tout r10?13 p00?03 p30?33 p40?43 fout r00 fout r10?13 p00?03 p30?33 p40?43 clk-sync. master r00 r10?13 p00?03 sin1(i) sout1(o) sclk1(o) p13 sin2(i) sout2(o) sclk2(o) p23 p30?33 p40?43 clk-sync. slave r00 r10?13 p00?03 sin1(i) sout1(o) sclk1(i) srdy1(o) sin2(i) sout2(o) sclk2(i) srdy2(o) p30?33 p40?43 async. r00 r10?13 p00?03 sin1(i) sout1(o) p12 p13 sin2(i) sout2(o) p22 p23 p30?33 p40?43 for setting procedure of the functions, see explanations for each of the peripheral circuits. 2.3 test terminal (test) this is the terminal used for the factory inspection of the ic. during normal operation, connect the test terminal to v ss .
12 epson s1c63808 technical manual chapter 3: cpu, rom, ram chapter 3 cpu, rom, ram 3.1 cpu the s1c63808 has a 4-bit core cpu s1c63000 built-in as its cpu part. refer to the "s1c63000 core cpu manual" for the s1c63000. note: the slp instruction cannot be used because the sleep operation is not assumed in the s1c63808. 3.2 code rom the built-in code rom is a mask rom for loading programs, and has a capacity of 8,192 steps 13 bits. the core cpu can linearly access the program space up to step ffffh from step 0000h, however, the program area of the s1c63808 is step 0000h to step 1fffh. the program start address after initial reset is assigned to step 0110h. the non-maskable interrupt (nmi) vector and hardware interrupt vectors are allocated to step 0100h and steps 0102h?10eh, respectively. 0000h 1fffh 2000h ffffh 0000h 0100h 0102h 010eh 0110h program area nmi vector hardware interrupt vectors program start address program area rom unused area 13 bits s1c63000 core cpu program space s1c63808 program area fi g. 3.2.1 configuration of code rom 3.3 ram the ram is a data memory for storing various kinds of data, and has a capacity of 2,048 words 4 bits. the ram area is assigned to addresses 0000h to 07ffh on the data memory map. addresses 0100h to 01ffh are 4-bit/16-bit data accessible areas and in other areas it is only possible to access 4-bit data. when programming, keep the following points in mind. (1) part of the ram area is used as a stack area for subroutine call and register evacuation, so pay attention not to overlap the data area and stack area. (2) the s1c63000 core cpu handles the stack using the stack pointer for 4-bit data (sp2) and the stack pointer for 16-bit data (sp1). 16-bit data are accessed in stack handling by sp1, therefore, this stack area should be allocated to the area where 4-bit/16-bit access is possible (0100h to 01ffh). the stack pointers sp1 and sp2 change cyclically within their respective range: the range of sp1 is 0000h to 03ffh and the range of sp2 is 0000h to 00ffh. therefore, pay attention to the sp1 value because it may be set to 0200h or more exceeding the 4-bit/16-bit accessible range in the s1c63808 or it may be set to 00ffh or less. memory accesses except for stack operations by sp1 are 4-bit data access. after initial reset, all the interrupts including nmi are masked until both the stack pointers sp1 and sp2 are set by software. further, if either sp1 or sp2 is re-set when both are set already, the interrupts including nmi are masked again until the other is re-set. therefore, the settings of sp1 and sp2 must be done as a pair.
s1c63808 technical manual epson 13 chapter 3: cpu, rom, ram (3) subroutine calls use 4 words (for pc evacuation) in the stack area for 16-bit data (sp1). interrupts use 4 words (for pc evacuation) in the stack area for 16-bit data (sp1) and 1 word (for f register evacua- tion) in the stack area for 4-bit data. 0000h 00ffh 0100h 01ffh 0200h 07ffh 4 bits 4-bit access area (sp2 stack area) 4-bit access area (data area) 4/16-bit access area (sp1 stack area) fi g. 3.3.1 configuration of data ram
14 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (memory map) chapter 4 p eripheral c ircuits and o peration the peripheral circuits of s1c63808 (timer, i/o, etc.) are interfaced with the cpu in the memory mapped i/o method. thus, all the peripheral circuits can be controlled by accessing the i/o memory on the memory map using the memory operation instructions. the following sections explain the detailed operation of each peripheral circuit. 4.1 memory map the s1c63808 data memory consists of 2,048-word ram and 90-word peripheral i/o memory. figure 4.1.1 shows the overall memory map of the s1c63808, and table 4.1.1 the peripheral circuits' (i/o space) memory maps. 0000h 0800h ff00h ffffh ram area unused area i/o memory area fi g. 4.1.1 memory map note: memory is not implemented in unused areas within the memory map. further, some non-imple- mentation areas and unused (access prohibition) areas exist in the peripheral i/o area. if the program that accesses these areas is generated, its operation cannot be guaranteed. refer to the i/o memory maps shown in table 4.1.1 for the peripheral i/o area.
s1c63808 technical manual epson 15 chapter 4: peripheral circuits and operation (memory map) address comment d3 d2 register d1 d0 name init ? 1 10 ff06h foute swdir fofq1 fofq0 r/w foute swdir fofq1 fofq0 0 0 0 0 enable disable ff05h 00 svddt svdon rr/w 0 ? 3 0 ? 3 svddt svdon ? ? 2 ? ? 2 0 0 low on normal off unused unused svd evaluation data svd circuit on/off ff07h 00 wden wdrst r/w w r 0 ? 3 0 ? 3 wden wdrst ? 3 ? ? 2 ? ? 2 1 reset enable reset disable invalid unused unused watchdog timer enable watchdog timer reset (writing) ff01h clkchg oscc 0 0 r/w r clkchg oscc 0 ? 3 0 ? 3 0 0 ? ? 2 ? ? 2 osc3 on osc1 off cpu clock switch osc3 oscillation on/off unused unused fout output enable stopwatch direct input switch 0: k00=run/stop, k01=lap 1: k00=lap, k01=run/stop fout frequency selection 0 f osc1 /64 1 f osc1 /8 2 f osc1 3 f osc3 [fofq1, 0] frequency ff04h svdchg svds2 svds1 svds0 r/w svdchg svds2 svds1 svds0 0 0 0 0 3.0 v 1.5 v svd voltage system selection svd criteria voltage setting 1 1.10 1.80 2 1.15 1.90 3 1.20 2.00 4 1.25 2.10 5 1.30 2.40 6 1.40 2.70 7 1.50 2.90 [svds2?] 1.5 v (v) 3.0 v (v) 0 1.05 1.70 ff1ah 00 stpb2 sdp2 rr/w 0 ? 3 0 ? 3 stpb2 sdp2 ? ? 2 ? ? 2 0 0 2 bits msb first 1 bit lsb first unused unused serial i/f 2 stop bit selection serial i/f 2 data input/output permutation selection 0 clk-sync. master 2 async. 7-bit 1 clk-sync. slave 3 async. 8-bit [smd21, 20] mode [smd21, 20] mode ff14h 0 smd21 smd20 esif2 rr/w 0 ? 3 smd21 smd20 esif2 ? ? 2 0 0 0sif i/o unused serial i/f 2 mode selection serial i/f 2 enable (p2x port function selection) 0 f osc3 /16 1 f osc3 /8 2 f osc3 /4 3 pt [scs21, 20] mode ff15h epr2 pmd2 scs21 scs20 r/w epr2 pmd2 scs21 scs20 0 0 0 0 enable odd disable even serial i/f 2 parity enable register serial i/f 2 parity mode selection serial i/f 2 clock source r/w ff16h rxtrg2 rxen2 txtrg2 txen2 rxtrg2 rxen2 txtrg2 txen2 0 0 0 0 run trigger enable run trigger enable stop disable stop disable serial i/f 2 receive status (reading) serial i/f 2 receive trigger (writing) serial i/f 2 receive enable serial i/f 2 transmit status (reading) serial i/f 2 transmit trigger (writing) serial i/f 2 transmit enable rr/w ff17h 0 fer2 per2 oer2 0 ? 3 fer2 per2 oer2 ? ? 2 0 0 0 error reset error reset error reset no error no error no error unused serial i/f 2 framing error flag status (reading) serial i/f 2 framing error flag reset (writing) serial i/f 2 parity error flag status (reading) serial i/f 2 parity error flag reset (writing) serial i/f 2 overrun error flag status (reading) serial i/f 2 overrun error flag reset (writing) r/w ff18h trxd23 trxd22 trxd21 trxd20 trxd23 trxd22 trxd21 trxd20 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low serial i/f 2 t ransmit/receive data (low-order 4 bits) lsb r/w ff19h trxd27 trxd26 trxd25 trxd24 trxd27 trxd26 trxd25 trxd24 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low msb serial i/f 2 t ransmit/receive data (high-order 4 bits) ff20h sik03 sik02 sik01 sik00 r/w sik03 sik02 sik01 sik00 0 0 0 0 enable enable enable enable disable disable disable disable k00?03 interrupt selection register t able 4.1.1 (a) i/o memory map (ff01h?f20h) remarks ? 1i nitial value at initial reset ? 2 not set in the circuit ? 3 constantly "0" when being read
16 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (memory map) address comment d3 d2 register d1 d0 name init ? 1 10 ff21h k03 k02 k01 k00 r k03 k02 k01 k00 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low k00?03 input port data ff22h kcp03 kcp02 kcp01 kcp00 r/w kcp03 kcp02 kcp01 kcp00 0 0 0 0 k00?03 input comparison register ff24h sik13 sik12 sik11 sik10 r/w sik13 sik12 sik11 sik10 0 0 0 0 enable enable enable enable disable disable disable disable k10?13 interrupt selection register ff25h k12 k11 k10 r k13 k12 k11 k10 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low k10?13 input port data ff26h kcp13 kcp12 kcp11 kcp10 r/w kcp13 kcp12 kcp11 kcp10 0 0 0 0 k10?13 input comparison register ff30h r03hiz r02hiz r01hiz r00hiz r/w r03hiz r02hiz r01hiz r00hiz 0 0 0 0 hi-z hi-z hi-z hi-z output output output output r03 (foute=0)/fout (foute=1) hi-z control r02 (ptout=0)/tout (ptout=1) hi-z control r01 (bze=0)/bz (bze=1) hi-z control r00 hi-z control ff31h r03 r02 r01 r00 r/w r03 r02 r01 r00 0 0 0 0 high high high high low low low low r03 output port data ( foute=0 ) fix at "1" when fout is used. r02 output port data ( ptout=0 ) fix at "1" when tout is used. r01 output port data ( bze=0 ) fix at "1" when bz is used. r00 output port data k13 ff32h 000 r1hiz rr/w 0 ? 3 0 ? 3 0 ? 3 r1hiz ? ? 2 ? ? 2 ? ? 2 0hi-z output unused unused unused r10?13 hi-z control ff33h r13 r12 r11 r10 r/w r13 r12 r11 r10 0 0 0 0 high high high high low low low low r10?13 output port data ff40h ioc03 ioc02 ioc01 ioc00 r/w ioc03 ioc02 ioc01 ioc00 0 0 0 0 output output output output input input input input p00?03 i/o control register ff41h pul03 pul02 pul01 pul00 r/w pul03 pul02 pul01 pul00 1 1 1 1 on on on on off off off off p00?03 pull-down control register ff42h p03 p02 p01 p00 r/w p03 p02 p01 p00 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low p00?03 i/o port data ff44h ioc13 ioc12 ioc11 ioc10 r/w ioc13 ioc12 ioc11 ioc10 0 0 0 0 output output output output input input input input p13 i/o control register functions as a general-purpose register when sif1 (slave) is selected p12 i/o control register (esif1=0) functions as a general-purpose register when sif1 is selected p11 i/o control register (esif1=0) functions as a general-purpose register when sif1 is selected p10 i/o control register (esif1=0) functions as a general-purpose register when sif1 is selected t able 4.1.1 (b) i/o memory map (ff21h?f44h)
s1c63808 technical manual epson 17 chapter 4: peripheral circuits and operation (memory map) address comment d3 d2 register d1 d0 name init ? 1 10 ff45h pul13 pul12 pul11 pul10 r/w pul13 pul12 pul11 pul10 1 1 1 1 on on on on off off off off p13 pull-down control register functions as a general-purpose register when sif1 (slave) is selected p12 pull-down control register (esif1=0) functions as a general-purpose register when sif1 (master) is selected sclk1 (i) pull-down control register when sif1 (slave) is selected p11 pull-down control register (esif1=0) functions as a general-purpose register when sif1 is selected p10 pull-down control register (esif1=0) sin1 pull-down control register when sif1 is selected ff46h p13 p12 p11 p10 r/w p13 p12 p11 p10 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low p13 i/o port data functions as a general-purpose register when sif1 (slave) is selected p12 i/o port data (esif1=0) functions as a general-purpose register when sif1 is selected p11 i/o port data (esif1=0) functions as a general-purpose register when sif1 is selected p10 i/o port data (esif1=0) functions as a general-purpose register when sif1 is selected ff49h pul23 pul22 pul21 pul20 r/w pul23 pul22 pul21 pul20 1 1 1 1 on on on on off off off off p23 pull-down control register functions as a general-purpose register when sif2 (slave) is selected p22 pull-down control register (esif2=0) functions as a general-purpose register when sif2 (master) is selected sclk2 (i) pull-down control register when sif2 (slave) is selected p21 pull-down control register (esif2=0) functions as a general-purpose register when sif2 is selected p20 pull-down control register (esif2=0) sin2 pull-down control register when sif2 is selected ff4ah p23 p22 p21 p20 r/w p23 p22 p21 p20 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low p23 i/o port data functions as a general-purpose register when sif2 (slave) is selected p22 i/o port data (esif2=0) functions as a general-purpose register when sif2 is selected p21 i/o port data (esif2=0) functions as a general-purpose register when sif2 is selected p20 i/o port data (esif2=0) functions as a general-purpose register when sif2 is selected ff4ch ioc33 ioc32 ioc31 ioc30 r/w ioc33 ioc32 ioc31 ioc30 0 0 0 0 output output output output input input input input p30?33 i/o control register ff50h ioc43 ioc42 ioc41 ioc40 r/w ioc33 ioc32 ioc31 ioc30 0 0 0 0 output output output output input input input input p40?43 i/o control register ff4dh pul33 pul32 pul31 pul30 r/w pul33 pul32 pul31 pul30 1 1 1 1 on on on on off off off off p30?33 pull-down control register ff4eh p33 p32 p31 p30 r/w p33 p32 p31 p30 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low p30?33 i/o port data ff48h ioc23 ioc22 ioc21 ioc20 r/w ioc23 ioc22 ioc21 ioc20 0 0 0 0 output output output output input input input input p23 i/o control register functions as a general-purpose register when sif2 (slave) is selected p22 i/o control register (esif2=0) functions as a general-purpose register when sif2 is selected p21 i/o control register (esif2=0) functions as a general-purpose register when sif2 is selected p20 i/o control register (esif2=0) functions as a general-purpose register when sif2 is selected ff51h pul43 pul42 pul41 pul40 r/w pul43 pul42 pul41 pul40 1 1 1 1 on on on on off off off off p40?43 pull-down control register t able 4.1.1 (c) i/o memory map (ff45h?f51h)
18 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (memory map) address comment d3 d2 register d1 d0 name init ? 1 10 ff52h p43 p42 p41 p40 r/w p43 p42 p41 p40 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low p40?43 i/o port data ff6ah 00 stpb1 sdp1 rr/w 0 ? 3 0 ? 3 stpb1 sdp1 ? ? 2 ? ? 2 0 0 2 bits msb first 1 bit lsb first unused unused serial i/f 1 stop bit selection serial i/f 1 data input/output permutation selection 0 clk-sync. master 2 async. 7-bit 1 clk-sync. slave 3 async. 8-bit [smd11, 10] mode [smd11, 10] mode ff64h 0 smd11 smd10 esif1 rr/w 0 ? 3 smd11 smd10 esif1 ? ? 2 0 0 0sif i/o unused serial i/f 1 mode selection serial i/f 1 enable (p1x port function selection) 0 f osc3 /16 1 f osc3 /8 2 f osc3 /4 3 pt [scs11, 10] mode ff65h epr1 pmd1 scs11 scs10 r/w epr1 pmd1 scs11 scs10 0 0 0 0 enable odd disable even serial i/f 1 parity enable register serial i/f 1 parity mode selection serial i/f 1 clock source r/w ff66h rxtrg1 rxen1 txtrg1 txen1 rxtrg1 rxen1 txtrg1 txen1 0 0 0 0 run trigger enable run trigger enable stop disable stop disable serial i/f 1 receive status (reading) serial i/f 1 receive trigger (writing) serial i/f 1 receive enable serial i/f 1 transmit status (reading) serial i/f 1 transmit trigger (writing) serial i/f 1 transmit enable rr/w ff67h 0 fer1 per1 oer1 0 ? 3 fer1 per1 oer1 ? ? 2 0 0 0 error reset error reset error reset no error no error no error unused serial i/f 1 framing error flag status (reading) serial i/f 1 framing error flag reset (writing) serial i/f 1 parity error flag status (reading) serial i/f 1 parity error flag reset (writing) serial i/f 1 overrun error flag status (reading) serial i/f 1 overrun error flag reset (writing) r/w ff68h trxd13 trxd12 trxd11 trxd10 trxd13 trxd12 trxd11 trxd10 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low serial i/f 1 t ransmit/receive data (low-order 4 bits) lsb r/w ff69h trxd17 trxd16 trxd15 trxd14 trxd17 trxd16 trxd15 trxd14 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low msb serial i/f 1 t ransmit/receive data (high-order 4 bits) 0 4096.0 1 3276.8 2 2730.7 3 2340.6 [bzfq2, 1, 0] frequency (hz) 4 2048.0 5 1638.4 6 1365.3 7 1170.3 [bzfq2, 1, 0] frequency (hz) ff6eh 0 bzfq2 bzfq1 bzfq0 rr/w 0 ? 3 bzfq2 bzfq1 bzfq0 ? ? 2 0 0 0 unused buzzer frequency selection ff6ch enrtm enrst enon bze r/w w r/w enrtm enrst ? 3 enon bze 0 reset 0 0 1 sec reset on enable 0.5 sec invalid off disable envelope releasing time selection envelope reset (writing) envelope on/off buzzer output enable ff6dh 0 bzstp bzsht shtpw rw r/w 0 ? 3 bzstp ? 3 bzsht shtpw ? ? 2 0 0 0 stop trigger busy 125 msec invalid invalid ready 31.25 msec unused 1-shot buzzer stop (writing) 1-shot buzzer trigger (writing) 1-shot buzzer status (reading) 1-shot buzzer pulse width setting ff62h 0 lc2 lc1 lc0 rr/w 0 ? 3 lc2 lc1 lc0 ? ? 2 0 0 0 0 low 7 high [lc2?] voltage unused 1/3 bias v c1 voltage adjustment lc3 lc2 lc1 lc0 r/w lc3 lc2 lc1 lc0 0 0 0 0 0 low 15 high [lc3?] voltage v c1 voltage adjustment 1/2 bias ff60h 000lpwr rr/w 0 ? 3 0 ? 3 0 ? 3 lpwr ? ? 2 ? ? 2 ? ? 2 0onoff unused unused unused epd driver power supply on/off t able 4.1.1 (d) i/o memory map (ff52h?f6eh)
s1c63808 technical manual epson 19 chapter 4: peripheral circuits and operation (memory map) address comment d3 d2 register d1 d0 name init ? 1 10 wr/w r ff78h 00 tmrst tmrun 0 ? 3 0 ? 3 tmrst ? 3 tmrun ? ? 2 ? ? 2 reset 0 reset run invalid stop unused unused clock timer reset (writing) clock timer run/stop r ff79h tm3 tm2 tm1 tm0 tm3 tm2 tm1 tm0 0 0 0 0 clock timer data (16 hz) clock timer data (32 hz) clock timer data (64 hz) clock timer data (128 hz) r ff7ah tm7 tm6 tm5 tm4 tm7 tm6 tm5 tm4 0 0 0 0 clock timer data (1 hz) clock timer data (2 hz) clock timer data (4 hz) clock timer data (8 hz) 0 none 1 k02 2 k02?3 3 k02?3,10 [dkm2, 1, 0] key mask 4 k10 5 k10?1 6 k10?2 7 k10?3 [dkm2, 1, 0] key mask r/w ff7bh edir dkm2 dkm1 dkm0 edir dkm2 dkm1 dkm0 0 0 0 0 enable disable direct input enable key mask selection r/w w r ff7ch lcurf crnwf swrun swrst lcurf crnwf swrun swrst ? 3 0 0 0 reset request renewal run reset no no stop invalid lap data carry-up request flag capture renewal flag stopwatch timer run/stop stopwatch timer reset (writing) swd7 swd6 swd5 swd4 0 0 0 0 stopwatch timer data bcd (1/100 sec) r ff7eh swd7 swd6 swd5 swd4 swd11 swd10 swd9 swd8 0 0 0 0 stopwatch timer data bcd (1/10 sec) r ff7fh swd11 swd10 swd9 swd8 drl3 drl2 drl1 drl0 ? ? 2 ? ? 2 ? ? 2 ? ? 2 low-order 8-bit destination register (low-order 4 bits) lsb r/w ff82h drl3 drl2 drl1 drl0 drl7 drl6 drl5 drl4 ? ? 2 ? ? 2 ? ? 2 ? ? 2 msb low-order 8-bit destination register (high-order 4 bits) r/w ff83h drl7 drl6 drl5 drl4 sr3 sr2 sr1 sr0 ? ? 2 ? ? 2 ? ? 2 ? ? 2 source register (low-order 4 bits) lsb r/w ff80h sr3 sr2 sr1 sr0 sr7 sr6 sr5 sr4 ? ? 2 ? ? 2 ? ? 2 ? ? 2 msb source register (high-order 4 bits) r/w ff81h sr7 sr6 sr5 sr4 drh3 drh2 drh1 drh0 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high-order 8-bit destination register (low-order 4 bits) lsb r/w ff84h drh3 drh2 drh1 drh0 drh7 drh6 drh5 drh4 ? ? 2 ? ? 2 ? ? 2 ? ? 2 msb high-order 8-bit destination register (high-order 4 bits) r/w ff85h drh7 drh6 drh5 drh4 r ff7dh swd3 swd2 swd1 swd0 swd3 swd2 swd1 swd0 0 0 0 0 stopwatch timer data bcd (1/1000 sec) ff6fh 0 bdty2 bdty1 bdty0 rr/w 0 ? 3 bdty2 bdty1 bdty0 ? ? 2 0 0 0 unused buzzer signal duty ratio selection (refer to main manual) t able 4.1.1 (e) i/o memory map (ff6fh?f85h)
20 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (memory map) address comment d3 d2 register d1 d0 name init ? 1 10 mod16 evcnt fcsel plpol 0 0 0 0 16 bits event ct. with nr 8 bits timer no nr 16-bit mode selection timer 0 counter mode selection timer 0 function selection (for event counter mode) timer 0 pulse polarity selection (for event counter mode) r/w ffc0h mod16 evcnt fcsel plpol ptps01 ptps00 ptrst0 ? 3 ptrun0 0 0 ? ? 2 0 reset run invalid stop prescaler 0 division ratio selection timer 0 reset (reload) timer 0 run/stop wr/w r/w ffc2h ptps01 ptps00 ptrst0 ptrun0 0 1/1 1 1/4 2 1/32 3 1/256 [ptps01, 00] division ratio chsel0 ptout cksel1 cksel0 0 0 0 0 timer 1 on osc3 osc3 timer 0 off osc1 osc1 tout output selection tout output control prescaler 1 source clock selection prescaler 0 source clock selection r/w ffc1h chsel0 ptout cksel1 cksel0 ptps11 ptps10 ptrst1 ? 3 ptrun1 0 0 ? ? 2 0 reset run invalid stop prescaler 1 division ratio selection timer 1 reset (reload) timer 1 run/stop wr/w r/w ffc3h ptps11 ptps10 ptrst1 ptrun1 0 1/1 1 1/4 2 1/32 3 1/256 [ptps11, 10] division ratio rld03 rld02 rld01 rld00 0 0 0 0 msb programmable timer 0 reload data (low-order 4 bits) lsb r/w ffc4h rld17 rld16 rld15 rld14 0 0 0 0 msb programmable timer 1 reload data (high-order 4 bits) lsb r/w ffc7h rld17 rld16 rld15 rld14 ptd03 ptd02 ptd01 ptd00 0 0 0 0 msb programmable timer 0 data (low-order 4 bits) lsb r ffc8h ptd03 ptd02 ptd01 ptd00 ptd07 ptd06 ptd05 ptd04 0 0 0 0 msb programmable timer 0 data (high-order 4 bits) lsb r ffc9h ptd07 ptd06 ptd05 ptd04 ptd13 ptd12 ptd11 ptd10 0 0 0 0 msb programmable timer 1 data (low-order 4 bits) lsb r ffcah ptd13 ptd12 ptd11 ptd10 ptd17 ptd16 ptd15 ptd14 0 0 0 0 msb programmable timer 1 data (high-order 4 bits) lsb r ffcbh ptd17 ptd16 ptd15 ptd14 rld13 rld12 rld11 rld10 0 0 0 0 msb programmable timer 1 reload data (low-order 4 bits) lsb r/w ffc6h rld13 rld12 rld11 rld10 rld07 rld06 rld05 rld04 0 0 0 0 msb programmable timer 0 reload data (high-order 4 bits) lsb r/w ffc5h rld07 rld06 rld05 rld04 rld03 rld02 rld01 rld00 ffe0h 0e iser2 eistr2 eisrc2 rr/w 0 ? 3 eiser2 eistr2 eisrc2 ? ? 2 0 0 0 enable enable enable mask mask mask unused interrupt mask register (serial i/f 2 error) interrupt mask register (serial i/f 2 transmit completion) interrupt mask register (serial i/f 2 receive completion) ffe1h 0e iser1 eistr1 eisrc1 rr/w 0 ? 3 eiser1 eistr1 eisrc1 ? ? 2 0 0 0 enable enable enable mask mask mask unused interrupt mask register (serial i/f 1 error) interrupt mask register (serial i/f 1 transmit completion) interrupt mask register (serial i/f 1 receive completion) ff86h nf vf zf calmd rr/w nf vf zf calmd 0 0 0 0 negative overflow zero run div. positive no no stop mult. negative flag overflow flag zero flag operation status (reading) calculation mode selection (writing) t able 4.1.1 (f) i/o memory map (ff86h?fe1h)
s1c63808 technical manual epson 21 chapter 4: peripheral circuits and operation (memory map) address comment d3 d2 register d1 d0 name init ? 1 10 ffe2h 00ei pt1 eipt0 rr/w 0 ? 3 0 ? 3 eipt1 eipt0 ? ? 2 ? ? 2 0 0 enable enable mask mask unused unused interrupt mask register (programmable timer 1) interrupt mask register (programmable timer 0) ffe6h eit3 eit2 eit1 eit0 r/w eit3 eit2 eit1 eit0 0 0 0 0 enable enable enable enable mask mask mask mask interrupt mask register (clock timer 1 hz) interrupt mask register (clock timer 2 hz) interrupt mask register (clock timer 8 hz) interrupt mask register (clock timer 32 hz) ffe8h eirun eilap eisw1 eisw10 r/w eirun eilap eisw1 eisw10 0 0 0 0 enable enable enable enable mask mask mask mask interrupt mask register (stopwatch direct run) interrupt mask register (stopwatch direct lap) interrupt mask register (stopwatch timer 1 hz) interrupt mask register (stopwatch timer 10 hz) fff2h 00i pt1 ipt0 rr/w 0 ? 3 0 ? 3 ipt1 ipt0 ? ? 2 ? ? 2 0 0 (r) yes (w) reset (r) no (w) invalid unused unused interrupt factor flag (programmable timer 1) interrupt factor flag (programmable timer 0) fff6h fff8h irun ilap isw1 isw10 r/w irun ilap isw1 isw10 0 0 0 0 (r) yes (w) reset (r) no (w) invalid interrupt factor flag (stopwatch direct run) interrupt factor flag (stopwatch direct lap) interrupt factor flag (stopwatch timer 1 hz) interrupt factor flag (stopwatch timer 10 hz) it3 it2 it1 it0 r/w it3 it2 it1 it0 0 0 0 0 (r) yes (w) reset (r) no (w) invalid interrupt factor flag (clock timer 1 hz) interrupt factor flag (clock timer 2 hz) interrupt factor flag (clock timer 8 hz) interrupt factor flag (clock timer 32 hz) fff4h 000ik0 rr/w 0 ? 3 0 ? 3 0 ? 3 ik0 ? ? 2 ? ? 2 ? ? 2 0 (r) yes (w) reset (r) no (w) invalid unused unused unused interrupt factor flag (k00?03) fff5h 000ik1 rr/w 0 ? 3 0 ? 3 0 ? 3 ik1 ? ? 2 ? ? 2 ? ? 2 0 (r) yes (w) reset (r) no (w) invalid unused unused unused interrupt factor flag (k10?13) fff0h 0i ser2 istr2 isrc2 rr/w 0 ? 3 iser2 istr2 isrc2 ? ? 2 0 0 0 (r) yes (w) reset (r) no (w) invalid unused interrupt factor flag (serial i/f 2 error) interrupt factor flag (serial i/f 2 transmit completion) interrupt factor flag (serial i/f 2 receive completion) fff1h 0i ser1 istr1 isrc1 rr/w 0 ? 3 iser1 istr1 isrc1 ? ? 2 0 0 0 (r) yes (w) reset (r) no (w) invalid unused interrupt factor flag (serial i/f 1 error) interrupt factor flag (serial i/f 1 transmit completion) interrupt factor flag (serial i/f 1 receive completion) ffe5h 000ei k1 rr/w 0 ? 3 0 ? 3 0 ? 3 eik1 ? ? 2 ? ? 2 ? ? 2 0 enable mask unused unused unused interrupt mask register (k10?13) ffe4h 000ei k0 rr/w 0 ? 3 0 ? 3 0 ? 3 eik0 ? ? 2 ? ? 2 ? ? 2 0 enable mask unused unused unused interrupt mask register (k00?03) t able 4.1.1 (g) i/o memory map (ffe2h?ff8h)
22 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (watchdog timer) 4.2 watchdog timer 4.2.1 configuration of watchdog timer the s1c63808 has a built-in watchdog timer that operates with a 256 hz divided clock from the osc1 as the source clock. the watchdog timer starts operating after initial reset, however, it can be stopped by the software. the watchdog timer must be reset cyclically by the software while it operates. if the watchdog timer is not reset in at least 3? seconds, it generates a non-maskable interrupt (nmi) to the cpu. figure 4.2.1.1 is the block diagram of the watchdog timer. watchdog timer non-maskable interrupt (nmi) osc1 dividing signal 256 hz watchdog timer enable signal watchdog timer reset signal fi g. 4.2.1.1 watchdog timer block diagram the watchdog timer contains a 10-bit binary counter, and generates the non-maskable interrupt when the last stage of the counter (0.25 hz) overflows. wa tchdog timer reset processing in the program's main routine enables detection of program overrun, such as when the main routine's watchdog timer processing is bypassed. ordinarily this routine is incorporated where periodic processing takes place, just as for the timer interrupt routine. the watchdog timer operates in the halt mode. if a halt status continues for 3? seconds, the non- maskable interrupt releases the halt status. 4.2.2 interrupt function if the watchdog timer is not reset periodically, the non-maskable interrupt (nmi) is generated to the core cpu. since this interrupt cannot be masked, it is accepted even in the interrupt disable status (i flag = "0"). however, it is not accepted when the cpu is in the interrupt mask state until sp1 and sp2 are set as a pair, such as after initial reset or during re-setting the stack pointer. the interrupt vector of nmi is assigned to 0100h in the program memory.
s1c63808 technical manual epson 23 chapter 4: peripheral circuits and operation (watchdog timer) 4.2.3 i/o memory of watchdog timer t able 4.2.3.1 shows the i/o address and control bits for the watchdog timer. t able 4.2.3.1 control bits of watchdog timer address comment d3 d2 register d1 d0 name init ? 1 10 ff07h 00 wden wdrst r/w w r 0 ? 3 0 ? 3 wden wdrst ? 3 ? ? 2 ? ? 2 1 reset enable reset disable invalid unused unused watchdog timer enable watchdog timer reset (writing) *1 initial value at initial reset *2 not set in the circuit *3 constantly "0" when being read wden: watchdog timer enable register (ff07h?1) selects whether the watchdog timer is used (enabled) or not (disabled). when "1" is written: enabled when "0" is written: disabled reading: valid when "1" is written to the wden register, the watchdog timer starts count operation. when "0" is written, the watchdog timer does not count and does not generate the interrupt (nmi). at initial reset, this register is set to "1". wdrst: watchdog timer reset (ff07h?0) resets the watchdog timer. when "1" is written: watchdog timer is reset when "0" is written: no operation reading: always "0" when "1" is written to wdrst, the watchdog timer is reset and restarts immediately after that. when "0" is written, no operation results. this bit is dedicated for writing, and is always "0" for reading. 4.2.4 programming notes (1) when the watchdog timer is being used, the software must reset it within 3-second cycles. (2) because the watchdog timer is set in operation state by initial reset, set the watchdog timer to disabled state (not used) before generating an interrupt (nmi) if it is not used.
24 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (oscillation circuit) 4.3 oscillation circuit 4.3.1 configuration of oscillation circuit the s1c63808 has two oscillation circuits (osc1 and osc3). osc1 is a crystal oscillation circuit that supplies the operating clock to the cpu and peripheral circuits. osc3 is either a cr or a ceramic oscilla- tion circuit. when processing with the s1c63808 requires high-speed operation, the cpu operating clock can be switched from osc1 to osc3 by the software. to stabilize operation of the internal circuits, the operating voltage must be switched according to the oscillation circuit to be used. figure 4.3.1.1 is the block diagram of this oscillation system. v osc v d1 high-speed operation voltage regulator voltage regulator for osc1 oscillation circuit oscillation circuit control signal cpu clock selection signal to cpu to peripheral circuits clock switch osc3 oscillation circuit osc1 oscillation circuit o p eratin g volta g e selection si g nal divider fi g. 4.3.1.1 oscillation system block diagram 4.3.2 osc1 oscillation circuit the osc1 crystal oscillation circuit generates the main clock for the cpu and the peripheral circuits. the oscillation frequency is 32.768 khz (typ.). figure 4.3.2.1 is the block diagram of the osc1 oscillation circuit. v ss c gx x'tal osc2 osc1 r r dx c dx to cpu (and peripheral circuits) fx v ss fi g. 4.3.2.1 osc1 oscillation circuit as shown in figure 4.3.2.1, the crystal oscillation circuit can be configured simply by connecting the crystal oscillator (x'tal) of 32.768 khz (typ.) between the osc1 and osc2 terminals and the trimmer capacitor (c gx ) between the osc1 and v ss terminals.
s1c63808 technical manual epson 25 chapter 4: peripheral circuits and operation (oscillation circuit) 4.3.3 osc3 oscillation circuit the s1c63808 has built-in the osc3 oscillation circuit that generates the cpu's sub-clock (max. 4.2 mhz) for high speed operation and the source clock for peripheral circuits needing a high speed clock (pro- grammable timer, fout output). the mask option enables selection of the oscillator type from cr (external r type), cr (built-in r type) and ceramic oscillation circuit. when cr oscillation (external r type) is selected, only a resistance is required as an external element. when ceramic oscillation is selected, a ceramic oscillator and two capacitors (gate and drain capacitance) are required. when cr oscillation (built-in r type) is selected, no external element is required. figure 4.3.3.1 is the block diagram of the osc3 oscillation circuit. to cpu (and some peripheral circuits) oscillation circuit control signal (b) cr oscillation circuit (built-in r type) (c) ceramic oscillation circuit c cr r cr v ss c gc c dc ceramic osc4 osc3 r r dc to cpu (and some peripheral circuits) oscillation circuit control signal fc to cpu (and some peripheral circuits) oscillation circuit control signal (a) cr oscillation circuit (external r type) c cr osc3 osc4 r cr fi g. 4.3.3.1 osc3 oscillation circuit as shown in figure 4.3.3.1, the cr oscillation circuit (external r type) can be configured simply by connecting the resistor r cr between the osc3 and osc4 terminals when cr oscillation is selected. see chapter 7, "electrical characteristics" for resistance value of r cr . when ceramic oscillation is selected, the ceramic oscillation circuit can be configured by connecting the ceramic oscillator (max. 4.2 mhz) between the osc3 and osc4 terminals, capacitor c gc between the osc3 and osc4 terminals, and capacitor c dc between the osc4 and v ss terminals. for both c gc and c dc , connect capacitors that are about 30 pf. to reduce current consumption of the osc3 oscillation circuit, oscillation can be stopped by the software (oscc register). t able 4.3.3.1 osc3 oscillation frequency oscillation circuit ceramic oscillation cr oscillation (built-in r type) cr oscillation (external r type) oscillation frequency max. 4.2 mhz typ. 200 khz 30% 200 khz to 2.2 mhz
26 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (oscillation circuit) 4.3.4 switching of cpu clock the system clock can be selected between osc1 and osc3 with software (using the clkchg register). the cpu clock should be switched using the following procedure. pay special attention to the stability waiting time for oscillation. osc1 osc3 1. set oscc to "1". (osc3 oscillation: off on) 2. wait 5 msec or more. 3. set clkchg to "1". (cpu clock: osc1 osc3) note: it takes at least 5 msec from the time the osc3 oscillation circuit goes on until the oscillation stabilizes. consequently, when switching the cpu operation clock from osc1 to osc3, do this after a minimum of 5 msec have elapsed since the osc3 oscillation went on. further, the oscillation stabilization time varies depending on the external oscillator characteristics and conditions of use, so allow ample margin when setting the wait time. osc3 osc1 1. set clkchg to "0". (cpu clock: osc3 osc1) 2. set oscc to "0". (osc3 oscillation: on off) note: when switching the clock form osc3 to osc1, use a separate instruction for switching the osc3 oscillation off. an error in the cpu operation can result if this processing is performed at the same time by the one instruction. 4.3.5 clock frequency and instruction execution time t able 4.3.5.1 shows the instruction execution time according to each frequency of the system clock. t able 4.3.5.1 clock frequency and instruction execution time clock frequency osc1: 32.768 khz osc3: 200 khz osc3: 1.1 mhz osc3: 2 mhz osc3: 4 mhz instruction execution time ( sec) 1-cycle instruction 2-cycle instruction 3-cycle instruction 61 122 183 10 20 30 1.8 3.6 5.5 123 0.5 1 1.5
s1c63808 technical manual epson 27 chapter 4: peripheral circuits and operation (oscillation circuit) 4.3.6 i/o memory of oscillation circuit t able 4.3.6.1 shows the i/o address and the control bits for the oscillation circuit. t able 4.3.6.1 control bits of oscillation circuit address comment d3 d2 register d1 d0 name init ? 1 10 ff01h clkchg oscc 0 0 r/w r clkchg oscc 0 ? 3 0 ? 3 0 0 ? ? 2 ? ? 2 osc3 on osc1 off cpu clock switch osc3 oscillation on/off unused unused *1 initial value at initial reset *2 not set in the circuit *3 constantly "0" when being read oscc: osc3 oscillation control register (ff01h?2) t urns the osc3 oscillation circuit on and off. when "1" is written: osc3 oscillation on when "0" is written: osc3 oscillation off reading: valid when it is necessary to operate the cpu at high speed, set oscc to "1". at other times, set it to "0" to r educe current consumption. at initial reset, this register is set to "0". clkchg: cpu system clock switching register (ff01h?3) the cpu's operation clock is selected with this register. when "1" is written: osc3 clock is selected when "0" is written: osc1 clock is selected reading: valid when the cpu clock is to be osc3, set clkchg to "1"; for osc1, set clkchg to "0". after turning the osc3 oscillation on (oscc = "1"), switching of the clock should be done after waiting 5 msec or more. at initial reset, this register is set to "0". 4.3.7 programming notes (1) it takes at least 5 msec from the time the osc3 oscillation circuit goes on until the oscillation stabi- lizes. consequently, when switching the cpu operation clock from osc1 to osc3, do this after a minimum of 5 msec have elapsed since the osc3 oscillation went on. further, the oscillation stabilization time varies depending on the external oscillator characteristics and conditions of use, so allow ample margin when setting the wait time. (2) when switching the clock form osc3 to osc1, use a separate instruction for switching the osc3 oscillation off. an error in the cpu operation can result if this processing is performed at the same time by the one instruction.
28 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (input ports) 4.4 input ports (k00?03 and k10?13) 4.4.1 configuration of input ports the s1c63808 has eight bits of general-purpose input ports (k00?03, k10?13). each input port termi- nal provides an internal pull-down resistor that can be enabled by mask option. figure 4.4.1.1 shows the configuration of input port. kxx mask option address v dd interrupt request data bus v ss fi g. 4.4.1.1 configuration of input port selection of "with pull-down resistor" with the mask option suits input from the push switch, key matrix, and so forth. when "gate direct" is selected, the port can be used for slide switch input and interfacing with other lsis. the k00 and k01 input ports can also be used as the run/stop and lap direct inputs for the stopwatch timer, and the k13 port can also be used as the event counter input for the programmable timer. 4.4.2 interrupt function all eight bits of the input ports (k00?03, k10?13) provide the interrupt function. the conditions for issuing an interrupt can be set by the software. further, whether to mask the interrupt function can be selected by the software. figure 4.4.2.1 shows the configuration of k00?03 (k10?13) interrupt circuit. input comparison register (kcp00, 10) k00, 10 interrupt request interrupt selection register (sik00, 10) address address address address interrupt factor flag (ik0, 1) k01, 11 k02, 12 k03, 13 interrupt mask register (eik0, 1) address data bus fi g. 4.4.2.1 input interrupt circuit configuration
s1c63808 technical manual epson 29 chapter 4: peripheral circuits and operation (input ports) the interrupt selection register (sik) and input comparison register (kcp) are individually set for the input ports k00?03 and k10?13, and can specify the terminals for generating interrupt and interrupt timing. the interrupt selection registers (sik00?ik03, sik10?ik13) select what input of k00?03 and k10?13 to use for the interrupt. writing "1" into an interrupt selection register incorporates that input port into the interrupt generation conditions. the changing the input port where the interrupt selection register has been set to "0" does not affect the generation of the interrupt. the input interrupt timing can select that the interrupt be generated at the rising edge of the input or that it be generated at the falling edge according to the set value of the input comparison registers (kcp00 kcp03, kcp10?cp13). by setting these two conditions, the interrupt for k00?03 or k10?13 is generated when input ports in which an interrupt has been enabled by the input selection registers and the contents of the input com- parison registers have been changed from matching to no matching. the interrupt mask registers (eik0, eik1) enable the interrupt mask to be selected for k00?03 and k10 k13. when the interrupt is generated, the interrupt factor flag (ik0, ik1) is set to "1". figure 4.4.2.2 shows an example of an interrupt for k00?03. interrupt selection register sik03 1 sik02 1 sik01 1 sik00 0 input port (1) (initial value) interrupt generation k03 1 k02 0 k01 1 k00 0 input comparison register kcp03 1 kcp02 0 kcp01 1 kcp00 0 with the above setting, the interrupt of k00?03 is generated under the following condition: (2) k03 1 k02 0 k01 1 k00 1 (3) k03 0 k02 0 k01 1 k00 1 (4) k03 0 k02 1 k01 1 k00 1 because k00 interrupt is set to disable, interrupt will be generated when no matching occurs between the contents of the 3 bits k01?03 and the 3 bits input comparison register kcp01?cp03. fi g. 4.4.2.2 example of interrupt of k00?03 k00 interrupt is disabled by the interrupt selection register (sik00), so that an interrupt does not occur at (2). at (3), k03 changes to "0"; the data of the terminals that are interrupt enabled no longer match the data of the input comparison registers, so that interrupt occurs. as already explained, the condition for the interrupt to occur is the change in the port data and contents of the input comparison registers from matching to no matching. hence, in (4), when the no matching status changes to another no matching status, an interrupt does not occur. further, terminals that have been masked for interrupt do not affect the conditions for interrupt generation. 4.4.3 mask option internal pull-down resistor can be selected for each of the eight bits of the input ports (k00?03, k10 k13) with the input port mask option. when "gate direct" is selected, take care that the floating status does not occur for the input. select "with pull-down resistor" for input ports that are not being used.
30 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (input ports) 4.4.4 i/o memory of input ports t able 4.4.4.1 shows the i/o addresses and the control bits for the input ports. t able 4.4.4.1 control bits of input ports address comment d3 d2 register d1 d0 name init ? 1 10 ff20h sik03 sik02 sik01 sik00 r/w sik03 sik02 sik01 sik00 0 0 0 0 enable enable enable enable disable disable disable disable k00?03 interrupt selection register ff21h k03 k02 k01 k00 r k03 k02 k01 k00 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low k00?03 input port data ff22h kcp03 kcp02 kcp01 kcp00 r/w kcp03 kcp02 kcp01 kcp00 0 0 0 0 k00?03 input comparison register ff24h sik13 sik12 sik11 sik10 r/w sik13 sik12 sik11 sik10 0 0 0 0 enable enable enable enable disable disable disable disable k10?13 interrupt selection register ff25h k13 k12 k11 k10 r k13 k12 k11 k10 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low k10?13 input port data ff26h kcp13 kcp12 kcp11 kcp10 r/w kcp13 kcp12 kcp11 kcp10 0 0 0 0 k10?13 input comparison register ffe4h 000ei k0 rr/w 0 ? 3 0 ? 3 0 ? 3 eik0 ? ? 2 ? ? 2 ? ? 2 0 enable mask unused unused unused interrupt mask register (k00?03) ffe5h 000ei k1 rr/w 0 ? 3 0 ? 3 0 ? 3 eik1 ? ? 2 ? ? 2 ? ? 2 0 enable mask unused unused unused interrupt mask register (k10?13) fff4h 000ik0 rr/w 0 ? 3 0 ? 3 0 ? 3 ik0 ? ? 2 ? ? 2 ? ? 2 0 (r) yes (w) reset (r) no (w) invalid unused unused unused interrupt factor flag (k00?03) fff5h 000ik1 rr/w 0 ? 3 0 ? 3 0 ? 3 ik1 ? ? 2 ? ? 2 ? ? 2 0 (r) yes (w) reset (r) no (w) invalid unused unused unused interrupt factor flag (k10?13) *1 initial value at initial reset *2 not set in the circuit *3 constantly "0" when being read k00?03: k0 port input port data (ff21h) k10?13: k1 port input port data (ff25h) input data of the input port terminals can be read with these registers. when "1" is read: high level when "0" is read: low level w riting: invalid the reading is "1" when the terminal voltage of the eight bits of the input ports (k00?03, k10?13) goes high (v dd ), and "0" when the voltage goes low (v ss ). these bits are dedicated for reading, so writing cannot be done.
s1c63808 technical manual epson 31 chapter 4: peripheral circuits and operation (input ports) sik00?ik03: k0 port interrupt selection register (ff20h) sik10?ik13: k1 port interrupt selection register (ff24h) selects the ports to be used for the k00?03 and k10?13 input interrupts. when "1" is written: enable when "0" is written: disable reading: valid enables the interrupt for the input ports (k00?03, k10?13) for which "1" has been written into the interrupt selection registers (sik00?ik03, sik10?ik13). the input port set for "0" does not affect the interrupt generation condition. at initial reset, these registers are set to "0". kcp00?cp03: k0 port input comparison register (ff22h) kcp10?cp13: k1 port input comparison register (ff26h) interrupt conditions for terminals k00?03 and k10?13 can be set with these registers. when "1" is written: falling edge when "0" is written: rising edge reading: valid the interrupt conditions can be set for the rising or falling edge of input for each of the eight bits (k00 k03 and k10?13), through the input comparison registers (kcp00?cp03 and kcp10?cp13). for kcp00?cp03, a comparison is done only with the ports that are enabled by the interrupt among k00?03 by means of the sik00?ik03 registers. for kcp10?cp13, a comparison is done only with the ports that are enabled by the interrupt among k10?13 by means of the sik10?ik13 registers. at initial reset, these registers are set to "0". eik0: k0 input interrupt mask register (ffe4h?0) eik1: k1 input interrupt mask register (ffe5h?0) masking the interrupt of the input port can be selected with these registers. when "1" is written: enable when "0" is written: mask reading: valid wi th these registers, masking of the input port interrupt can be selected for each of the two systems (k00 k03, k10?13). at initial reset, these registers are set to "0". ik0: k0 input interrupt factor flag (fff4h?0) ik1: k1 input interrupt factor flag (fff5h?0) these flags indicate the occurrence of input interrupt. when "1" is read: interrupt has occurred when "0" is read: interrupt has not occurred when "1" is written: flag is reset when "0" is written: invalid the interrupt factor flags ik0 and ik1 are associated with k00?03 and k10?13, respectively. from the status of these flags, the software can decide whether an input interrupt has occurred. the interrupt factor flag is set to "1" when the interrupt condition is established regardless of the interrupt mask register setting. however, the interrupt does not occur to the cpu when the interrupt is masked. these flags are reset to "0" by writing "1" to them. after an interrupt occurs, the same interrupt will occur again if the interrupt enabled state (i flag = "1") is set or the reti instruction is executed unless the interrupt factor flag is reset. therefore, be sure to reset (write "1" to) the interrupt factor flag in the interrupt service routine before shifting to the interrupt enabled state. at initial reset, these flags are set to "0".
32 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (input ports) 4.4.5 programming notes (1) when input ports are changed from high to low by pull-down resistors, the fall of the waveform is delayed on account of the time constant of the pull-down resistor and input gate capacitance. hence, when fetching input ports, set an appropriate waiting time. particular care needs to be taken of the key scan during key matrix configuration. make this waiting time the amount of time or more calculated by the following expression. 10 c r c: terminal capacitance 5 pf + parasitic capacitance ? pf r: pull-down resistance 375 k ? (max.) (2) after an interrupt occurs, the same interrupt will occur again if the interrupt enabled state (i flag = "1") is set or the reti instruction is executed unless the interrupt factor flag is reset. therefore, be sure to reset (write "1" to) the interrupt factor flag in the interrupt service routine before shifting to the interrupt enabled state.
s1c63808 technical manual epson 33 chapter 4: peripheral circuits and operation (output ports) 4.5 output ports (r00?03 and r10?13) 4.5.1 configuration of output ports the s1c63808 has eight bits of general output ports. output specifications of the output ports can be selected individually with the mask option. two kinds of output specifications are available: complementary output and p-channel open drain output. figure 4.5.1.1 shows the configuration of the output port. v dd v ss rxx data bus address data register address high impedance control register mask option fi g. 4.5.1.1 configuration of output port the r01, r02 and r03 output terminals are shared with special output terminals (bz, tout, fout), and this function is selected by the software. at initial reset, these are all set to the general purpose output port. t able 4.5.1.1 shows the setting of the output terminals by function selection. t able 4.5.1.1 function setting of output terminals terminal name r00 r01 r02 r03 r10?13 terminal status at initial reset r00 (low output) r01 (low output) r02 (low output) r03 (low output) r10?13 (low output) special output bz r00 bz r10?13 tout r00 tout r10?13 fout r00 fout r10?13 when using the output port (r01, r02, r03) as the special output port, the data register must be fixed at "1" and the high impedance control register must be fixed at "0" (data output). note: if an output terminal (including a special output terminal) of this ic is used to drive an external component that consumes a large amount of current such as a bipolar transistor, design the pattern of traces on the printed circuit board so that the operation of the external component does not affect the ic power supply. refer to in section 5.3, "precautions on mounting", for more information. 4.5.2 mask option output specifications of the output ports are selected by mask option. either complementary output or p-channel open drain output can be selected individually (in 1-bit units). however, when p-channel open drain output is selected, do not apply a voltage exceeding the power supply voltage to the output port.
34 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (output ports) 4.5.3 high impedance control the output ports can be set into a high impedance status. this control is done using the high impedance control registers. the high impedance control registers are provided to correspond with the output ports as shown below. high impedance control register corresponding output port r00hiz r00 (1 bit) r01hiz r01 (1 bit) r02hiz r02 (1 bit) r03hiz r03 (1 bit) r1hiz r10?13 (4 bits) when "1" is written to the high impedance control register, the corresponding output port terminal goes into high impedance status. when "0" is written, the port outputs a signal according to the data register. 4.5.4 special output in addition to the regular dc output, special output can be selected for the output ports r01, r02 and r03 as shown in table 4.5.4.1 with the software. t able 4.5.4.1 special output terminal r03 r02 r01 special output fout tout bz output control register foute ptout bze, bzsht at initial reset, the output port data register is set to "0" and the high impedance control register is set to "0". consequently, the output terminal goes low (v ss ). when using the output port (r01, r02, r03) as the special output port, fix the data register (r01, r02, r03) at "1" and the high impedance control register (r01hiz, r02hiz, r03hiz) at "0" (data output). the re spective signal should be turned on and off using the special output control register. notes: be aware that the output terminal is fixed at a low (v ss ) level the same as the dc output if "0" is written to the r01, r02 and r03 registers when the special output has been selected. be aware that the output terminal shifts into high impedance status when "1" is written to the high impedance control register (r01hiz, r02hiz, r03hiz). bz (r01) the r01 terminal can output a bz signal. the bz signal is the buzzer signal that is output from the sound generator. to output the bz signal, fix the r01 register at "1" and the r01hiz register at "0", and turn the signal on and off using the bze or bzsht register. refer to section 4.11, "sound generator" for details of the buzzer signal and controlling method. note: a hazard may occur when the bz signal is turned on and off. figure 4.5.4.1 shows the output waveform of the bz signal. r01hiz register r01 register bze register bz output fix at "0" fix at "1" "1" "0" "0" fi g. 4.5.4.1 output waveform of bz signal
s1c63808 technical manual epson 35 chapter 4: peripheral circuits and operation (output ports) ? out (r02) the r02 terminal can output a tout signal. the tout signal is the clock that is output from the programmable timer, and can be used to provide a clock signal to an external device. to output the tout signal, fix the r02 register at "1" and the r02hiz register at "0", and turn the signal on and off using the ptout register. it is, however, necessary to control the programmable timer. refer to section 4.9, "programmable timer" for details of the programmable timer. note: a hazard may occur when the tout signal is turned on and off. figure 4.5.4.2 shows the output waveform of the tout signal. r02hiz register r02 register ptout register tout output fix at "0" fix at "1" "1" "0" "0" fi g. 4.5.4.2 output waveform of tout signal fout (r03) the r03 terminal can output an fout signal. the fout signal is a clock (f osc1 or f osc3 ) that is output from the oscillation circuit or a clock that the f osc1 clock has divided in the internal circuit, and can be used to provide a clock signal to an external device. to output the fout signal, fix the r03 register at "1" and the r03hiz register at "0", and turn the signal on and off using the foute register. the frequency of the output clock may be selected from among 4 types shown in table 4.5.4.2 by setting the fofq0 and fofq1 registers. t able 4.5.4.2 fout clock frequency fofq1 1 1 0 0 fofq0 1 0 1 0 clock frequency f osc3 f osc1 f osc1 1/8 f osc1 1/64 f osc1 : clock that is output from the osc1 oscillation circuit f osc3 : clock that is output from the osc3 oscillation circuit when f osc3 is selected for the fout signal frequency, it is necessary to control the osc3 oscillation circuit before output. refer to section 4.3, "oscillation circuit", for the control and notes. note: a hazard may occur when the fout signal is turned on and off. figure 4.5.4.3 shows the output waveform of the fout signal. r03hiz register r03 register foute register fout output fix at "0" fix at "1" "1" "0" "0" fi g. 4.5.4.3 output waveform of fout signal
36 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (output ports) 4.5.5 i/o memory of output ports t able 4.5.5.1 shows the i/o addresses and control bits for the output ports. t able 4.5.5.1 control bits of output ports address comment d3 d2 register d1 d0 name init ? 1 10 ff06h foute swdir fofq1 fofq0 r/w foute swdir fofq1 fofq0 0 0 0 0 enable disable fout output enable stopwatch direct input switch 0: k00=run/stop, k01=lap 1: k00=lap, k01=run/stop fout frequency selection 0 f osc1 /64 1 f osc1 /8 2 f osc1 3 f osc3 [fofq1, 0] frequency ff32h 000 r1hiz rr/w 0 ? 3 0 ? 3 0 ? 3 r1hiz ? ? 2 ? ? 2 ? ? 2 0hi-z output unused unused unused r10?13 hi-z control ff33h r13 r12 r11 r10 r/w r13 r12 r11 r10 0 0 0 0 high high high high low low low low r10?13 output port data chsel0 ptout cksel1 cksel0 0 0 0 0 timer 1 on osc3 osc3 timer 0 off osc1 osc1 tout output selection tout output control prescaler 1 source clock selection prescaler 0 source clock selection r/w ffc1h chsel0 ptout cksel1 cksel0 ff6ch enrtm enrst enon bze r/w w r/w enrtm enrst ? 3 enon bze 0 reset 0 0 1 sec reset on enable 0.5 sec invalid off disable envelope releasing time selection envelope reset (writing) envelope on/off buzzer output enable ff6dh 0 bzstp bzsht shtpw rw r/w 0 ? 3 bzstp ? 3 bzsht shtpw ? ? 2 0 0 0 stop trigger busy 125 msec invalid invalid ready 31.25 msec unused 1-shot buzzer stop (writing) 1-shot buzzer trigger (writing) 1-shot buzzer status (reading) 1-shot buzzer pulse width setting ff30h r03hiz r02hiz r01hiz r00hiz r/w r03hiz r02hiz r01hiz r00hiz 0 0 0 0 hi-z hi-z hi-z hi-z output output output output r03 (foute=0)/fout (foute=1) hi-z control r02 (ptout=0)/tout (ptout=1) hi-z control r01 (bze=0)/bz (bze=1) hi-z control r00 hi-z control ff31h r03 r02 r01 r00 r/w r03 r02 r01 r00 0 0 0 0 high high high high low low low low r03 output port data ( foute=0 ) fix at "1" when fout is used. r02 output port data ( ptout=0 ) fix at "1" when tout is used. r01 output port data ( bze=0 ) fix at "1" when bz is used. r00 output port data *1 initial value at initial reset *2 not set in the circuit *3 constantly "0" when being read r00hiz?03hiz: r0 port high impedance control register (ff30h) r1hiz: r1 port high impedance control register (ff32h?0) controls high impedance output of the output port. when "1" is written: high impedance when "0" is written: data output reading: valid by writing "0" to the high impedance control register, the corresponding output terminal outputs accord- ing to the data register. when "1" is written, it shifts into high impedance status. when the output ports r01, r02 and r03 are used for special output (bz, tout, fout), fix the r01hiz r egister, r02hiz register and the r03hiz register at "0" (data output). at initial reset, these registers are set to "0".
s1c63808 technical manual epson 37 chapter 4: peripheral circuits and operation (output ports) r00?03: r0 output port data register (ff31h) r10?13: r1 output port data register (ff33h) set the output data for the output ports. when "1" is written: high level output when "0" is written: low level output reading: valid the output port terminals output the data written in the corresponding data registers without changing it. when "1" is written to the register, the output port terminal goes high (v dd ), and when "0" is written, the output port terminal goes low (v ss ). when the output ports r01, r02 and r03 are used for special output (bz, tout, fout), fix the r01 re gister, r02 register and the r03 register at "1". at initial reset, these registers are all set to "0". foute: fout output control register (ff06h?3) controls the fout output. when "1" is written: fout output on when "0" is written: fout output off reading: valid by writing "1" to the foute register when the r03 register has been set to "1" and the r03hiz register has been set to "0", the fout signal is output from the r03 terminal. when "0" is written, the r03 termi- nal goes low (v ss ). when using the r03 output port for dc output, fix this register at "0". at initial reset, this register is set to "0". fofq0, fofq1: fout frequency selection register (ff06h?0, d1) selects a frequency of the fout signal. t able 4.5.5.2 fout clock frequency fofq1 1 1 0 0 fofq0 1 0 1 0 clock frequency f osc3 f osc1 f osc1 1/8 f osc1 1/64 at initial reset, this register is set to "0". ptout: tout output control register (ffc1h?0) controls the tout output. when "1" is written: tout output on when "0" is written: tout output off reading: valid by writing "1" to the ptout register when the r02 register has been set to "1" and the r02hiz register has been set to "0", the tout signal is output from the r02 terminal. when "0" is written, the r02 termi- nal goes high (v dd ). when using the r02 output port for dc output, fix this register at "0". at initial reset, this register is set to "0".
38 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (output ports) bze: buzzer output control register (ff6ch?0) controls the buzzer signal output. when "1" is written: buzzer output on when "0" is written: buzzer output off reading: valid by writing "1" to the bze register when the r01 register has been set to "1" and the r01hiz register has been set to "0", the bz signal is output from the r01 terminal. when "0" is written, the r01 terminal goes low (v ss ). at initial reset, this register is set to "0". bzsht: one-shot buzzer trigger/status (ff6dh?1) controls the one-shot buzzer output. ?when writing when "1" is written: trigger when "0" is written: no operation w riting "1" into bzsht causes the one-short output circuit to operate and a buzzer signal to be output from the r01 terminal. to output the buzzer signal, the r01 register must be set to "1" and the r01hiz r egister must be set to "0". this output is automatically turned off after the time set by shtpw has elapsed. the one-shot output is only valid when the normal buzzer output is off (bze = "0") and will be invalid when the normal buzzer output is on (bze = "1"). when a re-trigger is assigned during a one-shot output, the one-shot output time set with shtpw is measured again from that point (time extension). ?when reading when "1" is read: busy when "0" is read: ready during reading bzsht shows the operation status of the one-shot output circuit. during one-shot output, bzsht becomes "1" and the output goes off, it shifts to "0". at initial reset, this bit is set to "0". 4.5.6 programming notes (1) when using the output port (r01, r02, r03) as the special output port (bz, tout, fout), fix the data r egister (r01, r02, r03) at "1" and the high impedance control register (r01hiz, r02hiz, r03hiz) at "0" (data output). be aware that the output terminal is fixed at a low (v ss ) level the same as the dc output if "0" is written to the r01, r02 and r03 registers when the special output has been selected. be aware that the output terminal shifts into high impedance status when "1" is written to the high impedance control register (r01hiz, r02hiz, r03hiz). (2) a hazard may occur when the bz, fout or tout signal is turned on and off. (3) when f osc3 is selected for the fout signal frequency, it is necessary to control the osc3 oscillation circuit before output. refer to section 4.3, "oscillation circuit", for the control and notes.
s1c63808 technical manual epson 39 chapter 4: peripheral circuits and operation (i/o ports) 4.6 i/o ports (p00?03, p10?13, p20?23, p30?33 and p40?43) 4.6.1 configuration of i/o ports the s1c63808 has 20 bits of general-purpose i/o ports. figure 4.6.1.1 shows the configuration of the i/o port. address data register data bus pxx address address address i/o control register (ioc) pull-down control register (pul) mask option v ss fi g. 4.6.1.1 configuration of i/o port the i/o port terminals p10 to p13 and p20 to p23 are shared with the serial interface input/output terminals. the software can select the function to be used. at initial reset, these terminals are all set to the i/o port. t able 4.6.1.1 shows the setting of the input/output terminals by function selection. t able 4.6.1.1 function setting of input/output terminals terminal name p00?03 p10 p11 p12 p13 p20 p21 p22 p23 p30?33 p40?43 terminal status at initial reset p00?03 (input & pulled down ? ) p10 (input & pulled down ? ) p11 (input & pulled down ? ) p12 (input & pulled down ? ) p13 (input & pulled down ? ) p20 (input & pulled down ? ) p21 (input & pulled down ? ) p22 (input & pulled down ? ) p23 (input & pulled down ? ) p30?33 (input & pulled down ? ) p40?43 (input & pulled down ? ) ? when "with pull-down resistor" is selected by the mask option (high impedance when "gate direct" is set) serial i/f clk-sync. master p00?03 sin1(i) sout1(o) sclk1(o) p13 sin2(i) sout2(o) sclk2(o) p23 p30?33 p40?43 clk-sync. slave p00?03 sin1(i) sout1(o) sclk1(i) srdy1(o) sin2(i) sout2(o) sclk2(i) srdy2(o) p30?33 p40?43 async. p00?03 sin1(i) sout1(o) p12 p13 sin2(i) sout2(o) p22 p23 p30?33 p40?43 when these ports are used as i/o ports, the ports can be set to either input mode or output mode indi- vidually (in 1-bit unit). modes can be set by writing data to the i/o control registers. refer to section 4.10, "serial interface", for control of the serial interface. note: if an output of this ic is used to drive an external component that consumes a large amount of current such as a bipolar transistor, design the pattern of traces on the printed circuit board so that the operation of the external component does not affect the ic power supply. refer to in section 5.3, "precautions on mounting", for more information.
40 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (i/o ports) 4.6.2 mask option the output specification of each i/o port during output mode can be selected from either complemen- tary output or p-channel open drain output by mask option. this selection can be done in 1-bit units. when p-channel open drain output is selected, do not apply a voltage exceeding the power supply voltage to the port. the mask option also permits selection of whether the pull-down resistor is used or not during input mode. this selection can be done in 1-bit units. when "without pull-down" during the input mode is selected, take care that the floating status does not occur. the pull-down resistor for input mode and output specification (complementary output or p-channel open drain output) selected by mask option are effective even when i/o ports are used for input/output of the serial interface. 4.6.3 i/o control registers and input/output mode input or output mode can be set for the i/o ports by writing data into the corresponding i/o control r egisters iocxx. to set the input mode, write "0" to the i/o control register. when an i/o port is set to input mode, it becomes high impedance status and works as an input port. however, when the pull-down explained in the following section has been set by software, the input line is pulled down only during this input mode. to set the output mode, write "1" is to the i/o control register. when an i/o port is set to output mode, it works as an output port, it outputs a high level (v dd ) when the port output data is "1", and a low level (v ss ) when the port output data is "0". if perform the read out in each mode; when output mode, the register value is read out, and when input mode, the port value is read out. at initial reset, the i/o control registers are set to "0", and the i/o ports enter the input mode. the i/o control registers of the ports that are set as input/output for the serial interface can be used as general purpose registers that do not affect the i/o control. (see table 4.6.1.1.) 4.6.4 pull-down during input mode a pull-down resistor that operates during the input mode is built into each i/o port of the s1c63808. mask option can set the use or non-use of this pull-down. the pull-down resistor becomes effective by writing "1" to the pull-down control register pulxx that corresponds to each port, and the input line is pulled down during the input mode. when "0" has been written, no pull-down is done. at initial reset, the pull-down control registers are set to "1". the pull-down control registers of the ports in which "gate direct" has been selected can be used as general purpose registers. even when "with pull-down" has been selected, the pull-down control registers of the ports, that are set as output for the serial interface, can be used as general purpose registers that do not affect the pull-down control. (see table 4.6.1.1.) the pull-down control registers of the port, that are set as input for the serial interface, function the same as the i/o port.
s1c63808 technical manual epson 41 chapter 4: peripheral circuits and operation (i/o ports) 4.6.5 i/o memory of i/o ports t able 4.6.5.1 shows the i/o addresses and the control bits for the i/o ports. t able 4.6.5.1(a) control bits of i/o ports address comment d3 d2 register d1 d0 name init ? 1 10 ff40h ioc03 ioc02 ioc01 ioc00 r/w ioc03 ioc02 ioc01 ioc00 0 0 0 0 output output output output input input input input p00?03 i/o control register ff41h pul03 pul02 pul01 pul00 r/w pul03 pul02 pul01 pul00 1 1 1 1 on on on on off off off off p00?03 pull-down control register ff42h p03 p02 p01 p00 r/w p03 p02 p01 p00 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low p00?03 i/o port data ff44h ioc13 ioc12 ioc11 ioc10 r/w ioc13 ioc12 ioc11 ioc10 0 0 0 0 output output output output input input input input p13 i/o control register functions as a general-purpose register when sif1 (slave) is selected p12 i/o control register (esif1=0) functions as a general-purpose register when sif1 is selected p11 i/o control register (esif1=0) functions as a general-purpose register when sif1 is selected p10 i/o control register (esif1=0) functions as a general-purpose register when sif1 is selected ff45h pul13 pul12 pul11 pul10 r/w pul13 pul12 pul11 pul10 1 1 1 1 on on on on off off off off p13 pull-down control register functions as a general-purpose register when sif1 (slave) is selected p12 pull-down control register (esif1=0) functions as a general-purpose register when sif1 (master) is selected sclk1 (i) pull-down control register when sif1 (slave) is selected p11 pull-down control register (esif1=0) functions as a general-purpose register when sif1 is selected p10 pull-down control register (esif1=0) sin1 pull-down control register when sif1 is selected ff46h p13 p12 p11 p10 r/w p13 p12 p11 p10 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low p13 i/o port data functions as a general-purpose register when sif1 (slave) is selected p12 i/o port data (esif1=0) functions as a general-purpose register when sif1 is selected p11 i/o port data (esif1=0) functions as a general-purpose register when sif1 is selected p10 i/o port data (esif1=0) functions as a general-purpose register when sif1 is selected ff49h pul23 pul22 pul21 pul20 r/w pul23 pul22 pul21 pul20 1 1 1 1 on on on on off off off off p23 pull-down control register functions as a general-purpose register when sif2 (slave) is selected p22 pull-down control register (esif2=0) functions as a general-purpose register when sif2 (master) is selected sclk2 (i) pull-down control register when sif2 (slave) is selected p21 pull-down control register (esif2=0) functions as a general-purpose register when sif2 is selected p20 pull-down control register (esif2=0) sin2 pull-down control register when sif2 is selected ff48h ioc23 ioc22 ioc21 ioc20 r/w ioc23 ioc22 ioc21 ioc20 0 0 0 0 output output output output input input input input p23 i/o control register functions as a general-purpose register when sif2 (slave) is selected p22 i/o control register (esif2=0) functions as a general-purpose register when sif2 is selected p21 i/o control register (esif2=0) functions as a general-purpose register when sif2 is selected p20 i/o control register (esif2=0) functions as a general-purpose register when sif2 is selected *1 initial value at initial reset *2 not set in the circuit *3 constantly "0" when being read
42 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (i/o ports) t able 4.6.5.1(b) control bits of i/o ports address comment d3 d2 register d1 d0 name init ? 1 10 ff4ah p23 p22 p21 p20 r/w p23 p22 p21 p20 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low p23 i/o port data functions as a general-purpose register when sif2 (slave) is selected p22 i/o port data (esif2=0) functions as a general-purpose register when sif2 is selected p21 i/o port data (esif2=0) functions as a general-purpose register when sif2 is selected p20 i/o port data (esif2=0) functions as a general-purpose register when sif2 is selected ff4ch ioc33 ioc32 ioc31 ioc30 r/w ioc33 ioc32 ioc31 ioc30 0 0 0 0 output output output output input input input input p30?33 i/o control register ff50h ioc43 ioc42 ioc41 ioc40 r/w ioc33 ioc32 ioc31 ioc30 0 0 0 0 output output output output input input input input p40?43 i/o control register ff4dh pul33 pul32 pul31 pul30 r/w pul33 pul32 pul31 pul30 1 1 1 1 on on on on off off off off p30?33 pull-down control register ff4eh p33 p32 p31 p30 r/w p33 p32 p31 p30 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low p30?33 i/o port data ff51h pul43 pul42 pul41 pul40 r/w pul43 pul42 pul41 pul40 1 1 1 1 on on on on off off off off p40?43 pull-down control register ff52h p43 p42 p41 p40 r/w p43 p42 p41 p40 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low p40?43 i/o port data 0 clk-sync. master 2 async. 7-bit 1 clk-sync. slave 3 async. 8-bit [smd11, 10] mode [smd11, 10] mode ff64h 0 smd11 smd10 esif1 rr/w 0 ? 3 smd11 smd10 esif1 ? ? 2 0 0 0sif i/o unused serial i/f 1 mode selection serial i/f 1 enable (p1x port function selection) 0 clk-sync. master 2 async. 7-bit 1 clk-sync. slave 3 async. 8-bit [smd21, 20] mode [smd21, 20] mode ff14h 0 smd21 smd20 esif2 rr/w 0 ? 3 smd21 smd20 esif2 ? ? 2 0 0 0sif i/o unused serial i/f 2 mode selection serial i/f 2 enable (p2x port function selection) *1 initial value at initial reset *2 not set in the circuit *3 constantly "0" when being read (1) selection of port function esif1: serial interface 1 enable register (ff64h?0) esif2: serial interface 2 enable register (ff14h?0) selects a function for p10?13 or p20?23. when "1" is written: serial interface input/output port when "0" is written: i/o port reading: valid serial interface 1 uses the p10?13 terminals and serial interface 2 uses the p20?23 terminals. when using the serial interface, write "1" to the esifx register . when p10?13 are used as i/o ports, write "0". the terminal configuration within p10?13/p20?23 that are used for the serial interface is decided by the transfer mode (7-bit asynchronous, 8-bit asynchronous, clock synchronous slave, clock synchronous master) selected with the smdxx register.
s1c63808 technical manual epson 43 chapter 4: peripheral circuits and operation (i/o ports) in the clock synchronous slave mode, all the p10?13/p20?23 ports are set to the serial interface input/ output port. in the clock synchronous master mode, p10?12/p20?22 are set to the serial interface input/output port and p13/p23 can be used as an i/o port. in the 8/7-bit asynchronous mode, p10/p20 and p11/p21 are set to the serial interface input/output port and p12/p22 and p13/p23 can be used as i/o ports. at initial reset, these registers are set to "0". (2) i/o port control p00?03: p0 i/o port data register (ff42h) p10?13: p1 i/o port data register (ff46h) p20?23: p2 i/o port data register (ff4ah) p30?33: p3 i/o port data register (ff4eh) p40?43: p4 i/o port data register (ff52h) i/o port data can be read and output data can be set through these registers. ?when writing data when "1" is written: high level when "0" is written: low level when an i/o port is set to the output mode, the written data is output unchanged from the i/o port terminal. when "1" is written as the port data, the port terminal goes high (v dd ), and when "0" is written, the terminal goes low (v ss ). port data can be written also in the input mode. ?when reading data when "1" is read: high level when "0" is read: low level the terminal voltage level of the i/o port is read out. when the i/o port is in the input mode the voltage level being input to the port terminal can be read out; in the output mode the register value can be read. when the terminal voltage is high (v dd ) the port data that can be read is "1", and when the terminal voltage is low (v ss ) the data is "0". when "with pull-down resistor" has been selected with the mask option and the pul register is set to "1", the built-in pull-down resistor goes on during input mode, so that the i/o port terminal is pulled down. the data registers of the port, which are set for the input/output of the serial interface (p10?13, p20 p23), become general-purpose registers that do not affect the input/output. note: when in the input mode, i/o ports are changed from high to low by pull-down resistor, the fall of the waveform is delayed on account of the time constant of the pull-down resistor and input gate capacitance. hence, when fetching input ports, set an appropriate wait time. pa rt icular care needs to be taken of the key scan during key matrix configuration. make this waiting time the amount of time or more calculated by the following expression. 10 c r c: terminal capacitance 5 pf + parasitic capacitance ? pf r: pull-down resistance 375 k ? (max.)
44 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (i/o ports) ioc00?oc03: p0 port i/o control register (ff40h) ioc10?oc13: p1 port i/o control register (ff44h) ioc20?oc23: p2 port i/o control register (ff48h) ioc30?oc33: p3 port i/o control register (ff4ch) ioc40?oc43: p4 port i/o control register (ff50h) the input and output modes of the i/o ports are set with these registers. when "1" is written: output mode when "0" is written: input mode reading: valid the input and output modes of the i/o ports are set in 1-bit unit. wr iting "1" to the i/o control register makes the corresponding i/o port enter the output mode, and writing "0" induces the input mode. at initial reset, these registers are all set to "0", so the i/o ports are in the input mode. the i/o control registers of the port, which are set for the input/output of the serial interface (p10?13, p20?23), become general-purpose registers that do not affect the input/output. pul00?ul03: p0 port pull-down control register (ff41h) pul10?ul13: p1 port pull-down control register (ff45h) pul20?ul23: p2 port pull-down control register (ff49h) pul30?ul33: p3 port pull-down control register (ff4dh) pul40?ul43: p4 port pull-down control register (ff51h) the pull-down during the input mode are set with these registers. when "1" is written: pull-down on when "0" is written: pull-down off reading: valid the built-in pull-down resistor which is turned on during input mode is set to enable in 1-bit units. (the pull-down resistor is included into the ports selected by mask option.) by writing "1" to the pull-down control register, the corresponding i/o ports are pulled down (during input mode), while writing "0" disables the pull-down function. at initial reset, these registers are all set to "1", so the pull-down function is enabled. the pull-down control registers of the ports in which the pull-down resistor is not included become the general purpose register. the registers of the ports that are set as output for the serial interface can also be used as general purpose registers that do not affect the pull-down control. the pull-down control registers of the port that are set as input for the serial interface function the same as the i/o port. 4.6.6 programming note when in the input mode, i/o ports are changed from high to low by pull-down resistor, the fall of the waveform is delayed on account of the time constant of the pull-down resistor and input gate capaci- tance. hence, when fetching input ports, set an appropriate wait time. particular care needs to be taken of the key scan during key matrix configuration. make this waiting time the amount of time or more calculated by the following expression. 10 c r c: terminal capacitance 5 pf + parasitic capacitance ? pf r: pull-down resistance 375 k ? (max.)
s1c63808 technical manual epson 45 chapter 4: peripheral circuits and operation (clock timer) 4.7 clock timer 4.7.1 configuration of clock timer the s1c63808 has a built-in clock timer that uses osc1 (crystal oscillator) as the source oscillator. the clock timer is configured of an 8-bit binary counter that serves as the input clock, f osc1 divided clock output from the prescaler. timer data (128?6 hz and 8? hz) can be read out by the software. figure 4.7.1.1 is the block diagram for the clock timer. 128 hz?6 hz data bus 32 hz, 8 hz, 2 hz, 1 hz 256 hz clock timer reset signal divider interrupt request interrupt control 8 hz? hz clock timer run/stop signal clock timer osc1 oscillation circuit (f osc1 ) fig. 4. 7.1.1 block diagram for the clock timer ordinarily, this clock timer is used for all types of timing functions such as clocks. 4.7.2 data reading and hold function the 8 bits timer data are allocated to the address ff79h and ff7ah. d0: tm0 = 128 hz d1: tm1 = 64 hz d2: tm2 = 32 hz d3: tm3 = 16 hz d0: tm4 = 8 hz d1: tm5 = 4 hz d2: tm6 = 2 hz d3: tm7 = 1 hz since the clock timer data has been allocated to two addresses, a carry is generated from the low-order data within the count (tm0?m3: 128?6 hz) to the high-order data (tm4?m7: 8? hz). when this carry is generated between the reading of the low-order data and the high-order data, a content combining the two does not become the correct value (the low-order data is read as ffh and the high-order data becomes the value that is counted up 1 from that point). the high-order data hold function in the s1c63808 is designed to operate to avoid this. this function temporarily stops the counting up of the high-order data (by carry from the low-order data) at the point where the low-order data has been read and consequently the time during which the high-order data is held is the shorter of the two indicated here following. 1. period until it reads the high-order data. 2. 0.48?.5 msec (varies due to the read timing.) note: since the low-order data is not held when the high-order data has previously been read, the low- order data should be read first.
46 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (clock timer) 4.7.3 interrupt function the clock timer can cause interrupts at the falling edge of 32 hz, 8 hz, 2 hz and 1 hz signals. software can set whether to mask any of these frequencies. figure 4.7.3.1 is the timing chart of the clock timer. address ff79h ff7ah 32 hz interrupt request 8 hz interrupt request 2 hz interrupt request 1 hz interrupt request bit d0 d1 d2 d3 d0 d1 d2 d3 frequency clock timer timing chart 128 hz 64 hz 32 hz 16 hz 8 hz 4 hz 2 hz 1 hz fi g. 4.7.3.1 timing chart of clock timer as shown in figure 4.7.3.1, interrupt is generated at the falling edge of the frequencies (32 hz, 8 hz, 2 hz, 1 hz). at this time, the corresponding interrupt factor flag (it0, it1, it2, it3) is set to "1". selection of whether to mask the separate interrupts can be made with the interrupt mask registers (eit0, eit1, eit2, eit3). however, regardless of the interrupt mask register setting, the interrupt factor flag is set to "1" at the falling edge of the corresponding signal.
s1c63808 technical manual epson 47 chapter 4: peripheral circuits and operation (clock timer) 4.7.4 i/o memory of clock timer t able 4.7.4.1 shows the i/o addresses and the control bits for the clock timer. t able 4.7.4.1 control bits of clock timer address comment d3 d2 register d1 d0 name init ? 1 10 wr/w r ff78h 00 tmrst tmrun 0 ? 3 0 ? 3 tmrst ? 3 tmrun ? ? 2 ? ? 2 reset 0 reset run invalid stop unused unused clock timer reset (writing) clock timer run/stop r ff79h tm3 tm2 tm1 tm0 tm3 tm2 tm1 tm0 0 0 0 0 clock timer data (16 hz) clock timer data (32 hz) clock timer data (64 hz) clock timer data (128 hz) r ff7ah tm7 tm6 tm5 tm4 tm7 tm6 tm5 tm4 0 0 0 0 clock timer data (1 hz) clock timer data (2 hz) clock timer data (4 hz) clock timer data (8 hz) ffe6h eit3 eit2 eit1 eit0 r/w eit3 eit2 eit1 eit0 0 0 0 0 enable enable enable enable mask mask mask mask interrupt mask register (clock timer 1 hz) interrupt mask register (clock timer 2 hz) interrupt mask register (clock timer 8 hz) interrupt mask register (clock timer 32 hz) fff6h it3 it2 it1 it0 r/w it3 it2 it1 it0 0 0 0 0 (r) yes (w) reset (r) no (w) invalid interrupt factor flag (clock timer 1 hz) interrupt factor flag (clock timer 2 hz) interrupt factor flag (clock timer 8 hz) interrupt factor flag (clock timer 32 hz) *1 initial value at initial reset *2 not set in the circuit *3 constantly "0" when being read tm0?m7: timer data (ff79h, ff7ah) the 128? hz timer data of the clock timer can be read out with these registers. these eight bits are read only, and writing operations are invalid. by reading the low-order data (ff79h), the high-order data (ff7ah) is held until reading or for 0.48?.5 msec (one of shorter of them). at initial reset, the timer data is initialized to "00h". tmrst: clock timer reset (ff78h?1) this bit resets the clock timer. when "1" is written: clock timer reset when "0" is written: no operation reading: always "0" the clock timer is reset by writing "1" to tmrst. when the clock timer is reset in the run status, opera- tion restarts immediately. also, in the stop status the reset data is maintained. no operation results when "0" is written to tmrst. this bit is write-only, and so is always "0" at reading. tmrun: clock timer run/stop control register (ff78h?0) controls run/stop of the clock timer. when "1" is written: run when "0" is written: stop reading: valid the clock timer enters the run status when "1" is written to the tmrun register, and the stop status when "0" is written. in the stop status, the timer data is maintained until the next run status or the timer is reset. also, when the stop status changes to the run status, the data that is maintained can be used for resuming the count. at initial reset, this register is set to "0".
48 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (clock timer) eit0: 32 hz interrupt mask register (ffe6h?0) eit1: 8 hz interrupt mask register (ffe6h?1) eit2: 2 hz interrupt mask register (ffe6h?2) eit3: 1 hz interrupt mask register (ffe6h?3) these registers are used to select whether to mask the clock timer interrupt. when "1" is written: enabled when "0" is written: masked reading: valid the interrupt mask registers (eit0, eit1, eit2, eit3) are used to select whether to mask the interrupt to the separate frequencies (32 hz, 8 hz, 2 hz, 1 hz). at initial reset, these registers are set to "0". it0: 32 hz interrupt factor flag (fff6h?0) it1: 8 hz interrupt factor flag (fff6h?1) it2: 2 hz interrupt factor flag (fff6h?2) it3: 1 hz interrupt factor flag (fff6h?3) these flags indicate the status of the clock timer interrupt. when "1" is read: interrupt has occurred when "0" is read: interrupt has not occurred when "1" is written: flag is reset when "0" is written: invalid the interrupt factor flags (it0, it1, it2, it3) correspond to the clock timer interrupts of the respective frequencies (32 hz, 8 hz, 2 hz, 1 hz). the software can judge from these flags whether there is a clock timer interrupt. however, even if the interrupt is masked, the flags are set to "1" at the falling edge of the signal. these flags are reset to "0" by writing "1" to them. after an interrupt occurs, the same interrupt will occur again if the interrupt enabled state (i flag = "1") is set or the reti instruction is executed unless the interrupt factor flag is reset. therefore, be sure to reset (write "1" to) the interrupt factor flag in the interrupt service routine before shifting to the interrupt enabled state. at initial reset, these flags are set to "0". 4.7.5 programming notes (1) be sure to read timer data in the order of low-order data (tm0?m3) then high-order data (tm4 tm7). (2) after an interrupt occurs, the same interrupt will occur again if the interrupt enabled state (i flag = "1") is set or the reti instruction is executed unless the interrupt factor flag is reset. therefore, be sure to reset (write "1" to) the interrupt factor flag in the interrupt service routine before shifting to the interrupt enabled state.
s1c63808 technical manual epson 49 chapter 4: peripheral circuits and operation (stopwatch timer) 4.8 stopwatch timer 4.8.1 configuration of stopwatch timer the s1c63808 has a 1/1,000 sec stopwatch timer. the stopwatch timer is configured of a 3-stage, 4-bit bcd counter serving as the input clock of a 1,000 hz signal output from the prescaler. data can be read out four bits (1/1,000 sec, 1/100 sec and 1/10 sec) at a time by the software. in addition it has a direct input function that controls the stopwatch timer run/stop and lap using the input ports k00 and k01. figure 4.8.1.1 is the block diagram of the stopwatch timer. data bus 1 hz interrupt request 1,000 / 1,024 prescaler f osc1 /32 (1,024 hz) 1/1,000 sec counter 1/100 sec counter 1/10 sec counter capture buffer swd0? reading swd4? reading swd8?1 reading [swrst] 10 hz interrupt request capture control circuit [swrun] [edir] [crnwf] [dkm2?] [lcurf] direct run interrupt request direct lap interrupt request (1,000 hz) direct input control [swdir] k01 k00 k02?13 fi g. 4.8.1.1 block diagram of stopwatch timer the stopwatch timer can be used as a separate timer from the clock timer. in particular, digital watch stopwatch functions can be realized easily with software. 4.8.2 counter and prescaler the stopwatch timer is configured of four-bit bcd counters swd0?, swd4? and swd8?1. the counter swd0?, at the stage preceding the stopwatch timer, has a 1,000 hz signal generated by the prescaler for the input clock. it counts up every 1/1,000 sec, and generates 100 hz signal. the counter swd4? has a 100 hz signal generated by the counter swd0? for the input clock. it count-up every 1/100 sec, and generated 10 hz signal. the counter swd8?1 has an approximated 10 hz signal gener- ated by the counter swd4? for the input clock. it count-up every 1/10 sec, and generated 1 hz signal. the prescaler inputs a 1,024 hz clock dividing f osc1 (output from the osc1 oscillation circuit), and outputs 1,000 hz counting clock for swd0?. to generate a 1,000 hz clock from 1,024 hz, 24 pulses from 1,024 pulses that are input to the prescaler every second are taken out. when the counter becomes the value indicated below, one pulse (1,024 hz) that is input immediately after to the prescaler will be pulled out. 39, 79, 139, 179, 219, 259, 299, 319, 359, 399, 439, 479, 539, 579, 619, 659, 699, 719, 759, 799, 839, 879, 939, 979
50 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (stopwatch timer) figure 4.8.2.1 shows the operation of the prescaler. prescaler input clock (1,024 hz) prescaler output clock counter data start 000 001 002 037 038 039 040 041 fi g. 4.8.2.1 timing of the prescaler operation for the above reason, the counting clock is 1,024 hz (0.9765625 msec) except during pulse correction. consequently, frequency of the prescaler output clock (1,000 hz), 100 hz generated by swd0? and 10 hz generated by swd4? are approximate values. 4.8.3 capture buffer and hold function the stopwatch data, 1/1,000 sec, 1/100 sec and 1/10 sec, can be read from swd0? (ff7dh), swd4? (ff7eh) and swd8?1 (ff7fh), respectively. the counter data are latched in the capture buffer when r eading, and are held until reading of three words is completed. for this reason, correct data can be read even when a carry from lower digits occurs during reading the three words. further, three counter data are latched in the capture buffer at the same time when swd0? (1/1,000 sec) is read. the data hold is r eleased when swd8?1 (1/10 sec) reading is completed. therefore, data should be read in order of swd0? swd4? swd8?1. if swd4? or swd8?1 is first read when data have not been held, the hold function does not work and data in the counter is directly read out. when data that has not been held is read in the stopwatch timer run status, you cannot judge whether it is correct or not. the stopwatch timer has a lap function using an external key input (explained later). the capture buffer is also used to hold lap data. in this case, data is held until swd8?1 is read. however, when a lap input is performed before completing the reading, the content of the capture buffer is renewed at that point. remaining data that have not been read become invalid by the renewal, and the hold status is not r eleased if swd8?1 is read. when swd8?1 is read after the capture buffer is updated, the capture r enewal flag is set to "1" at that point. in this case, it is necessary to read from swd0? again. the capture r enewal flag is renewed by reading swd8?1. figure 4.8.3.1 shows the timing for data holding and reading. direct lap input (k01/k00) direct lap internal signal capture renewal flag crnwf swd0? reading swd4? reading swd8?1 reading data holding fi g. 4.8.3.1 timing for data holding and reading
s1c63808 technical manual epson 51 chapter 4: peripheral circuits and operation (stopwatch timer) 4.8.4 stopwatch timer run/stop and reset run/stop control and reset of the stopwatch timer can be done by the software. stopwatch timer run/stop the stopwatch timer enters the run status when "1" is written to swrun, and the stop status when "0" is written. in the stop status, the timer data is maintained until the next run status or resets timer. also, when the stop status changes to the run status, the data that was maintained can be used for resuming the count. the run/stop operation of the stopwatch timer by writing to the swrun register is performed in synchronization with the falling edge of the 1,024 hz same as the prescaler input clock. the swrun register can be read, and in this case it indicates the operating status of the stopwatch timer. figure 4.8.4.1 shows the operating timing when controlling the swrun register. f osc1 /32 (1,024 hz) swrun writing swrun register count clock fi g. 4.8.4.1 operating timing when controlling swrun when the direct input function (explained in next section) is set, run/stop control is done by an external key input. in this case, swrun becomes read only register that indicates the operating status of the stopwatch timer. stopwatch timer reset the stopwatch timer is reset when "1" is written to swrst. with this, the counter value is cleared to "000". since this resetting does not affect the capture buffer, data that has been held in the capture buffer is not cleared and is maintained as is. when the stopwatch timer is reset in the run status, counting restarts from count "000". also, in the stop status the reset data "000" is maintained until the next run. 4.8.5 direct input function and key mask the stopwatch timer has a direct input function that can control the run/stop and lap operation of the stopwatch timer by external key input. this function is set by writing "1" to the edir register. when edir is set to "0", only the software control is possible as explained in the previous section. input port configuration in the direct input function, the input ports k00 and k01 are used as the run/stop and lap input ports. the key assignment can be selected using the swdir register. t able 4.8.5.1 run/stop and lap input ports swdir 0 1 k00 run/stop lap k01 lap run/stop direct run when the direct input function is selected, run/stop operation of the stopwatch timer can be controlled by using the key connected to the input port k00/k01 (selected by swdir). k00/k01 works as a normal input port, but the input signal is sent to the stopwatch control circuit. the key input signal from the k00/k01 port works as a toggle switch. when it is input in stop status, the stopwatch timer runs, and in run status, the stopwatch timer stops. run/stop status of the stopwatch timer can be checked by reading the swrun register. an interrupt is generated by direct run input. the sampling for key input signal is performed at the falling edge of 1,024 hz signal same as the swrun control. the chattering judgment is performed at the point where the key turns off, and a chattering less than 46.8?2.5 msec is removed. therefore, more time is needed for an interval be- tween run and stop key inputs.
52 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (stopwatch timer) figure 4.8.5.1 shows the operating timing for the direct run input. f osc1 /32 (1,024 hz) direct run input (k00/k01) direct run internal signal swrun register count clock direct run interrupt fi g. 4.8.5.1 operating timing for direct run input direct lap control for the lap can also be done by key input same as the direct run. when the direct input function is selected, the input port k01/k00 (selected by swdir) becomes the lap key input port. sampling for the input signal and the chattering judgment are the same as a direct run. by entering the lap key, the counter data at that point is latched into the capture buffer and is held. the counter continues counting operation. furthermore, an interrupt occurs by direct lap input. as stated above, the capture buffer data is held until swd8?1 is read. if the lap key is input when data has been already held, it renews the content of the capture buffer. when swd8?1 is read after r enewing, the capture renewal flag is set to "1". in this case, the hold status is not released by reading swd8?1, and it continues. normally the lap data should be read after the interrupt is generated. after that, be sure to check the capture renewal flag. when the capture renewal flag is set, renewed data is held in the capture buffer. so it is necessary to read from swd0? again. the stopwatch timer sets the 1 hz interrupt factor flag isw1 to "1" when requiring a carry-up to 1-sec digit by an swd8?1 overflow. if the capture buffer shifts into hold status (when swd0? is read or when lap is input) while the 1 hz interrupt factor flag isw1 is set to "1", the lap data carry-up r equest flag lcurf is set to "1" to indicate that a carry-up to 1-sec digit is required for the processing of lap input. in normal software processing, lap processing may take precedence over 1-sec or higher digits processing by a 1 hz interrupt, therefore carry-up processing using this flag should be used for time display in the lap processing to prevent the 1-sec digit data decreasing by 1 second. this flag is renewed when the capture buffer shifts into hold status. figure 4.8.5.2 shows the operating timing for the direct lap input, and figure 4.8.5.3 shows the timings for data holding and reading during a direct lap input and reading. f osc1 /32 (1,024 hz) direct lap input (k01/k00) direct lap internal signal data holding direct lap interrupt swd8?1 reading fi g. 4.8.5.2 operating timing for direct lap input direct lap input (k01/k00) capture renewal flag crnwf swd0? reading swd4? reading swd8?1 reading data holding 1 hz interrupt factor flag isw1 lap data carry-up request flag lcurf counter data 999 000 fi g. 4.8.5.3 timing for data holding and reading during direct lap input
s1c63808 technical manual epson 53 chapter 4: peripheral circuits and operation (stopwatch timer) key mask in stopwatch applications, some functions may be controlled by a combination of keys including direct run or direct lap. for instance, the run key can be used for other functions, such as reset and setting a watch, by pressing the run key with another key. in this case, the direct run function or direct lap function must be invalid so that it does not function. for this purpose, the key mask function is set so that it judges concurrence of input keys and invalidates run and lap functions. a combination of the key inputs for this judgment can be selected using the dkm0?km2 registers. t able 4.8.5.2 key mask selection dkm2 0 0 0 0 1 1 1 1 dkm1 0 0 1 1 0 0 1 1 dkm0 0 1 0 1 0 1 0 1 mask key combination none (at initial reset) k02 k02, k03 k02, k03, k10 k10 k10, k11 k10, k11, k12 k10, k11, k12, k13 run or lap inputs become invalid in the following status. 1. the run or lap key is pressed when one or more keys that are included in the selected combina- tion (here in after referred to as mask) are held down. 2. the run or lap key has been pressed when the mask is released. f osc1 /32 (1,024 hz) direct run/lap input key mask valid invalid invalid invalid fi g. 4.8.5.4 operation of key mask run or lap inputs become valid in the following status. 1. either the run or lap key is pressed independently if no other key is been held down. 2. both the run and lap keys are pressed at the same time if no other key is held down. (run and lap functions are effective.) 3. the run or lap key is pressed if either is held down. (run and lap functions are effective.) 4. either the run or lap key and the mask key are pressed at the same time if no other key is held down. 5. both the run and lap keys and the mask key are pressed at the same time if no other key is held down. (run and lap functions are effective.) * simultaneous key input is referred to as two or more key inputs are sampled at the same falling edge of 1,024 hz clock.
54 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (stopwatch timer) 4.8.6 interrupt function 10 hz and 1 hz interrupts the 10 hz and 1 hz interrupts can be generated through the overflow of stopwatch timers swd4? and swd8?1 respectively. also, software can set whether to separately mask the frequencies de- scribed earlier. figure 4.8.6.1 is the timing chart for the counters. 10 hz interrupt request 1 hz interrupt request ff7fh (1/10 sec bcd) ff7eh (1/100 sec bcd) d0 d1 d2 d3 d0 d1 d2 d3 address register stopwatch timer (swd0?) timing chart ff7dh (1/1,000 sec bcd) d0 d1 d2 d3 address register stopwatch timer (swd4?) timing chart address register stopwatch timer (swd8?1) timing chart fi g. 4.8.6.1 timing chart for counters as shown in figure 4.8.6.1, the interrupts are generated by the overflow of their respective counters ("9" changing to "0"). also, at this time the corresponding interrupt factor flag (isw10, isw1) is set to "1". the respective interrupts can be masked separately through the interrupt mask registers (eisw10, eisw1). however, regardless of the setting of the interrupt mask registers, the interrupt factor flags are set to "1" by the overflow of their corresponding counters.
s1c63808 technical manual epson 55 chapter 4: peripheral circuits and operation (stopwatch timer) direct run and direct lap interrupts when the direct input function is selected, the direct run and direct lap interrupts can be generated. the respective interrupts occur at the rising edge of the internal signal for direct run and direct lap after sampling the direct input signal in the falling edge of 1,024 hz signal. also, at this time the corresponding interrupt factor flag (irun, ilap) is set to "1". the respective interrupts can be masked separately through the interrupt mask registers (eirun, eilap). however, regardless of the setting of the interrupt mask registers, the interrupt factor flags are set to "1" by the inputs of the run and lap. the direct run and lap functions use the k00 and k01 ports. therefore, the direct input interrupt and the k00?03 inputs interrupt may generate at the same time depending on the interrupt condi- tion setting for the input port k00?03. consequently, when using the direct input interrupt, set the interrupt selection registers sik00 and sik01 to "0" so that the input interrupt does not generate by k00 and k01 inputs. f osc1 /32 (1,024 hz) swrst writing edir writing edir register direct run input swrun writing swrun register direct lap input counter data capture buffer swd0? reading swd4? reading swd8?1 reading crnwf 1 hz interrupt factor flag isw1 lcurf direct run interrupt direct lap interrupt 10 hz interrupt 1 hz interrupt 001 002 003 004 005 006 098 099 100 101 102 000 001 002 003 004 005 006 007 993 994 000 995 996 997 998 999 000 001 002 003 004 005 006 007 003 005 995 001 006 fi g. 4.8.6.2 timing chart for stopwatch timer
56 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (stopwatch timer) 4.8.7 i/o memory of stopwatch timer t able 4.8.7.1 shows the i/o addresses and the control bits for the stopwatch timer. t able 4.8.7.1 control bits of stopwatch timer address comment d3 d2 register d1 d0 name init ? 1 10 ff06h foute swdir fofq1 fofq0 r/w foute swdir fofq1 fofq0 0 0 0 0 enable disable fout output enable stopwatch direct input switch 0: k00=run/stop, k01=lap 1: k00=lap, k01=run/stop fout frequency selection 0 f osc1 /64 1 f osc1 /8 2 f osc1 3 f osc3 [fofq1, 0] frequency swd7 swd6 swd5 swd4 0 0 0 0 stopwatch timer data bcd (1/100 sec) r ff7eh swd7 swd6 swd5 swd4 swd11 swd10 swd9 swd8 0 0 0 0 stopwatch timer data bcd (1/10 sec) r ff7fh swd11 swd10 swd9 swd8 r ff7dh swd3 swd2 swd1 swd0 swd3 swd2 swd1 swd0 0 0 0 0 stopwatch timer data bcd (1/1000 sec) 0 none 1 k02 2 k02?3 3 k02?3,10 [dkm2, 1, 0] key mask 4 k10 5 k10?1 6 k10?2 7 k10?3 [dkm2, 1, 0] key mask r/w ff7bh edir dkm2 dkm1 dkm0 edir dkm2 dkm1 dkm0 0 0 0 0 enable disable direct input enable key mask selection r/w w r ff7ch lcurf crnwf swrun swrst lcurf crnwf swrun swrst ? 3 0 0 0 reset request renewal run reset no no stop invalid lap data carry-up request flag capture renewal flag stopwatch timer run/stop stopwatch timer reset (writing) ffe8h eirun eilap eisw1 eisw10 r/w eirun eilap eisw1 eisw10 0 0 0 0 enable enable enable enable mask mask mask mask interrupt mask register (stopwatch direct run) interrupt mask register (stopwatch direct lap) interrupt mask register (stopwatch timer 1 hz) interrupt mask register (stopwatch timer 10 hz) fff8h irun ilap isw1 isw10 r/w irun ilap isw1 isw10 0 0 0 0 (r) yes (w) reset (r) no (w) invalid interrupt factor flag (stopwatch direct run) interrupt factor flag (stopwatch direct lap) interrupt factor flag (stopwatch timer 1 hz) interrupt factor flag (stopwatch timer 10 hz) *1 initial value at initial reset *2 not set in the circuit *3 constantly "0" when being read swd0?wd3: stopwatch timer data 1/1,000 sec (ff7dh) data (bcd) of the 1/1,000 sec column of the capture buffer can be read out. the hold function of the capture buffer works by reading this data. these 4 bits are read-only, and cannot be used for writing operations. at initial reset, the timer data is set to "0". swd4?wd7: stopwatch timer data 1/100 sec (ff7eh) data (bcd) of the 1/100 sec column of the capture buffer can be read out. these 4 bits are read-only, and cannot be used for writing operations. at initial reset, the timer data is set to "0". swd8?wd11: stopwatch timer data 1/10 sec (ff7fh) data (bcd) of the 1/10 sec column of the capture buffer can be read out. these 4 bits are read-only, and cannot be used for writing operations. at initial reset, the timer data is set to "0". note: be sure to data reading in the order of swd0? swd4? swd8?1.
s1c63808 technical manual epson 57 chapter 4: peripheral circuits and operation (stopwatch timer) edir: direct input function enable register (ff7bh?3) enables the direct input (run/lap) function. when "1" is written: enabled when "0" is written: disabled reading: valid the direct input function is enabled by writing "1" to edir, and then run/stop and lap control can be done by external key input. when "0" is written, the direct input function is disabled, and the stopwatch timer is controlled by the software only. further the function switching is actually done by synchronizing with the falling edge of f osc1 /32 (1,024 hz) after the data is written to this register (after 977 ?ec maximum). at initial reset, this register is set to "0". swdir: direct input switch register (ff06h?2) switches the direct-input key assignment for the k00 and k01 ports. when "1" is written: k00 = lap, k01 = run/stop when "0" is written: k00 = run/stop, k01 = lap reading: valid the direct-input key assignment is selected using this register. the k00 and k01 port statuses are input to the stopwatch timer as the run/stop and lap inputs according to this selection. at initial reset, this register is set to "0". dkm0?km2: direct key mask selection register (ff7bh?0?2) selects a combination of the key inputs for concurrence judgment with run and lap inputs when the direct input function is set. t able 4.8.7.2 key mask selection dkm2 0 0 0 0 1 1 1 1 dkm1 0 0 1 1 0 0 1 1 dkm0 0 1 0 1 0 1 0 1 mask key combination none (at initial reset) k02 k02, k03 k02, k03, k10 k10 k10, k11 k10, k11, k12 k10, k11, k12, k13 when the concurrence is detected, run and lap inputs cannot be accepted until the concurrence is r eleased. at initial reset, this register is set to "0". swrst: stopwatch timer reset (ff7ch?0) this bit resets the stopwatch timer. when "1" is written: stopwatch timer reset when "0" is written: no operation reading: always "0" the stopwatch timer is reset when "1" is written to swrst. when the stopwatch timer is reset in the run status, operation restarts immediately. also, in the stop status the reset data is maintained. since this reset does not affect the capture buffer, the capture buffer data in hold status is not cleared and is maintained. this bit is write-only, and is always "0" at reading.
58 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (stopwatch timer) swrun: stopwatch timer run/stop (ff7ch?1) this register controls the run/stop of the stopwatch timer, and the operating status can be monitored by reading this register. ?when writing data when "1" is written: run when "0" is written: stop the stopwatch timer enters the run status when "1" is written to swrun, and the stop status when "0" is written. in the stop status, the timer data is maintained until the next run status or resets timer. also, when the stop status changes to the run status, the data that was maintained can be used for resuming the count. run/stop control with this register is valid only when the direct input function is set to disable. when the direct input function is set, it becomes invalid. ?when reading data when "1" is read: run when "0" is read: stop reading is always valid regardless of the direct input function setting. "1" is read when the stopwatch timer is in the run status, and "0" is read in the stop status. at initial reset, this register is set to "0". lcurf: lap data carry-up request flag (ff7ch?3) this flag indicates a carry that has been generated to 1 sec-digit when the data is held. note that this flag is invalid when the direct input function is disabled. when "1" is read: carry is required when "0" is read: carry is not required w riting: invalid if the capture buffer shifts into hold status while the 1 hz interrupt factor flag isw1 is set to "1", lcurf is set to "1" to indicate that a carry-up to 1-sec digit is required. when performing a processing such as a lap input preceding with 1 hz interrupt processing, read this flag before processing and check whether carry-up is needed or not. this flag is renewed (set/reset) every time the capture buffer shifts into hold status. at initial reset, this flag is set to "0". crnwf: capture renewal flag (ff7ch?2) this flag indicates that the content of the capture buffer has been renewed. when "1" is read: renewed when "0" is read: not renewed w riting: invalid the content of the capture buffer is renewed if the lap key is input when the data held into the capture buffer has not yet been read. reading swd8?1 in that status sets this flag to "1", and the hold status is maintained. consequently, when data that is held by a lap input is read, read this flag after reading the swd8?1 and check whether the data has been renewed or not. this flag is renewed when swd8?1 is read. at initial reset, this flag is set to "0". eirun, eilap, eisw1, eisw10: interrupt mask registers (ffe8h) these registers are used to select whether to mask the stopwatch timer interrupt. when "1" is written: enabled when "0" is written: masked reading: valid the interrupt mask registers eirun, eilap, eisw1 and eisw10 are used to separately select whether to mask the direct run, direct lap, 1 hz and 10 hz interrupts. at initial reset, these registers are set to "0".
s1c63808 technical manual epson 59 chapter 4: peripheral circuits and operation (stopwatch timer) irun, ilap, isw1, isw10: interrupt factor flags (fff8h) these flags indicate the status of the stopwatch timer interrupt. when "1" is read: interrupt has occurred when "0" is read: interrupt has not occurred when "1" is written: flag is reset when "0" is written: invalid the interrupt factor flags irun, ilap, isw1 and isw10 correspond to the direct run, direct lap, 1 hz and 10 hz interrupts respectively. the software can judge from these flags whether there is a stopwatch timer interrupt. however, even if the interrupt is masked, the flags are set to "1" when the timing condi- tion is established. these flags are reset to "0" by writing "1" to them. after an interrupt occurs, the same interrupt will occur again if the interrupt enabled state (i flag = "1") is set or the reti instruction is executed unless the interrupt factor flag is reset. therefore, be sure to reset (write "1" to) the interrupt factor flag in the interrupt service routine before shifting to the interrupt enabled state. at initial reset, these flags are set to "0". 4.8.8 programming notes (1) the interrupt factor flag should be reset after resetting the stopwatch timer. (2) be sure to data reading in the order of swd0? swd4? swd8?1. (3) when data that is held by a lap input is read, read the capture buffer renewal flag crnwf after r eading the swd8?1 and check whether the data has been renewed or not. (4) when performing a processing such as a lap input preceding with 1 hz interrupt processing, read the lap data carry-up request flag lcurf before processing and check whether carry-up is needed or not. (5) after an interrupt occurs, the same interrupt will occur again if the interrupt enabled state (i flag = "1") is set or the reti instruction is executed unless the interrupt factor flag is reset. therefore, be sure to reset (write "1" to) the interrupt factor flag in the interrupt service routine before shifting to the interrupt enabled state.
60 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (programmable timer) 4.9 programmable timer 4.9.1 configuration of programmable timer the s1c63808 has two 8-bit programmable timer systems (timer 0 and timer 1) built-in. the timers are composed of 8-bit presettable down counters and they can be used as 8 bits 2 channels or 16 bits 1 channel of programmable timers. timer 0 also has an event counter function using the k13 input port terminal. figure 4.9.1.1 shows the configuration of the programmable timer. the programmable timer is designed to count down from the initial value set in the counter with soft- ware. an underflow according to the initial value occurs by counting down and is used for the following functions: presetting the initial value to the counter to generate the periodical underflow signal generating an interrupt generating a tout signal output from the r02 output port terminal generating the synchronous clock source for the serial interface (timer 1 underflow is used, and it is possible to set the transfer rate) reload data register rld00?ld07 data buffer ptd00?td07 ptrun0 fcsel plpol timer 0 ptps00 ptps01 8-bit down counter prescaler selector cksel0 timer 0 run/stop clock control circuit timer function setting pulse polarity setting prescaler setting under- flow signal data bus interrupt request chsel0 tout (r02) serial interface selector cksel1 mod16 timer 1 run/stop ptrst0 timer 0 reset 2,048 hz divider osc3 oscillation circuit interrupt control circuit osc1 oscillation circuit f osc3 f osc1 1/2 ptout selector output port r02 data buffer ptd10?td17 timer 1 ptps10 ptps11 8-bit down counter prescaler selector prescaler setting under- flow signal ptrst1 timer 1 reset 16-bit mode selection reload data register rld10?ld17 1/2 ptrun1 input port k13 evcnt event counter mode setting k13 clock control circuit fi g. 4.9.1.1 configuration of programmable timer note: if the tout terminal is used to drive an external component that consumes a large amount of current such as a bipolar transistor, design the pattern of traces on the printed circuit board so that the operation of the external component does not affect the ic power supply. refer to in section 5.3, "precautions on mounting", for more information.
s1c63808 technical manual epson 61 chapter 4: peripheral circuits and operation (programmable timer) 4.9.2 basic count operation this section explains the basic count operation when each timer is used as an individual 8-bit timer. each timer has an 8-bit down counter and an 8-bit reload data register. the reload data register rldx0?ldx7 (x = timer number) is used to set the initial value to the down counter. by writing "1" to the timer reset bit ptrstx, the down counter loads the initial value set in the reload r egister. therefore, down-counting is executed from the stored initial value by the input clock. the ptrunx register is provided to control the run/stop for each timer. by writing "1" to this register after presetting the reload data to the down counter, the down counter starts counting down. writing "0" stops the input count clock and the down counter stops counting. this control (run/stop) does not affect the counter data. the counter maintains its data while stopped, and can restart counting continuing from that data. the counter data can be read via the data buffer ptdx0?tdx7 in optional timing. however, the counter has the data hold function the same as the clock timer, that holds the high-order data (ptdx4?tdx7) when the low-order data (ptdx0?tdx3) is read in order to prevent the borrowing operation between low- and high-order reading, therefore be sure to read the low-order data first. the counter reloads the initial value set in the reload data register when an underflow occurs through the count down. it continues counting down from the initial value after reloading. in addition to reloading the counter, this underflow signal controls the interrupt generation, pulse (tout signal) output and clock supplying to the serial interface. ptrunx ptrstx rldx0?7 input clock ptdx7 ptdx6 ptdx5 ptdx4 ptdx3 ptdx2 ptdx1 ptdx0 a6h f3h preset reload & interrupt generation fi g. 4.9.2.1 basic operation timing of down counter
62 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (programmable timer) 4.9.3 setting the input clock a prescaler is provided for each timer. the prescaler generates the input clock for the timer by dividing the source clock supplied from the osc1 or osc3 oscillation circuit. the source clock (osc1 or osc3) and the division ratio of the prescaler can be selected with software for each timer individually. the input clock is set in the following sequence. selection of source clock select the source clock input to each prescaler from either osc1 or osc3. this selection is done using the source clock selection register ckselx; when "0" is written to the register, osc1 is selected and when "1" is written, osc3 is selected. when the osc3 oscillation clock is selected for the clock source, it is necessary to turn the osc3 oscillation on, prior to using the programmable timer. however the osc3 oscillation circuit requires a time at least 5 msec from turning the circuit on until the oscillation stabilizes. therefore, allow an adequate interval from turning the osc3 oscillation circuit on to starting the programmable timer. refer to section 4.3, "oscillation circuit", for the control and notes of the osc3 oscillation circuit. at initial reset, the osc3 oscillation circuit is set in off state. selection of prescaler division ratio select the division ratio for each prescaler from among 4 types. this selection is done using the prescaler division ratio selection register ptpsx0/ptpsx1. table 4.9.3.1 shows the correspondence between the setting value and the division ratio. t able 4.9.3.1 selection of prescaler division ratio ptpsx1 1 1 0 0 ptpsx0 1 0 1 0 prescaler division ratio source clock / 256 source clock / 32 source clock / 4 source clock / 1 by writing "1" to the ptrunx register, the prescaler inputs the source clock and outputs the clock divided by the selected division ratio. the counter starts counting down by inputting the clock. 4.9.4 event counter mode (timer 0) ti mer 0 has an event counter function that counts an external clock input to the input port k13. this function is selected by writing "1" to timer 0 counter mode selection register evcnt. at initial reset, evcnt is set to "0" and timer 0 is configured as a normal timer that counts the internal clock. in the event counter mode, the clock is supplied to timer 0 from outside the ic, therefore, the settings of the timer 0 prescaler division ratio selection register ptps00?tps01 and the settings of the timer 0 source clock selection register cksel0 become invalid. count down timing can be selected from either the falling or rising edge of the input clock using the timer 0 pulse polarity selection register plpol. when "0" is written to the plpol register, the falling edge is selected, and when "1" is written, the rising edge is selected. the count down timing is shown in figure 4.9.4.1. k13 input count data n n-1 n-2 n-3 n-4 n-5 n-6 plpol evcnt 01 1 ptrun0 fi g. 4.9.4.1 timing chart in event counter mode
s1c63808 technical manual epson 63 chapter 4: peripheral circuits and operation (programmable timer) the event counter mode also allows use of a noise reject function to eliminate noise such as chattering on the external clock (k13 input signal). this function is selected by writing "1" to the timer 0 function selection register fcsel. when "with noise rejector" is selected, an input pulse width for both low and high levels must be 0.98 msec ? or more to count reliably. the noise rejector allows the counter to input the clock at the second falling edge of the internal 2,048 hz ? signal after changing the input level of the k13 input port terminal. consequently, the pulse width of noise that can reliably be rejected is 0.48 msec ? or less. ( ? : f osc1 = 32.768 khz) figure 4.9.4.2 shows the count down timing with noise rejector. counter input clock ? 2 counter data n n-1 n-2 n-3 evin input (k13) 2,048 hz ? 1 ? 1 when f osc1 is 32.768 khz ? 2 when plpol register is set to "0" fi g. 4.9.4.2 count down timing with noise rejector the operation of the event counter mode is the same as the normal timer except it uses the k13 input as the clock. refer to section 4.9.2, "basic count operation" for basic operation and control. 4.9.5 16-bit timer (timer 0 + timer 1) ti mers 0 and 1 can be used as a 16-bit timer. to use the 16-bit timer, write "1" to the timer 0 16-bit mode selection register mod16. the 16-bit timer is configured with timer 0 for low-order byte and timer 1 for high-order byte as shown in figure 4.9.5.1. reload data register rld00?ld07 data buffer ptd00?td07 ptrun0 fcsel plpol timer 0 + timer 1 timer 0 timer 1 ptps00 ptps01 8-bit down counter 8-bit down counter prescaler selector cksel0 timer 0 run/stop clock control circuit timer function setting pulse polarity setting prescaler setting under- flow signal data bus interrupt tout ptrst0 timer 0 reset low-order 8 bits high-order 8 bits data buffer ptd10?td17 divider osc3 oscillation circuit osc1 oscillation circuit f osc3 f osc1 reload data register rld10?ld17 input port k13 evcnt event counter mode setting k13 fi g. 4.9.5.1 configuration of 16-bit timer the registers for timer 0 are used to control the timer. thus the event counter function can also be used. ti mer 1 operates with the timer 0 underflow signal as the count clock, so the clock and run/stop control registers for timer 1 become invalid. the counter data in 16-bit mode must be read in the order below. ptd00?td03 ptd04?dt07 ptd10?td13 ptd14?td17
64 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (programmable timer) 4.9.6 interrupt function the programmable timer can generate an interrupt due to an underflow of each timer. see figure 4.9.2.1 for the interrupt timing. an underflow of timer x sets the corresponding interrupt factor flag iptx to "1", and generates an inter- rupt. the interrupt can also be masked by setting the corresponding interrupt mask register eiptx. however, the interrupt factor flag is set to "1" by an underflow of the corresponding timer regardless of the interrupt mask register setting. when timers 0 and 1 are used as a 16-bit timer, an interrupt is generated by an underflow of timer 1. in this case, ipt0 is not set to "1" by a timer 0 underflow. 4.9.7 control of tout output the programmable timer can generate a tout signal due to an underflow of a timer. the tout signal is generated by dividing the underflows in 1/2. it is possible to select which timer's underflow is to be used by the tout output channel selection register chsel0. t able 4.9.7.1 selecting a timer for tout output chsel0 1 0 tout output timer timer 1 timer 0 select timer 1 when generating the tout signal from the 16-bit timer output. the tout signal can be output from the r02 output port terminal. programmable clocks can be supplied to external devices. figure 4.9.7.1 shows the configuration of the output port r02. data bus register ptout register r02 tout r02 (tout) register r02hiz fi g. 4.9.7.1 configuration of r02 the output of a tout signal is controlled by the ptout register. when "1" is written to the ptout r egister, the tout signal is output from the r02 output port terminal and when "0" is written, the terminal goes to a high (v dd ) level. however, the data register r02 must always be "1" and the high impedance control register r02hiz must always be "0" (data output state). since the tout signal is generated asynchronously from the ptout register, a hazard within 1/2 cycle is generated when the signal is turned on and off by setting the register. figure 4.9.7.2 shows the output waveform of the tout signal. r02hiz register r02 register ptout register tout output fix at "0" fix at "1" "1" "0" "0" fi g. 4.9.7.2 output waveform of the tout signal
s1c63808 technical manual epson 65 chapter 4: peripheral circuits and operation (programmable timer) 4.9.8 transfer rate setting for serial interface the signal that is made from underflows of timer 2 by dividing them in 1/2, can be used as the clock source for the serial interface. the programmable timer outputs the clock to the serial interface by setting timer 1 into run state (ptrun1 = "1", or ptrun0 = "1" in 16-bit mode). it is not necessary to control with the ptout register. ptrunx timer 1 underflow source clock for serial i/f fi g. 4.9.8.1 synchronous clock of serial interface a setting value for the rld1x register according to a transfer rate is calculated by the following expres- sion: rld1x = fosc / (32 ? bps ? division ratio of the prescaler) - 1 f osc :o scillation frequency (osc1/osc3) bps :t ransfer rate (00h can be set to rld1x) be aware that the maximum clock frequency for the serial interface is limited to 2 mhz when osc3 is used as the clock source.
66 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (programmable timer) 4.9.9 i/o memory of programmable timer t able 4.9.9.1 shows the i/o addresses and the control bits for the programmable timer. t able 4.9.9.1 control bits of programmable timer address comment d3 d2 register d1 d0 name init ? 1 10 mod16 evcnt fcsel plpol 0 0 0 0 16 bits event ct. with nr 8 bits timer no nr 16-bit mode selection timer 0 counter mode selection timer 0 function selection (for event counter mode) timer 0 pulse polarity selection (for event counter mode) r/w ffc0h mod16 evcnt fcsel plpol ptps01 ptps00 ptrst0 ? 3 ptrun0 0 0 ? ? 2 0 reset run invalid stop prescaler 0 division ratio selection timer 0 reset (reload) timer 0 run/stop wr/w r/w ffc2h ptps01 ptps00 ptrst0 ptrun0 0 1/1 1 1/4 2 1/32 3 1/256 [ptps01, 00] division ratio chsel0 ptout cksel1 cksel0 0 0 0 0 timer 1 on osc3 osc3 timer 0 off osc1 osc1 tout output selection tout output control prescaler 1 source clock selection prescaler 0 source clock selection r/w ffc1h chsel0 ptout cksel1 cksel0 ptps11 ptps10 ptrst1 ? 3 ptrun1 0 0 ? ? 2 0 reset run invalid stop prescaler 1 division ratio selection timer 1 reset (reload) timer 1 run/stop wr/w r/w ffc3h ptps11 ptps10 ptrst1 ptrun1 0 1/1 1 1/4 2 1/32 3 1/256 [ptps11, 10] division ratio rld03 rld02 rld01 rld00 0 0 0 0 msb programmable timer 0 reload data (low-order 4 bits) lsb r/w ffc4h rld17 rld16 rld15 rld14 0 0 0 0 msb programmable timer 1 reload data (high-order 4 bits) lsb r/w ffc7h rld17 rld16 rld15 rld14 ptd03 ptd02 ptd01 ptd00 0 0 0 0 msb programmable timer 0 data (low-order 4 bits) lsb r ffc8h ptd03 ptd02 ptd01 ptd00 ptd07 ptd06 ptd05 ptd04 0 0 0 0 msb programmable timer 0 data (high-order 4 bits) lsb r ffc9h ptd07 ptd06 ptd05 ptd04 ptd13 ptd12 ptd11 ptd10 0 0 0 0 msb programmable timer 1 data (low-order 4 bits) lsb r ffcah ptd13 ptd12 ptd11 ptd10 ptd17 ptd16 ptd15 ptd14 0 0 0 0 msb programmable timer 1 data (high-order 4 bits) lsb r ffcbh ptd17 ptd16 ptd15 ptd14 rld13 rld12 rld11 rld10 0 0 0 0 msb programmable timer 1 reload data (low-order 4 bits) lsb r/w ffc6h rld13 rld12 rld11 rld10 rld07 rld06 rld05 rld04 0 0 0 0 msb programmable timer 0 reload data (high-order 4 bits) lsb r/w ffc5h rld07 rld06 rld05 rld04 rld03 rld02 rld01 rld00 ffe2h 00ei pt1 eipt0 rr/w 0 ? 3 0 ? 3 eipt1 eipt0 ? ? 2 ? ? 2 0 0 enable enable mask mask unused unused interrupt mask register (programmable timer 1) interrupt mask register (programmable timer 0) fff2h 00i pt1 ipt0 rr/w 0 ? 3 0 ? 3 ipt1 ipt0 ? ? 2 ? ? 2 0 0 (r) yes (w) reset (r) no (w) invalid unused unused interrupt factor flag (programmable timer 1) interrupt factor flag (programmable timer 0) *1 initial value at initial reset *3 constantly "0" when being read *2 not set in the circuit
s1c63808 technical manual epson 67 chapter 4: peripheral circuits and operation (programmable timer) cksel0: prescaler 0 source clock selection register (ffc1h?0) cksel1: prescaler 1 source clock selection register (ffc1h?1) selects the source clock of the prescaler. when "1" is written: osc3 clock when "0" is written: osc1 clock reading: valid the source clock for the prescaler is selected from osc1 or osc3. when "0" is written to the ckselx r egister, the osc1 clock is selected as the input clock for the prescaler x (for timer x) and when "1" is written, the osc3 clock is selected. when the event counter mode is selected for timer 0, the setting of cksel0 becomes invalid. when timers 0 and 1 are used as a 16-bit timer, the setting of cksel1 becomes invalid. at initial reset, these registers are set to "0". ptps00, ptps01: timer 0 prescaler division ratio selection register (ffc2h?2, d3) ptps10, ptps11: timer 1 prescaler division ratio selection register (ffc3h?2, d3) sets the division ratio of the prescaler as shown in table 4.9.9.2. t able 4.9.9.2 selection of prescaler division ratio ptpsx1 1 1 0 0 ptpsx0 1 0 1 0 prescaler division ratio source clock / 256 source clock / 32 source clock / 4 source clock / 1 when the event counter mode is selected to timer 0, the setting of ptps00 and ptps01 becomes invalid. when timers 0 and 1 are used as a 16-bit timer, the setting of ptps10 and ptps11 becomes invalid. at initial reset, these registers are set to "0". mod16: 16-bit mode selection register (ffc0h?3) selects whether timers 0 and 1 are used as a 16-bit timer or 2 channels of 8-bit timer. when "1" is written: 16-bit timer when "0" is written: 8-bit timer reading: valid when "1" is written to mod16, a 16-bit timer is configured with timer 0 for low-order byte and timer 1 for high-order byte. use the timer 0 registers for control. when "0" is written to mod16, timer 0 and timer 1 are used as independent 8-bit timers. at initial reset, this register is set to "0". evcnt: timer 0 counter mode selection register (ffc0h?2) selects a counter mode for timer 0. when "1" is written: event counter mode when "0" is written: timer mode reading: valid the counter mode for timer 0 is selected from either the event counter mode or timer mode. when "1" is written to the evcnt register, the event counter mode is selected and when "0" is written, the timer mode is selected. at initial reset, this register is set to "0".
68 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (programmable timer) fcsel: timer 0 function selection register (ffc0h?1) selects whether the noise rejector of the clock input circuit will be used or not in the event counter mode. when "1" is written: with noise rejector when "0" is written: without noise rejector reading: valid when "1" is written to the fcsel register, the noise rejector is used and counting is done by an external clock (k13) with 0.98 msec * or more pulse width. the noise rejector allows the counter to input the clock at the second falling edge of the internal 2,048 hz * signal after changing the input level of the k13 input port terminal. consequently, the pulse width of noise that can reliably be rejected is 0.48 msec * or less. ( ? : f osc1 = 32.768 khz) when "0" is written to the fcsel register, the noise rejector is not used and the counting is done directly by an external clock input to the k13 input port terminal. setting of this register is effective only when timer 0 is used in the event counter mode. at initial reset, this register is set to "0". plpol: timer 0 pulse polarity selection register (ffc0h?0) selects the count pulse polarity in the event counter mode. when "1" is written: rising edge when "0" is written: falling edge reading: valid the count timing in the event counter mode (timer 0) is selected from either the falling edge of the external clock input to the k13 input port terminal or the rising edge. when "0" is written to the plpol r egister, the falling edge is selected and when "1" is written, the rising edge is selected. setting of this register is effective only when timer 0 is used in the event counter mode. at initial reset, this register is set to "0". rld00?ld07: timer 0 reload data register (ffc4h, ffc5h) rld10?ld17: timer 1 reload data register (ffc6h, ffc7h) sets the initial value for the counter. the reload data written in this register is loaded to the respective counters. the counter counts down using the data as the initial value for counting. reload data is loaded to the counter when the counter is reset by writing "1" to the ptrstx register, or when counter underflow occurs. at initial reset, these registers are set to "00h". ptd00?td07: timer 0 counter data (ffc8h, ffc9h) ptd10?td17: timer 1 counter data (ffcah, ffcbh) count data in the programmable timer can be read from these latches. the low-order 4 bits of the count data in timer x can be read from ptdx0?tdx3, and the high-order data can be read from ptdx4?tdx7. since the high-order 4 bits are held by reading the low-order 4 bits, be sure to read the low-order 4 bits first. since these latches are exclusively for reading, the writing operation is invalid. at initial reset, these counter data are set to "00h".
s1c63808 technical manual epson 69 chapter 4: peripheral circuits and operation (programmable timer) ptrst0: timer 0 reset (reload) (ffc2h?1) ptrst1: timer 1 reset (reload) (ffc3h?1) resets the timer and presets reload data to the counter. when "1" is written: reset when "0" is written: no operation reading: always "0" by writing "1" to ptrstx, the reload data in the reload register rldx0?ldx7 is preset to the counter in timer x. when the counter is preset in the run status, the counter restarts immediately after presetting. in the case of stop status, the reload data is preset to the counter and is maintained. no operation results when "0" is written. since these bits are exclusively for writing, always set to "0" during reading. ptrun0: timer 0 run/stop control register (ffc2h?0) ptrun1: timer 1 run/stop control register (ffc3h?0) controls the run/stop of the counter. when "1" is written: run when "0" is written: stop reading: valid the counter in timer x starts counting down by writing "1" to the ptrunx register and stops by writing "0". in stop status, the counter data is maintained until the counter is reset or is set in the next run status. when stop status changes to run status, the data that has been maintained can be used for r esuming the count. at initial reset, these registers are set to "0". chsel0: tout output channel selection register (ffc1h?3) selects the channel used for tout signal output. when "1" is written: timer 1 when "0" is written: timer 0 reading: valid this register selects which timer's output (timer 0 or timer 1) is used to generate a tout signal. when "0" is written to the chsel0 register, timer 0 is selected and when "1" is written, timer 1 is selected. in the 16- bit mode (mod16 = "1"), timer 1 is always selected regardless of this register setting. at initial reset, this register is set to "0". ptout: tout output control register (ffc1h?2) t urns tout signal output on and off. when "1" is written: on when "0" is written: off reading: valid ptout is the output control register for the tout signal. when "1" is written to the register, the tout signal is output from the output port terminal r02 and when "0" is written, the terminal goes to a high (v dd ) level. however, the data register r02 must always be "1" and the high impedance control register r02hiz must always be "0" (data output state). at initial reset, this register is set to "0".
70 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (programmable timer) eipt0: timer 0 interrupt mask register (ffe2h?0) eipt1: timer 1 interrupt mask register (ffe2h?1) these registers are used to select whether to mask the programmable timer interrupt or not. when "1" is written: enabled when "0" is written: masked reading: valid the timer x interrupt can be masked individually by the interrupt mask registers eiptx. at initial reset, these registers are set to "0". ipt0: timer 0 interrupt factor flag (fff2h?0) ipt1: timer 1 interrupt factor flag (fff2h?1) these flags indicate the status of the programmable timer interrupt. when "1" is read: interrupt has occurred when "0" is read: interrupt has not occurred when "1" is written: flag is reset when "0" is written: invalid the interrupt factor flags iptx correspond to the timer x interrupt. the software can judge from these flags whether there is a programmable timer interrupt. however, even if the interrupt is masked, the flags are set to "1" by the underflows of the corresponding counters. these flags are reset to "0" by writing "1" to them. after an interrupt occurs, the same interrupt will occur again if the interrupt enabled state (i flag = "1") is set or the reti instruction is executed unless the interrupt factor flag is reset. therefore, be sure to reset (write "1" to) the interrupt factor flag in the interrupt service routine before shifting to the interrupt enabled state. at initial reset, these flags are set to "0".
s1c63808 technical manual epson 71 chapter 4: peripheral circuits and operation (programmable timer) 4.9.10 programming notes (1) when reading counter data, be sure to read the low-order 4 bits (ptdx0?tdx3) first. furthermore, the high-order 4 bits (ptdx4?tdx7) should be read within 0.73 msec (when f osc1 is 32.768 khz) of r eading the low-order 4 bits (ptdx0?tdx3). the counter data in 16-bit mode must be read in the order below. ptd00?td03 ptd04?dt07 ptd10?td13 ptd14?td17 (2) the programmable timer actually enters run/stop status in synchronization with the falling edge of the input clock after writing to the ptrunx register. consequently, when "0" is written to the ptrunx register, the timer enters stop status at the point where the counter is decremented (-1). the ptrunx register maintains "1" for reading until the timer actually stops. figure 4.9.10.1 shows the timing chart for the run/stop control. ptrunx (wr) ptdx0?tdx7 42h 41h 40h 3fh 3eh 3dh ptrunx (rd) input clock "1" (run) writing "0" (stop) writing fi g. 4.9.10.1 timing chart for run/stop control it is the same even in the event counter mode. therefore, be aware that the counter does not enter run/stop status if a clock is not input after setting the run/stop control register (ptrun0). (3) since the tout signal is generated asynchronously from the ptout register, a hazard within 1/2 cycle is generated when the signal is turned on and off by setting the register. (4) when the osc3 oscillation clock is selected for the clock source, it is necessary to turn the osc3 oscillation on, prior to using the programmable timer. however the osc3 oscillation circuit requires a time at least 5 msec from turning the circuit on until the oscillation stabilizes. therefore, allow an adequate interval from turning the osc3 oscillation circuit on to starting the programmable timer. refer to section 4.3, "oscillation circuit", for the control and notes of the osc3 oscillation circuit. at initial reset, the osc3 oscillation circuit is set in the off state. (5) after an interrupt occurs, the same interrupt will occur again if the interrupt enabled state (i flag = "1") is set or the reti instruction is executed unless the interrupt factor flag is reset. therefore, be sure to reset (write "1" to) the interrupt factor flag in the interrupt service routine before shifting to the interrupt enabled state. (6) for the reason below, pay attention to the reload data write timing when changing the interval of the programmable timer interrupts while the programmable timer is running. the programmable timer counts down at the falling edge of the input clock and at the same time it generates an interrupt if the counter underflows. then it starts loading the reload data to the counter and the counter data is determined at the next rising edge of the input clock (period shown in as ? in the figure). input clock counter data (continuous mode) (reload data = 25h) 03h 02h 01h 00h 25h 24h counter data is determined by reloading. underflow (interrupt is generated) ? fi g. 4.9.10.2 reload timing for programmable timer to avoid improper reloading, do not rewrite the reload data after an interrupt occurs until the counter data is determined including the reloading period ? . be especially careful when using the osc1 (low- speed clock) as the clock source of the programmable timer and the cpu is operating with the osc3 (high-speed clock).
72 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (serial interface) 4.10 serial interface 4.10.1 configuration of serial interface the s1c63808 incorporates two channels of full duplex serial interface ports (when asynchronous system is selected) that allows the user to select either clock synchronous system or asynchronous system. the data transfer method can be selected in software. when the clock synchronous system is selected, 8-bit data transfer is possible. when the asynchronous system is selected, either 7-bit or 8-bit data transfer is possible, and a parity check of received data and the addition of a parity bit for transmitting data can automatically be done by selecting in software. figure 4.10.1.1 shows the configuration of the serial interface. f osc3 data bus soutx serial i/o control & status register received data buffer interrupt control circuit serial input control circuit received data shift register transmitting data shift register serial output control circuit sinx clock control circuit ready output control circuit sclkx or sclkx error detection circuit srdyx or srdyx start bit detection circuit programmable timer 1 underflow signal interrupt request osc3 oscillation circuit fi g. 4.10.1.1 configuration of serial interface note: channels 1 and 2 of the serial interface are precisely identical, and the signal and register names are identified by the channel number (1 or 2) attached (e.g. the sin1 terminal is for channel 1 and sin2 terminal is for channel 2). this section explains the serial interface functions in common to both channels using common signal names with "x" attached as a substitute for the channel number (e.g. sin1/sin2 sinx) except the part that needs distinction. serial interface 1 input/output terminals, sin1, sout1, sclk1 and srdy1 are shared with the i/o ports p10?13. serial interface 2 input/output terminals, sin2, sout2, sclk2 and srdy2 are shared with the i/ o ports p20?23. in order to utilize these terminals for the serial interface input/output terminals, proper settings have to be made with registers esifx, smdx0 and smdx1. (at initial reset, these terminals are set as i/o port terminals.) the direction of i/o port terminals set for serial interface input/output terminals are determined by the signal and transfer mode for each terminal. furthermore, the settings for the corresponding i/o control re gisters for the i/o ports become invalid. t able 4.10.1.1 configuration of input/output terminals terminal when serial interface is selected p10 p11 p12 p13 p20 p21 p22 p23 sin1 sout1 sclk1 srdy1 sin2 sout2 sclk2 srdy2 * the terminals used may change according to the transfer mode.
s1c63808 technical manual epson 73 chapter 4: peripheral circuits and operation (serial interface) sinx and soutx are serial data input and output terminals which function identically in clock synchro- nous system and asynchronous system. sclkx is exclusively for use with clock synchronous system and functions as a synchronous clock input/output terminal. srdyx is exclusively for use in clock synchro- nous slave mode and functions as a send-receive ready signal output terminal. when asynchronous system is selected, since sclkx and srdyx are superfluous, the i/o port terminals p12/p22 and p13/p23 can be used as i/o ports. in the same way, when clock synchronous master mode is selected, since srdyx is superfluous, the i/o port terminal p13/p23 can be used as i/o port. 4.10.2 mask option since the input/output terminals of the serial interface is shared with the i/o ports (p10?13, p20?23), the mask option that selects the terminal specification for the i/o port is also applied to the serial interface. output specification the output specification of the terminals soutx, sclkx (for clock synchronous master mode) and srdyx (for clock synchronous slave mode) that are used as output in the input/output port of the serial interface is respectively selected by the mask options of p11/p21, p12/p22 and p13/p23. either complementary output or p-channel open drain output can be selected as the output specification. however, when p-channel open drain output is selected, do not apply a voltage exceeding the power supply voltage to the terminal. pull-down resistor the pull-down resistors for the sinx terminal and the sclkx terminal (during slave mode) that are used as input terminals can be selected by mask option. the pull-down resistor can be added by the mask options of p10/p20 and p12/p22. when "gate direct" is selected, take care that the floating status does not occur. p olarity of synchronous clock and ready signal in clock synchronous slave mode polarity of the synchronous clock and the ready signal that is output in the clock synchronous slave mode can be selected from either positive polarity (high active, sclkx & srdyx) or negative polarity ___________ ___________ (low active, sclkx & srdyx). when operating the serial interface in the slave mode, the synchronous clock is input from a external device. be aware that the terminal specification is pull-down only and a pull-up resistor cannot be built in if negative polarity is selected. in the following explanation, it is assumed that positive polarity (sclkx, srdyx) has been selected. 4.10.3 transfer modes there are four transfer modes for the serial interface and mode selection is made by setting the two bits of the mode selection registers smdx0 and smdx1 as shown in the table below. t able 4.10.3.1 transfer modes smdx1 smdx0 mode 1 1 0 0 1 0 1 0 8-bit asynchronous 7-bit asynchronous clock synchronous slave clock synchronous master t able 4.10.3.2 terminal settings corresponding to each transfer mode mode sin asynchronous 8-bit asynchronous 7-bit clock synchronous slave clock synchronous master p13/p23 p13/p23 output p13/p23 soutx sclkx srdyx p12/p22 p12/p22 input output output output output output input input input input at initial reset, transfer mode is set to clock synchronous master mode.
74 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (serial interface) clock synchronous master mode in this mode, the internal clock is utilized as a synchronous clock for the built-in shift registers, and 8- bit clock synchronous serial transfers can be performed with this serial interface as the master. the synchronous clock is also output from the sclkx terminal which enables control of the external (slave side) serial i/o device. since the srdyx terminal is not utilized in this mode, it can be used as an i/o port. figure 4.10.3.1(a) shows the connection example of input/output terminals in the clock synchronous master mode. clock synchronous slave mode in this mode, a synchronous clock from the external (master side) serial input/output device is utilized and 8-bit clock synchronous serial transfers can be performed with this serial interface as the slave. the synchronous clock is input to the sclkx terminal and is utilized by this interface as the synchronous clock. furthermore, the srdyx signal indicating the transmit-receive ready status is output from the srdyx terminal in accordance with the serial interface operating status. in the slave mode, the settings for registers scsx0 and scsx1 used to select the clock source are invalid. figure 4.10.3.1(b) shows the connection example of input/output terminals in the clock synchronous slave mode. 7-bit asynchronous mode in this mode, 7-bit asynchronous transfer can be performed. parity check during data reception and addition of parity bit (odd/even/none) during transmitting can be specified and data processed in 7 bits with or without parity. since this mode employs the internal clock, the sclkx terminal is not used. furthermore, since the srdyx terminal is not utilized either, both of these terminals can be used as i/o ports. figure 4.10.3.1(c) shows the connection example of input/output terminals in the asynchronous mode. 8-bit asynchronous mode in this mode, 8-bit asynchronous transfer can be performed. parity check during data reception and addition of parity bit (odd/even/none) during transmitting can be specified and data processed in 8 bits with or without parity. since this mode employs the internal clock, the sclkx terminal is not used. furthermore, since the srdyx terminal is not utilized either, both of these terminals can be used as i/o ports. figure 4.10.3.1(c) shows the connection example of input/output terminals in the asynchronous mode. data input data output clock output ready input sinx(p10/p20) soutx(p11/p21) sclkx(p12/p22) input port external serial device s1c63808 data input data output clock output ready input sinx(p10/p20) soutx(p11/p21) sclkx(p12/p22) srdyx(p13/p23) external serial device s1c63808 (a) clock synchronous master mode (b) clock synchronous slave mode data input data output sinx(p10/p20) soutx(p11/p21) external serial device s1c63808 (c) asynchronous 7-bit/8-bit mode fi g. 4.10.3.1 connection examples of serial interface i/o terminals
s1c63808 technical manual epson 75 chapter 4: peripheral circuits and operation (serial interface) 4.10.4 clock source there are four clock sources and selection is made by setting the two bits of the clock source selection re gister scsx0 and scsx1 as shown in table below. t able 4.10.4.1 clock source scsx1 1 1 0 0 scsx0 1 0 1 0 clock source programmable timer f osc3 / 4 f osc3 / 8 f osc3 / 16 this register setting is invalid in clock synchronous slave mode and the external clock input from the sclkx terminal is used. when the "programmable timer" is selected, the programmable timer 1 underflow signal is divided by 4 and this signal used as the clock source. with respect to the transfer rate setting, see "4.9 programmable ti mer". at initial reset, the synchronous clock is set to "f osc3 /16". whichever clock is selected, the signal is further divided by 1/16 and then used as the synchronous clock. furthermore, external clock input is used as is for sclkx in clock synchronous slave mode. f osc3 1/4 1/8 1/16 1/16 synchro- nous clock programmable timer 1 underflow signal sclkx (clock synchronous slave mode) divider selector selector 1/4 osc3 oscillation circuit fi g. 4.10.4.1 division of the synchronous clock t able 4.10.4.2 shows an examples of transfer rates and osc3 oscillation frequencies when the clock source is set to programmable timer. t able 4.10.4.2 osc3 oscillation frequencies and transfer rates transfer rate (bps) 9,600 4,800 2,400 1,200 600 300 150 75 f osc3 = 3.072 mhz ptps1x 0 (1/1) 0 (1/1) 0 (1/1) 0 (1/1) 0 (1/1) 0 (1/1) 2 (1/32) 2 (1/32) rld1x 04h 09h 13h 27h 4fh 9fh 09h 13h when the demultiplied signal of the osc3 oscillation circuit is made the clock source, it is necessary to turn the osc3 oscillation on, prior to using the serial interface. a time interval of 5 msec, from the turning on of the osc3 oscillation circuit to until the oscillation stabilizes, is necessary, due to the oscillation element that is used. consequently, you should allow an adequate waiting time after turning on of the osc3 oscillation, before starting transmitting/receiving of serial interface. (the oscillation start time will vary somewhat depending on the oscillator and on the externally attached parts. refer to the oscillation start time example indicated in chapter 7, "electrical characteristics".) at initial reset, the osc3 oscillation circuit is set to off status.
76 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (serial interface) 4.10.5 transmit-receive control below is a description of the registers which handle transmit-receive control. with respect to transmit- r eceive control procedures and operations, please refer to the following sections in which these are discussed on a mode by mode basis. shift register and receive data buffer exclusive shift registers for transmitting and receiving are installed in this serial interface. conse- quently, duplex communication simultaneous transmit and receive is possible when the asynchronous system is selected. data being transmitted are written to trxdx0?rxdx7 and converted to serial through the shift r egister and is output from the soutx terminal. in the reception section, a receive data buffer is installed separate from the shift register. data being received are input to the sinx terminal and is converted to parallel through the shift r egister and written to the receive data buffer. since the receive data buffer can be read even during serial input operation, the continuous data is r eceived efficiently. however, since buffer functions are not used in clock synchronous mode, be sure to read out data before the next data reception begins. t ransmit enable register and transmit control bit for transmit control, use the transmit enable register txenx and transmit control bit txtrgx. the transmit enable register txenx is used to set the transmit enable/disable status. when "1" is written to this register to set the transmitting enable status, clock input to the shift register is enabled and the system is ready to transmit data. in the clock synchronous mode, synchronous clock input/ output from the sclkx terminal is also enabled. the transmit control bit txtrgx is used as the trigger to start transmitting data. data to be transmitted is written to the transmit data shift register, and when transmitting prepara- tions a recomplete, "1" is written to txtrgx whereupon data transmitting begins. when interrupt has been enabled, an interrupt is generated when the transmission is completed. if there is subsequent data to be transmitted it can be sent using this interrupt. in addition, txtrgx can be read as a status bit. when set to "1", it indicates transmitting operation, and "0" indicates transmitting stop. for details on timing, see the timing chart which gives the timing for each mode. when not transmitting, set txenx to "0" to disable transmission. receive enable register and receive control bit for receiving control, use the receive enable register rxenx and receive control bit rxtrgx. receive enable register rxenx is used to set receiving enable/disable status. when "1" is written into this register to set the receiving enable status, clock input to the shift register is enabled and the system is ready to receive data. in the clock synchronous mode, synchronous clock input/output from the sclkx terminal is also enabled. with the above setting, receiving begins and serial data input from the sinx terminal goes to the shift register. the operation of the receive control bit rxtrgx is slightly different depending on whether a clock synchronous system or an asynchronous system is being used. in clock synchronous system, the receive control bit rxtrgx is used as the trigger to start receiving data. when received data has been read and the preparation for next data receiving is completed, write "1" into rxtrgx to start receiving. (when "1" is written to rxtrgx in slave mode, srdyx is asserted.) in asynchronous system, rxtrgx is used to prepare for next data receiving. after reading the re- ceived data from the receive data buffer, write "1" into rxtrgx to signify that the receive data buffer is empty. if "1" is not written into rxtrgx, the overrun error flag oerx will be set to "1" when the next receiving operation is completed. (an overrun error will be generated when receiving is com- pleted between reading the received data and the writing of "1" to rxtrgx.)
s1c63808 technical manual epson 77 chapter 4: peripheral circuits and operation (serial interface) in addition, rxtrgx can be read as a status bit. in either clock synchronous mode or asynchronous mode, when rxtrgx is set to "1", it indicates receiving operation and when set to "0", it indicates that r eceiving has stopped. for details on timing, see the timing chart which gives the timing for each mode. when you do not receive, set rxenx to "0" to disable receiving. 4.10.6 operation of clock synchronous transfer clock synchronous transfer involves the transfer of 8-bit data by synchronizing it to eight clocks. the same synchronous clock is used by both the transmitting and receiving sides. when the serial interface is used in the master mode, the clock signal selected using scsx0 and scsx1 is further divided by 1/16 and employed as the synchronous clock. this signal is then sent via the sclkx terminal to the slave side (external serial i/o device). when used in the slave mode, the clock input to the sclkx terminal from the master side (external serial input/output device) is used as the synchronous clock. in the clock synchronous mode, since one clock line (sclkx) is shared for both transmitting and receiv- ing, transmitting and receiving cannot be performed simultaneously. (half duplex only is possible in clock synchronous mode.) the transfer data length is fixed at 8 bits. data can be switched using a register whether it is transmitted/ r eceived from lsb (bit 0) or msb (bit 7). sclkx (positive) data d0 d1 d2 d3 d4 d5 d6 d7 lsb msb data d0 d1 d2 d3 d4 d5 d6 d7 lsb msb lsb first sclkx (negative) sclkx (positive) data d7 d6 d5 d4 d3 d2 d1 d0 msb lsb msb first sclkx (negative) data d7 d6 d5 d4 d3 d2 d1 d0 msb lsb fi g. 4.10.6.1 transfer data configuration using clock synchronous mode below is a description of initialization when performing clock synchronous transfer, transmit-receive control procedures and operations. w ith respect to serial interface interrupt, see "4.10.8 interrupt function". initialization of serial interface when performing clock synchronous transfer, the following initial settings must be made. (1) setting of transmitting/receiving disable to set the serial interface into a status in which both transmitting and receiving are disabled, "0" must be written to both the transmit enable register txenx and the receive enable register rxenx. fix these two registers to a disable status until data transfer actually begins. (2) port selection because serial interface input/output ports sinx, soutx, sclkx and srdyx are set as i/o port terminals p10?13 and p20?23 at initial reset, "1" must be written to the serial interface enable r egister esifx in order to set these terminals for serial interface use.
78 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (serial interface) (3) setting of transfer mode select the clock synchronous mode by writing the data as indicated below to the two bits of the mode selection registers smdx0 and smdx1. master mode: smdx0 = "0", smdx1 = "0" slave mode: smdx0 = "1", smdx1 = "0" (4) clock source selection in the master mode, select the synchronous clock source by writing data to the two bits of the clock source selection registers scsx0 and scsx1. (see table 4.10.4.1.) this selection is not necessary in the slave mode. the parity enable register eprx is also assigned to this address, however, since parity is not necessary in the clock synchronous mode, parity check will not take place regardless of how they are set. (5) clock source control when the master mode is selected and programmable timer for the clock source is selected, set transfer rate on the programmable timer side. (see "4.9 programmable timer".) when the divided signal of osc3 oscillation circuit is selected for the clock source, be sure that the osc3 oscillation circuit is turned on prior to commencing data transfer. (see "4.3 oscillation circuit".) note that the frequency of the serial interface clock is limited to a maximum of 2 mhz. (6) serial data input/output permutation the s1c63808 provides the data input/output permutation select register sdpx to select whether the serial data bits are transferred from the lsb or msb. the sdpx register should be set before writing data to trxdx0?rxdx7.
s1c63808 technical manual epson 79 chapter 4: peripheral circuits and operation (serial interface) data transmit procedure the control procedure and operation during transmitting is as follows. data transmitting end txenx 0, rxenx 0 no yes transmit complete ? set transmitting data to trxdx0?rxdx7 no yes istrx = 1 ? txenx 0 txtrgx 1 txenx 1 no yes receiver ready ? in case of master mode fi g. 4.10.6.2 transmit procedure in clock synchronous mode (1) write "0" in the transmit enable register txenx and the receive enable register rxenx to reset the serial interface. (2) write "1" in the transmit enable register txenx to set into the transmitting enable status. (3) write the transmitting data into trxdx0?rxdx7. (4) in case of the master mode, confirm the receive ready status on the slave side (external serial input/output device), if necessary. wait until it reaches the receive ready status. (5) write "1" in the transmit control bit txtrgx and start transmitting. in the master mode, this control causes the synchronous clock to change to enable and to be provided to the shift register for transmitting and output from the sclkx terminal. in the slave mode, it waits for the synchronous clock to be input from the sclkx terminal. the transmitting data of the shift register shifts one bit at a time at each falling edge of the syn- chronous clock and is output from the soutx terminal. when the final bit is output, the soutx terminal is maintained at that level, until the next transmitting begins. the transmitting complete interrupt factor flag istrx is set to "1" at the point where the data transmitting of the shift register is completed. when interrupt has been enabled, a transmitting complete interrupt is generated at this point. set the following transmitting data using this interrupt. (6) repeat steps (3) to (5) for the number of bytes of transmitting data, and then set the transmit disable status by writing "0" to the transmit enable register txenx, when the transmitting is completed.
80 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (serial interface) data receive procedure the control procedure and operation during receiving is as follows. data receiving end rxenx 0, txenx 0 no yes receiving complete ? received data reading from trxdx0?rxdx7 no yes isrcx = 1 ? rxenx 0 rxtrgx 1 rxenx 1 no yes transmitter ready ? in case of master mode fi g. 4.10.6.3 receiving procedure in clock synchronous mode (1) write "0" in the receive enable register rxenx and transmit enable register txenx to reset the serial interface. (2) write "1" in the receive enable register rxenx to set into the receiving enable status. (3) in case of the master mode, confirm the transmit ready status on the slave side (external serial input/output device), if necessary. wait until it reaches the transmit ready status. (4) write "1" in the receive control bit rxtrgx and start receiving. in the master mode, this control causes the synchronous clock to change to enable and is provided to the shift register for receiving and output from the sclkx terminal. in the slave mode, it waits for the synchronous clock to be input from the sclkx terminal. the r eceived data input from the sinx terminal is successively incorporated into the shift register in synchronization with the rising edge of the synchronous clock. at the point where the data of the 8th bit has been incorporated at the final (8th) falling edge (when positive polarity is selected) or rising edge (when negative polarity is selected) of the synchronous clock, the content of the shift register is sent to the receive data buffer and the r eceiving complete interrupt factor flag isrcx is set to "1". when interrupt has been enabled, a r eceiving complete interrupt is generated at this point. (5) read the received data from trxdx0?rxdx7 using receiving complete interrupt. (6) repeat steps (3) to (5) for the number of bytes of receiving data, and then set the receive disable status by writing "0" to the receive enable register rxenx, when the receiving is completed.
s1c63808 technical manual epson 81 chapter 4: peripheral circuits and operation (serial interface) tr ansmit/receive ready (srdyx) signal when this serial interface is used in the clock synchronous slave mode (external clock input), an srdyx signal is output from the srdyx terminal to indicate whether or not this serial interface can transmit/receive to the master side (external serial input/output device). when positive polarity is selected the srdyx signal goes "1" (high level) when this interface enters the transmit or receive enable (ready) status, and it goes "0" (low level) when the interface is in a busy status, such as during transmit/receive operation. the srdyx signal changes "0" to "1" immediately after writing "1" into the transmit control bit txtrgx or the receive control bit rxtrgx and it returns to "0" at the point where the first syn- chronous clock is input (rising edge). when negative polarity is selected ___________ the srdyx signal goes "0" (low level) when this interface enters the transmit or receive enable (ready) status, and it goes "1" (high level) when the interface is in a busy status, such as during transmit/receive operation. ___________ the srdyx signal changes "1" to "0" immediately after writing "1" into the transmit control bit txtrgx or the receive control bit rxtrgx and it returns to "1" at the point where the first syn- chronous clock is input (falling edge). when you have set in the master mode, control the transfer by inputting the same signal from the slave side using the input port or i/o port. at this time, since the srdyx terminal is not set and instead p13/p23 functions as the i/o port, you can apply this port for said control. timing chart the timing chart for the clock synchronous system transmission is shown in figure 4.10.6.4. sclkx txtrgx (rd) sclkx soutx d0 d1 d2 d3 d4 d5 d6 d7 txenx interrupt txtrgx (wr) () sclkx txtrgx (rd) soutx d0 d 1d2d3d4d5d6 d7 txenx interrupt txtrgx (wr) srdyx sclkx srdyx () () sclkx rxtrgx (rd) sclkx sinx d0 d1 d2 d3 d4 d5 d6 d7 rxenx interrupt rxtrgx (wr) trxdx 7f 1st data () sclkx rxtrgx (rd) sinx d0 d1 d2 d3 d4 d5 d6 d7 rxenx interrupt rxtrgx (wr) trxdx 7f 1st data srdyx sclkx srdyx 7f () () (a) transmit timing for master mode (c) receive timing for master mode (b) transmit timing for slave mode (d) receive timing for slave mode fi g. 4.10.6.4 timing chart (clock synchronous system transmission)
82 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (serial interface) 4.10.7 operation of asynchronous transfer asynchronous transfer is a mode that transfers by adding a start bit and a stop bit to the front and the back of each piece of serial converted data. in this mode, there is no need to use a clock that is fully synchronized clock on the transmit side and the receive side, but rather transmission is done while adopting the synchronization at the start/stop bits that have attached before and after each piece of data. the rs-232c interface functions can be easily realized by selecting this transfer mode. this interface has separate transmit and receive shift registers and is designed to permit full duplex transmission to be done simultaneously for transmitting and receiving. for transfer data in the 7-bit asynchronous mode, either 7 bits data (no parity) or 7 bits data + parity bit can be selected. in the 8-bit asynchronous mode, either 8 bits data (no parity) or 8 bits data + parity bit can be selected. parity can be even or odd, and parity checking of received data and adding a party bit to transmitting data will be done automatically. thereafter, it is not necessary to be conscious of parity itself in the program. the start bit length is fixed at 1 bit. for the stop bit length, either 1 bit or 2 bits can be selected using the stop bit select register stpbx. whether data is transmitted/received from lsb (bit 0) or msb (bit 7) it can be switched using the data input/output permutation select register sdpx. sampling clock lsb first 8bit data d0 d1 d2 d3 d4 d5 d6 d7 s1 s2 7bit data +parity d0 d1 d2 d3 d4 d5 d6 p s1 s2 8bit data +parity d0 d1 d2 d3 d4 d5 d6 d7 s1 p s2 7bit data d0 d1 d2 d3 d4 d5 d6 s1 s2 sampling clock msb first 8bit data d7 d6 d5 d4 d3 d2 d1 d0 s1 s2 7bit data +parity d6 d5 d4 d3 d2 d1 d0 p s1 s2 8bit data +parity d7 d6 d5 d4 d3 d2 d1 d0 s1 p s2 s1 s2 p : start bit (low level, 1 bit) : stop bit (high level, 1 bit or 2 bits) : parity bit 7bit data d6 d5 d4 d3 d2 d1 d0 s1 s2 fi g. 4.10.7.1 transfer data configuration for asynchronous system here following, we will explain the control sequence and operation for initialization and transmitting / r eceiving in case of asynchronous data transfer. see "4.10.8 interrupt function" for the serial interface interrupts. initialization of serial interface the below initialization must be done in cases of asynchronous system transfer. (1) setting of transmitting/receiving disable to set the serial interface into a status in which both transmitting and receiving are disabled, "0" must be written to both the transmit enable register txenx and the receive enable register rxenx. fix these two registers to a disable status until data transfer actually begins.
s1c63808 technical manual epson 83 chapter 4: peripheral circuits and operation (serial interface) (2) port selection because serial interface input/output terminals sinx and soutx are set as i/o port terminals p10/p20 and p11/p21 at initial reset, "1" must be written to the serial interface enable register esifx in order to set these terminals for serial interface use. sclkx and srdyx terminals set in the clock synchronous mode are not used in the asynchronous mode. these terminals function as i/o port terminals p12/p22 and p13/p23. (3) setting of transfer mode select the asynchronous mode by writing the data as indicated below to the two bits of the mode selection registers smdx0 and smdx1. 7-bit mode: smdx0 = "0", smdx1 = "1" 8-bit mode: smdx0 = "1", smdx1 = "1" (4) parity bit selection when checking and adding parity bits, write "1" into the parity enable register eprx to set to "with parity check". as a result of this setting, in the 7-bit asynchronous mode, it has a 7 bits data + parity bit configuration and in the 8-bit asynchronous mode it has an 8 bits data + parity bit configuration. in this case, parity checking for receiving and adding a party bit for transmitting is done automatically in hardware. moreover, when "with parity check" has been selected, "odd" or "even" parity must be further selected in the parity mode selection register pmdx. when "0" is written to the eprx register to select "without parity check" in the 7-bit asynchronous mode, data configuration is set to 7 bits data (no parity) and in the 8-bit asynchronous mode (no parity) it is set to 8 bits data (no parity) and parity checking and parity bit adding will not be done. (5) clock source selection select the clock source by writing data to the two bits of the clock source selection registers scsx0 and scsx1. (see table 4.10.4.1.) (6) clock source control when the programmable timer is selected for the clock source, set transfer rate on the programma- ble timer side. (see "4.9 programmable timer".) when the divided signal of osc3 oscillation circuit is selected for the clock source, be sure that the osc3 oscillation circuit is turned on prior to commencing data transfer. (see "4.3 oscillation circuit".) (7) stop bit length selection the stop bit length can be configured to 1 bit or 2 bits using the stop bit select register stpbx. t able 4.10.7.1 stop bit and parity bit settings eprx 1 0 1 0 stpbx 1 0 pmdx 1 0 1 0 stop bit 2 bits 2 bits 2 bits 1 bit 1 bit 1 bit parity bit odd even non parity odd even non parity settings (8) serial data input/output permutation the s1c63808 provides the data input/output permutation select register sdpx to select whether the serial data bits are transferred from the lsb or msb. the sdpx register should be set before writing data to trxdx0?rxdx7.
84 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (serial interface) data transmit procedure the control procedure and operation during transmitting is as follows. data transmitting end txenx 0 no yes transmit complete ? set transmitting data to trxdx0?rxdx7 no yes istrx = 1 ? txenx 0 txtrgx 1 txenx 1 fi g. 4.10.7.2 transmit procedure in asynchronous mode (1) write "0" in the transmit enable register txenx to reset the serial interface. (2) write "1" in the transmit enable register txenx to set into the transmitting enable status. (3) w rite the transmitting data into trxdx0?rxdx7. also, when 7-bit data is selected, the trxdx7 data becomes invalid. (4) write "1" in the transmit control bit txtrgx and start transmitting. this control causes the shift clock to change to enable and a start bit (low) is output to the soutx terminal in synchronize to its falling edge. the transmitting data set to the shift register is shifted one bit at a time at each falling edge of the clock thereafter and is output from the soutx terminal. after the data output, it outputs a stop bit (high) and high level is maintained until the next start bit is output. the transmitting complete interrupt factor flag istrx is set to "1" at the point where the data transmitting is completed. when interrupt has been enabled, a transmitting complete interrupt is generated at this point. set the following transmitting data using this interrupt. (5) repeat steps (3) to (4) for the number of bytes of transmitting data, and then set the transmit disable status by writing "0" to the transmit enable register txenx, when the transmitting is completed.
s1c63808 technical manual epson 85 chapter 4: peripheral circuits and operation (serial interface) data receive procedure the control procedure and operation during receiving is as follows. end rxenx 1 no yes receiving interrupt ? yes receiving complete ? received data reading from trxdx0?rxdx7 rxenx 0 rxtrgx 1 no yes error generated ? error processing data receiving rxenx 0 resets error flags perx, oerx and ferx no fi g. 4.10.7.3 receiving procedure in asynchronous mode (1) w rite "0" in the receive enable register rxenx to set the receiving disable status and to reset the r espective perx, oerx, ferx flags that indicate parity, overrun and framing errors. (2) w rite "1" in the receive enable register rxenx to set into the receiving enable status. (3) the shift clock will change to enable from the point where the start bit (low) has been input from the sinx terminal and the receive data will be synchronized to the rising edge following the second clock, and will thus be successively incorporated into the shift register. after data bits have been incorporated, the stop bit is checked and, if it is not high, it becomes a framing error and the error interrupt factor flag iserx is set to "1". when interrupt has been enabled, an error interrupt is generated at this point. when receiving is completed, data in the shift register is transferred to the receive data buffer and the r eceiving complete interrupt flag isrcx is set to "1". when interrupt has been enabled, a receiving complete interrupt is generated at this point. (when an overrun error is generated, the interrupt factor flag isrcx is not set to "1" and a receiving complete interrupt is not generated.) if "with parity check" has been selected, a parity check is executed when data is transferred into the r eceive data buffer from the shift register and if a parity error is detected, the error interrupt factor flag is set to "1". when the interrupt has been enabled, an error interrupt is generated at this point just as in the framing error mentioned above. (4) read the received data from trxdx0?rxdx7 using receiving complete interrupt. (5) w rite "1" to the receive control bit rxtrgx to inform that the receive data has been read out. when the following data is received prior to writing "1" to rxtrgx, it is recognized as an overrun error and the error interrupt factor flag is set to "1". when the interrupt has been enabled, an error interrupt is generated at this point just as in the framing error and parity error mentioned above. (6) repeat steps (3) to (5) for the number of bytes of receiving data, and then set the receive disable status by writing "0" to the receive enable register rxenx, when the receiving is completed.
86 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (serial interface) receive error during receiving the following three types of errors can be detected by an interrupt. (1) parity error when writing "1" to the eprx register to select "with parity check", a parity check (vertical parity check) is executed during receiving. after each data bit is sent a parity check bit is sent. the parity check bit is a "0" or a "1". even parity checking will cause the sum of the parity bit and the other bits to be even. odd parity causes the sum to be odd. this is checked on the receiving side. the parity check is performed when data received in the shift register is transferred to the receive data buffer. it checks whether the parity check bit is a "1" or a "0" (the sum of the bits including the parity bit) and the parity set in the pmdx register match. when it does not match, it is recognized as an parity error and the parity error flag perx and the error interrupt factor flag iserx are set to "1". when interrupt has been enabled, an error interrupt is generated at this point. the perx flag is reset to "0" by writing "1". even when this error has been generated, the received data corresponding to the error is trans- ferred in the receive data buffer and the receive operation also continues. the received data at this point cannot assured because of the parity error. (2) framing error in asynchronous transfer, synchronization is adopted for each character at the start bit ("0") and the stop bit ("1"). when receiving has been done with the stop bit set at "0", the serial interface judges the synchronization to be off and a framing error is generated. when this error is gener- ated, the framing error flag ferx and the error interrupt factor flag iserx are set to "1". when interrupt has been enabled, an error interrupt is generated at this point. the ferx flag is reset to "0" by writing "1". even when this error has been generated, the received data corresponding to the error is trans- ferred in the receive data buffer and the receive operation also continues. however, even when it does not become a framing error with the following data receiving, such data cannot be assured. (3) overrun error when the next data is received before "1" is written to rxtrgx, an overrun error will be gener- ated, because the previous receive data will be overwritten. when this error is generated, the overrun error flag oerx and the error interrupt factor flag iserx are set to "1". when interrupt has been enabled, an error interrupt is generated at this point. the oerx flag is reset to "0" by writing "1" into it. even when this error has been generated, the received data corresponding to the error is trans- ferred in the receive data buffer and the receive operation also continues. furthermore, when the timing for writing "1" to rxtrgx and the timing for the received data transfer to the receive data buffer overlap, it will be recognized as an overrun error.
s1c63808 technical manual epson 87 chapter 4: peripheral circuits and operation (serial interface) timing chart figure 4.10.7.4 show the asynchronous transfer timing chart. txenx txtrgx(rd) txtrgx(wr) soutx interrupt (in 8-bit mode/non parity) d0 d1 d2 d3 d4 d5 d6 d7 sampling clock (a) transmit timing rxenx rxtrgx(rd) rxtrgx(wr) sinx trxdx oerx control signal oerx interrupt (in 8-bit mode/non parity) d0 d1 d2 d3 d4 d5 d6 d7 d0 d1 d6 d7 d0 d1 d2 d3 d4 d5 d6 d7 d2 d3 d4 d5 1st data 2nd data sampling clock (b) receive timing fi g. 4.10.7.4 timing chart (asynchronous transfer) 4.10.8 interrupt function this serial interface includes a function that generates the below indicated three types of interrupts. ?transmitting complete interrupt ?receiving complete interrupt ?error interrupt the interrupt factor flag and the interrupt mask register for the respective interrupt factors are provided and then the interrupt can be disabled/enabled by the software. figure 4.10.8.1 shows the configuration of the serial interface interrupt circuit.
88 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (serial interface) data bus interrupt request address error generation interrupt factor flag iserx address interrupt mask register eiserx address receive completion interrupt factor flag isrcx address interrupt mask register eisrcx address transmit completion interrupt factor flag istrx address interrupt mask register eistrx fi g. 4.10.8.1 configuration of serial interface interrupt circuit t ransmit completion interrupt this interrupt factor is generated at the point where the sending of the data written into the shift r egister has been completed and sets the interrupt factor flag istrx to "1". when set in this manner, if the corresponding interrupt mask register eistrx is set to "1" and the cpu is set to interrupt enabled status (i flag = "1"), an interrupt will be generated to the cpu. when the interrupt mask register eistrx has been set to "0" and interrupt has been disabled, no interrupt is generated to the cpu. even in this case, the interrupt factor flag istrx is set to "1". the interrupt factor flag istrx is reset to "0" by writing "1". the following transmitting data can be set and the transmitting can be started (writing "1" to txtrgx) after this interrupt factor occurs. receive completion interrupt this interrupt factor is generated at the point where receiving has been completed and the receive data incorporated into the shift register has been transferred into the receive data buffer and it sets the interrupt factor flag isrcx to "1". when set in this manner, if the corresponding interrupt mask r egister eisrcx is set to "1" and the cpu is set to interrupt enabled status (i flag = "1"), an interrupt will be generated to the cpu. when the interrupt mask register eisrcx has been set to "0" and interrupt has been disabled, no interrupt is generated to the cpu. even in this case, the interrupt factor flag isrcx is set to "1". the interrupt factor flag isrcx is reset to "0" by writing "1". the generation of this interrupt factor allows reading of the received data. also, the interrupt factor flag isrcx is set to "1" when a parity error or framing error is generated. error interrupt this interrupt factor is generated at the point where a parity error, framing error or overrun error is detected during receiving and it sets the interrupt factor flag iserx to "1". when set in this manner, if the corresponding interrupt mask register eiserx is set to "1" and the cpu is set to interrupt enabled status (i flag = "1"), an interrupt will be generated to the cpu. when the interrupt mask register eiserx has been set to "0" and interrupt has been disabled, an interrupt is not generated to the cpu. even in this case, the interrupt factor flag iserx is set to "1". the interrupt factor flag iserx is reset to "0" by writing "1". since all three types of errors result in the same interrupt factor, you should identify the error that has been generated by the error flags perx (parity error), oerx (overrun error) and ferx (framing error).
s1c63808 technical manual epson 89 chapter 4: peripheral circuits and operation (serial interface) 4.10.9 i/o memory of serial interface t able 4.10.9.1 show the serial interface control bits and their addresses. t able 4.10.9.1(a) serial interface control bits address comment d3 d2 register d1 d0 name init ? 1 10 ff1ah 00 stpb2 sdp2 rr/w 0 ? 3 0 ? 3 stpb2 sdp2 ? ? 2 ? ? 2 0 0 2 bits msb first 1 bit lsb first unused unused serial i/f 2 stop bit selection serial i/f 2 data input/output permutation selection 0 clk-sync. master 2 async. 7-bit 1 clk-sync. slave 3 async. 8-bit [smd21, 20] mode [smd21, 20] mode ff14h 0 smd21 smd20 esif2 rr/w 0 ? 3 smd21 smd20 esif2 ? ? 2 0 0 0sif i/o unused serial i/f 2 mode selection serial i/f 2 enable (p2x port function selection) 0 f osc3 /16 1 f osc3 /8 2 f osc3 /4 3 pt [scs21, 20] mode ff15h epr2 pmd2 scs21 scs20 r/w epr2 pmd2 scs21 scs20 0 0 0 0 enable odd disable even serial i/f 2 parity enable register serial i/f 2 parity mode selection serial i/f 2 clock source r/w ff16h rxtrg2 rxen2 txtrg2 txen2 rxtrg2 rxen2 txtrg2 txen2 0 0 0 0 run trigger enable run trigger enable stop disable stop disable serial i/f 2 receive status (reading) serial i/f 2 receive trigger (writing) serial i/f 2 receive enable serial i/f 2 transmit status (reading) serial i/f 2 transmit trigger (writing) serial i/f 2 transmit enable rr/w ff17h 0 fer2 per2 oer2 0 ? 3 fer2 per2 oer2 ? ? 2 0 0 0 error reset error reset error reset no error no error no error unused serial i/f 2 framing error flag status (reading) serial i/f 2 framing error flag reset (writing) serial i/f 2 parity error flag status (reading) serial i/f 2 parity error flag reset (writing) serial i/f 2 overrun error flag status (reading) serial i/f 2 overrun error flag reset (writing) r/w ff18h trxd23 trxd22 trxd21 trxd20 trxd23 trxd22 trxd21 trxd20 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low serial i/f 2 t ransmit/receive data (low-order 4 bits) lsb r/w ff19h trxd27 trxd26 trxd25 trxd24 trxd27 trxd26 trxd25 trxd24 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low msb serial i/f 2 t ransmit/receive data (high-order 4 bits) ff45h pul13 pul12 pul11 pul10 r/w pul13 pul12 pul11 pul10 1 1 1 1 on on on on off off off off p13 pull-down control register functions as a general-purpose register when sif1 (slave) is selected p12 pull-down control register (esif1=0) functions as a general-purpose register when sif1 (master) is selected sclk1 (i) pull-down control register when sif1 (slave) is selected p11 pull-down control register (esif1=0) functions as a general-purpose register when sif1 is selected p10 pull-down control register (esif1=0) sin1 pull-down control register when sif1 is selected ff49h pul23 pul22 pul21 pul20 r/w pul23 pul22 pul21 pul20 1 1 1 1 on on on on off off off off p23 pull-down control register functions as a general-purpose register when sif2 (slave) is selected p22 pull-down control register (esif2=0) functions as a general-purpose register when sif2 (master) is selected sclk2 (i) pull-down control register when sif2 (slave) is selected p21 pull-down control register (esif2=0) functions as a general-purpose register when sif2 is selected p20 pull-down control register (esif2=0) sin2 pull-down control register when sif2 is selected *1 initial value at initial reset *2 not set in the circuit *3 constantly "0" when being read
90 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (serial interface) t able 4.10.9.1(b) serial interface control bits address comment d3 d2 register d1 d0 name init ? 1 10 ff6ah 00 stpb1 sdp1 rr/w 0 ? 3 0 ? 3 stpb1 sdp1 ? ? 2 ? ? 2 0 0 2 bits msb first 1 bit lsb first unused unused serial i/f 1 stop bit selection serial i/f 1 data input/output permutation selection 0 clk-sync. master 2 async. 7-bit 1 clk-sync. slave 3 async. 8-bit [smd11, 10] mode [smd11, 10] mode ff64h 0 smd11 smd10 esif1 rr/w 0 ? 3 smd11 smd10 esif1 ? ? 2 0 0 0sif i/o unused serial i/f 1 mode selection serial i/f 1 enable (p1x port function selection) 0 f osc3 /16 1 f osc3 /8 2 f osc3 /4 3 pt [scs11, 10] mode ff65h epr1 pmd1 scs11 scs10 r/w epr1 pmd1 scs11 scs10 0 0 0 0 enable odd disable even serial i/f 1 parity enable register serial i/f 1 parity mode selection serial i/f 1 clock source r/w ff66h rxtrg1 rxen1 txtrg1 txen1 rxtrg1 rxen1 txtrg1 txen1 0 0 0 0 run trigger enable run trigger enable stop disable stop disable serial i/f 1 receive status (reading) serial i/f 1 receive trigger (writing) serial i/f 1 receive enable serial i/f 1 transmit status (reading) serial i/f 1 transmit trigger (writing) serial i/f 1 transmit enable rr/w ff67h 0 fer1 per1 oer1 0 ? 3 fer1 per1 oer1 ? ? 2 0 0 0 error reset error reset error reset no error no error no error unused serial i/f 1 framing error flag status (reading) serial i/f 1 framing error flag reset (writing) serial i/f 1 parity error flag status (reading) serial i/f 1 parity error flag reset (writing) serial i/f 1 overrun error flag status (reading) serial i/f 1 overrun error flag reset (writing) r/w ff68h trxd13 trxd12 trxd11 trxd10 trxd13 trxd12 trxd11 trxd10 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low serial i/f 1 t ransmit/receive data (low-order 4 bits) lsb r/w ff69h trxd17 trxd16 trxd15 trxd14 trxd17 trxd16 trxd15 trxd14 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high high high high low low low low msb serial i/f 1 t ransmit/receive data (high-order 4 bits) ffe0h 0e iser2 eistr2 eisrc2 rr/w 0 ? 3 eiser2 eistr2 eisrc2 ? ? 2 0 0 0 enable enable enable mask mask mask unused interrupt mask register (serial i/f 2 error) interrupt mask register (serial i/f 2 transmit completion) interrupt mask register (serial i/f 2 receive completion) ffe1h 0e iser1 eistr1 eisrc1 rr/w 0 ? 3 eiser1 eistr1 eisrc1 ? ? 2 0 0 0 enable enable enable mask mask mask unused interrupt mask register (serial i/f 1 error) interrupt mask register (serial i/f 1 transmit completion) interrupt mask register (serial i/f 1 receive completion) fff0h 0i ser2 istr2 isrc2 rr/w 0 ? 3 iser2 istr2 isrc2 ? ? 2 0 0 0 (r) yes (w) reset (r) no (w) invalid unused interrupt factor flag (serial i/f 2 error) interrupt factor flag (serial i/f 2 transmit completion) interrupt factor flag (serial i/f 2 receive completion) fff1h 0i ser1 istr1 isrc1 rr/w 0 ? 3 iser1 istr1 isrc1 ? ? 2 0 0 0 (r) yes (w) reset (r) no (w) invalid unused interrupt factor flag (serial i/f 1 error) interrupt factor flag (serial i/f 1 transmit completion) interrupt factor flag (serial i/f 1 receive completion) *1 initial value at initial reset *2 not set in the circuit *3 constantly "0" when being read
s1c63808 technical manual epson 91 chapter 4: peripheral circuits and operation (serial interface) esif1: serial interface 1 enable register (p1 port function selection) (ff64h?0) esif2: serial interface 2 enable register (p2 port function selection) (ff14h?0) sets p10?13 and p20?23 to the input/output ports for the serial interface. when "1" is written: serial interface when "0" is written: i/o port reading: valid the esif1 is the serial interface 1 enable register and p10?13 terminals become serial input/output terminals (sin1, sout1, sclk1, srdy1) when "1" is written. the esif2 is the serial interface 2 enable r egister and p20?23 terminals become serial input/output terminals (sin2, sout2, sclk2, srdy2) when "1" is written. they become i/o port terminals when "0" is written. also, see table 4.10.3.2 for the terminal settings according to the transfer modes. at initial reset, this register is set to "0". pul10: sin1 pull-down control register (ff45h?0) pul20: sin2 pull-down control register (ff49h?0) pul12: sclk1 pull-down control register (ff45h?2) pul22: sclk2 pull-down control register (ff49h?2) sets the pull-down of the sinx terminal and the sclkx terminals (in the slave mode). when "1" is written: pull-down on when "0" is written: pull-down off reading: valid sets the pull-down resistor built into the sinx (p10/p20) and sclkx (p12/p22) terminals to on or off. sclkx pull-down is effective only in the slave mode. in the master mode, the pul12/pull22 register can be used as a general purpose register. at initial reset, these registers are set to "1" and the lines are pulled down. smd10, smd11: serial interface 1 mode selection registers (ff64h?1, d2) smd20, smd21: serial interface 2 mode selection registers (ff14h?1, d2) set the transfer modes as shown in table 4.10.9.2. t able 4.10.9.2 transfer mode settings smdx1 smdx0 mode 1 1 0 0 1 0 1 0 8-bit asynchronous 7-bit asynchronous clock synchronous slave clock synchronous master smdx0 and smdx1 can also read out. at initial reset, these registers are set to "0". scs10, scs11: serial interface 1 clock source selection registers (ff65h?0, d1) scs20, scs21: serial interface 2 clock source selection registers (ff15h?0, d1) select the clock source as shown in table 4.10.9.3. t able 4.10.9.3 clock source selection scsx1 1 1 0 0 scsx0 1 0 1 0 clock source programmable timer f osc3 / 4 f osc3 / 8 f osc3 / 16 scsx0 and scsx1 can also be read out. in the clock synchronous slave mode, setting of these registers are invalid. at initial reset, these registers are set to "0".
92 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (serial interface) sdp1: serial interface 1 data input/output permutation select register (ff6ah?0) sdp2: serial interface 2 data input/output permutation select register (ff1ah?0) selects the serial data input/output permutation. when "1" is written: msb first when "0" is written: lsb first reading: valid select whether the data input/output permutation will be msb first or lsb first. at initial reset, this register is set to "0". stpb1: serial interface 1 stop bit select register (ff6ah?1) stpb2: serial interface 2 stop bit select register (ff1ah?1) selects the stop bit length for asynchronous data transfer. when "1" is written: 2 bits when "0" is written: 1 bit reading: valid stpbx is the stop bit select register that is effective in asynchronous mode. when "1" is written to stpbx, the stop bit length is set to 2 bits, and when "0" is written, it is set to 1 bit. in clock synchronous mode, no start/stop bits can be added to transfer data. therefore, stpbx is ineffec- tive. at initial reset, stpbx is set to "0" (1 bit). epr1: serial interface 1 parity enable register (ff65h?3) epr2: serial interface 2 parity enable register (ff15h?3) selects the parity function. when "1" is written: with parity when "0" is written: non parity reading: valid selects whether or not to check parity of the received data and to add a parity bit to the transmitting data. when "1" is written to eprx, the most significant bit of the received data is considered to be the parity bit and a parity check is executed. a parity bit is added to the transmitting data. when "0" is written, neither checking is done nor is a parity bit added. parity is valid only in asynchronous mode and the eprx setting becomes invalid in the clock synchro- nous mode. at initial reset, this register is set to "0". pmd1: serial interface 1 parity mode selection register (ff65h?2) pmd2: serial interface 2 parity mode selection register (ff15h?2) selects odd parity/even parity. when "1" is written: odd parity when "0" is written: even parity reading: valid when "1" is written to pmdx, odd parity is selected and even parity is selected when "0" is written. the parity check and addition of a parity bit is only valid when "1" has been written to eprx. when "0" has been written to eprx, the parity setting by pmdx becomes invalid. at initial reset, this register is set to "0".
s1c63808 technical manual epson 93 chapter 4: peripheral circuits and operation (serial interface) txen1: serial interface 1 transmit enable register (ff66h?0) txen2: serial interface 2 transmit enable register (ff16h?0) sets the serial interface to the transmit enabled status. when "1" is written: transmit enabled when "0" is written: transmit disabled reading: valid when "1" is written to txenx, the serial interface shifts to the transmit enabled status and shifts to the transmit disabled status when "0" is written. set txenx to "0" when making the initial settings of the serial interface and similar operations. at initial reset, this register is set to "0". txtrg1: serial interface 1 transmit trigger/status (ff66h?1) txtrg2: serial interface 2 transmit trigger/status (ff16h?1) functions as the transmit start trigger and the operation status indicator (transmitting/stop status). when "1" is read: during transmitting when "0" is read: during stop when "1" is written: start transmitting when "0" is written: invalid starts transmitting when "1" is written to txtrgx after writing the transmitting data. txtrgx can be read as the status. when set to "1", it indicates transmitting operation, and "0" indicates transmitting stop. at initial reset, txtrgx is set to "0". rxen1: serial interface 1 receive enable register (ff66h?2) rxen2: serial interface 2 receive enable register (ff16h?2) sets the serial interface to the receive enabled status. when "1" is written: receive enabled when "0" is written: receive disabled reading: valid when "1" is written to rxenx, the serial interface shifts to the receive enabled status and shifts to the r eceive disabled status when "0" is written. set rxenx to "0" when making the initial settings of the serial interface and similar operations. at initial reset, this register is set to "0". rxtrg1: serial interface 1 receive trigger/status (ff66h?3) rxtrg2: serial interface 2 receive trigger/status (ff16h?3) functions as the receive start trigger or preparation for the following data receiving and the operation status indicator (during receiving/during stop). when "1" is read: during receiving when "0" is read: during stop when "1" is written: start receiving/following data receiving preparation when "0" is written: invalid rxtrgx has a slightly different operation in the clock synchronous system and the asynchronous system. the rxtrgx in the clock synchronous system is used as the trigger for starting receive operation. w rite "1" into rxtrgx to start receiving at the point where the receive data has been read and the following receive preparation has been done. (in the slave mode, srdyx is asserted at the point where "1" has been written into the rxtrgx.)
94 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (serial interface) in the asynchronous system, rxtrgx is used for preparation of the following data receiving. read the r eceived data located in the receive data buffer and write "1" into rxtrgx to inform that the receive data buffer has shifted to empty. when "1" has not been written to rxtrgx, the overrun error flag oerx is set to "1" at the point where the following receiving has been completed. (when the receiving has been completed between the operation to read the received data and the operation to write "1" into rxtrgx, an overrun error occurs.) in addition, rxtrgx can be read as the status. in either clock synchronous mode or asynchronous mode, when rxtrgx is set to "1", it indicates receiving operation and when set to "0", it indicates that receiving has stopped. at initial reset, rxtrgx is set to "0". trxd10?rxd17: serial interface 1 transmit/receive data (ff68h, ff69h) trxd20?rxd27: serial interface 2 transmit/receive data (ff18h, ff19h) during transmitting t ransmitting data is set. when "1" is written: high level when "0" is written: low level w rite the transmitting data prior to starting transmission. in the case of continuous transmitting, wait for the transmit completion interrupt, then write the data. the trxdx7 becomes invalid for the 7-bit asynchronous mode. converted serial data for which the bits set at "1" as high (v dd ) level and for which the bits set at "0" as low (v ss ) level are output from the soutx terminal. during receiving the received data is stored. when "1" is read: high level when "0" is read: low level the data from the receive data buffer can be read out. since the sift register is provided separately from this buffer, reading can be done during a receive opera- tion in the asynchronous mode. (the buffer function is not used in the clock synchronous mode.) read the data after waiting for a receive completion interrupt. when performing parity check in the 7-bit asynchronous mode, "0" is loaded into the 8th bit (trxdx7) that corresponds to the parity bit. the serial data input from the sinx terminal is level converted, making the high (v dd ) level bit "1" and the low (v ss ) level bit "0" and is then loaded into this buffer. at initial reset, the buffer content is undefined. oer1: serial interface 1 overrun error flag (ff67h?0) oer2: serial interface 2 overrun error flag (ff17h?0) indicates the generation of an overrun error. when "1" is read: error when "0" is read: no error when "1" is written: reset to "0" when "0" is written: invalid oerx is an error flag that indicates the generation of an overrun error and becomes "1" when an error has been generated. an overrun error is generated when a receiving of data has completed prior to writing "1" to rxtrgx in the asynchronous mode. oerx is reset to "0" by writing "1". oerx is set to "0" at initial reset or when rxenx is set to "0".
s1c63808 technical manual epson 95 chapter 4: peripheral circuits and operation (serial interface) per1: serial interface 1 parity error flag (ff67h?1) per2: serial interface 2 parity error flag (ff17h?1) indicates the generation of a parity error. when "1" is read: error when "0" is read: no error when "1" is written: reset to "0" when "0" is written: invalid perx is an error flag that indicates the generation of a parity error and becomes "1" when an error has been generated. when a parity check is performed in the asynchronous mode, a parity error will be generated if data that does not match the parity is received. perx is reset to "0" by writing "1". perx is set to "0" at initial reset or when rxenx is set to "0". fer1: serial interface 1 framing error flag (ff67h?2) fer2: serial interface 2 framing error flag (ff17h?2) indicates the generation of a framing error. when "1" is read: error when "0" is read: no error when "1" is written: reset to "0" when "0" is written: invalid ferx is an error flag that indicates the generation of a framing error and becomes "1" when an error has been generated. when the stop bit for the receiving in the asynchronous mode has become "0", a framing error is gener- ated. ferx is reset to "0" by writing "1". ferx is set to "0" at initial reset or when rxenx is set to "0". eisrc1, eistr1, eiser1: serial interface 1 interrupt mask registers (ffe1h?0, d1, d2) eisrc2, eistr2, eiser2: serial interface 2 interrupt mask registers (ffe0h?0, d1, d2) enables or disables the generation of an interrupt for the cpu. when "1" is written: enabled when "0" is written: disabled reading: valid eisrcx, eistrx and eiserx are interrupt mask registers that respectively correspond to the interrupt factors for receive completion, transmit completion and receive error. interrupts set to "1" are enabled and interrupts set to "0" are disabled. at initial reset, these registers are set to "0". isrc1, istr1, iser1: serial interface 1 interrupt factor flags (fff1h?0, d1, d2) isrc2, istr2, iser2: serial interface 2 interrupt factor flags (fff0h?0, d1, d2) indicates the serial interface interrupt generation status. when "1" is read: interrupt has occurred when "0" is read: interrupt has not occurred when "1" is written: flag is reset when "0" is written: invalid isrcx, istrx and iserx are interrupt factor flags that respectively correspond to the interrupts for r eceive completion, transmit completion and receive error, and are set to "1" by generation of each factor. t ransmit completion interrupt factor is generated at the point where the data transmission of the shift r egister has been completed. receive completion interrupt factor is generated at the point where the received data has been transferred into the receive data buffer.
96 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (serial interface) receive error interrupt factor is generated when a parity error, framing error or overrun error has been detected during data receiving. when set in this manner, if the corresponding interrupt enable mask is set to "1" and the cpu is set to interrupt enabled status (i flag = "1") , an interrupt will be generated to the cpu. regardless of the interrupt mask register setting, the interrupt factor flag will be set to "1" by the occurrence of an interrupt generation condition. the interrupt factor flag is reset to "0" by writing "1". after an interrupt occurs, the same interrupt will occur again if the interrupt enabled state (i flag = "1") is set or the reti instruction is executed unless the interrupt factor flag is reset. therefore, be sure to reset (write "1" to) the interrupt factor flag in the interrupt service routine before shifting to the interrupt enabled state. at initial reset, these flags are set to "0". 4.10.10 programming notes (1) be sure to initialize the serial interface mode in the transmit/receive disabled status (txenx = rxenx = "0"). (2) do not perform double trigger (writing "1") to txtrgx (rxtrgx) when the serial interface is in the transmitting (receiving) operation. (3) in the clock synchronous mode, since one clock line (sclkx) is shared for both transmitting and r eceiving, transmitting and receiving cannot be performed simultaneously. (half duplex only is possible in clock synchronous mode.) consequently, be sure not to write "1" to rxtrgx (txtrgx) when txtrgx (rxtrgx) is "1". (4) when a parity error or framing error is generated during receiving in the asynchronous mode, the r eceiving error interrupt factor flag iserx is set to "1" prior to the receive completion interrupt factor flag isrcx for the time indicated in table 4.10.10.1. consequently, when an error is generated, you should reset the receiving complete interrupt factor flag isrcx to "0" by providing a wait time in error processing routines and similar routines. when an overrun error is generated, the receiving complete interrupt factor flag isrcx is not set to "1" and a receiving complete interrupt is not generated. t able 4.10.10.1 time difference between iserx and isrcx on error generation clock source time difference f osc3 / n programmable timer 1/2 cycles of f osc3 / n 1 cycle of timer 1 underflow (5) when the demultiplied signal of the osc3 oscillation circuit is made the clock source, it is necessary to turn the osc3 oscillation on, prior to using the serial interface. a time interval of 5 msec, from the turning on of the osc3 oscillation circuit to until the oscillation stabilizes, is necessary, due to the oscillation element that is used. consequently, you should allow an adequate waiting time after turning on of the osc3 oscillation, before starting transmitting/receiv- ing of serial interface. (the oscillation start time will vary somewhat depending on the oscillator and on the externally attached parts. refer to the oscillation start time example indicated in chapter 7, "electrical characteristics".) at initial reset, the osc3 oscillation circuit is set to off status. (6) be aware that the maximum clock frequency for the serial interface is limited to 2 mhz. (7) after an interrupt occurs, the same interrupt will occur again if the interrupt enabled state (i flag = "1") is set or the reti instruction is executed unless the interrupt factor flag is reset. therefore, be sure to reset (write "1" to) the interrupt factor flag in the interrupt service routine before shifting to the interrupt enabled state.
s1c63808 technical manual epson 97 chapter 4: peripheral circuits and operation (sound generator) 4.11 sound generator 4.11.1 configuration of sound generator the s1c63808 has a built-in sound generator for generating a buzzer signal. hence, the generated buzzer signal can be output from the r01 (bz) terminal. aside permitting the respective setting of the buzzer signal frequency and sound level to 8 stages, it permits the adding of a digital envelope by means of duty ratio control. it also has a one-shot output function for outputting key operated sounds. figure 4.11.1.1 shows the configuration of the sound generator. f osc1 r01 (bz) terminal programmable dividing circuit 256 hz one-shot buzzer control circuit duty ratio control circuit bzfq0?zfq2 bdty0?dty2 buzzer output control circuit envelope addition circuit enon bze enrtm enrst bzstp bzsht shtpw fi g. 4.11.1.1 configuration of sound generator note: if the bz terminal is used to drive an external component that consumes a large amount of current such as a bipolar transistor, design the pattern of traces on the printed circuit board so that the operation of the external component does not affect the ic power supply. refer to in section 5.3, "precautions on mounting", for more information. 4.11.2 control of buzzer output the bz signal generated by the sound generator is output from the r01 (bz) terminal by setting "1" for the buzzer output enable register bze. when "0" is set to bze register, the r01 (bz) terminal goes low (v ss ). r01hiz register r01 register bze register bz output fix at "0" fix at "1" "1" "0" "0" fi g. 4.11.2.1 buzzer signal output timing chart notes: when using the r01 port as the bz output port, fix the data register r01 at "1" and the high impedance control register r01hiz at "0" (data output). ? ince it generates the buzzer signal that is out of synchronization with the bze register, hazards may at times be produced when the signal goes on/off due to the setting of the bze register.
98 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (sound generator) 4.11.3 setting of buzzer frequency and sound level the divided signal of the osc1 oscillation clock (32.768 khz) is used for the buzzer signal and it is set up such that 8 types of frequencies can be selected by changing this division ratio. frequency selection is done by setting the buzzer frequency selection registers bzfq0?zfq2 as shown in table 4.11.3.1. t able 4.11.3.1 buzzer signal frequency setting buzzer frequency (hz) 4096.0 3276.8 2730.7 2340.6 2048.0 1638.4 1365.3 1170.3 bzfq0 0 1 0 1 0 1 0 1 bzfq1 0 0 1 1 0 0 1 1 bzfq2 0 0 0 0 1 1 1 1 the buzzer sound level is changed by controlling the duty ratio of the buzzer signal. the duty ratio can be selected from among the 8 types shown in table 4.11.3.2 according to the setting of the buzzer duty selection registers bdty0?dty2. t able 4.11.3.2 duty ratio setting bdty0 0 1 0 1 0 1 0 1 bdty1 0 0 1 1 0 0 1 1 bdty2 0 0 0 0 1 1 1 1 level level 1 (max.) level 2 level 3 level 4 level 5 level 6 level 7 level 8 (min.) 4096.0 2048.0 8/16 7/16 6/16 5/16 4/16 3/16 2/16 1/16 3276.8 1638.4 8/20 7/20 6/20 5/20 4/20 3/20 2/20 1/20 2730.7 1365.3 12/24 11/24 10/24 9/24 8/24 7/24 6/24 5/24 2340.6 1170.3 12/28 11/28 10/28 9/28 8/28 7/28 6/28 5/28 duty ratio by buzzer frequency (hz) when the high level output time has been made th and when the low level output time has been made tl due to the ratio of the pulse width to the pulse synchronization, the duty ratio becomes th/(th+tl). when bdty0?dty2 have all been set to "0", the duty ratio becomes maximum and the sound level also becomes maximum. conversely, when bdty0?dty2 have all been set to "1", the duty ratio becomes minimum and the sound level also becomes minimum. the duty ratio that can be set is different depending on the frequency that has been set, so see table 4.11.3.2. level 1 (max.) level 2 level 3 level 4 level 5 level 6 level 7 level 8 (min.) tl th fi g. 4.11.3.1 duty ratio of the buzzer signal waveform note: when a digital envelope has been added to the buzzer signal, the bdty0?dty2 settings will be invalid due to the control of the duty ratio.
s1c63808 technical manual epson 99 chapter 4: peripheral circuits and operation (sound generator) 4.11.4 digital envelope a digital envelope for duty control can be added to the buzzer signal. the envelope can be controlled by staged changing of the same duty envelope as detailed in table 4.11.3.2 in the preceding item from level 1 (maximum) to level 8 (minimum). the addition of an envelope to the buzzer signal can be done by writing "1" into enon, but when "0" has been written it is not added. when a buzzer signal output is begun (writing "1" into bze) after setting enon, the duty ratio shifts to level 1 (maximum) and changes in stages to level 8. when attenuated down to level 8 (minimum), it is retained at that level. the duty ratio can be returned to maximum, by writing "1" into register enrst during output of a envelope attached buzzer signal. the envelope attenuation time (time for changing of the duty ratio) can be selected by the register enrtm. the time for a 1 stage level change is 62.5 msec (16 hz), when "0" has been written into enrtm and 125 msec (8 hz), when to "1" has been written. however, there is also a max. 4 msec error from envelope on, up to the first change. figure 4.11.4.1 shows the timing chart of the digital envelope. bzfq0? enon enrst enrtm bze t 01 t 02 t 03 t 04 t 05 t 06 t 07 t 01 t 11 t 12 t 13 t 14 t 15 t 16 t 17 level 1 (max.) 2 3 4 5 6 7 8 (min.) bz signal duty ratio no change of duty level t 01 t 02?7 = 62.5 msec = 62.5 msec +0 ? t 11 t 12?7 = 125 msec = 125 msec +0 ? fi g. 4.11.4.1 timing chart for digital envelope
100 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (sound generator) 4.11.5 one-shot output the sound generator has a one-shot output function for outputting a short duration buzzer signal for key operation sounds and similar effects. either 125 msec or 31.25 msec can be selected by shtpw register for one-shot buzzer signal output time. the output of the one-shot buzzer is controlled by writing "1" into the one-shot buzzer trigger bzsht. when this trigger has been assigned, a buzzer signal in synchronization with the internal 256 hz signal is output from the buzzer output terminal. thereafter, when the set time has elapsed, a buzzer signal in synchronization with the 256 hz signal goes off in the same manner as for the start of output. the bzsht also permits reading. when bzsht is "1", the one-shot output circuit is in operation (during one-shot output) and when it is "0", it shows that the circuit is in the ready (outputtable) status. in addition, it can also terminate one-shot output prior to the elapsing of the set time. this is done by writing a "1" into the one-shot buzzer stop bzstp. in this case as well, the buzzer signal goes off in synchronization with the 256 hz signal. when "1" is written to bzsht again during a one-shot output, a new one-shot output for 125 msec or 31.25 msec starts from that point (in synchronization with the 256 hz signal). the one-shot output cannot add an envelope for short durations. however, the sound level can be set by selecting the duty ratio, and the frequency can also be set. one-shot output is invalid during normal buzzer output (during bze = "1"). figure 4.11.5.1 shows timing chart for one-shot output. 256 hz shtpw bzsht (w) bzsht (r) bzstp bz output fi g. 4.11.5.1 timing chart for one-shot output
s1c63808 technical manual epson 101 chapter 4: peripheral circuits and operation (sound generator) 4.11.6 i/o memory of sound generator t able 4.11.6.1 shows the i/o addresses and the control bits for the sound generator. t able 4.11.6.1 control bits of sound generator address comment d3 d2 register d1 d0 name init ? 1 10 0 4096.0 1 3276.8 2 2730.7 3 2340.6 [bzfq2, 1, 0] frequency (hz) 4 2048.0 5 1638.4 6 1365.3 7 1170.3 [bzfq2, 1, 0] frequency (hz) ff6eh 0 bzfq2 bzfq1 bzfq0 rr/w 0 ? 3 bzfq2 bzfq1 bzfq0 ? ? 2 0 0 0 unused buzzer frequency selection ff6fh 0 bdty2 bdty1 bdty0 rr/w 0 ? 3 bdty2 bdty1 bdty0 ? ? 2 0 0 0 unused buzzer signal duty ratio selection (refer to main manual) ff6ch enrtm enrst enon bze r/w w r/w enrtm enrst ? 3 enon bze 0 reset 0 0 1 sec reset on enable 0.5 sec invalid off disable envelope releasing time selection envelope reset (writing) envelope on/off buzzer output enable ff6dh 0 bzstp bzsht shtpw rw r/w 0 ? 3 bzstp ? 3 bzsht shtpw ? ? 2 0 0 0 stop trigger busy 125msec invalid invalid ready 31.25msec unused 1-shot buzzer stop (writing) 1-shot buzzer trigger (writing) 1-shot buzzer status (reading) 1-shot buzzer pulse width setting *1 initial value at initial reset *2 not set in the circuit *3 constantly "0" when being read bze: buzzer output control register (ff6ch?0) controls the buzzer signal output. when "1" is written: buzzer output on when "0" is written: buzzer output off reading: valid when "1" is written to bze, the bz signal is output from the r01 (bz) terminal. when "0" is written, the r01 (bz) terminal goes to low (v ss ). at initial reset, this register is set to "0". note: when using the r01 port as the bz output port, fix the data register r01 at "1" and the high impedance control register r01hiz at "0" (data output). bzfq0?zfq2: buzzer frequency selection registers (ff6eh?0?2) selects the buzzer signal frequency. t able 4.11.6.2 buzzer signal frequency setting buzzer frequency (hz) 4096.0 3276.8 2730.7 2340.6 2048.0 1638.4 1365.3 1170.3 bzfq0 0 1 0 1 0 1 0 1 bzfq1 0 0 1 1 0 0 1 1 bzfq2 0 0 0 0 1 1 1 1 select the buzzer frequency from among the above 8 types that have divided the oscillation clock. at initial reset, these registers are set to "0".
102 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (sound generator) bdty0?dty2: duty level selection registers (ff6fh?0?2) selects the duty ratio of the buzzer signal as shown in table 4.11.6.3. t able 4.11.6.3 duty ratio setting bdty0 0 1 0 1 0 1 0 1 bdty1 0 0 1 1 0 0 1 1 bdty2 0 0 0 0 1 1 1 1 level level 1 (max.) level 2 level 3 level 4 level 5 level 6 level 7 level 8 (min.) 4096.0 2048.0 8/16 7/16 6/16 5/16 4/16 3/16 2/16 1/16 3276.8 1638.4 8/20 7/20 6/20 5/20 4/20 3/20 2/20 1/20 2730.7 1365.3 12/24 11/24 10/24 9/24 8/24 7/24 6/24 5/24 2340.6 1170.3 12/28 11/28 10/28 9/28 8/28 7/28 6/28 5/28 duty ratio by buzzer frequency (hz) the sound level of this buzzer can be set by selecting this duty ratio. however, when the envelope has been set to on (enon = "1"), this setting becomes invalid. at initial reset, these registers are set to "0". enrst: envelope reset (ff6ch?2) resets the envelope. when "1" is written: reset when "0" is written: no operation reading: always "0" w riting "1" into enrst resets envelope and the duty ratio becomes maximum. if an envelope has not been added (enon = "0") and if no buzzer signal is being output, the reset becomes invalid. writing "0" is also invalid. this bit is dedicated for writing, and is always "0" for reading. enon: envelope on/off control register (ff6ch?1) controls the addition of an envelope onto the buzzer signal. when "1" is written: on when "0" is written: off reading: valid wr iting "1" into the enon causes an envelope to be added during buzzer signal output. when a "0" has been written, an envelope is not added. at initial reset, this register is set to "0". enrtm: envelope releasing time selection register (ff6ch?3) selects the envelope releasing time that is added to the buzzer signal. when "1" is written: 1.0 sec (125 msec 7 = 875 msec) when "0" is written: 0.5 sec (62.5 msec 7 = 437.5 msec) reading: valid the releasing time of the digital envelope is determined by the time for converting the duty ratio. when "1" has been written in enrtm, it becomes 125 msec (8 hz) units and when "0" has been written, it becomes 62.5 msec (16 hz) units. at initial reset, this register is set to "0".
s1c63808 technical manual epson 103 chapter 4: peripheral circuits and operation (sound generator) shtpw: one-shot buzzer pulse width setting register (ff6dh?0) selects the output time of the one-shot buzzer. when "1" is written: 125 msec when "0" is written: 31.25 msec reading: valid wr iting "1" into shtpw causes the one-short output time to be set at 125 msec, and writing "0" causes it to be set to 31.25 msec. it does not affect normal buzzer output. at initial reset, this register is set to "0". bzsht: one-shot buzzer trigger/status (ff6dh?1) controls the one-shot buzzer output. ?when writing when "1" is written: trigger when "0" is written: no operation w riting "1" into bzsht causes the one-short output circuit to operate and a buzzer signal to be output. this output is automatically turned off after the time set by shtpw has elapsed. the one-shot output is only valid when the normal buzzer output is off (bze = "0") and will be invalid when the normal buzzer output is on (bze = "1"). when a re-trigger is assigned during a one-shot output, the one-shot output time set with shtpw is measured again from that point (time extension). ?when reading when "1" is read: busy when "0" is read: ready during reading bzsht shows the operation status of the one-shot output circuit. during one-shot output, bzsht becomes "1" and the output goes off, it shifts to "0". at initial reset, this bit is set to "0". bzstp: one-shot buzzer stop (ff6dh?2) stops the one-shot buzzer output. when "1" is written: stop when "0" is written: no operation reading: always "0" w riting "1" into bzstp permits the one-shot buzzer output to be turned off prior to the elapsing of the time set by shtpw. writing "0" is invalid and writing "1" is also invalid except during one-shot output. this bit is dedicated for writing, and is always "0" for reading. 4.11.7 programming notes (1) when using the r01 port as the bz output port, fix the data register r01 at "1" and the high imped- ance control register r01hiz at "0" (data output). (2) since it generates a buzzer signal that is out of synchronization with the bze register, hazards may at times be produced when the signal goes on/off due to the setting of the bze register. (3) the one-shot output is only valid when the normal buzzer output is off (bze = "0") and will be invalid when the normal buzzer output is on (bze = "1").
104 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (integer multiplier) 4.12 integer multiplier 4.12.1 configuration of integer multiplier the s1c63808 has a built-in unsigned-integer multiplier. this multiplier performs 8 bits 8 bits of multiplication or 16 bits 8 bits of division and returns the results and three flag states. figure 4.12.1.1 shows the configuration of the integer multiplier. flag (nf/vf/zf) destination register high-order byte (drh) low-order byte (drl) data bus operation control (calmd) source register (sr) temporary register b temporary register a adder fi g. 4.12.1.1 configuration of the integer multiplier 4.12.2 multiplication mode to perform a multiplication, set the multiplier to the source register (sr) and the multiplicand to the low- order 8 bits (drl) of the destination register, then write "0" to the calculation mode selection register (calmd). the multiplication takes 10 cpu clock cycles from writing "0" to calmd until the 16-bit product is loaded into the destination register (drh and drl). at the same time the result is loaded, the operation flags (nf, vf and zf) are updated. the following shows the conditions that change the operation flag states and examples of multiplication. n flag: set when the msb of drh is "1" and reset when it is "0". v flag: always reset after a multiplication. z flag: set when the 16-bit value in drh/drl is 0000h and reset when it is not 0000h. drl (m ultiplicand) sr (m ultiplier) drh/drl (product) nf vf zf 00h 64h 0000h 0 0 1 64h 58h 2260h 0 0 0 c8h 58h 44c0h 0 0 0 c8h a5h 80e8h 1 0 0
s1c63808 technical manual epson 105 chapter 4: peripheral circuits and operation (integer multiplier) 4.12.3 division mode to perform a division, set the divisor to the source register (sr) and the dividend to the destination r egister (drh and drl), then write "1" to the calculation mode selection register (calmd). the division takes 10 cpu clock cycles from writing "1" to calmd until the quotient is loaded into the low-order 8 bits (drl) of the destination register and the remainder is loaded into the high-order 8 bits (drh) of the destination register. at the same time the result is loaded, the operation flags (nf, vf and zf) are up- dated. however, when an overflow results (if the quotient exceeds the 8-bit range), the destination register (drh and drl) does not change its contents as it maintains the dividend. the following shows the conditions that change the operation flag states and examples of division. n flag: set when the msb of drl is "1" and reset when it is "0". v flag: set when the quotient exceeds the 8-bit range and reset when it is within the 8-bit range. z flag: set when the 8-bit value in drl is 00h and reset when it is not 00h. drh/drl (dividend) sr (divisor) drl (quotient) drh (remainder) nf vf zf 1a16h 64h 42h 4eh 0 0 0 332ch 64h 83h 00h 1 0 0 0000h 58h 00h 00h 0 0 1 2468h 13h 68h 24h 1 1 0 in the example of "2468h" "13h" shown above, drh/drl maintains the dividend because the quotient overflows the 8-bit. to get the correct results when an overflow has occurred, perform the division with two steps as shown below. 1. divide the high-order 8 bits of the dividend (24h) by the divisor (13h) and then store the quotient (01h) to memory. drh/drl (dividend) sr (divisor) drl (quotient) drh (remainder) nf vf zf 0024h 13h 01h 11h 0 0 0 2. keep the remainder (11h) in drh and load the low-order 8 bits of the dividend (68h) to drl, then perform division again. drh/drl (dividend) sr (divisor) drl (quotient) drh (remainder) nf vf zf 1 168h 13h eah 0ah 1 0 0 the correct result is obtained as the quotient = 01eah (the first and second results of drl are merged) and the remainder = 0ah. however, since the operation flags (nf/vf/zf) are changed in each step, they cannot indicate the states according to the final operation results. note: make sure that the division results are correct using software as the hardware does not check.
106 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (integer multiplier) 4.12.4 execution cycle both the multiplication and division take 10 cpu cycles for an operation. therefore, before the results can be read from the destination register drh/drl, wait at least 5 bus cycles after writing to calmd. the same applies to reading the operation flags nf/vf/zf. the following shows a sample program. ldb %ext, src_data@h ldb %xl, src_data@l ; set ram address for operand ldb %ext, au@h ldb %yl, au@l ; set multiplier i/o memory address ; ldb %ba, [%x]+ ldb [%y]+, %ba ; set data to sr ldb %ba, [%x]+ ldb [%y]+, %ba ; set data to drl ldb %ba, [%x]+ ldb [%y]+, %ba ; set data to drh ; ld [%y], 0b0001 ; start operation (select calculation mode) ; ldb %ext, rslt_data@h ldb %xl, rslt_data@l ; set result store address nop nop nop ; dummy instructions to wait end of operation ; bit [%y], 0b0100 jrnz overflow ; jump to error routine if vf = "1" ; add %y, -4 ; set drl again ; ldb %ba, [%y]+ ldb [%x]+, %ba ; store result (quotient) into ram ldb %ba, [%y]+ ldb [%x]+, %ba ; store result (remainder) into ram
s1c63808 technical manual epson 107 chapter 4: peripheral circuits and operation (integer multiplier) 4.12.5 i/o memory of integer multiplier t able 4.12.5.1 shows the i/o addresses and the control bits for the integer multiplier. t able 4.12.5.1 control bits of integer multiplier address comment d3 d2 register d1 d0 name init ? 1 10 drl3 drl2 drl1 drl0 ? ? 2 ? ? 2 ? ? 2 ? ? 2 low-order 8-bit destination register (low-order 4 bits) lsb r/w ff82h drl3 drl2 drl1 drl0 drl7 drl6 drl5 drl4 ? ? 2 ? ? 2 ? ? 2 ? ? 2 msb low-order 8-bit destination register (high-order 4 bits) r/w ff83h drl7 drl6 drl5 drl4 sr3 sr2 sr1 sr0 ? ? 2 ? ? 2 ? ? 2 ? ? 2 source register (low-order 4 bits) lsb r/w ff80h sr3 sr2 sr1 sr0 sr7 sr6 sr5 sr4 ? ? 2 ? ? 2 ? ? 2 ? ? 2 msb source register (high-order 4 bits) r/w ff81h sr7 sr6 sr5 sr4 ff86h nf vf zf calmd rr/w nf vf zf calmd 0 0 0 0 negative overflow zero run div. positive no no stop mult. negative flag overflow flag zero flag operation status (reading) calculation mode selection (writing) drh3 drh2 drh1 drh0 ? ? 2 ? ? 2 ? ? 2 ? ? 2 high-order 8-bit destination register (low-order 4 bits) lsb r/w ff84h drh3 drh2 drh1 drh0 drh7 drh6 drh5 drh4 ? ? 2 ? ? 2 ? ? 2 ? ? 2 msb high-order 8-bit destination register (high-order 4 bits) r/w ff85h drh7 drh6 drh5 drh4 *1 initial value at initial reset *2 not set in the circuit *3 constantly "0" when being read sr0?r7: source register (ff80h, ff81h) used to set multipliers and divisors. set the low-order 4 bits of data to sr0?r3 and the high-order 4 bits to sr4?r7. this register maintains the latest set value until the next writing, so it is not necessary to set data for each operation if the same multiplier and divisor is used in a series of operations. at initial reset, this register is undefined. drl0?rl7: destination register low-order 8 bits (ff82h, ff83h) used to set multiplicands and low-order 8 bits of dividends. set the low-order 4 bits of data to drl0?rl3 and the high-order 4 bits to drl4?rl7. data written to this register is loaded to the arithmetic circuit when an operation starts (by writing to ff86h?0), and then a multiplication or a division is performed in 10 cpu clock cycles (5 bus cycles). after the operation has finished, the low-order 8 bits of the product or the quotient are loaded to this r egister. however, if an overflow occurs in a division process, the quotient is not loaded and the low-order 8 bits of the dividend remains. at initial reset, this register is undefined.
108 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (integer multiplier) drh0?rh7: destination register high-order 8 bits (ff84h, ff85h) used to set high-order 8 bits of dividends. set the low-order 4 bits of data to drh0?rh3 and the high-order 4 bits to drh4?rh7. at the start of a multiplication (by writing "0" to ff86h?0), the contents in this register are ignored. after 10 cpu cycles (5 bus cycles) of multiplication process has finished, the high-order 8 bits of the product are loaded in this register. in a division process, data written to this register is loaded to the arithmetic circuit when an operation starts (by writing "1" to ff86h?0), and then a division is performed in 10 cpu clock cycles (5 bus cycles). after the operation has finished, the remainder is loaded to this register. however, if an overflow occurs in a division process, the remainder is not loaded and the high-order 8 bits of the dividend remains. at initial reset, this register is undefined. nf: negative flag (ff86h?3) indicates whether the operation result is a positive value or a negative value. when "1" is read: negative value (msb of the results is "1") when "0" is read: positive value (msb of the results is "0") w riting: invalid nf is a read-only bit, so writing operation is invalid. at initial reset, this flag is set to "0". vf: overflow flag (ff86h?2) indicates whether an overflow has occurred or not in a division process. when "1" is read: overflow occurred when "0" is read: overflow has not occurred w riting: invalid when a multiplication process has finished, this flag is always set to "0". vf is a read-only bit, so writing operation is invalid. at initial reset, this flag is set to "0". zf: zero flag (ff86h?1) indicates whether the operation result is zero or not. when "1" is read: zero when "0" is read: not zero w riting: invalid zf is a read-only bit, so writing operation is invalid. at initial reset, this flag is set to "0". calmd: calculation mode selection register/operation status (ff86h?0) selects multiplication or division mode and starts operation. when "1" is written: selects/starts division when "0" is written: selects/starts multiplication when "1" is read: under operating when "0" is read: operation has finished w riting to this register starts the specified operation. after that, this register is set to "1" and returns to "0" when the multiplication or division process has finished. at initial reset, this register is reset to "0". 4.12.6 programming note an operation process takes 10 cpu clock cycles (5 bus cycles) after writing to the calculation mode selection register calmd until the operation result is set to the destination register drh/drl and the operation flags. while this operation is in process, do not read/write from/to the destination register drh/drl and do not read nf/vf/zf.
s1c63808 technical manual epson 109 chapter 4: peripheral circuits and operation (svd circuit) 4.13 svd (supply voltage detection) circuit 4.13.1 configuration of svd circuit the s1c63808 has a built-in svd (supply voltage detection) circuit, so that the software can find when the source voltage lowers. turning the svd circuit on/off and the svd criteria voltage setting can be done with software. figure 4.13.1.1 shows the configuration of the svd circuit. v detection output data bus dd v ss svdon svdchg svds2? criteria voltage setting circuit svd circuit svddt fi g. 4.13.1.1 configuration of svd circuit 4.13.2 svd operation the svd circuit compares the criteria voltage set by software and the supply voltage (v dd terminal? ss terminal) and sets its results into the svddt latch. by reading the data of this svddt latch, it can be determined by means of software whether the supply voltage is normal or has dropped. the criteria voltage to be used can be selected from 8 levels using svds2?vds0. furthermore, two types of 8-voltage combinations for 3.0 v and 1.5 v supply voltages are available and either one can be selected using svdchg. set svdchg to "1" when 3.0 v (typ.) supply voltage is used or to "0" when 1.5 v (typ.) supply voltage is used. t able 4.13.2.1 lists the criteria voltages. t able 4.13.2.1 criteria voltage svds2 1 1 1 1 0 0 0 0 svds1 1 1 0 0 1 1 0 0 svds0 1 0 1 0 1 0 1 0 1.5 v system (svdchg = "0") 1.50 1.40 1.30 1.25 1.20 1.15 1.10 1.05 criteria voltage ( v ) 3.0 v system (svdchg = "1") 2.90 2.70 2.40 2.10 2.00 1.90 1.80 1.70 when the svdon register is set to "1", source voltage or external voltage detection by the svd circuit is executed. as soon as the svdon register is reset to "0", the result is loaded to the svddt latch and the svd circuit goes off. to obtain a stable detection result, the svd circuit must be on for at least 1 msec. so, to obtain the svd detection result, follow the programming sequence below. 1. set svdon to "1" 2. maintain for 1 msec minimum 3. set svdon to "0" 4. read svddt when the svd circuit is on, the ic draws a large current, so keep the svd circuit off unless it is.
110 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (svd circuit) 4.13.3 i/o memory of svd circuit t able 4.13.3.1 shows the i/o addresses and the control bits for the svd circuit. t able 4.13.3.1 control bits of svd circuit address comment d3 d2 register d1 d0 name init ? 1 10 ff05h 00 svddt svdon rr/w 0 ? 3 0 ? 3 svddt svdon ? ? 2 ? ? 2 0 0 low on normal off unused unused svd evaluation data svd circuit on/off ff04h svdchg svds2 svds1 svds0 r/w svdchg svds2 svds1 svds0 0 0 0 0 3.0 v 1.5 v svd voltage system selection svd criteria voltage setting 1 1.10 1.80 2 1.15 1.90 3 1.20 2.00 4 1.25 2.10 5 1.30 2.40 6 1.40 2.70 7 1.50 2.90 [svds2?] 1.5 v (v) 3.0 v (v) 0 1.05 1.70 *1 initial value at initial reset *2 not set in the circuit *3 constantly "0" when being read svdchg: svd voltage set selection register (ff04h?3) selects an svd criteria voltage combination according to the supply voltage. when "1" is written: 3.0 v (typ.) when "0" is written: 1.5 v (typ.) reading: valid when svdchg is set to "1", the 8-level criteria voltage set is configured for a 3.0 v supply voltage and when it is set to "0", voltages are configured for a 1.5 v supply voltage. at initial reset, this register is set to "0". svds2?vds0: svd criteria voltage setting registers (ff04h?2?0) criteria voltage for svd is set as shown in table 4.13.2.1. at initial reset, these registers are set to "0". svdon: svd control (on/off) register (ff05h?0) t urns the svd circuit on and off. when "1" is written: svd circuit on when "0" is written: svd circuit off reading: valid when svdon is set to "1", a source voltage detection is executed by the svd circuit. as soon as svdon is reset to "0", the result is loaded to the svddt latch. to obtain a stable detection result, the svd circuit must be on for at least 1 msec. at initial reset, this register is set to "0". svddt: svd data (ff05h?1) this is the result of supply voltage detection. when "0" is read: supply voltage (v dd ? ss ) criteria voltage when "1" is read: supply voltage (v dd ? ss ) < criteria voltage w riting: invalid the result of supply voltage detection at time of svdon is set to "0" can be read from this latch. at initial reset, svddt is set to "0".
s1c63808 technical manual epson 111 chapter 4: peripheral circuits and operation (svd circuit) 4.13.4 programming notes (1) to obtain a stable detection result, the svd circuit must be on for at least 1 msec. so, to obtain the svd detection result, follow the programming sequence below. 1. set svdon to "1" 2. maintain for 1 msec minimum 3. set svdon to "0" 4. read svddt (2) the svd circuit should normally be turned off because svd operation increase current consumption.
112 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (power supply for epd driver ic) 4.14 power supply for epd driver ic (v c1 ? c3 ) 4.14.1 configuration of epd system voltage circuit the s1c63808 has a built-in power supply circuit that generates the voltages (v c1 ? c3 ) for epd driver ics. figure 4.14.1.1 shows the configuration of the epd system voltage circuit. epd system voltage regulator v c1 v c2 v c3 ca cb v c1 voltage booster lpwr lc0?c3 to epd driver ic ? ? connect the v c3 pin to v ss when 1/2 bias is selected. fi g. 4.14.1.1 configuration of epd system voltage circuit the epd system voltage circuit generates v c1 with the voltage regulator built-in, and generates two other voltages (v c2 = 2v c1 , v c3 = 3v c1 , v c3 = v ss when 1/2 bias is selected) by boosting v c1 . note: do not drive external loads with the output voltage from the epd system voltage circuit except for the exclusive epd driver ic. 4.14.2 mask option either 1/2 bias or 1/3 bias can be selected to configure the outputs from the epd system voltage circuit. when 1/3 bias is selected: v c1 = 1.03 to 1.23 v, v c2 = 2 v c1 , v c3 = 3 v c1 when 1/2 bias is selected: v c1 = 1.08 to 1.84 v, v c2 = 2 v c1 , v c3 = v ss 4.14.3 turning epd system voltage circuit on and off the epd system voltage circuit is turned on and off using the lpwr register. when lpwr is set to "1", the epd system voltage circuit outputs the v c1 ? c3 voltages to the epd driver ic. when lpwr is set to "0", the epd system voltage circuit goes off and the v c1 ? c3 terminals go to v ss level.
s1c63808 technical manual epson 113 chapter 4: peripheral circuits and operation (power supply for epd driver ic) 4.14.4 adjustment of epd driver voltages the epd driver voltages (v c1 ? c3 ) can be adjusted in the software. it is realized by controlling the voltages v c1 output from the epd system voltage circuit. the v c1 voltage for 1/3 bias can be adjusted to 8 levels as shown in table 4.14.4.1 using the lc2?c0 r egister. the v c1 voltage varies within the range from 1.03 to 1.23 v, and other voltages change according to v c1 . the v c1 voltage for 1/2 bias can be adjusted to 16 levels as shown in table 4.14.4.1 using the lc3?c0 r egister. the v c1 voltage varies within the range from 1.08 to 1.84 v, and v c2 changes according to v c1 . t able 4.14.4.1 v c1 voltage value no. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 lc2 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 lc3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 lc1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 lc0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1/2 bias 1.08 1.14 1.20 1.27 1.33 1.39 1.43 1.49 1.55 1.59 1.63 1.67 1.72 1.76 1.80 1.84 1/3 bias 1.03 1.06 1.09 1.12 1.15 1.18 1.20 1.23 v c1 (v) when 1/2 bias is selected: v c2 = 2 v c1 , v c3 = v ss when 1/3 bias is selected: v c2 = 2 v c1 , v c3 = 3 v c1 , lc3 is ineffective. at initial reset, the lc3(lc2)?c0 register is set to 0000b. the software should initialize the register to get the desired contrast. note: to generate stable epd driver voltages, the v dd voltage to be supplied to the ic must be higher than the v c1 voltage that will be generated by setting the lc3?c0 register to the maximum value (7 for 1/3 bias or 15 for 1/2 bias).
114 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (power supply for epd driver ic) 4.14.5 i/o memory of power supply for epd driver ic t able 4.14.5.1 shows the i/o addresses and the control bits of the power supply for epd driver ics. t able 4.14.5.1 control bits of power supply for epd driver ics address comment d3 d2 register d1 d0 name init ? 1 10 ff62h 0 lc2 lc1 lc0 rr/w 0 ? 3 lc2 lc1 lc0 ? ? 2 0 0 0 0 low 7 high [lc2?] voltage unused 1/3 bias v c1 voltage adjustment lc3 lc2 lc1 lc0 r/w lc3 lc2 lc1 lc0 0 0 0 0 0 low 15 high [lc3?] voltage v c1 voltage adjustment 1/2 bias ff60h 000lpwr rr/w 0 ? 3 0 ? 3 0 ? 3 lpwr ? ? 2 ? ? 2 ? ? 2 0onoff unused unused unused epd driver power supply on/off *1 initial value at initial reset *2 not set in the circuit *3 constantly "0" when being read lpwr: epd driver power control (on/off) register (ff60h?0) tu rns the epd system voltage circuit on and off. when "1" is written: on when "0" is written: off reading: valid when "1" is written to the lpwr register, the epd system voltage circuit goes on and generates the v c1 v c3 voltages for epd driver ics. when "0" is written, all the epd driver voltages go to v ss level. it takes about 100 msec for the epd driver voltages to stabilize after starting up the epd system voltage circuit by writing "1" to the lpwr register. at initial reset, this register is set to "0". lc3?c0: v c1 voltage adjustment register (ff62h) adjusts the v c1 voltage as shown in table 4.14.5.2. when 1/3 bias is selected, lc3 is ineffective. t able 4.14.5.2 v c1 voltage value no. 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 lc2 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 lc3 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 lc1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 lc0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1/2 bias 1.08 1.14 1.20 1.27 1.33 1.39 1.43 1.49 1.55 1.59 1.63 1.67 1.72 1.76 1.80 1.84 1/3 bias 1.03 1.06 1.09 1.12 1.15 1.18 1.20 1.23 v c1 (v) when 1/2 bias is selected: v c2 = 2 v c1 , v c3 = v ss when 1/3 bias is selected: v c2 = 2 v c1 , v c3 = 3 v c1 , lc3 is ineffective. at initial reset, this register is set to 0000b.
s1c63808 technical manual epson 115 chapter 4: peripheral circuits and operation (power supply for epd driver ic) 4.14.6 programming note because at initial reset, the lc3?c0 register is set to 0000b (v c1 = 1.03 v when 1/3 bias is selected or 1.08 v when 1/2 bias is selected), it is necessary to initialize by the software. furthermore, the epd system voltage circuit is turned off and the v c1 ? c3 terminals go to v ss level.
116 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (interrupt and halt) 4.15 interrupt and halt the s1c63808 provides the following interrupt functions. external interrupt: input interrupt (2 systems) internal interrupt: watchdog timer interrupt (nmi, 1 system) ?programmable timer interrupt (2 systems) ?serial interface interrupt (6 systems) ?clock timer interrupt (4 systems) ?stopwatch timer interrupt (4 systems) to authorize interrupt, the interrupt flag must be set to "1" (ei) and the necessary related interrupt mask r egisters must be set to "1" (enable). when an interrupt occurs the interrupt flag is automatically reset to "0" (di), and interrupts after that are inhibited. the watchdog timer interrupt is an nmi (non-maskable interrupt), therefore, the interrupt is generated r egardless of the interrupt flag setting. also the interrupt mask register is not provided. however, it is possible to not generate nmi since software can stop the watchdog timer operation. figure 4.15.1 shows the configuration of the interrupt circuit. note: after an initial reset, all the interrupts including nmi are masked until both the stack pointers sp1 and sp2 are set with the software. be sure to set the sp1 and sp2 in the initialize routine. further, when re-setting the stack pointer, the sp1 and sp2 must be set as a pair. when one of them is set, all the interrupts including nmi are masked and interrupts cannot be accepted until the other one is set. the s1c63808 has halt functions that considerably reduce the current consumption when it is not necessary. the cpu enters halt status when the halt instruction is executed. in halt status, the operation of the cpu is stopped. however, timers continue counting since the oscillation circuit operates. reactivating the cpu from halt status is done by generating a hardware interrupt request including nmi.
s1c63808 technical manual epson 117 chapter 4: peripheral circuits and operation (interrupt and halt) fi g. 4.15.1 configuration of the interrupt circuit k10 kcp10 sik10 k11 kcp11 sik11 k12 kcp12 sik12 k13 kcp13 sik13 ik1 eik1 it3 eit3 it2 eit2 it1 eit1 it0 eit0 irun eirun ilap eilap isw1 eisw1 isw10 eisw10 ipt1 eipt1 ipt0 eipt0 interrupt vector generation circuit program counter (low-order 4 bits) int interrupt request nmi request watchdog timer interrupt factor flag interrupt mask register input comparison register interrupt selection register interrupt flag k00 kcp00 sik00 k01 kcp01 sik01 k02 kcp02 sik02 k03 kcp03 sik03 ik0 eik0 iser2 eiser2 istr2 eistr2 isrc2 eisrc2 iser1 eiser1 istr1 eistr1 isrc1 eisrc1
118 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (interrupt and halt) 4.15.1 interrupt factor t able 4.15.1.1 shows the factors for generating interrupt requests. the interrupt flags are set to "1" depending on the corresponding interrupt factors. the cpu operation is interrupted when an interrupt factor flag is set to "1" if the following conditions are established. ?the corresponding mask register is "1" (enabled) ?the interrupt flag is "1" (ei) the interrupt factor flag is reset to "0" when "1" is written. at initial reset, the interrupt factor flags are reset to "0". ? since the watchdog timer's interrupt is nmi, the interrupt is generated regardless of the setting above, and no interrupt factor flag is provided. t able 4.15.1.1 interrupt factors interrupt factor programmable timer 1 (counter = 0) programmable timer 0 (counter = 0) serial interface 1 (receive error) serial interface 1 (transmit completion) serial interface 1 (receive completion) serial interface 2 (receive error) serial interface 2 (transmit completion) serial interface 2 (receive completion) k00?03 input (falling edge or rising edge) k10?13 input (falling edge or rising edge) clock timer 1 hz (falling edge) clock timer 2 hz (falling edge) clock timer 8 hz (falling edge) clock timer 32 hz (falling edge) stopwatch timer (direct run) stopwatch timer (direct lap) stopwatch timer (1 hz) stopwatch timer (10 hz) ipt1 ipt0 iser1 istr1 isrc1 iser2 istr2 isrc2 ik0 ik1 it3 it2 it1 it0 irun ilap isw1 isw10 ( fff2h?1 ) ( fff2h?0 ) ( fff1h?2 ) ( fff1h?1 ) ( fff1h?0 ) ( fff0h?2 ) ( fff0h?1 ) ( fff0h?0 ) ( fff4h?0 ) ( fff5h?0 ) ( fff6h?3 ) ( fff6h?2 ) ( fff6h?1 ) ( fff6h?0 ) ( fff8h?3 ) ( fff8h?2 ) ( fff8h?1 ) ( fff8h?0 ) interrupt factor flag note: after an interrupt occurs, the same interrupt will occur again if the interrupt enabled state (i flag = "1") is set or the reti instruction is executed unless the interrupt factor flag is reset. therefore, be sure to reset (write "1" to) the interrupt factor flag in the interrupt service routine before shifting to the interrupt enabled state.
s1c63808 technical manual epson 119 chapter 4: peripheral circuits and operation (interrupt and halt) 4.15.2 interrupt mask the interrupt factor flags can be masked by the corresponding interrupt mask registers. the interrupt mask registers are read/write registers. they are enabled (interrupt authorized) when "1" is written to them, and masked (interrupt inhibited) when "0" is written to them. at initial reset, the interrupt mask register is reset to "0". t able 4.15.2.1 shows the correspondence between interrupt mask registers and interrupt factor flags. t able 4.15.2.1 interrupt mask registers and interrupt factor flags ipt1 ipt0 iser1 istr1 isrc1 iser2 istr2 isrc2 ik0 ik1 it3 it2 it1 it0 irun ilap isw1 isw10 ( fff2h?1 ) ( fff2h?0 ) ( fff1h?2 ) ( fff1h?1 ) ( fff1h?0 ) ( fff0h?2 ) ( fff0h?1 ) ( fff0h?0 ) ( fff4h?0 ) ( fff5h?0 ) ( fff6h?3 ) ( fff6h?2 ) ( fff6h?1 ) ( fff6h?0 ) ( fff8h?3 ) ( fff8h?2 ) ( fff8h?1 ) ( fff8h?0 ) interrupt factor flag eipt1 eipt0 eiser1 eistr1 eisrc1 eiser2 eistr2 eisrc2 eik0 eik1 eit3 eit2 eit1 eit0 eirun eilap eisw1 eisw10 ( ffe2h?1 ) ( ffe2h?0 ) ( ffe1h?2 ) ( ffe1h?1 ) ( ffe1h?0 ) ( ffe0h?2 ) ( ffe0h?1 ) ( ffe0h?0 ) ( ffe4h?0 ) ( ffe5h?0 ) ( ffe6h?3 ) ( ffe6h?2 ) ( ffe6h?1 ) ( ffe6h?0 ) ( ffe8h?3 ) ( ffe8h?2 ) ( ffe8h?1 ) ( ffe8h?0 ) interrupt mask register 4.15.3 interrupt vector when an interrupt request is input to the cpu, the cpu begins interrupt processing. after the program being executed is terminated, the interrupt processing is executed in the following order. 1 the content of the flag register is evacuated, then the i flag is reset. 2 the address data (value of program counter) of the program to be executed next is saved in the stack area (ram). 3 the interrupt request causes the value of the interrupt vector (0100h?10ch) to be set in the program counter. 4 the program at the specified address is executed (execution of interrupt processing routine by software). t able 4.15.3.1 shows the correspondence of interrupt requests and interrupt vectors. t able 4.15.3.1 interrupt request and interrupt vectors interrupt vector 0100h 0102h 0104h 0106h 0108h 010ah 010ch 010eh interrupt factor watchdog timer programmable timer serial interface k00?03, k10?13 input clock timer stopwatch timer priority high low the four low-order bits of the program counter are indirectly addressed through the interrupt request.
120 epson s1c63808 technical manual chapter 4: peripheral circuits and operation (interrupt and halt) 4.15.4 i/o memory of interrupt t ables 4.15.4.1 shows the i/o addresses and the control bits for controlling interrupts. t able 4.15.4.1(a) control bits of interrupt address comment d3 d2 register d1 d0 name init ? 1 10 ff20h sik03 sik02 sik01 sik00 r/w sik03 sik02 sik01 sik00 0 0 0 0 enable enable enable enable disable disable disable disable k00?03 interrupt selection register ff22h kcp03 kcp02 kcp01 kcp00 r/w kcp03 kcp02 kcp01 kcp00 0 0 0 0 k00?03 input comparison register ff24h sik13 sik12 sik11 sik10 r/w sik13 sik12 sik11 sik10 0 0 0 0 enable enable enable enable disable disable disable disable k10?13 interrupt selection register ff26h kcp13 kcp12 kcp11 kcp10 r/w kcp13 kcp12 kcp11 kcp10 0 0 0 0 k10?13 input comparison register ffe0h 0e iser2 eistr2 eisrc2 rr/w 0 ? 3 eiser2 eistr2 eisrc2 ? ? 2 0 0 0 enable enable enable mask mask mask unused interrupt mask register (serial i/f 2 error) interrupt mask register (serial i/f 2 transmit completion) interrupt mask register (serial i/f 2 receive completion) ffe1h 0e iser1 eistr1 eisrc1 rr/w 0 ? 3 eiser1 eistr1 eisrc1 ? ? 2 0 0 0 enable enable enable mask mask mask unused interrupt mask register (serial i/f 1 error) interrupt mask register (serial i/f 1 transmit completion) interrupt mask register (serial i/f 1 receive completion) ffe2h 00ei pt1 eipt0 rr/w 0 ? 3 0 ? 3 eipt1 eipt0 ? ? 2 ? ? 2 0 0 enable enable mask mask unused unused interrupt mask register (programmable timer 1) interrupt mask register (programmable timer 0) ffe6h eit3 eit2 eit1 eit0 r/w eit3 eit2 eit1 eit0 0 0 0 0 enable enable enable enable mask mask mask mask interrupt mask register (clock timer 1 hz) interrupt mask register (clock timer 2 hz) interrupt mask register (clock timer 8 hz) interrupt mask register (clock timer 32 hz) ffe8h eirun eilap eisw1 eisw10 r/w eirun eilap eisw1 eisw10 0 0 0 0 enable enable enable enable mask mask mask mask interrupt mask register (stopwatch direct run) interrupt mask register (stopwatch direct lap) interrupt mask register (stopwatch timer 1 hz) interrupt mask register (stopwatch timer 10 hz) fff2h 00i pt1 ipt0 rr/w 0 ? 3 0 ? 3 ipt1 ipt0 ? ? 2 ? ? 2 0 0 (r) yes (w) reset (r) no (w) invalid unused unused interrupt factor flag (programmable timer 1) interrupt factor flag (programmable timer 0) fff0h 0i ser2 istr2 isrc2 rr/w 0 ? 3 iser2 istr2 isrc2 ? ? 2 0 0 0 (r) yes (w) reset (r) no (w) invalid unused interrupt factor flag (serial i/f 2 error) interrupt factor flag (serial i/f 2 transmit completion) interrupt factor flag (serial i/f 2 receive completion) fff1h 0i ser1 istr1 isrc1 rr/w 0 ? 3 iser1 istr1 isrc1 ? ? 2 0 0 0 (r) yes (w) reset (r) no (w) invalid unused interrupt factor flag (serial i/f 1 error) interrupt factor flag (serial i/f 1 transmit completion) interrupt factor flag (serial i/f 1 receive completion) ffe5h 000ei k1 rr/w 0 ? 3 0 ? 3 0 ? 3 eik1 ? ? 2 ? ? 2 ? ? 2 0 enable mask unused unused unused interrupt mask register (k10?13) ffe4h 000ei k0 rr/w 0 ? 3 0 ? 3 0 ? 3 eik0 ? ? 2 ? ? 2 ? ? 2 0 enable mask unused unused unused interrupt mask register (k00?03) *1 initial value at initial reset *2 not set in the circuit *3 constantly "0" when being read
s1c63808 technical manual epson 121 chapter 4: peripheral circuits and operation (interrupt and halt) t able 4.15.4.1(b) control bits of interrupt address comment d3 d2 register d1 d0 name init ? 1 10 fff6h fff8h irun ilap isw1 isw10 r/w irun ilap isw1 isw10 0 0 0 0 (r) yes (w) reset (r) no (w) invalid interrupt factor flag (stopwatch direct run) interrupt factor flag (stopwatch direct lap) interrupt factor flag (stopwatch timer 1 hz) interrupt factor flag (stopwatch timer 10 hz) it3 it2 it1 it0 r/w it3 it2 it1 it0 0 0 0 0 (r) yes (w) reset (r) no (w) invalid interrupt factor flag (clock timer 1 hz) interrupt factor flag (clock timer 2 hz) interrupt factor flag (clock timer 8 hz) interrupt factor flag (clock timer 32 hz) fff4h 000ik0 rr/w 0 ? 3 0 ? 3 0 ? 3 ik0 ? ? 2 ? ? 2 ? ? 2 0 (r) yes (w) reset (r) no (w) invalid unused unused unused interrupt factor flag (k00?03) fff5h 000ik1 rr/w 0 ? 3 0 ? 3 0 ? 3 ik1 ? ? 2 ? ? 2 ? ? 2 0 (r) yes (w) reset (r) no (w) invalid unused unused unused interrupt factor flag (k10?13) *1 initial value at initial reset *2 not set in the circuit *3 constantly "0" when being read eipt1, eipt0: interrupt mask registers (ffe2h?2, d1, d0) ipt1, ipt0: interrupt factor flags (fff2h?2, d1, d0) refer to section 4.9, "programmable timer". eiser1, eistr1, eisrc1: interrupt mask registers (ffe1h?2, d1, d0) eiser2, eistr2, eisrc2: interrupt mask registers (ffe0h?2, d1, d0) iser1, istr1, isrc1: interrupt factor flags (fff1h?2, d1, d0) iser2, istr2, isrc2: interrupt factor flags (fff0h?2, d1, d0) refer to section 4.10, "serial interface". kcp03?cp00, kcp13?cp10: input comparison registers (ff22h, ff26h) sik03?ik00, sik13?ik10: interrupt selection registers (ff20h, ff24h) eik0, eik1: interrupt mask registers (ffe4h?0, ffe5h?0) ik0, ik1: interrupt factor flags (fff4h?0, fff5h?0) refer to section 4.4, "input ports". eit3?it0: interrupt mask registers (ffe6h) it3?t0: interrupt factor flags (fff6h) refer to section 4.7, "clock timer". eirun, eilap, eisw1, eisw10: interrupt mask registers (ffe8h) irun, ilap, isw1, isw10: interrupt factor flags (fff8h) refer to section 4.8, "stopwatch timer". 4.15.5 programming notes (1) the interrupt factor flags are set when the interrupt condition is established, even if the interrupt mask registers are set to "0". (2) after an interrupt occurs, the same interrupt will occur again if the interrupt enabled state (i flag = "1") is set or the reti instruction is executed unless the interrupt factor flag is reset. therefore, be sure to reset (write "1" to) the interrupt factor flag in the interrupt service routine before shifting to the interrupt enabled state. (3) after an initial reset, all the interrupts including nmi are masked until both the stack pointers sp1 and sp2 are set with the software. be sure to set the sp1 and sp2 in the initialize routine. further, when re-setting the stack pointer, the sp1 and sp2 must be set as a pair. when one of them is set, all the interrupts including nmi are masked and interrupts cannot be accepted until the other one is set.
122 epson s1c63808 technical manual chapter 5: summary of notes chapter 5s ummary of n o tes 5.1 notes for low current consumption the s1c63808 contains control registers for each of the circuits so that current consumption can be r educed. these control registers reduce the current consumption through programs that operate the circuits at the minimum levels. the following lists the circuits that can control operation and their control registers. refer to these when programming. t able 5.1.1 circuits and control registers circuit (and item) cpu cpu operating frequency svd circuit epd system voltage circuit control register halt instruction clkchg, oscc svdon lpwr refer to chapter 7, "electrical characteristics" for current consumption. below are the circuit statuses at initial reset. cpu : operating status cpu operating frequency : low speed side (clkchg = "0") osc3 oscillation circuit is in off status (oscc = "0") svd circuit :o ff status (svdon = "0") epd system voltage circuit :o ff status (lpwr = "0")
s1c63808 technical manual epson 123 chapter 5: summary of notes 5.2 summary of notes by function here, the cautionary notes are summed up by function category. keep these notes well in mind when programming. memory and stack (1 )m emory is not implemented in unused areas within the memory map. further, some non-implemen- tation areas and unused (access prohibition) areas exist in the peripheral i/o area. if the program that accesses these areas is generated, its operation cannot be guaranteed. refer to the i/o memory maps shown in table 4.1.1 for the peripheral i/o area. (2) part of the ram area is used as a stack area for subroutine call and register evacuation, so pay attention not to overlap the data area and stack area. (3) the s1c63000 core cpu handles the stack using the stack pointer for 4-bit data (sp2) and the stack pointer for 16-bit data (sp1). 16-bit data are accessed in stack handling by sp1, therefore, this stack area should be allocated to the area where 4-bit/16-bit access is possible (0100h to 01ffh). the stack pointers sp1 and sp2 change cyclically within their respective range: the range of sp1 is 0000h to 03ffh and the range of sp2 is 0000h to 00ffh. therefore, pay attention to the sp1 value because it may be set to 0200h or more exceeding the 4-bit/16-bit accessible range in the s1c63808 or it may be set to 00ffh or less. memory accesses except for stack operations by sp1 are 4-bit data access. after initial reset, all the interrupts including nmi are masked until both the stack pointers sp1 and sp2 are set by software. further, if either sp1 or sp2 is re-set when both are set already, the interrupts including nmi are masked again until the other is re-set. therefore, the settings of sp1 and sp2 must be done as a pair. w atchdog timer (1) when the watchdog timer is being used, the software must reset it within 3-second cycles. (2) because the watchdog timer is set in operation state by initial reset, set the watchdog timer to disabled state (not used) before generating an interrupt (nmi) if it is not used. oscillation circuit (1) it takes at least 5 msec from the time the osc3 oscillation circuit goes on until the oscillation stabi- lizes. consequently, when switching the cpu operation clock from osc1 to osc3, do this after a minimum of 5 msec have elapsed since the osc3 oscillation went on. further, the oscillation stabilization time varies depending on the external oscillator characteristics and conditions of use, so allow ample margin when setting the wait time. (2) when switching the clock form osc3 to osc1, use a separate instruction for switching the osc3 oscillation off. an error in the cpu operation can result if this processing is performed at the same time by the one instruction. input port when input ports are changed from high to low by pull-down resistors, the fall of the waveform is delayed on account of the time constant of the pull-down resistor and input gate capacitance. hence, when fetching input ports, set an appropriate waiting time. particular care needs to be taken of the key scan during key matrix configuration. make this waiting time the amount of time or more calcu- lated by the following expression. 10 c r c: terminal capacitance 5 pf + parasitic capacitance ? pf r: pull-down resistance 375 k ? (max.)
124 epson s1c63808 technical manual chapter 5: summary of notes output port (1) when using the output port (r01, r02, r03) as the special output port (bz, tout, fout), fix the data r egister (r01, r02, r03) at "1" and the high impedance control register (r01hiz, r02hiz, r03hiz) at "0" (data output). be aware that the output terminal is fixed at a low (v ss ) level the same as the dc output if "0" is written to the r01, r02 and r03 registers when the special output has been selected. be aware that the output terminal shifts into high impedance status when "1" is written to the high impedance control register (r01hiz, r02hiz, r03hiz). (2) a hazard may occur when the bz signal, fout signal and the tout signal are turned on and off. (3) when f osc3 is selected for the fout signal frequency, it is necessary to control the osc3 oscillation circuit before output. refer to section 4.3, "oscillation circuit", for the control and notes. i/o port when in the input mode, i/o ports are changed from high to low by pull-down resistor, the fall of the waveform is delayed on account of the time constant of the pull-down resistor and input gate capaci- tance. hence, when fetching input ports, set an appropriate wait time. particular care needs to be taken of the key scan during key matrix configuration. make this waiting time the amount of time or more calculated by the following expression. 10 c r c: terminal capacitance 5 pf + parasitic capacitance ? pf r: pull-down resistance 375 k ? (max.) clock timer be sure to read timer data in the order of low-order data (tm0 C tm3) then high-order data (tm4 C tm7). stopwatch timer (1) the interrupt factor flag should be reset after resetting the stopwatch timer. (2) be sure to data reading in the order of swd0 C 3 s wd4 C 7 s wd8 C 11. (3) when data that is held by a lap input is read, read the capture buffer renewal flag crnwf after r eading the swd8 C 11 and check whether the data has been renewed or not. (4) when performing a processing such as a lap input preceding with 1 hz interrupt processing, read the lap data carry-up request flag lcurf before processing and check whether carry-up is needed or not. programmable timer (1) when reading counter data, be sure to read the low-order 4 bits (ptdx0 C ptdx3) first. furthermore, the high-order 4 bits (ptdx4 C ptdx7) should be read within 0.73 msec (when f osc1 is 32.768 khz) of r eading the low-order 4 bits (ptdx0 C ptdx3). the counter data in 16-bit mode must be read in the order below. ptd00 C ptd03 ptd04 C pdt07 ptd10 C ptd13 ptd14 C ptd17 (2) the programmable timer actually enters run/stop status in synchronization with the falling edge of the input clock after writing to the ptrunx register. consequently, when "0" is written to the ptrunx register, the timer enters stop status at the point where the counter is decremented (-1). the ptrunx register maintains "1" for reading until the timer actually stops. figure 5.2.1 shows the timing chart for the run/stop control. ptrunx (wr) ptdx0?tdx7 42h 41h 40h 3fh 3eh 3dh ptrunx (rd) input clock "1" (run) writing "0" (stop) writing fi g. 5.2.1 timing chart for run/stop control it is the same even in the event counter mode. therefore, be aware that the counter does not enter run/stop status if a clock is not input after setting the run/stop control register (ptrun0).
s1c63808 technical manual epson 125 chapter 5: summary of notes (3 )s ince the tout signal is generated asynchronously from the ptout register, a hazard within 1/2 cycle is generated when the signal is turned on and off by setting the register. (4) when the osc3 oscillation clock is selected for the clock source, it is necessary to turn the osc3 oscillation on, prior to using the programmable timer. however the osc3 oscillation circuit requires a time at least 5 msec from turning the circuit on until the oscillation stabilizes. therefore, allow an adequate interval from turning the osc3 oscillation circuit on to starting the programmable timer. refer to section 4.3, "oscillation circuit", for the control and notes of the osc3 oscillation circuit. at initial reset, the osc3 oscillation circuit is set in the off state. (5) for the reason below, pay attention to the reload data write timing when changing the interval of the programmable timer interrupts while the programmable timer is running. the programmable timer counts down at the falling edge of the input clock and at the same time it generates an interrupt if the counter underflows. then it starts loading the reload data to the counter and the counter data is determined at the next rising edge of the input clock (period shown in as ? in the figure). input clock counter data (continuous mode) (reload data = 25h) 03h 02h 01h 00h 25h 24h counter data is determined by reloading. underflow (interrupt is generated) ? fi g. 5.2.2 reload timing for programmable timer to avoid improper reloading, do not rewrite the reload data after an interrupt occurs until the counter data is determined including the reloading period ? . be especially careful when using the osc1 (low- speed clock) as the clock source of the programmable timer and the cpu is operating with the osc3 (high-speed clock). serial interface (1) be sure to initialize the serial interface mode in the transmit/receive disabled status (txenx = rxenx = "0"). (2) do not perform double trigger (writing "1") to txtrgx (rxtrgx) when the serial interface is in the transmitting (receiving) operation. (3) in the clock synchronous mode, since one clock line (sclkx) is shared for both transmitting and r eceiving, transmitting and receiving cannot be performed simultaneously. (half duplex only is possible in clock synchronous mode.) consequently, be sure not to write "1" to rxtrgx (txtrgx) when txtrgx (rxtrgx) is "1". (4) when a parity error or framing error is generated during receiving in the asynchronous mode, the r eceiving error interrupt factor flag iserx is set to "1" prior to the receive completion interrupt factor flag isrcx for the time indicated in table 5.2.1. consequently, when an error is generated, you should r eset the receiving complete interrupt factor flag isrcx to "0" by providing a wait time in error processing routines and similar routines. when an overrun error is generated, the receiving complete interrupt factor flag isrcx is not set to "1" and a receiving complete interrupt is not generated. t able 5.2.1 time difference between iserx and isrcx on error generation clock source time difference f osc3 / n programmable timer 1/2 cycles of f osc3 / n 1 cycle of timer 1 underflow
126 epson s1c63808 technical manual chapter 5: summary of notes (5) when the demultiplied signal of the osc3 oscillation circuit is made the clock source, it is necessary to turn the osc3 oscillation on, prior to using the serial interface. a time interval of 5 msec, from the turning on of the osc3 oscillation circuit to until the oscillation stabilizes, is necessary, due to the oscillation element that is used. consequently, you should allow an adequate waiting time after turning on of the osc3 oscillation, before starting transmitting/receiv- ing of serial interface. (the oscillation start time will vary somewhat depending on the oscillator and on the externally attached parts. refer to the oscillation start time example indicated in chapter 7, "electrical characteristics".) at initial reset, the osc3 oscillation circuit is set to off status. (6) be aware that the maximum clock frequency for the serial interface is limited to 2 mhz. sound generator (1) when using the r01 port as the bz output port, fix the data register r01 at "1" and the high imped- ance control register r01hiz at "0" (data output). (2) since it generates a buzzer signal that is out of synchronization with the bze register, hazards may at times be produced when the signal goes on/off due to the setting of the bze register. (3) the one-shot output is only valid when the normal buzzer output is off (bze = "0") and will be invalid when the normal buzzer output is on (bze = "1"). integer multiplier an operation process takes 10 cpu clock cycles (5 bus cycles) after writing to the calculation mode selection register calmd until the operation result is set to the destination register drh/drl and the operation flags. while this operation process, do not read/write from/to the destination register drh/drl and do not read nf/vf/zf. svd circuit (1) to obtain a stable detection result, the svd circuit must be on for at least 1 msec. so, to obtain the svd detection result, follow the programming sequence below. 1. set svdon to "1" 2. maintain for 1 msec minimum 3. set svdon to "0" 4. read svddt (2) the svd circuit should normally be turned off because svd operation increase current consumption. po wer supply for epd driver ic because at initial reset, the lc3 C lc0 register is set to 0000b (v c1 = 1.03 v when 1/3 bias is selected or 1.08 v when 1/2 bias is selected), it is necessary to initialize by the software. furthermore, the epd system voltage circuit is turned off and the v c1 C v c3 terminals go to v ss level. interrupt (1) the interrupt factor flags are set when the interrupt condition is established, even if the interrupt mask registers are set to "0". (2) after an interrupt occurs, the same interrupt will occur again if the interrupt enabled state (i flag = "1") is set or the reti instruction is executed unless the interrupt factor flag is reset. therefore, be sure to reset (write "1" to) the interrupt factor flag in the interrupt service routine before shifting to the interrupt enabled state. (3) after an initial reset, all the interrupts including nmi are masked until both the stack pointers sp1 and sp2 are set with the software. be sure to set the sp1 and sp2 in the initialize routine. further, when re-setting the stack pointer, the sp1 and sp2 must be set as a pair. when one of them is set, all the interrupts including nmi are masked and interrupts cannot be accepted until the other one is set.
s1c63808 technical manual epson 127 chapter 5: summary of notes 5.3 precautions on mounting oscillation characteristics change depending on conditions (board pattern, components used, etc.). in particular, when a ceramic oscillator or crystal oscillator is used, use the oscillator manufacturer's r ecommended values for constants such as capacitance and resistance. disturbances of the oscillation clock due to noise may cause a malfunction. consider the following points to prevent this: (1) components which are connected to the osc1, osc2, osc3 and osc4 terminals, such as oscillators, resistors and capacitors, should be connected in the shortest line. (2) as shown in the right hand figure, make a v ss pattern as large as possible at circumscription of the osc1, osc2, osc3 and osc4 terminals and the components connected to these terminals. furthermore, do not use this v ss pattern for any purpose other than the oscillation system. osc4 osc3 v ss sample v ss pattern (osc3) in order to prevent unstable operation of the oscillation circuit due to current leak between osc1/ osc3 and v dd , please keep enough distance between osc1/osc3 and v dd or other signals on the board pattern. the power-on reset signal which is input to the reset terminal changes depending on conditions (power rise time, components used, board pattern, etc.). decide the time constant of the capacitor and resistor after enough tests have been completed with the application product. when using the built-in pull-down resistor of the reset terminal, take into consideration dispersion of the resistance for setting the constant. in order to prevent any occurrences of unnecessary resetting caused by noise during operating, components such as capacitors and resistors should be connected to the reset terminal in the shortest line. sudden power supply variation due to noise may cause malfunction. consider the following points to prevent this: (1) the power supply should be connected to the v dd and v ss terminals with patterns as short and large as possible. (2) when connecting between the v dd and v ss terminals with a bypass capacitor, the terminals should be connected as short as possible. v dd v ss bypass capacitor connection example v dd v ss (3) components which are connected to the v d1 and v osc terminals, such as capacitors, should be connected in the shortest line.
128 epson s1c63808 technical manual chapter 5: summary of notes in order to prevent generation of electromagnetic induction noise caused by mutual inductance, do not arrange a large current signal line near the circuits that are sensitive to noise such as the oscillation unit. when a signal line is parallel with a high-speed line in long distance or intersects a high-speed line, noise may generated by mutual interference between the signals and it may cause a malfunction. do not arrange a high-speed signal line especially near circuits that are sensitive to noise such as the oscillation unit. osc4 osc3 v ss large current signal line high-speed signal line prohibited pattern example when an output terminal is used to drive an external component that consumes a large amount of current, the operation of the external component affects the built-in power supply circuit of this ic and the output voltage may vary. when driving a bipolar transistor by a periodic signal such as the bz or timer output in particular, it may cause variations in the voltage output from the epd system voltage circuit that affects the epd contrast. to prevent this, separate the traces on the printed circuit board. put one between the power supply and the ic's v dd and v ss terminals, and another between the power supply and the external component that consumes the large amount of current. further- more, use an external component with as low a current consumption as possible. v dd v ss piezo bz c p example: buzzer output circuit + vi sible radiation causes semiconductor devices to change the electrical characteristics. it may cause this ic to malfunction. when developing products which use this ic, consider the following precau- tions to prevent malfunctions caused by visible radiations. (1) design the product and implement the ic on the board so that it is shielded from visible radiation in actual use. (2) the inspection process of the product needs an environment that shields the ic from visible radiation. (3) as well as the face of the ic, shield the back and side too.
s1c63808 technical manual epson 129 chapter 6: basic external wiring diagram chapter 6b asic e xternal w iring d iagram note: the above table is simply an example, and is not guaranteed to work. reset v dd v d1 v osc osc1 osc2 osc3 osc4 test v ss c 1 c 2 c gx c dc c res c p 2.1 v ? 3 | 3.6 v + x'tal cr ? 1 ? 2 r cr k00?03 k10?13 p00?03 p10 (sin1) p11 (sout1) p12 (sclk1) p13 (srdy1) p20 (sin2) p21 (sout2) p22 (sclk2) p23 (srdy2) p30?33 p40?43 r00 r02 (tout) r03 (fout) r10?13 r01 (bz) ? 1: ceramic oscillation ? 2: cr oscillation (external r) ? 3: 1.0?.6 v when osc3 (ceramic or cr with external r) is not used ? 4: c 6 is required when1/3 bias is selected. connect v c3 to v ss when 1/2 bias is selected. c gc input output i/o x'tal c gx cr c gc c dc r cr c 1 ? 6 c p c res crystal oscillator trimmer capacitor ceramic oscillator gate capacitor drain capacitor resistor for osc3 cr oscillation capacitor capacitor reset terminal capacitor 32.768 khz, c i (max.) = 34 k ? 5?5 pf 4 mhz (3.0 v) 30 pf 30 pf 30 k ? (2 mhz) 0.2 f 3.3 f 0.1 f s1c63808 [the potential of the substrate (back of the chip) is v ss .] piezo coil c 3 c 4 c 5 c 6 ca cb v c1 v c2 v c3 ? 4
130 epson s1c63808 technical manual chapter 7: electrical characteristics chapter 7e lectrical c haracteristics 7.1 absolute maximum rating item supply voltage input voltage (1) input voltage (2) permissible total output current ? 1 operating temperature storage temperature soldering temperature / time permissible dissipation ? 2 ? 1 ? 2 ( v ss =0v ) symbol v dd v i v iosc i vdd topr tstg tsol p d rated value -0.5 to 4.5 -0.5 to v dd + 0.3 -0.5 to v d1 + 0.3 10 -20 to 70 -65 to 150 260 c, 10sec ( lead section ) 250 unit v v v ma c c mw the permissible total output current is the sum total of the current (average current) that simultaneously flows from the output pin (or is drawn in). in case of plastic package (qfp13-64pin). 7.2 recommended operating conditions item supply voltage oscillation frequency ( ta=-20 to 70 c ) symbol v dd f osc1 f osc3 unit v v v khz khz khz khz max. 3.6 3.6 3.6 260 2,200 4,200 typ. 32.768 200 min. 1.0 1.0 2.1 140 200 condition v ss =0v when osc3 is not used when osc3 is used, 260khz (max.) when osc3 is used, 4.2mhz (max.) crystal oscillation cr oscillation (built-in r), v dd =1.0 to 3.6v cr oscillation (external r), v dd =2.1 to 3.6v ceramic oscillation, v dd =2.1 to 3.6v 7.3 dc characteristics item high level input voltage (1) high level input voltage (2) low level input voltage (1) low level input voltage (2) high level input current (1) high level input current (2) low level input current (1) low level input current (2) high level output current (1) low level output current (1) unless otherwise specified: v dd =3.0v, v ss =0v, f osc1 =32.768khz, ta=25 c, v d1 /v c1 ? c3 are internal voltage, c 1 ? 6 =0.2 f symbol v ih1 v ih2 v il1 v il2 i ih1 i ih2 i il1 i il2 i oh1 i ol1 unit v v v v a a a a ma ma max. v dd v dd 0.2? dd 0.1? dd 0.5 20 0 0 -0.5 typ. 12 min. 0.8? dd 0.9? dd 0 0 0 8 -0.5 -0.5 0.5 condition kxx, pxx reset, test kxx, pxx reset, test v ih1 =3.0v kxx, pxx no pull down reset, test v ih2 =3.0v kxx, pxx with pull down reset, test v il1 =v ss kxx, pxx no pull down reset, test v il2 =v ss kxx, pxx with pull down reset, test v oh1 =0.9? dd pxx, rxx v ol1 =0.1? dd pxx, rxx
s1c63808 technical manual epson 131 chapter 7: electrical characteristics 7.4 analog circuit characteristics and power current consumption 1.5 v system svd voltage 3.0 v system svd voltage svd circuit response time v svd1 v svd2 t svd v v ms typ. +100mv typ. +100mv 1 1.05 1.10 1.15 1.20 1.25 1.30 1.40 1.50 1.70 1.80 1.90 2.00 2.10 2.40 2.70 2.90 1.00 typ. -100mv typ. -100mv svds0?="0" svds0?="1" svds0?="2" svds0?="3" svds0?="4" svds0?="5" svds0?="6" svds0?="7" svds0?="0" svds0?="1" svds0?="2" svds0?="3" svds0?="4" svds0?="5" svds0?="6" svds0?="7" item voltages for epd driver ic (1/3 bias) voltages for epd driver ic (1/2 bias) symbol v c1 v c2 v c3 v c1 v c2 v c3 condition connect 1 m ? load resistor lc0?="0" between v ss and v c1 lc0?="1" lc0?="2" lc0?="3" lc0?="4" lc0?="5" lc0?="6" lc0?="7" connect 1 m ? load resistor between v ss and v c2 connect 1 m ? load resistor between v ss and v c3 connect 1 m ? load resistor lc0?="0" between v ss and v c1 lc0?="1" lc0?="2" lc0?="3" lc0?="4" lc0?="5" lc0?="6" lc0?="7" lc0?="8" lc0?="9" lc0?="10" lc0?="11" lc0?="12" lc0?="13" lc0?="14" lc0?="15" connect 1 m ? load resistor between v ss and v c2 always v ss level unless otherwise specified: v dd =3.0v, v ss =0v, f osc1 =32.768khz, ta=25 c, v d1 /v c1 ? c3 are internal voltage, c 1 ? 6 =0.2 f unit v v v v v v max. typ. +100mv 2? c1 3? c1 typ. +100mv 2? c1 typ. 1.03 1.06 1.09 1.12 1.15 1.18 1.20 1.23 1.08 1.14 1.20 1.27 1.33 1.39 1.43 1.49 1.55 1.59 1.63 1.67 1.72 1.76 1.80 1.84 v ss min. typ. -100mv 2? c1 0.9 3? c1 0.9 typ. -150mv 2? c1 0.9
132 epson s1c63808 technical manual chapter 7: electrical characteristics 0.45 1.60 1.50 1.10 2.00 1.90 2.20 3.20 5.80 7.10 40 700 850 1100 3.0 0.23 0.90 0.85 0.60 1.10 1.00 1.90 2.65 4.80 5.80 25 550 600 850 2.0 item symbol unit max. typ. min. condition unless otherwise specified: v dd =3.0v, v ss =0v, f osc1 =32.768khz, ta=25 c, v d1 /v c1 ? c3 are internal voltage, c 1 ? 6 =0.2 f current consumption in halt mode current consumption in run state svd circuit current ? 1 ? 2 ? 3 ? 4 i halt i exe i svd a a a a a a a a a a a a a a a no load on the power supply for the epd driver ic and when the svd circuit is in off status when cr (built-in r type) is selected for the osc3 oscillation circuit by mask option when cr (external r type) is selected for the osc3 oscillation circuit by mask option when 1/3 bias is selected by mask option 32khz crystal, epd driver ic power supply off ? 1, ? 2 32khz crystal, epd driver ic power supply on (1/3 bias) ? 1, ? 2 32khz crystal, epd driver ic power supply on (1/2 bias) ? 1, ? 2 32khz crystal, epd driver ic power supply off ? 1, ? 3 32khz crystal, epd driver ic power supply on (1/3 bias) ? 1, ? 3 32khz crystal, epd driver ic power supply on (1/2 bias) ? 1, ? 3 32khz crystal, epd driver ic power supply off ? 1, ? 2 32khz crystal, epd driver ic power supply on ? 1, ? 2, ? 4 32khz crystal, epd driver ic power supply off ? 1, ? 3 32khz crystal, epd driver ic power supply on ? 1, ? 3, ? 4 200khz cr, epd driver ic power supply on ? 1, ? 2 1.1mhz cr, epd driver ic power supply on ? 1, ? 3 2mhz ceramic, epd driver ic power supply on ? 1, ? 3 4mhz ceramic, epd driver ic power supply on ? 1, ? 3 during voltage detection, v dd =1.0 to 3.6v
s1c63808 technical manual epson 133 chapter 7: electrical characteristics 7.5 oscillation characteristics the oscillation characteristics change depending on the conditions (components used, board pattern, etc.). use the following characteristics as reference values. osc1 crystal oscillation circuit item oscillation start voltage oscillation stop voltage built-in capacitance (drain) frequency/voltage deviation frequency/ic deviation frequency adjustment range harmonic oscillation start voltage permitted leak resistance symbol vsta vstp c d ? f/ ? v ? f/ ? ic ? f/ ? c g v hho r leak unit v v pf ppm ppm ppm v m ? max. 5 10 typ. 11 20 min. 1.0 1.0 -10 10 3.6 200 condition t sta 3sec ( v dd ) t stp 10sec ( v dd ) including the parasitic capacitance inside the ic (in chip) v dd =1.0 to 3.6v c g =5 to 25pf c g =5pf ( v dd ) between osc1 and v ss unless otherwise specified: v dd =3.0v, v ss =0v, f osc1 =32.768khz, c g =25pf, c d =built-in, ta=-20 to 70 c osc3 ceramic oscillation circuit item oscillation start voltage oscillation start time oscillation stop voltage symbol vsta t sta vstp unit v ms v max. 5 typ. min. 2.1 2.1 condition (v dd ) v dd =2.1 to 3.6v (v dd ) unless otherwise specified: v dd =3.0v, v ss =0v, ceramic oscillator: 4mhz, c gc =c dc =30pf, ta=-20 to 70 c osc3 cr oscillation circuit (built-in r type) item oscillation frequency dispersion oscillation start voltage oscillation start time oscillation stop voltage symbol f osc3 vsta t sta vstp unit % v ms v max. 30 3 typ. 200khz min. -30 1.0 1.0 condition (v dd ) v dd =1.0 to 3.6v (v dd ) unless otherwise specified: v dd =3.0v, v ss =0v, r cr =built-in, ta=-20 to 70 c osc3 cr oscillation circuit (external r type) item oscillation frequency dispersion oscillation start voltage oscillation start time oscillation stop voltage symbol f osc3 vsta t sta vstp unit % v ms v max. 30 3 typ. min. -30 2.1 2.1 condition (v dd ) v dd =2.1 to 3.6v (v dd ) unless otherwise specified: v dd =3.0v, v ss =0v, r cr =30k ? (2mhz), ta=-20 to 70 c
134 epson s1c63808 technical manual chapter 7: electrical characteristics osc3 cr oscillation frequency-resistance characteristic (external r type) the oscillation characteristics change depending on the conditions (components used, board pattern, etc.). use the following characteristics as reference values and evaluate the characteristics on the actual product. resistor value for cr oscillation r cr [k ? ] cr oscillation frequency f osc3 [khz] 0 20 40 60 80 100 120 10000 1000 100 v dd = 2.1?.6 v ta = 25 c typ. value
s1c63808 technical manual epson 135 chapter 7: electrical characteristics 7.6 serial interface ac characteristics clock synchronous master mode ?during 32 khz operation item transmitting data output delay time receiving data input set-up time receiving data input hold time symbol t smd t sms t smh unit s s s max. 5 typ. min. 10 5 condition: v dd =3.0v, v ss =0v, ta=-20 to 70 c, v ih1 =0.8v dd , v il1 =0.2v dd , v oh =0.8v dd , v ol =0.2v dd ?during 4 mhz operation item transmitting data output delay time receiving data input set-up time receiving data input hold time symbol t smd t sms t smh unit ns ns ns max. 200 typ. min. 400 200 note that the maximum clock frequency is limited to 2 mhz. condition: v dd =3.0v, v ss =0v, ta=-20 to 70 c, v ih1 =0.8v dd , v il1 =0.2v dd , v oh =0.8v dd , v ol =0.2v dd clock synchronous slave mode ?during 32 khz operation item transmitting data output delay time receiving data input set-up time receiving data input hold time symbol t ssd t sss t ssh unit s s s max. 10 typ. min. 10 5 condition: v dd =3.0v, v ss =0v, ta=-20 to 70 c, v ih1 =0.8v dd , v il1 =0.2v dd , v oh =0.8v dd , v ol =0.2v dd ?during 4 mhz operation item transmitting data output delay time receiving data input set-up time receiving data input hold time symbol t ssd t sss t ssh unit ns ns ns max. 500 typ. min. 400 200 note that the maximum clock frequency is limited to 2 mhz. condition: v dd =3.0v, v ss =0v, ta=-20 to 70 c, v ih1 =0.8v dd , v il1 =0.2v dd , v oh =0.8v dd , v ol =0.2v dd sclkx out soutx sinx v oh v ol t sms t smh t smd v oh v ih1 v il1 v ol sclkx in soutx sinx v ih1 v oh v ol t sss t ssh t ssd v ih1 v il1 v il1
136 epson s1c63808 technical manual chapter 7: electrical characteristics 7.7 timing chart system clock switching oscc clkchg ? 5 msec min. ? 1 instruction execution time or longer
s1c63808 technical manual epson 137 chapter 8: package chapter 8p a ckage 8.1 plastic package qfp13-64pin (unit: mm) the dimensions are subject to change without notice. 10 0.1 12 0.4 33 48 10 0.1 12 0.4 17 32 index 0.18 16 1 64 49 1.4 0.1 0.1 1.7 max 1 0.5 0.2 0 10 0.125 +0.1 ?.05 +0.05 ?.025 0.5
138 epson s1c63808 technical manual chapter 8: package 8.2 ceramic package for test samples qfp6-60pin (unit: mm) 13.97 0.15 17 0.3 13.97 0.15 17 0.3 0.35 0.8 0.2 2.52 max 0.7 0.2 0.15 31 45 16 30 15 1 60 46 index no. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 no. 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 no. 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 no. 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 pin name p10/sin1 p11/sout1 p12/sclk1 p13/srdy1 p20/sin2 p21/sout2 p22/sclk2 p23/srdy2 p30 p31 p32 p33 p40 p41 n.c. pin name p42 p43 test reset n.c. v dd v osc osc1 osc2 v d1 osc3 osc4 v ss v c1 n.c. pin name v c2 v c3 cb ca k00 k01 k02 k03 k10 k11 k12 k13 n.c. n.c. v dd pin name n.c. n.c. v ss r00 r01/bz r02/tout r03/fout r10 r11 r12 r13 p00 p01 p02 p03 n.c. : no connection
s1c63808 technical manual epson 139 chapter 9: pad layout chapter 9p ad l ay out 9.1 diagram of pad layout chip thickness: 400 m pad opening: 90 m x y (0, 0) 4.20 mm 4.20 mm die no. cb808d 1 5 10 30 35 15 20 25 40 45 50 53
140 epson s1c63808 technical manual chapter 9: pad layout 9.2 pad coordinates no. 1 2 3 4 5 6 7 8 9 10 11 12 13 pad name p42 p43 test reset v dd v osc osc1 osc2 v d1 osc3 osc4 v ss v c1 x 1.655 1.544 1.102 0.992 -0.033 -0.143 -0.253 -0.364 -0.474 -0.584 -0.694 -0.804 -0.914 y 1.968 1.968 1.968 1.968 1.968 1.968 1.968 1.968 1.968 1.968 1.968 1.968 1.968 no. 14 15 16 17 18 19 20 21 22 23 24 25 26 pad name v c2 v c3 cb ca k00 k01 k02 k03 k10 k11 k12 k13 v dd x -1.968 -1.968 -1.968 -1.968 -1.968 -1.968 -1.968 -1.968 -1.968 -1.968 -1.968 -1.968 -1.968 y 1.634 1.524 1.413 1.300 0.285 0.175 0.065 -0.045 -0.156 -0.266 -0.376 -0.486 -1.380 no. 27 28 29 30 31 32 33 34 35 36 37 38 39 pad name v ss r00 r01/bz r02/tout r03/fout r10 r11 r12 r13 p00 p01 p02 p03 x -0.361 -0.213 -0.103 0.007 0.117 0.270 0.381 0.491 0.601 1.050 1.160 1.270 1.381 y -1.968 -1.968 -1.968 -1.968 -1.968 -1.968 -1.968 -1.968 -1.968 -1.968 -1.968 -1.968 -1.968 no. 40 41 42 43 44 45 46 47 48 49 50 51 52 53 pad name p10/sin1 p11/sout1 p12/sclk1 p13/srdy1 p20/sin2 p21/sout2 p22/sclk2 p23/srdy2 p30 p31 p32 p33 p40 p41 x 1.968 1.968 1.968 1.968 1.968 1.968 1.968 1.968 1.968 1.968 1.968 1.968 1.968 1.968 y -0.749 -0.638 -0.528 -0.418 -0.308 -0.197 -0.087 0.023 0.133 0.244 0.354 0.464 0.594 0.704 unit: mm
s1c63808 technical manual epson 141 appendix peripheral circuit boards for s1c63808 appendix p eripheral c ircuit b o ards for s1c63808 this section describes how to use the peripheral circuit boards for the s1c63808 (s5u1c63000p1), which provide emulation functions when mounted on the debugging tool for the s1c63 family of 4-bit single-chip microcomputers, the ice (s5u1c63000h1/s5u1c63000h2). this description of the s1c63 family peripheral circuit board (s5u1c63000p1) provided in this docu- ment assumes that circuit data for the s1c63808 has already been downloaded to the board. for informa- tion on downloading various circuit data, please see section a.3. please refer to the user? manual provided with your ice for detailed information on its functions and method of use. a.1 names and functions of each part the s5u1c63000p1 board provides peripheral circuit functions of s1c63 family microcomputers other than the core cpu. the following explains the names and functions of each part of the s5u1c63000p1 board. vsvd fpga prog prg norm 1 1 2 15 led vc5 vlcd p r c 6 3 0 0 0 ver. x.x vc5 clk cn0 gnd gnd fosc3(cr) fosc1(cr) adosca sn0 st1 st0 lclk 32k eprom config sel flash cpa1 e iosel2 osc1(cr)adj osc3(cr)adj d cn3 connector (not used) cn2 connector cn1 connector 16 16 reset (3) (4) (9) (1) (2) (11) (10) (9) (8) (7) (6) (5) xc4062xla (1) vlcd unused (2) vsvd this control allows you to vary the power supply voltage artificially in order to verify the operation of the power supply voltage detect function (svd). (3) register monitor leds these leds correspond one-to-one to the registers listed below. the led lights when the data is logic "1" and goes out when the data is logic "0". svds0?vds2, svdchg, svdon, oscc, clkchg, hvld, lpwr, lc0?c2
142 epson s1c63808 technical manual appendix peripheral circuit boards for s1c63808 (4) register monitor pins these pins correspond one-to-one to the registers listed below. the pin outputs a high for logic "1" and a low for logic "0". pin no. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 monitor ? done: the monitor pin outputs a high while the led lights when initialization of this board completes without problems. name done * svds0 svds1 svds2 svdchg svdon oscc clkchg hvld lpwr lc0 lc1 lc2 led no. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 led name done * svds0 svds1 svds2 svdchg svdon oscc clkchg hvld lpwr lc0 lc1 lc2 monitor pin 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 3 5 7 9 11 13 15 2 4 6 8 10 12 14 16 led (5) cr oscillation frequency adjusting control this control allows you to adjust the osc3 oscillation frequency. this function is effective when ceramic oscillation is selected for the osc3 oscillation circuit by mask option as well as when cr oscillation is selected. the oscillation frequency can be adjusted in the range of approx. 100 khz to 8 mhz. note that the actual ic does not operate with all of these frequencies; refer to chapter 7, "electrical characteristics", to select the appropriate operating frequency. not used not used osc3 rough adjustment osc3 fine adjustment (6) cr oscillation frequency monitor pins these pins allow you to monitor the clock waveform from the cr oscillation circuit with an oscillo- scope. note that these pins always output a signal waveform whether or not the oscillation circuit is operating. osc3 monitor pin (red) not used gnd pin (black) reset
s1c63808 technical manual epson 143 appendix peripheral circuit boards for s1c63808 (7) reset switch this switch initializes the internal circuits of this board and feeds a reset signal to the ice. (8) external part connecting socket unused (9) clk and prg switch if power to the ice is shut down before circuit data downloading is complete, the circuit configura- tion in this board will remain incomplete, and the debugger may not be able to start when you power on the ice once again. in this case, temporarily power off the ice and set clk to the 32k position and the prg switch to the prog position, then switch on power for the ice once again. this should allow the debugger to start up, allowing you to download circuit data. after downloading the circuit data, temporarily power off the ice and reset clk and prg to the lclk and the norm position, respec- tively. then power on the ice once again. (10) iosel2 when downloading circuit data, set iosel2 to the "e" position. otherwise, set to the "d" position. (11) vc5 this control allows adjustment of the epd driver voltage values (v c1 v c3 ).
144 epson s1c63808 technical manual appendix peripheral circuit boards for s1c63808 a.2 connecting to the target system this section explains how to connect the s5u1c63000p1 to the target system. s5u1c63000p1 fi g. a.2.1 installing the peripheral circuit boards to the ice installing the s5u1c63000p1 board set the jig included with the ice into position as shown in figure a.2.2. using this jig as a lever, push it toward the inside of the board evenly on the left and right sides. after confirming that the board has been firmly fitted into the internal slot of the ice, remove the jig. fi g. a.2.2 installing the board dismounting the s5u1c63000p1 board set the jig included with the ice into position as shown in figure a.2.3. using this jig as a lever, push it toward the outside of the board evenly on the left and right sides. after confirming that the board has been dismounted from the backboard connector, pull the board out of the ice. fi g. a.2.3 dismounting the board to connect this board (s5u1c63000p1) to the target system, use the i/o connecting cables supplied with the board (80-pin/40-pin 2, flat type). take care when handling the connectors, since they conduct electrical power (v dd = +3.3 v). cn1-1 (40-pin) cn1-2 (40-pin) i/o connection cable to target board mark fi g. a.2.4 connecting the s5u1c63000p1 to the target system board board
s1c63808 technical manual epson 145 appendix peripheral circuit boards for s1c63808 t able a.2.1 i/o connector pin assignment no. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 i/o i i i i i i i i i/o i/o i/o i/o i/o i/o i/o i/o i/o i/o i/o i/o i/o i/o i/o i/o i/o i/o i/o i/o i/o o o o o o o o o 40-pin cn1-1 connector pin name v dd (= 3.3 v) v dd (= 3.3 v) k00 k01 k02 k03 k10 k11 k12 k13 v ss v ss p00 p01 p02 p03 p10 p11 p12 p13 v dd (= 3.3 v) v dd (= 3.3 v) p20 p21 p22 p23 p30 p31 p32 p33 vss vss p40 p41 p42 p43 cannot be connected cannot be connected vss vss no. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 40-pin cn1-2 connector pin name v dd (= 3.3 v) v dd (= 3.3 v) r00 r01 r02 r03 r10 r11 r12 r13 v ss v ss cannot be connected cannot be connected cannot be connected cannot be connected cannot be connected cannot be connected cannot be connected cannot be connected v dd (= 3.3 v) v dd (= 3.3 v) cannot be connected cannot be connected cannot be connected cannot be connected cannot be connected cannot be connected cannot be connected exosc3 v ss v ss cannot be connected cannot be connected v c1 v c2 v c3 reset v ss v ss
146 epson s1c63808 technical manual appendix peripheral circuit boards for s1c63808 a.3 downloading to s5u1c63000p1 a.3.1 downloading circuit data 1 ?when new ice (s5u1c63000h2) is used the s5u1c63000p1 board comes with the fpga that contains factory inspection data, therefore the circuit data for the model to be used should be downloaded. the following explains the downloading proce- dure. 1) remove the ice top cover and then set the dip switch "iosel2" on this board to the "e" position. 2) connect the ice to the host pc. then turn the host pc and ice on. 3) invoke the debugger included in the assembler package (ver. 5 or later). for how to use the ice and debugger, refer to the manuals supplied with the ice and assembler package. 4) download the circuit data file (.mot) corresponding to the model by entering the following commands in the command window. >xfer (erase all) >xfwr (download the specified file) * >xfcp (compare the specified file and downloaded data) ? the downloading takes about 15 minutes. 5) terminate the debugger and then turn the ice off. 6) set the dip switch "iosel2" on this board to the "d" position. 7) turn the ice on and invoke the debugger again. debugging can be started here. a.3.2 downloading circuit data 2 ?when previous ice (s5u1c63000h1) is used the standard ice (s5u1c63000h1, previous model) did not support the circuit data download function for this board. to use the download function, update the ice firmware according to the following procedure. 1) set the baud rate of the ice to 9600 bps. refer to the manual supplied with the ice for setting the dip switch. 2) connect the ice to the host pc and then start up the host pc in dos. when windows is running, re start in dos mode. note: do not use the dos prompt of windows. 3) turn the ice on. 4) configure the rs232c parameters for the host pc as follows: c:\>mode com1:9600,n,8,1,p (9600 bps, 8-bit data, 1 stop bit, no parity) 5) copy the following files included in the assembler package (ver. 5 or later) to a directory on the hard disk. tm63.exe, ice63.com, i63com.o, i63par 6) move to the directory in step 5, run the tm63. tm63 enters command ready status after invocation, enter a command as follows: ________ c:\>tm63 xat tm63 start on ibm pc tm63 start v01.01 ________________________________ >dlf ice63.com i63com.o i63par 0b ... _ >q 7) enter "q" to terminate tm63 after the prompt mark is displayed. 8) the ice firmware is now updated. turn the ice off and then download the circuit data by the proce- dure described in section a.3.1.
s1c63808 technical manual epson 147 appendix peripheral circuit boards for s1c63808 a.4 usage precautions to ensure correct use of the peripheral circuit board, please observe the following precautions. a.4.1 operational precautions (1) before inserting or removing cables, turn off power to all pieces of connected equipment. (2) do not turn on power or load mask option data if all of the input ports (k00?03) are held low. doing so may activate the multiple key entry reset function. (3) before debugging, always be sure to load mask option data. a.4.2 differences with the actual ic (1) differences in i/o s5u1c63000p1 and target system interface voltage is set to +3.3 v. to obtain the same interface voltage as in the actual ic, attach a level shifter circuit, etc. on the target system side to accommodate the required interface voltage.