No part of this material may be reproduced or duplicated in any form or by any means without the written permission
of Seiko Epson. Seiko Epson reserves the right to make changes to this material without notice. Seiko Epson does
not assume any liability of any kind arising out of any inaccuracies contained in this material or due to its application
or use in any product or circuit and, further, there is no representation that this material is applicable to products
requiring high level reliability, such as, medical products. Moreover, no license to any intellectual property rights is
granted by implication or otherwise, and there is no representation or warranty that anything made in accordance with
this material will be free from any patent or copyright infringement of a third party. This material or portions thereof
may contain technology or the subject relating to strategic products under the control of the Foreign Exchange and
Foreign Trade Law of Japan and may require an export license from the Ministry of Economy, Trade and Industry or
other approval from another government agency.
All brands or product names mentioned herein are trademarks and/or registered trademarks of their respective
companies.
A.5.1 Specifications of S5U1C63000P6 ............................................................. 219
A.5.2 Specifications of S5U1C6F632P2 ............................................................. 220
revision history _________________________________________221
3240-0412
Page 8
SIC63616-(Rev. 1.0) NO. P1
chapter 1 Outline
The S1C63616 is a microcomputer which has a 4-bit CPU S1C63000 as the core CPU, ROM (16,384 words ×
13 bits), RAM (2,048 words × 4 bits), multiply-divide circuit, serial interface, watchdog timer, programmable
timer, time base counters (2 systems), a dot matrix LCD driver that can drive a maximum 1,280 dots of LCD
panel, and an R/f converter that can measure temperature and humidity using sensors such as a thermistor.
The S1C63616 features low current consumption, this makes it suitable for battery driven clocks and
watches with temperature and humidity measurement functions.
1.1 Features
OSC1 oscillation circuit
OSC3 oscillation circuit
Instruction set
R/f converter AC-bias oscillation output pin for humidity sensor
O
Initial reset input pin
I
Test input pin
I
Function
3240-0412
Page 13
SIC63616-(Rev. 1.0) NO. P6
1.5 Mask Option
Mask options shown below are provided for the S1C63616. 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 S1C63616, is used for this
selection. Mask pattern of the IC is finally generated based on the data created by the winfog. Refer to the
"S5U1C63000A Manual" for the winfog.
<Outline of the mask option>
(1) OSC1 oscillation circuit
The OSC1 oscillator type is fixed at crystal oscillation. Refer to Section 4.4.3, "OSC1 oscillation circuit",
for details.
(2) OSC3 oscillation circuit
The OSC3 oscillator type can be selected from ceramic oscillation or CR oscillation (external R). Refer to
Section 4.4.4, "OSC3 oscillation circuit", for details.
(3) RESET terminal pull-down resistor
This option is used to select whether an internal pull-down resistor is incorporated into the RESET input
port. Refer to Section 2.2.1, "Reset terminal (RESET)", for details.
(4) I/O port pull-down resistor
This option is used to select whether an internal pull-down resistor that will be enabled in input mode
is incorporated into each I/O port (P00–P03, P10–P13, P20–P23, P40–P43). Refer to Section 4.5.2, "Mask
option", for details.
(5) Output specification of the I/O port
This option is used to select either complementary output or P-channel open drain output as the output
cell type of each I/O port (P00–P03, P10–P13, P20–P23, P40–P43). Refer to Section 4.5.2, "Mask option",
for details.
(6) Multiple key entry reset function (by simultaneous high input to the P1x ports)
This option is used to select whether the function to reset the IC by pressing multiple keys simultaneously is implemented or not. A combination of the P1x ports (P10–P13) to be used for this function can
also be selected. Refer to Section 2.2.2, "Simultaneous high input to P1x ports (P10–P13)", for details.
(7) Time authorize circuit for the multiple key entry reset function
When the multiple key entry reset option (option (6)) is selected, the time authorize circuit can also be
incorporated. The time authorize circuit measures the high pulse width of the simultaneous input signals and asserts the reset signal if it is longer than the predetermined time. This option is not available
when the multiple key entry reset option is not selected. Refer to Section 2.2.2, "Simultaneous high input
to P1x ports (P10–P13)", for details.
(8) LCD drive power supply
This option is used to select the LCD drive bias from 1/5 bias (with VC2 reference voltage), 1/4 bias (with
VC2 reference voltage) and 1/4 bias (with VC1 reference voltage). Refer to Section 4.6.2, "Power supply
for LCD driving", for details.
3240-0412
Page 14
SIC63616-(Rev. 1.0) NO. P7
<Option List>
The following is the option list for the S1C63616.
Multiple selections are available in each option item as indicated in the option list. Select the specifications
that meet the target system and check the appropriate box. Be sure to record the specifications for unused
functions too, according to the instructions provided.
1. OSC1 SYSTEM CLOCK
1. Crystal
2. OSC3 SYSTEM CLOCK
1. CR (external R)
2. Ceramic (4.2 MHz)
3. RESET PORT PULL DOWN RESISTOR
•RESET 1. Use 2. Not Use
4. I/O PORT PULL DOWN RESISTOR
•P00 1. Use 2. Not Use
•P01 1. Use 2. Not Use
•P02 1. Use 2. Not Use
•P03 1. Use 2. Not Use
•P10 1. Use 2. Not Use
•P11 1. Use 2. Not Use
•P12 1. Use 2. Not Use
•P13 1. Use 2. Not Use
•P20 1. Use 2. Not Use
•P21 1. Use 2. Not Use
•P22 1. Use 2. Not Use
•P23 1. Use 2. Not Use
•P40 1. Use 2. Not Use
•P41 1. Use 2. Not Use
•P42 1. Use 2. Not Use
•P43 1. Use 2. Not Use
5. I/O PORT OUTPUT SPECIFICATION
•P00 1. Complementary 2. Pch Open Drain
•P01 1. Complementary 2. Pch Open Drain
•P02 1. Complementary 2. Pch Open Drain
•P03 1. Complementary 2. Pch Open Drain
•P10 1. Complementary 2. Pch Open Drain
•P11 1. Complementary 2. Pch Open Drain
•P12 1. Complementary 2. Pch Open Drain
•P13 1. Complementary 2. Pch Open Drain
•P20 1. Complementary 2. Pch Open Drain
•P21 1. Complementary 2. Pch Open Drain
•P22 1. Complementary 2. Pch Open Drain
•P23 1. Complementary 2. Pch Open Drain
•P40 1. Complementary 2. Pch Open Drain
•P41 1. Complementary 2. Pch Open Drain
•P42 1. Complementary 2. Pch Open Drain
•P43 1. Complementary 2. Pch Open Drain
3240-0412
Page 15
6. MULTIPLE KEY ENTRY RESET COMBINATION
1. Not Use
2. Use <P10, P11>
3. Use <P10, P11, P12>
4. Use <P10, P11, P12, P13>
7. MULTIPLE KEY ENTRY RESET TIME AUTHORIZE
1. Not Use
2. Use
8. LCD DRIVING POWER
1. 1/5 Bias, VC2 Reference
2. 1/4 Bias, VC2 Reference
3. 1/4 Bias, VC1 Reference
SIC63616-(Rev. 1.0) NO. P8
3240-0412
Page 16
SIC63616-(Rev. 1.0) NO. P9
chapter 2 pOwer Supplyand initial reSet
2.1 Power Supply
This section explains the operating voltage and the configuration of the internal power supply circuit of the
S1C63616.
2.1.1 Operating voltage
The S1C63616 operating power voltage is as follows:
1.6 V to 5.5 V
2.1.2 Internal power supply circuit
The S1C63616 incorporates the power supply circuit shown in Figure 2.1.2.1. When voltage within the range
described above is supplied to VDD (+) and VSS (GND), all the voltages needed for the internal circuits are
generated internally in the IC.
DD
External
power
supply
∗1
∗2
V
CF
CG
V
VD1
VOSC
VC1
VC2
VC3
VC4
VC5
CA
CB
CC
CD
CE
V
D2
SS
Power supply voltage
booster/halver
VD2
∗3
VDD
VCSEL
Oscillation system
voltage regulator
VOSC
LCD system
voltage
regulator
VC1–VC5
DBON
HLON
VDD
Internal voltage
regulator
∗4
Internal circuits
VD1
OSC3
oscillation circuit
OSC1
oscillation circuit
LCD
driver
circuit
OSC3
OSC4
OSC1
OSC2
COM0–COM31
SEG0–SEG39
∗1 Leave these terminals open when the power supply voltage booster/halver is not used.
∗2 Connect when the 1/5 bias LCD drive power is used. (Leave the terminal open when the 1/4 bias LCD drive power is used.)
∗3 Can be selected as the power source for the LCD system voltage regulator when the power supply voltage booster/halver
operates in boost mode.
∗4 HLON is prohibited from use.
Fig. 2.1.2.1 Configuration of power supply circuit
The power supply circuit is broadly divided into four blocks.
Table 2.1.2.1 Power supply circuit
Circuit
Internal and oscillation system voltage regulators
Internal circuits and OSC3 oscillation circuit
OSC1 oscillation circuit
LCD system voltage regulator
LCD driver
Power supply voltage (VDD)
Internal voltage regulator
Oscillation system voltage regulator
Power supply voltage booster/halver (halving mode)
LCD system voltage regulator
Power supply circuit
Output voltage
—
VD1
VOSC
VDD or VD2
VC1—VC5
Note: The supply voltage booster/halver circuit can perform either boosting or halving the supply voltage at
a time. The boosting and halving operations cannot be performed simultaneously.
3240-0412
Page 17
SIC63616-(Rev. 1.0) NO. P10
Power supply voltage booster/halver circuit
The S1C63616 supports a wide supply voltage (VDD) range that exceeds the operating voltage range of
the voltage regulator (LCD system voltage regulator). The power supply voltage booster/halver circuit
generates the VD2 voltage to drive the voltage regulators when the supply voltage VDD is out of the
operating voltage range of the voltage regulators.
Table 2.1.2.2 Relationship between supply voltage VDD and voltage regulator operating voltage
Power supply
voltage VDD
1.6 to 2.5 V
2.5 to 5.5 V
When a VC2 reference voltage option for the LCD drive power supply is selected, the LCD system voltage regulator must be driven with a 2.5 V or more operating voltage. Therefore, the LCD system voltage
regulator can be driven with VDD if 2.5 V or more supply voltage VDD is used. When the supply voltage
VDD is less than 2.5 V, drive the power supply voltage booster/halver in boost mode to generate VD2
and use it to drive the LCD system voltage regulator. The VD2 voltage generated in boost mode is about
double the VDD voltage level.
The VD2 voltage is not required when the power supply voltage (VDD) is within the range from 2.5 V to
5.5 V (1.6 V to 5.5 V when the VC1 reference LCD drive power option is selected). In this case the power
supply voltage booster/halver can be turned off.
The S1C63616 allows software to control the power supply voltage booster/halver and to select the
power source of the voltage regulator. Refer to Section 4.2, "Power Control", for details.
Power source for
LCD system voltage regulator
VD2 (≈ VDD × 2)
VDD
Internal voltage regulator
The internal voltage regulator generates the operating voltage VD1 for driving the internal logic circuits
and the OSC3 oscillation circuit.
Oscillation system voltage regulator
The oscillation system voltage regulator generates the V
circuit and is provided separately with the internal voltage regulator to stabilize the oscillation and to
reduce power consumption.
OSC
voltage for driving the OSC1 oscillation
LCD system voltage regulator
The LCD system voltage regulator generates the LCD drive voltages VC1 to VC5. See Chapter 7, "Electrical Characteristics" for the voltage values.
In the S1C63616, the LCD drive voltage is supplied to the built-in LCD driver which drives the LCD
panel connected to the SEG and COM terminals.
andVC1toVC5 terminal output voltages to drive external
3240-0412
Page 18
SIC63616-(Rev. 1.0) NO. P11
2.2 Initial Reset
The S1C63616 should be reset to initialize the internal circuits. There are two ways of doing this.
(1) External initial reset by the RESET terminal
(2) External initial reset by simultaneous high input to P10–P13 ports (mask option)
The circuits are initialized by either (1) or (2). When the power is turned on, be sure to initialize using the
reset function. 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.
OSC1
OSC2
P10
P11
P12
P13
RESET
OSC1
oscillation
circuit
Mask option
Divider
1 kHz
16 Hz
1 Hz
Time
authorize
circuit
Mask option
Noise
reject
circuit
R Q
S
Internal
initial
reset
VSS
Fig. 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 (VDD). After that the
initial reset is released by setting the reset terminal to a low level (VSS) and the CPU starts operating.
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 16 Hz signal (high) that is divided by the OSC1 clock. Therefore in
normal operation, a maximum of 16,396/f
OSC1
seconds (500 msec when f
the internal initial reset 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.
1.3 V
VDD
OSC1
= 32.768 kHz) is needed until
RESET
Power on
0.9•VDD or more (high level)
0.5•V
DD
2.0 msec or more
Fig. 2.2.1.1 Initial reset at power on
Theresetterminalshouldbesetto0.9•VDD or more (high level) until the supply voltage becomes 1.3 V or
more.
Afterthat,alevelof0.5•VDD 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
resistor is used or not.
3240-0412
Page 19
SIC63616-(Rev. 1.0) NO. P12
2.2.2 Simultaneous high input to P1x ports (P10-P13)
Another way of executing initial reset externally is to input high level signals simultaneously to the P1x
ports (P10–P13) selected by a 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
operation. The noise reject circuit does not operate immediately after turning the power on until the oscilla-tion. 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.
Table 2.2.2.1 shows the combinations of P1x ports (P10–P13) that can be selected by a mask option.
Table 2.2.2.1 Combinations of P1x ports
Not use
1
P10∗P11
2
P10∗P11∗P12
3
P10∗P11∗P12∗P13
4
When, for instance, mask option 4 (P10∗P11∗P12∗P13) is selected, initial reset is executed when the signals
input to the four ports P10–P13 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.
Further, the time authorize circuit mask option is selected when this reset function is selected. The time
authorize circuit 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.
OSC1
is 32.768 kHz) during normal
2.2.3 Internal register at initial resetting
Initial reset initializes the CPU as shown in Table 2.2.3.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.
Table 2.2.3.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
–
See Section 4.1, "Memory Map".
∗
Setting value
Undefined
Undefined
∗
3240-0412
Page 20
SIC63616-(Rev. 1.0) NO. P13
2.2.4 Terminal settings at initial resetting
The I/O port (P) terminals are shared with special output terminals and input/output terminals of the
serial interface, R/f converter, stopwatch timer and programmable timer (event counter). These functions
are selected by the software. At initial reset, these terminals are configured to the general purpose I/O port
terminals. Set them according to the system in the initial routine.
Table 2.2.4.1 shows the list of the shared terminal settings.
Table 2.2.4.1 List of shared terminal settings
Terminal
name
P00
P00 (Input & pulled down∗)
P01
P01 (Input & pulled down∗)
P02
P02 (Input & pulled down∗)
P03
P03 (Input & pulled down∗)
P10
P10 (Input & pulled down∗)
P11
P11 (Input & pulled down∗)
P12
P12 (Input & pulled down∗)
P13
P13 (Input & pulled down∗)
P20
P20 (Input & pulled down∗)
P21
P21 (Input & pulled down∗)
P22
P22 (Input & pulled down∗)
P23
P23 (Input & pulled down∗)
P40
P40 (Input & pulled down∗)
P41
P41 (Input & pulled down∗)
P42
P42 (Input & pulled down∗)
P43
P43 (Input & pulled down∗)
Terminal status
at initial reset
TOUT_A
When special outputs/peripheral functions are used (selected by software)
Special output
TOUT
FOUT
FOUT
∗ When "With Pull-Down" is selected by mask option (high impedance when "Gate Direct" is selected)
BZBZMaster
SCLK(O)
SOUT(O)
SIN(I)
Serial I/F
SCLK(I)
SOUT(O)
SIN(I)
SRDY(O)/SS(I)
Slave
R/f converter
RFIN0
REF0
SEN0
RFOUT
Stopwatch
direct input
RUN/LAP
RUN/LAP
Event
counter
EVIN_A
EVIN_B
EVIN_C
EVIN_D
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 VSS.
3240-0412
Page 21
SIC63616-(Rev. 1.0) NO. P14
0000H
3FFFH
4000H
FFFFH
0000H
0100H
0101H
0110H
0100H
0101H
0102H
0103H
0104H
0105H
0106H
0107H
0108H
0109H
010AH
010BH
010CH
010DH
010EH
010FH
Program area
NMI vector
Hardware
interrupt vectors
Program start address
Program area
Code ROM
Unused area
13 bits
S1C63000 core CPU
program space
Watchdog timer
R/f converter
Programmable timer 0
Programmable timer 1
Programmable timer 2
Programmable timer 3
Programmable timer 4
Programmable timer 5
Programmable timer 6
Programmable timer 7
Serial interface
Key input interrupt (P1)
Key input interrupt (P4)
Stopwatch
Clock timer (128/64/32/16 Hz)
Clock timer (8/4/2/1 Hz)
S1C63616
program area
Chapter 3 Cpu, roM, raM
3.1 CPU
The S1C63616 has a 4-bit core CPU S1C63000 built-in as its CPU part.
Refer to the "S1C63000 Core CPU Manual" for the S1C63000.
3.2 Code ROM
The built-in code ROM is a mask ROM for loading programs, and has a capacity of 16,384 words × 13
bits. The core CPU can linearly access the program space up to step FFFFH from step 0000H, however, the
program area of the S1C63616 is step 0000H to step 3FFFH. 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 0101H–010FH, respectively.
Fig. 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 atten-
tion 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 07FFH 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 S1C63616 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.
3240-0412
Page 22
SIC63616-(Rev. 1.0) NO. P15
(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
evacuation) in the stack area for 4-bit data.
0000H
0800H
8000H
8800H
F000H
FF00H
FFFFH
RAM
Unused area
Data ROM
Unused area
Display memory area
Unused area
I/O memory area
0000H
00FFH
0100H
01FFH
0200H
07FFH
4-bit access area
(SP2 stack area)
4/16-bit access area
(SP1 stack area)
4-bit access area
(Data area)
4 bits
Fig. 3.3.1 Configuration of data RAM
3.4 Data ROM
The data ROM is a mask ROM for loading various static data such as a character generator, and has a capacity of 2,048 words × 4 bits. The data ROM is assigned to addresses 8000H to 87FFH on the data memory
map, and the data can be read using the same data memory access instructions as the RAM.
3240-0412
Page 23
SIC63616-(Rev. 1.0) NO. P16
Chapter 4 peripheral CirCuitsand operation
The peripheral circuits of S1C63616 (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 S1C63616 data memory consists of 2,048-word RAM, 2,048-word mask ROM, 2,048-bit display memory
and 170-word peripheral I/O memory. Figure 4.1.1 shows the overall memory map of the S1C63616, and
Table 4.1.1 the peripheral circuits' (I/O space) memory maps.
0000H
RAM area
0800H
Unused area
8000H
Data ROM area
8800H
Unused area
F000H
Display memory area
F36FH
Unused area
F000H
FF00H
FFFFH
Display memory area
Unused area
I/O memory area
FF00H
Peripheral I/O area
FFFFH
Fig. 4.1.1 Memory map
Note: Memory 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.
Interrupt factor flag (R/f converter reference oscillate completion)
(W)
Interrupt factor flag (R/f converter sensor oscillate completion)
Invalid
Unused
(R)
Unused
No
Interrupt factor flag (Programmable timer 0 underflow)
(W)
Interrupt factor flag (Programmable timer 0 compare match)
Invalid
(R)
Unused
No
Unused
(W)
Interrupt factor flag (Programmable timer 1 underflow)
Invalid
Interrupt factor flag (Programmable timer 1 compare match)
(R)
Unused
No
Unused
(W)
Interrupt factor flag (Programmable timer 2 underflow)
Invalid
Interrupt factor flag (Programmable timer 2 compare match)
(R)
Unused
No
Unused
(W)
Interrupt factor flag (Programmable timer 3 underflow)
Invalid
Interrupt factor flag (Programmable timer 3 compare match)
(R)
Unused
No
Unused
(W)
Interrupt factor flag (Programmable timer 4 underflow)
Invalid
Interrupt factor flag (Programmable timer 4 compare match)
(R)
Unused
No
Unused
(W)
Interrupt factor flag (Programmable timer 5 underflow)
Invalid
Interrupt factor flag (Programmable timer 5 compare match)
(R)
Unused
No
Unused
(W)
Interrupt factor flag (Programmable timer 6 underflow)
Invalid
Interrupt factor flag (Programmable timer 6 compare match)
(R)
Unused
No
Unused
(W)
Interrupt factor flag (Programmable timer 7 underflow)
Invalid
Interrupt factor flag (Programmable timer 7 compare match)
(R)
Unused
No
Unused
(W)
Unused
Invalid
Interrupt factor flag (Serial interface)
(R)
Interrupt factor flag (Key input interrupt 3 <P13>)
No
Interrupt factor flag (Key input interrupt 2 <P12>)
(W)
Interrupt factor flag (Key input interrupt 1 <P11>)
Invalid
Interrupt factor flag (Key input interrupt 0 <P10>)
(R)
Interrupt factor flag (Key input interrupt 7 <P43>)
No
Interrupt factor flag (Key input interrupt 6 <P42>)
(W)
Interrupt factor flag (Key input interrupt 5 <P41>)
Invalid
Interrupt factor flag (Key input interrupt 4 <P40>)
3240-0412
Page 38
SIC63616-(Rev. 1.0) NO. P31
Table 4.1.1 (o) I/O memory map (FFFDH-FFFFH)
AddressComment
IRUNILAPISW1ISW10
FFFDH
FFFEH
FFFFH
Register
D3D2D1D0Name Init
IRUN
ILAP
R/W
IT3IT2IT1IT0
R/W
IT7IT6IT5IT4
R/W
ISW1
ISW10
IT3
IT2
IT1
IT0
IT7
IT6
IT5
IT4
∗1
10
0
(R)
0
Yes
0
(W)
0
Reset
0
(R)
0
Yes
0
(W)
0
Reset
0
(R)
0
Yes
0
(W)
0
Reset
Interrupt factor flag (Stopwatch direct RUN)
(R)
Interrupt factor flag (Stopwatch direct LAP)
No
Interrupt factor flag (Stopwatch timer 1 Hz)
(W)
Interrupt factor flag (Stopwatch timer 10 Hz)
Invalid
Interrupt factor flag (Clock timer 16 Hz)
(R)
Interrupt factor flag (Clock timer 32 Hz)
No
Interrupt factor flag (Clock timer 64 Hz)
(W)
Interrupt factor flag (Clock timer 128 Hz)
Invalid
(R)
Interrupt factor flag (Clock timer 1 Hz)
No
Interrupt factor flag (Clock timer 2 Hz)
(W)
Interrupt factor flag (Clock timer 4 Hz)
Invalid
Interrupt factor flag (Clock timer 8 Hz)
3240-0412
Page 39
SIC63616-(Rev. 1.0) NO. P32
4.2 Power Control
4.2.1 Configuration of power supply circuit
The S1C63616 has built-in power supply circuits shown in Figure 4.2.1.1 so the voltages to drive the CPU,
internal logic circuits, oscillation circuits and LCD driver can be generated on the chip.
DD
External
power
supply
∗1
∗2
V
CF
CG
VD2
VD1
VOSC
VC1
VC2
VC3
VC4
VC5
CA
CB
CC
CD
CE
V
SS
Power supply voltage
booster/halver
VD2
∗3
VDD
VCSEL
Oscillation system
voltage regulator
VOSC
LCD system
voltage
regulator
V
C1–VC5
VDD
Internal voltage
LPWR
VCHLMOD
DBON
HLON
VDHLMOD
regulator
∗4
Internal circuits
VD1
OSC3
oscillation circuit
OSC1
oscillation circuit
LCD
driver
circuit
OSC3
OSC4
OSC1
OSC2
COM0–COM31
SEG0–SEG39
∗1 Leave these terminals open when the power supply voltage booster/halver is not used.
∗2 Connect when the 1/5 bias LCD drive power is used. (Leave the terminal open when the 1/4 bias LCD drive power is used.)
∗3 Can be selected as the power source for the LCD system voltage regulator when the power supply voltage booster/halver
operates in boost mode.
∗4 HLON is prohibited from use.
Fig. 4.2.1.1 Built-in power supply circuit
Power supply voltage booster/halver
The power supply voltage booster/halver generates the operating voltage VD2 for the voltage regulator (LCD system voltage regulator). The S1C63616 allows software to control the power supply voltage
booster/halver and to select the power source of the voltage regulator.
Internal voltage regulator
This voltage regulator always operates to generate the VD1 operating voltage for the internal logic circuits and OSC3 oscillation circuit.
Oscillation system voltage regulator
This voltage regulator always operates to generate the V
circuit.
OSC
voltage for driving the OSC1 oscillation
LCD system voltage regulator
The LCD system voltage regulator generates the LCD drive voltages VC1 to VC5. See Chapter 7, "Electrical Characteristics" for the voltage values. In the S1C63616, the LCD drive voltage is supplied to the
built-in LCD driver which drives the LCD panel connected to the SEG and COM terminals.
Note: BesurenottousetheVD1,VD2,V
circuits.
OSC
andVC1toVC5 terminal output voltages to drive external
3240-0412
Page 40
SIC63616-(Rev. 1.0) NO. P33
4.2.2 Controlling the power supply voltage booster/halver and voltage regulators
Controlling the power supply voltage booster/halver
The power supply voltage booster/halver generates the operating voltage VD2 for driving the voltage
regulator (LCD system voltage regulator) when the supply voltage VDD is out of their operating voltage
range.
The power supply voltage booster/halver has two operating modes, boost mode and halving mode,
that can be selected using the DBON and HLON registers according to the VDD value being supplied.
The power supply voltage booster/halver enters boost mode by setting DBON to "1" and boosts the
supply voltage VDD to generate VD2 (about double VDD). The power supply voltage booster/halver
should be placed in boost mode only when VD2 is required for driving the LCD system voltage regulator (see "Controlling the LCD system voltage regulator" described below).
HLON is prohibited from use. Always be sure to set to "0".
Setting both DBON and HLON to "0" turns the power supply voltage booster/halver off. The VD2 voltage is not required when the supply voltage VDD is within the range from 2.5 V to 5.5 V (1.6 V to 5.5
V when the VC1 reference LCD drive power option is selected). In this case the power supply voltage
booster/halver should be turned off to reduce current consumption.
At initial reset, DBON and HLON are both set to "0" and the power supply voltage booster/halver does
not activate.
Controlling the LCD system voltage regulator
When the VC2 reference LCD drive power option is selected, the LCD system voltage regulator must be
driven with a 2.5 V or more power voltage. Therefore, they can be driven with VDD if the supply voltage
VDD is 2.5 V or more. When the supply voltage VDD less than 2.5 V is used, drive the power supply voltage booster/halver in boost mode to generate VD2 and use it to drive the LCD system voltage regulator.
Use VCSEL to select the power source voltage (VDD or VD2) for the LCD system voltage regulator. It is
driven with VDD by setting VCSEL to "0" or VD2 by setting VCSEL to "1".
At initial reset, VCSEL is set to "0" so that VDD is selected as the power source for the LCD system voltage regulator.
To generate the LCD drive voltages by the LCD system voltage regulator (to start LCD display), turn the
LCD system voltage regulator on using the LPWR register. When "1" is written to LPWR, the LCD system voltage regulator goes on and generates the LCD drive voltages. At initial reset, LPWR is set to "0"
(Off). When LCD display is not necessary, turn the LCD system voltage regulator off to reduce power
consumption.
thepowersupplyvoltagebooster/halverinboostmodebeforesettingVCSELto"1".Furthermore,
donotswitchthepowersourcetoVD2forabout1msecuntiltheVD2 voltage has stabilized after
the power supply voltage booster/halver is turned on.
• DonotsetDBONto"1"(boostmode)andVCSELto"1"(drivingwithVD2) if the supply voltage
toVC5voltagescannotbegeneratedwithinspecications(whenaVC2 reference voltage option is
selected).
3240-0412
Page 41
SIC63616-(Rev. 1.0) NO. P34
Table 4.2.2.1 lists settings of the above registers according to the supply voltage VDD.
Table 4.2.2.1 Power control register settings according to supply voltage VDD
When VC2 reference LCD drive power option is selected
Power supply
voltage VDD
1.6 to 2.5 V
2.5 to 5.5 V
When VC1 reference LCD drive power option is selected
Power supply
voltage VDD
1.6 to 5.5 V
DBON
DBON0HLON0VDSEL0VCSEL
HLON
VDSEL
1
0
0
0
VCSEL
0
0
1
0
0
Power source for internal and
oscillation system voltage regulators
VDD
VDD
Power source for internal and
oscillation system voltage regulators
VDD
Power source for LCD system
voltage regulator (VC2 reference)
VD2 (≈ VDD × 2)
VDD
Power source for LCD system
voltage regulator (VC1 reference)
VDD
4.2.3 Heavy load protection function
In order to ensure a stable circuit behavior and LCD display quality even if the power supply voltage
fluctuates due to driving an external load, the internal operating voltage regulator and the LCD system
voltage regulator have a heavy load protection function.
The internal operating voltage regulator enters heavy load protection mode by writing "1" to the
VDHLMOD register and it ensures stable VD1 output. Use the heavy load protection function when a heavy
load such as a lamp or buzzer is driven with a port output.
The LCD system voltage regulator enters heavy load protection mode by writing "1" to the VCHLMOD
register and it ensures stable VC1–VC5 outputs. Use the heavy load protection function when the LCD
display has inconsistencies in density.
Note: Current consumption increases in heavy load protection mode, therefore do not set heavy load
protection mode with software if unnecessary.
4.2.4 I/O memory for power control
Table 4.2.4.1 shows the I/O address and the control bits for power control.
Table 4.2.4.1 Power control bits
AddressComment
VDSEL VCSEL HLONDBON
FF02H
VCHLMOD VDHLMOD
FF03H
*1 Initial value at initial reset*3 Constantly "0" when being read
*2 Not set in the circuit
DBON: Power supply voltage booster/halver boost mode On/Off register (FF02H•D0)
Activates the power supply voltage booster/halver in boost mode.
When "1" is written: Booster On
When "0" is written: Booster Off
When "1" is written to DBON, the power supply voltage booster/halver activates in boost mode and almost
doubles the VDD voltage to generate the VD2 voltage. Turn the power supply voltage booster/halver on
when driving the LCD system voltage regulator with VD2 (VC2 reference voltage, VDD = 1.6 to 2.5 V). When
"0" is written to DBON, the voltage boost operation is deactivated. Be sure to set DBON to "0" (Off) when
driving the LCD system voltage regulator with VDD. Furthermore, do not set both DBON and HLON to "1".
At initial reset, this register is set to "0".
Register
D3D2
Reading: Valid
D1D0Name Init
VDSEL
VCSEL
R/W
General LPWR
R/W
HLON
DBON
VCHLMOD
VDHLMOD
General
LPWR
∗1
10
General-purpose register
0
0
0
0
0
0
0
0
0
1
D2
DD
Power source select for LCD system voltage regulator
V
V
On
Off
On
On
On
1
On
Power voltage booster/halver halving mode On/Off
Off
Power voltage booster/halver boost mode On/Off
Heavy load protection mode On/Off for LCD system voltage regulator
Off
Heavy load protection mode On/Off for internal voltage regulator
Off
General-purpose register
0
LCD system voltage regulator On/Off
Off
3240-0412
Page 42
SIC63616-(Rev. 1.0) NO. P35
HLON: Power supply voltage booster/halver halving mode On/Off register (FF02H•D1)
Activates the power supply voltage booster/halver in halving mode.
When "1" is written: Halver On
When "0" is written: Halver Off
Reading: Valid
HLON is prohibited from use. Always be sure to set to "0".
At initial reset, this register is set to "0".
VCSEL: LCD system voltage regulator power source switch register (FF02H•D2)
Selects the power voltage for the LCD system voltage regulator.
When "1" is written: V
When "0" is written: V
D2
DD
Reading: Valid
When "1" is written to VCSEL, the LCD system voltage regulator is driven with VD2 generated by the power
supply voltage booster/halver. Before this setting is made, it is necessary to write "1" to DBON to activate
the power supply voltage booster (boost mode). Furthermore, do not switch the power voltage to VD2 for at
least 1 msec after the power supply voltage booster/halver is turned on to allow VD2 to stabilize. When "0"
is written to VCSEL, the LCD system voltage regulator is driven with VDD.
At initial reset, this register is set to "0".
LPWR: LCD system voltage regulator On/Off register (FF03H•D0)
Turns the LCD system voltage regulator on and off.
When "1" is written: On
When "0" is written: Off
Reading: Valid
When "1" is written to LPWR, the LCD system voltage regulator goes on and generates the LCD drive
voltages. When "0" is written, all the LCD drive voltages go to VSS level.
It takes about 100 msec for the LCD drive voltages to stabilize after starting up the LCD system voltage
regulator by writing "1" to LPWR.
At initial reset, this register is set to "0".
VDHLMOD: Internal operating voltage regulator heavy load protection On/Off register (FF03H•D2)
Enables heavy load protection function for the internal operating voltage regulator.
When "1" is written: On
When "0" is written: Off
Reading: Valid
By writing "1" to VDHLMOD, the internal operating voltage regulator enters heavy load protection mode
and it ensures stable VD1 output. The heavy load protection function is effective when the buzzer/FOUT
signal is being output. However, heavy load protection mode increases current consumption compared
with normal operation mode. Therefore, do not set heavy load protection mode unless it is necessary.
At initial reset, this register is set to "0".
3240-0412
Page 43
SIC63616-(Rev. 1.0) NO. P36
VCHLMOD: LCD system voltage regulator heavy load protection On/Off register (FF03H•D3)
Enables heavy load protection function for the LCD system voltage regulator.
When "1" is written: On
When "0" is written: Off
Reading: Valid
By writing "1" to VCHLMOD, the LCD system voltage regulator enters heavy load protection mode to
minimize degradation in display quality when fluctuations in the supply voltage occurs due to driving a
heavy load. The heavy load protection function is effective when the OSC3 clock is used or the buzzer/
FOUT signal is being output. However, heavy load protection mode increases current consumption
compared with normal operation mode. Therefore, do not set heavy load protection mode unless it is
necessary.
At initial reset, this register is set to "0".
4.2.5 Programming notes
(1) When the power supply voltage booster/halver is turned on, the VD2 output voltage requires about
1 msec to stabilize. Do not switch the power source for the voltage regulator (LCD system voltage
regulator) to VD2 until the stabilization time has elapsed.
(2) HLON is prohibited from use, as it may cause malfunctions. Always be sure to set to "0".
(3) Do not set DBON to "1" (boost mode) and VCSEL to "1" (driving with VD2) if the supply voltage VDD
exceeds 2.5 V, as it may cause damage of the IC.
(4) Current consumption increases in heavy load protection mode, therefore do not set heavy load pro-
tection mode with software if unnecessary.
3240-0412
Page 44
SIC63616-(Rev. 1.0) NO. P37
4.3 Watchdog Timer
4.3.1 Configuration of watchdog timer
The S1C63616 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–4 seconds, it generates a non-maskable interrupt (NMI) to the CPU.
Figure 4.3.1.1 is the block diagram of the watchdog timer.
OSC1 dividing signal 256 Hz
Watchdog timer enable signal
Watchdog timer reset signal
Watchdog timer
Non-maskable
interrupt (NMI)
Fig. 4.3.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.
Watchdog 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–4 seconds, the nonmaskable interrupt releases the HALT status.
4.3.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.
3240-0412
Page 45
SIC63616-(Rev. 1.0) NO. P38
4.3.3 I/O memory of watchdog timer
Table 4.3.3.1 shows the I/O address and control bits for the watchdog timer.
Table 4.3.3.1 Control bits of watchdog timer
AddressComment
FF01H
*1 Initial value at initial reset
*2 Not set in the circuit
*3 Constantly "0" when being read
WDRST: Watchdog timer reset (FF01H•D0)
Resets the watchdog timer.
When "1" is written: Watchdog timer is reset
When "0" is written: No operation
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.
WDEN: Watchdog timer enable register (FF01H•D1)
Selects whether the watchdog timer is used (enabled) or not (disabled).
Register
D3D2
00WDEN WDRST
D1D0Name Init
R/WWR
Reading: Always "0"
0
0
WDEN
WDRST
∗1
∗
3
–
∗
3
–
∗
3
Reset
10
∗
2
∗
2
1
Enable
Reset
Unused
Unused
Disable
Watchdog timer enable
Invalid
Watchdog timer reset (writing)
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".
4.3.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 dis-
abled state (not used) before generating an interrupt (NMI) if it is not used.
3240-0412
Page 46
SIC63616-(Rev. 1.0) NO. P39
4.4 Oscillation Circuit
4.4.1 Configuration of oscillation circuit
The S1C63616 is configured as a twin clock system with two internal oscillation circuits (OSC1 and OSC3).
The OSC1 oscillation circuit generates the main-clock (Typ. 32.768 kHz) for low-power operation and the
OSC3 oscillation circuit generates the sub-clock (Max. 4.2 MHz) to run the CPU and some peripheral circuits in high speed.
Figure 4.4.1.1 shows the configuration of the oscillation circuit.
oscillation circuit
oscillation circuit
SLEEP
status
OSC1
OSC3
Oscillation circuit
control signal
OSCC
(fOSC1)
(f
OSC3)
Prescaler
Clock
switch
CPU clock
selection signal
CLKCHG
To peripheral
circuits
To CPU
To some peripheral
circuits
Fig. 4.4.1.1 Oscillation system block diagram
At initial reset, OSC1 oscillation circuit is selected as the CPU operating clock source. The S1C63616 allows
the software to turn the OSC3 oscillation circuit on and off, and to switch the system clock between OSC3
and OSC1. The OSC3 oscillation circuit is used when the CPU and some peripheral circuits need high speed
operation. Otherwise, use the OSC1 oscillation circuit to generate the operating clock and stop the OSC3
oscillation circuit to reduce current consumption.
Note: The S1C63616 supports the SLEEP function and both the OSC1 and OSC3 oscillation circuits
stop oscillating when the CPU enters SLEEP mode. To prevent the CPU from a malfunction when it
resumes operating from SLEEP mode, switch the CPU clock to OSC1 before placing the CPU into
SLEEP mode.
4.4.2 Mask option
The OSC1 oscillator type is fixed at crystal.
For the OSC3 oscillator type, either ceramic or CR (external R) can be selected.
3240-0412
Page 47
SIC63616-(Rev. 1.0) NO. P40
4.4.3 OSC1 oscillation circuit
The OSC1 oscillation circuit generates the 32.768 kHz (Typ.) system clock which is used during low speed
(low power) operation of the CPU and peripheral circuits. Furthermore, even when OSC3 is used as the
system clock, OSC1 continues to generate the source clock for the clock timer and stopwatch timer. This
oscillation circuit stops when the SLP instruction is executed.
Figure 4.4.3.1 shows the configuration of the OSC1 oscillation circuit.
A crystal oscillation circuit can be configured simply by connecting a crystal oscillator X'tal (Typ. 32.768
kHz) between the OSC1 and OSC2 terminals along with a trimmer capacitor CG1 (0–25 pF) between the
OSC1 terminal and VSS.
4.4.4 OSC3 oscillation circuit
The OSC3 oscillation circuit generates the system clock to run the CPU and some peripheral circuits at high
speed. This oscillation circuit stops when the SLP instruction is executed or the OSCC register is set to "0".
The oscillator type can be selected from ceramic or CR by mask option.
Figure 4.4.4.1 shows the configuration of the OSC3 oscillation circuit.
CG3
OSC3
Ceramic
C
D3
VSS
Rf
OSC4
(1) Ceramic oscillation circuit
fOSC3
Oscillation circuit
control signal
SLEEP status
OSC3
fOSC3
CR
R
Oscillation circuit
OSC4
control signal
SLEEP status
(2) CR oscillation circuit
Fig. 4.4.4.1 OSC3 oscillation circuit
When ceramic oscillation circuit (Max. 4.2 MHz) is selected, connect a ceramic oscillator (Ceramic) between
the OSC3 and OSC4 terminals and connecting two capacitors (CG3, CD3) between the OSC3 terminal and
VSS, and between the OSC4 terminal and VSS, respectively.
When CR oscillation (Max. 2 MHz) is selected, connect a resistor (RCR) between the OSC3 and OSC4 terminals.
3240-0412
Page 48
SIC63616-(Rev. 1.0) NO. P41
4.4.5 Switching the CPU clock
Either the OSC1 clock or the OSC3 clock can be selected as the CPU system clock using the CLKCHG
register.
The OSC3 oscillation circuit can be turned off (OSCC = "0") to save power while the CPU is operating with
the OSC1 clock (CLKCHG = "0").
If the system needs high speed operation, turn the OSC3 oscillation circuit on (OSCC = "1") and switch over
the system clock to OSC3 (CLKCHG = "0" → "1").
In this case, since 1 msec to several tens of msec are necessary for the oscillation to stabilize after turning the
OSC3 oscillation circuit on, you should switch over the clock after the stabilization time has elapsed. For the
oscillation start time, refer to Chapter 8, "Electrical Characteristics".
After the clock is switched from OSC3 to OSC1, the OSC3 oscillation circuit can be turned off immediately.
When switching the clock from OSC3 to OSC1 (CLKCHG = "1" → "0"), be sure to switch OSC3 oscillation
off with separate instructions. Using a single instruction to process simultaneously can cause a malfunction
of the CPU.
Figure 4.4.5.1 indicates the status transition diagram for the clock changeover.
Program Execution Status
RESET
High speed operation
OSC1
OSC3
CPU clock
ON
ON
OSC3
CLKCHG=0
CLKCHG=1
Low speed operation
OSC1
OSC3
CPU clock
ON
ON
OSC1
OSCC=0
OSCC=1
Low speed and
low power operation
OSC1
OSC3
CPU clock
ON
OFF
OSC1
**
HALT status
OSC1
OSC3
CPU clock
HALT instructionSLP instructionInterruptInterrupt
(Key input interrupt)
ON
ON or OFF
STOP
SLEEP status
OSC1
OSC3
CPU clock
OFF
OFF
STOP
Standby Status
* The return destination from the standby status becomes the program execution status prior to shifting to the standby status.
Fig. 4.4.5.1 Status transition diagram for the clock changeover
3240-0412
Page 49
SIC63616-(Rev. 1.0) NO. P42
4.4.6 I/O memory of oscillation circuit
Table 4.4.6.1 shows the I/O address and the control bits for the oscillation circuit.
Note: The control bits for the oscillation circuit described below are effective only when the OSC3 oscil-
lation circuit is used. If the system uses the OSC1 oscillation circuit only, do not change the default
settings.
Table 4.4.6.1 Control bits of oscillation circuit
AddressComment
CLKCHG
FF00H
*1 Initial value at initial reset
*2 Not set in the circuit
*3 Constantly "0" when being read
OSCC: OSC3 oscillation control register (FF00H•D2)
Turns the OSC3 oscillation circuit on and off.
When "1" is written: OSC3 oscillation On
When "0" is written: OSC3 oscillation Off
When it is necessary to operate the CPU at high speed, set OSCC to "1". At other times, set it to "0" to reduce
current consumption.
At initial reset, this register is set to "0".
Register
D3D2
OSCC00
R/WR
Reading: Valid
D1D0Name Init
CLKCHG
OSCC
∗
0
∗
0
3
–
3
–
∗1
0
0
∗
2
∗
2
10
OSC3OnOSC1
Off
CPU clock switch
OSC3 oscillation On/Off
Unused
Unused
CLKCHG: CPU system clock switching register (FF00H•D3)
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".
At initial reset, this register is set to "0".
3240-0412
Page 50
SIC63616-(Rev. 1.0) NO. P43
4.4.7 Programming notes
(1) When the high speed CPU operation is not necessary, you should operate the peripheral circuits accord-
(When the OSC3 clock is not necessary for some peripheral circuits.)
(2) Since 1 msec to several tens of msec are necessary for the oscillation to stabilize after turning the OSC3
oscillation circuit on. Consequently, you should switch the CPU operating clock (OSC1 → OSC3) after
allowing for a sufficient waiting time once the OSC3 oscillation goes on. (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".)
(3) When switching the clock from OSC3 to OSC1, be sure to switch OSC3 oscillation off with separate
instructions. Using a single instruction to process simultaneously can cause a malfunction of the CPU.
(4) The S1C63616 supports the SLEEP function and both the OSC1 and OSC3 oscillation circuits stop oscil-
lating when the CPU enters SLEEP mode. To prevent the CPU from a malfunction when it resumes
operating from SLEEP mode, switch the CPU clock to OSC1 before placing the CPU into SLEEP mode.
3240-0412
Page 51
SIC63616-(Rev. 1.0) NO. P44
4.5 I/O Ports
(P00-P03, P10-P13, P20-P23 and P40-P43)
4.5.1 Configuration of I/O ports
The S1C63616 is equipped with 16 bits of I/O ports (P00–P03, P10–P13, P20–P23 and P40–P43) in which the
input/output direction can be switched with software.
Figure 4.5.1.1 shows the structure of an I/O port.
Pull-down control
register (PUL)
Data bus
*1
*2
I/O control
register (IOC)
Data
register
Input
control
∗1: During output mode
∗2: During input mode
Fig. 4.5.1.1 Structure of I/O port
VDD
Pxx
Mask
option
VSS
Note: If an output terminal (including a special output terminal) of this IC is used to drive an external com-
ponent 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
Each I/O port terminal provides an internal pull-down resistor. The mask option allows selection of the
pull-down resistor to be connected or disconnected in 1-bit units.
When "Use" is selected by mask option, the port suits input from the push switch, key matrix, and so forth.
When "Not use" is selected, the port can be used for slide switch input and interfacing with other LSIs.
The P10 and P11 I/O ports can also be used as the Run/Stop and Lap direct inputs for the stopwatch timer.
The P12 and P41–P43 ports can also be used as the event counter inputs for the programmable timer.
The I/O port terminals P00–P03, P13, P20–P23 are shared with the R/f converter input/output terminals,
serial interface input/output terminals and special output (BZ, FOUT, TOUT_A) terminals. The software
can select the function to be used.
At initial reset, these terminals are all set to the I/O port.
Table 4.5.1.1 shows the setting of the input/output terminals by function selection.
3240-0412
Page 52
SIC63616-(Rev. 1.0) NO. P45
Table 4.5.1.1 Function setting of input/output terminals
Terminal
name
P00
P00 (Input & pulled down∗)
P01
P01 (Input & pulled down∗)
P02
P02 (Input & pulled down∗)
P03
P03 (Input & pulled down∗)
P10
P10 (Input & pulled down∗)
P11
P11 (Input & pulled down∗)
P12
P12 (Input & pulled down∗)
P13
P13 (Input & pulled down∗)
P20
P20 (Input & pulled down∗)
P21
P21 (Input & pulled down∗)
P22
P22 (Input & pulled down∗)
P23
P23 (Input & pulled down∗)
P40
P40 (Input & pulled down∗)
P41
P41 (Input & pulled down∗)
P42
P42 (Input & pulled down∗)
P43
P43 (Input & pulled down∗)
Terminal status
at initial reset
TOUT_A
When special outputs/peripheral functions are used (selected by software)
Special output
TOUT
FOUT
FOUT
∗ When "With Pull-Down" is selected by mask option (high impedance when "Gate Direct" is selected)
BZBZMaster
SCLK(O)
SOUT(O)
SIN(I)
Serial I/F
SCLK(I)
SOUT(O)
SIN(I)
SRDY(O)/SS(I)
Slave
R/f converter
RFIN0
REF0
SEN0
RFOUT
Stopwatch
direct input
RUN/LAP
RUN/LAP
Event
counter
EVIN_A
EVIN_B
EVIN_C
EVIN_D
When these ports are used as I/O ports, the ports can be set to either input mode or output mode
individually (in 1-bit units). The mode can be set by writing data to the I/O control registers.
When the special output or peripheral function is used, the input/output direction of the port is automatically
configured by switching the terminal function. For controlling the serial interface, R/f converter, BZ output,
stopwatch timer, and event counter, refer to "4.10 Serial Interface", "4.13 R/f Converter", "4.11 Sound
Generator", "4.8 Stopwatch Timer", and "4.9 Programmable Timer".
entry reset, serial interface, event counter input, direct RUN/LAP input for stopwatch) must be disabled.
4.5.2 Mask option
The output specification of each I/O port during output mode can be selected from either complementary
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 allows selection of whether the pull-down resistor is used or not during input mode.
This selection can be done in 1-bit units. When "Not use" is selected, take care that the floating status does
not occur during input mode.
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 and R/f converter.
3240-0412
Page 53
SIC63616-(Rev. 1.0) NO. P46
4.5.3 I/O control registers and input/output mode
The I/O ports can be placed into input or output mode by writing data to the corresponding I/O control
registers IOCxx.
To set a port to 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 Section 4.5.5 has been enabled by software, the input line is
pulled down only during this input mode.
To set a port to output mode, write "1" to the I/O control register. When an I/O port is set to output mode,
it works as an output port. The port outputs a high level (VDD) when the port output data is "1", and a
low level (VSS) when the port output data is "0". The I/O ports allow software to read data even in output
mode. In this case, the data register value is read out.
At initial reset, the I/O control registers are set to "0", and the I/O ports enter input mode.
When the peripheral input/output or special output function is selected (see Table 4.5.1.1), the input/
output direction is controlled by the hardware. In this case, the I/O control register of the port can be used
as a general purpose register that does not affect the I/O control.
4.5.4 Input interface level
The I/O ports (P1x, P2x, P4x) allow software to select an input interface level. When the input interface
level select register SMTxx is set to "0", the corresponding port is configured with a CMOS level input
interface. When SMTxx is set to "1", the port is configured with a CMOS Schmitt level input interface.
(P0x is the fixed setting for CMOS Schmitt level.) At initial reset, all the ports are configured with a CMOS
Schmitt level interface.
The input interface level select register of the port that is set for a peripheral output , R/f converter input/
output or special output (see Table 4.5.1.1) can be used as a general-purpose register.
The input interface level select register of the port that is set for a peripheral input (except for the R/f
converter) functions the same as the I/O port.
4.5.5 Pull-down during input mode
A pull-down resistor that activates during the input mode can be built into the I/O ports of the S1C63616.
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 input mode. When "0" is written to
PULxx or in output mode, the port will not be pulled down.
At initial reset, the pull-down control registers are set to "1".
The pull-down control registers of the ports in which the pull-down resistor is disconnected by mask option
can be used as general purpose registers.
Even if the pull-down resistor has been connected, the pull-down control register of the port that is set for
a peripheral output, R/f converter input/output or output special output (see Table 4.5.1.1) can be used as
a general purpose register that does not affect the pull-down control. The pull-down control register of the
port that is set for a peripheral input (except for the R/f converter) functions the same as the I/O port.
3240-0412
Page 54
SIC63616-(Rev. 1.0) NO. P47
4.5.6 Special output
Besides general purpose DC input/output, the I/O ports P03, P13 and P23 can also be assigned special
output functions in software as shown in Table 4.5.6.1.
Table 4.5.6.1 Special output ports
Port
P03
P13
P23
When a special output function is enabled using the special output control register, the corresponding
I/O port is automatically configured for output. The data register, I/O control register, pull-down control
register and input interface level select register of the special output port can be used as general-purpose
registers that do not affect the output status.
TOUT output (P13)
In order for the S1C63616 to provide clock signals to external devices, the P13 terminal can be used to
output the TOUT_A signal (clocks output by the programmable timer).
The TOUT_A signal is enabled to output by the PTOUT_A register. When PTOUT_A is set to "1", the
TOUT_A signal is output from the corresponding port terminal (P13). The I/O control register (IOC13),
pull-down control register (PUL13) and data register (P13) setting is ineffective while the TOUT_A signal is being output.
When PTOUT_A is set to "0", the port is configured as a general-purpose DC input/output port.
The TOUT_A signal is generated from the underflow and compare-match signals of a programmable
timer. Refer to Section 4.9, "Programmable Timer", for controlling the clock output and frequency.
Since the TOUT_A signal is generated asynchronously from the PTOUT_A register, a hazard of a 1/2
cycle or less is generated when the signal is turned on or off by setting the register.
Figure 4.5.6.1 shows the output waveform of the TOUT_A signal.
Special output
BZ
TOUT_A
FOUT
Special output control register
BZE, BZSHT
PTOUT_A
FOUT0–FOUT3
PTOUT_A
TOUT_A output
(P13)
01
Fig. 4.5.6.1 Output waveform of TOUT_A signal
FOUT output (P23)
In order for the S1C63616 to provide a clock signal to an external device, the FOUT signal (f
or a divided clock) can be output from the P23 port terminal.
The FOUT signal is enabled to output by the FOUT0–FOUT3 registers. When the output clock frequency
is selected using FOUT0–FOUT3, the FOUT signal is output from the P23 port terminal. The I/O control
register (IOC23), pull-down control register (PUL23) and data register (P23) settings are ineffective
while the FOUT signal is being output.
When FOUT0–FOUT3 are set to "0", the P23 port is configured as a general-purpose DC input/output
port.
The frequency of the FOUT signal can be selected from among 15 settings as shown in Table 4.5.6.2.
: OSC1 oscillation frequency. ( ) indicates the clock frequency when f
OSC3
f
: OSC3 oscillation frequency
When the FOUT frequency is set to "f
OSC3
/n", the OSC3 oscillation circuit must be turned on before
OSC1
= 32 kHz.
outputting the FOUT signal. A time interval of several tens of µsec to several tens of msec, from turning
the OSC3 oscillation circuit on until the oscillation stabilizes, is necessary, due to the oscillation element
that is used. Consequently, if an abnormality occurs as the result of an unstable FOUT signal being
output externally, you should allow an adequate waiting time after turning the OSC3 oscillation on,
before starting FOUT output. (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".)
Since the FOUT signal is generated asynchronously from the FOUT0–FOUT3 registers, a hazard of a 1/2
cycle or less is generated when the signal is turned on or off by setting the registers.
Figure 4.5.6.2 shows the output waveform of the FOUT signal.
FOUT0–3
FOUT output (P23)
00Other than 0
Fig. 4.5.6.2 Output waveform of FOUT signal
Note: The P23 terminal used for FOUT output is also shared with the SRDY output or SS input for the
The P03 terminal can output the BZ signal.
The BZ signal is the buzzer signal generated by the sound generator.
Use the BZE or BZSHT register for controlling (On/Off) the BZ signal output.
Refer to Section 4.11, "Sound Generator", for details of the buzzer signal and controlling method.
Eight bits of the I/O ports (P10–P13, P40–P43) provide the interrupt function. The conditions for generating
an interrupt can be set with software. Further, whether to mask the interrupt function can be selected with
software. Figure 4.5.7.1 shows the configuration of the key input interrupt circuit.
The interrupt select registers (SIP00–SIP03, SIP10–SIP13) and interrupt polarity select registers (PCP00–
PCP03, PCP10–PCP13) are individually provided for the I/O ports P10–P13 and P40–P43.
The interrupt select registers (SIPxx) select the ports to be used for generating interrupts or canceling SLEEP
mode. Writing "1" to an interrupt select register incorporates that port into the interrupt generation conditions. Changing the port where the interrupt select register has been set to "0" does not affect the generation
of the interrupt.
The input interrupt timing can be selected using the interrupt polarity select registers (PCPxx) so that an
interrupt will be generated at the rising edge or falling edge of the input.
By setting these two conditions, an interrupt request signal and a SLEEP cancellation signal are generated
at the rising or falling edge (selected by PCPxx) of the signal input to the port (selected by SIPxx).
When an interrupt factor occurs, the interrupt factor flag (IK00–IK03, IK10–IK13) is set to "1". At the same
time, an interrupt request is generated to the CPU if the corresponding interrupt mask register (EIK00–
EIK03, EIK10–EIK13) is set to "1".
When the interrupt mask register (EIKxx) is set to "0", the interrupt request is masked and no interrupt is
generated to the CPU. However, SLEEP mode can be cancelled regardless of the interrupt mask register setting.
The key input interrupt circuit has a noise rejector to avoid unnecessary interrupt generation due to noise
or chattering. This noise rejector allows selection of a noise-reject frequency from among three types shown
in Table 4.5.7.1. Use the NRSP01 and NRSP00 registers for P10–P13 ports or NRSP11 and NRSP10 registers
for P40–P43 ports to select a noise-reject frequency. If a pulse shorter than the selected width is input to the
port, an interrupt is not generated. When high speed response is required, turns the noise rejecter off (bypassed).
Interrupt factor flag (Key input interrupt 3 <P13>)
(R)
Interrupt factor flag (Key input interrupt 2 <P12>)
No
Interrupt factor flag (Key input interrupt 1 <P11>)
(W)
Interrupt factor flag (Key input interrupt 0 <P10>)
Invalid
Interrupt factor flag (Key input interrupt 7 <P43>)
(R)
Interrupt factor flag (Key input interrupt 6 <P42>)
No
Interrupt factor flag (Key input interrupt 5 <P41>)
(W)
Interrupt factor flag (Key input interrupt 4 <P40>)
Invalid
(1) Selecting port functions
ESIF: Serial interface enable (P2 port function select) register (FF58H•D0)
Selects the function for P20–P23.
When "1" is written: Serial interface input/output port
When "0" is written: I/O port
Reading: Valid
When using the serial interface, write "1" to this register and when P20–P23 are used as I/O ports, write "0".
The configuration of the terminals within P20–P23 that are used for the serial interface depends on master
or slave mode set by the SMOD register (see Section 4.10). In slave mode, all the P20–P23 ports are set to the
serial interface input/output port. In master mode, P20–P22 are set to the serial interface input/output port
and P23 can be used as an I/O port. Furthermore, when the SOUT terminal is disabled (ESOUT = "0"), P21
can be used as an I/O port.
At initial reset, this register is set to "0".
ENCS: Serial interface enable (P23 port function select) register (FF5AH•D0)
Selects the function for P23.
When "1" is written: Serial interface input/output port (SRDY or SS)
When "0" is written: I/O port
Reading: Valid
Set this register to "0" to use P23 as an I/O port if SRDY output or SS input is not used in slave mode.
At initial reset, this register is set to "0".
Selects the function for P00–P03.
When using the R/f converter, write "01B–11B" to this register and when P00–P03 are used as I/O ports,
write "00B". Furthermore, when the RFOUT terminal is disabled (RFOUT = "0"), P03 can be used as an I/O
port even if the R/f converter is used.
At initial reset, this register is set to "0".
EDIR: Direct input function enable register (FF48H•D0)
Enables the direct input (RUN/LAP) function.
When "1" is written: Enabled
When "0" is written: Disabled
Reading: Valid
The direct input function of the stopwatch timer is enabled by writing "1" to EDIR, and the P10 and P11
ports are set for the RUN/STOP and LAP key input ports. When "0" is written to EDIR, the direct input
function is disabled, and P10 and P11 can be used as I/O ports.
At initial reset, this register is set to "0".
Selects a counter mode for programmable timer 0/2/4/6.
When "1" is written: Event counter mode
When "0" is written: Timer mode
Reading: Valid
When "1" is written to the EVCNT_A/B/C/D register, programmable timer 0/2/4/6 is placed into event
counter mode. In this mode, P12/P41/P42/P43 is used as an external clock input port for the event counter.
When "0" is written to EVCNT_A/B/C/D, P12/P41/P42/P43 can be used as an I/O port.
At initial reset, these registers are set to "0".
(2) I/O port control
P00–P03: P0 I/O port data register (FF20H)
P10–P13: P1 I/O port data register (FF24H)
P20–P23: P2 I/O port data register (FF28H)
P40–P43: P4 I/O port data register (FF30H)
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 placed into output mode, the written data is output unchanged from the I/O port
terminal. When "1" is written as port data, the port terminal goes high (VDD), and when "0" is written, the
terminal goes low (VSS).
Port data can be written also in the input mode.
3240-0412
Page 64
SIC63616-(Rev. 1.0) NO. P57
• When reading data
When "1" is read:High level
When "0" is read:Low level
When the I/O port is placed into input mode, the voltage level being input to the port terminal can be read
out. When the terminal voltage is high (VDD), the port data that can be read is "1", and when the terminal
voltage is low (VSS) the read data is "0".
When the pull-down resistor option has been selected and the PULxx register is set to "1", the built-in pulldown resistor goes on during input mode, so that the I/O port terminal is pulled down.
When the I/O port is placed into output mode, the register value is read. Therefore, when using the data
register of a port that is not used for signal input/output as a general-purpose register, set the port to output mode.
At initial reset, these registers are set to "1".
The data register of the port, which is set for an input/output of the serial interface or R/f converter or a
special output, becomes a general-purpose register that does not affect the input/output status.
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.
IOC00–IOC03: P0 port I/O control register (FF21H)
IOC10–IOC13: P1 port I/O control register (FF25H)
IOC20–IOC23: P2 port I/O control register (FF29H)
IOC40–IOC43: P4 port I/O control register (FF31H)
Sets the I/O ports to input or output mode.
When "1" is written: Output mode
When "0" is written: Input mode
Reading: Valid
The input/output mode of the I/O ports are set in 1-bit units.
Writing "1" to the I/O control register places the corresponding I/O port into output mode, and writing "0"
sets input mode.
At initial reset, these registers are all set to "0", so the I/O ports are placed in input mode.
The I/O control register of the port, which is set for an input/output of the serial interface or R/f converter
or a special output, becomes a general-purpose register that does not affect the input/output status.
PUL00–PUL03: P0 port pull-down control register (FF22H)
PUL10–PUL13: P1 port pull-down control register (FF26H)
PUL20–PUL23: P2 port pull-down control register (FF2AH)
PUL40–PUL43: P4 port pull-down control register (FF32H)
Enables the pull-down during input mode.
When "1" is written: Pull-down On
When "0" is written: Pull-down Off
Reading: Valid
3240-0412
Page 65
SIC63616-(Rev. 1.0) NO. P58
These registers enable the built-in pull-down resistor to be effective during input mode 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" or output mode 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 register of the port in which the pull-down resistor is not included becomes a
general-purpose register. The register of the port that is set as output for the serial interface, input/output
for the R/f converter or a special output can also be used as a general-purpose register that does not affect
the pull-down control.
The pull-down control register of the port that is set as input for the serial interface functions the same as
the I/O port.
SMT10–SMT01: P1 port input interface level select register (FF27H)
SMT20–SMT23: P2 port input interface level select register (FF2BH)
SMT40–SMT43: P4 port input interface level select register (FF33H)
Selects an input interface level.
When "1" is written: CMOS Schmitt level
When "0" is written: CMOS level
Reading: Valid
These registers select the input interface level of the I/O ports in 1-bit units.
When "1" is written to SMTxx, the corresponding I/O port Pxx is configured with a CMOS Schmitt level
input interface. When "0" is written, the port is configured with a CMOS level input interface. (P0x is the
fixed setting for CMOS Schmitt level.)
At initial reset, these registers are set to "1".
SIP00–SIP03: P1 port interrupt select register (FF3CH)
SIP10–SIP13: P4 port interrupt select register (FF3EH)
Selects the ports used for the key input interrupt from P10–P13 and P40–P43.
When "1" is written: Interrupt enable
When "0" is written: Interrupt disable
Reading: Valid
By writing "1" to an interrupt select register (SIP00–SIP03, SIP10–SIP13), the corresponding I/O port (P10
–P13, P40–P43) is enabled to generate interrupts. When "0" is written, the I/O port does not affect the
interrupt generation.
Reactivating from SLEEP status can only be done by generation of a key input interrupt factor. Therefore
when using the SLEEP function, it is necessary to set the interrupt select register (SIPxx = "1") of the port to
be used for releasing SLEEP status before executing the SLP instruction.
At initial reset, these registers are set to "0".
PCP00–PCP03: P1 port interrupt polarity select register (FF3DH)
PCP10–PCP13: P4 port interrupt polarity select register (FF3FH)
Sets the interrupt conditions.
When "1" is written: Falling edge
When "0" is written: Rising edge
Reading: Valid
When "1" is written to an interrupt polarity select register (PCP00–PCP03, PCP10–PCP13), the corresponding
I/O port (P10–P13, P40–P43) generates an interrupt at the falling edge of the input signal. When "0" is
written, the I/O port generates an interrupt at the rising edge of the input signal.
At initial reset, these registers are set to "1".
NRSP0x and NRSP1x are the noise reject frequency select registers that correspond to the key input interrupts
0–3 (P10–P13) and the key input interrupts 4–7 (P40–P43), respectively.
At initial reset, these registers are set to "00B".
When "1" is written: Enable
When "0" is written: Mask
Reading: Valid
EIK0x and EIK1x are the interrupt mask registers that correspond to the key input interrupts 0–3 (P10–P13)
and the key input interrupts 4–7 (P40–P43), respectively.
Setting EIKxx to "1" enables the interrupt and setting EIKxx to "0" disables the interrupt.
The SLEEP cancellation signal will be generated even if this register is set to "0". However, enable the key
input interrupt using the corresponding interrupt mask register before executing the SLP instruction to
execute the key input interrupt handler routine after SLEEP status is released.
At initial reset, these registers are set to "0".
These flags indicate the occurrence of key input interrupts.
When "1" is read:Interrupt has occurred
When "0" is read:Interrupt has not occurred
When "1" is written: Flag reset
When "0" is written: Invalid
The interrupt factor flags IK00–IK03 and IK10–IK13 are associated with the key input interrupts 0–3 (P10
–P13) and the key input interrupts 4–7 (P40–P43), respectively. From the status of these flags, the software
can decide whether an key 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".
3240-0412
Page 67
(3) Special output control
FOUT0–FOUT3: FOUT frequency select register (FF10H)
Selects the frequency of the FOUT signal and controls the FOUT output.
Table 4.5.8.3 FOUT clock frequency
FOUT3
f
: OSC1 oscillation frequency. ( ) indicates the clock frequency when fOSC1 = 32 kHz.
Selecting an FOUT frequency (writing 1–15 to this register) outputs the FOUT signal from the P23 terminal.
Set FOUT0–FOUT3 to "0" to use P23 as a general-purpose DC input/output port.
At initial reset, these registers are set to "0".
BZE: Buzzer output control register (FF44H•D0)
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 P03 terminal. When "0" is written, P03 is used
as a general-purpose DC input/output port.
At initial reset, this register is set to "0".
BZSHT: One-shot buzzer trigger/status (FF45H•D1)
Controls the one-shot buzzer output.
• When writing
When "1" is written: Trigger
When "0" is written: No operation
Writing "1" into BZSHT causes the one-short output circuit to operate and a buzzer signal to be output from
the P03 terminal. This output is automatically turned off after the time set by SHTPW has elapsed. The oneshot 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 oneshot 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 register is set to "0".
3240-0412
Page 68
SIC63616-(Rev. 1.0) NO. P61
PTOUT_A: TOUT_A output control register (FF81H•D0)
Controls the TOUT_A output.
When "1" is written: TOUT output On
When "0" is written: TOUT output Off
Reading: Valid
By writing "1" to the PTOUT_A register, the TOUT_A signal is output from the P13 terminal. When "0" is
written, the corresponding terminal is used as a general-purpose DC input/output port.
At initial reset, these registers are set to "0".
4.5.9 Programming notes
(1) When an I/O ports in input mode is changed from high to low by the 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 data, 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
(2) Be sure to turn the noise rejector off before executing the SLP instruction.
(3) Reactivating from SLEEP status can only be done by generation of a key input interrupt factor. There-
fore when using the SLEEP function, it is necessary to set the interrupt select register (SIPxx = "1") of the
port to be used for releasing SLEEP status before executing the SLP instruction. Furthermore, enable the
key input interrupt using the corresponding interrupt mask register (EIKxx = "1") before executing the
SLP instruction to run key input interrupt handler routine after SLEEP status is released.
(4) A hazard may occur when the TOUT_A and FOUT signals are turned on and off.
(5) 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.4, "Oscillation Circuit", for the control and notes.
(6) 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.
(7) Before the port function is configured, the circuit that uses the port (e.g. input interrupt, multiple key
entry reset, serial interface, event counter input, direct RUN/LAP input for stopwatch) must be disabled.
3240-0412
Page 69
SIC63616-(Rev. 1.0) NO. P62
4.6 LCD Driver
4.6.1 Configuration of LCD driver
The S1C63616 has a built-in dot matrix LCD driver that can drive an LCD panel with a maximum of 1,280
dots (40 segments × 32 commons). Figures 4.6.1.1 to 4.6.1.3 show the configuration of the LCD driver and
the drive power supply.
VCCKS1
VCCKS0
FLCKS1
FLCKS0
DBON
VD2
CF
CG
OSC1
Oscillation circuit
Power supply
voltage
booster/halver
Clock
manager
VDDVD2
VCSEL
VSS
VC1
VC2
VC3
VC4
VC5
CA
CB
CC
CD
CE
LCD system
voltage regulator
V
C1–VC5
LCD contrast
adjustment circuit
LCD driver
Display memory
LC3
LC2
LC1
LC0
DSPC1
DSPC0
LDUTY2
LDUTY1
LDUTY0
LPAGE
COM0–COM31
SEG0–SEG39
Fig. 4.6.1.1 Configuration of LCD driver and drive power supply (VC2 reference, 1/5 bias)
VSS
VD2
CG
VC1
VC2
VC3
VC4
VC5
CA
CB
CC
CD
CE
CF
VCSEL
OSC1
Oscillation circuit
Power supply
voltage
booster/halver
VDDVD2
LCD system
voltage regulator
V
C1–VC5
Clock
manager
LCD contrast
adjustment circuit
LCD driver
Display memory
VCCKS1
VCCKS0
FLCKS1
FLCKS0
DBON
LC3
LC2
LC1
LC0
DSPC1
DSPC0
LDUTY2
LDUTY1
LDUTY0
LPAGE
COM0–COM15
SEG0–SEG55
3240-0412
Page 70
SIC63616-(Rev. 1.0) NO. P63
Fig. 4.6.1.2 Configuration of LCD driver and drive power supply (VC2 reference, 1/4 bias)
OSC1
Oscillation circuit
VSS
VD2
CG
VC1
VC2
VC3
VC4
VC5
CA
CB
CC
CD
CE
CF
VCSEL
Power supply
voltage
booster/halver
VDDVD2
LCD system
voltage regulator
Fig. 4.6.1.3 Configuration of LCD driver and drive power supply (VC1 reference, 1/4 bias)
4.6.2 Power supply for LCD driving
V
C1–VC5
Clock
manager
LCD contrast
adjustment circuit
LCD driver
Display memory
VCCKS1
VCCKS0
FLCKS1
FLCKS0
DBON
LC3
LC2
LC1
LC0
DSPC1
DSPC0
LDUTY2
LDUTY1
LDUTY0
LPAGE
COM0–COM15
SEG0–SEG55
(1) Mask option
The S1C63616 provides three options to configure the internal LCD power supply for generating the
LCD drive voltages VC1–VC5.
TYPE 1 VC2 reference, 1/5 bias
VDD = 1.6 to 2.5 V (power supply voltage booster/halver is used)
VDD = 2.5 to 5.5 V (power supply voltage booster/halver is not used)
TYPE 2 VC2 reference, 1/4 bias
VDD = 1.6 to 2.5 V (power supply voltage booster/halver is used)
VDD = 2.5 to 5.5 V (power supply voltage booster/halver is not used)
TYPE 3 VC1 reference, 1/4 bias
VDD = 1.6 to 5.5 V (power supply voltage booster/halver is not used)
Select one from three types according to the supply voltage and the LCD panel characteristics.
The LCD drive voltages are generated by boosting/halving the VC1 or VC2 reference voltage output
from the voltage regulator.
Table 4.6.2.1 lists the VC1, VC2, VC3, VC4 and VC5 voltage values and boosting/halving status. Note that
the number of externally attached parts differs according to the selected bias (1/5 or 1/4). (See Figures
4.6.1.1 to 4.6.1.3.)
Table 4.6.2.1 LCD drive voltage
LCD drive voltage
VC1
VC2
VC3
VC4
VC5
Note: Each LCD drive voltage varies depending on the contrast adjustment register (LCx) setting.
TYPE 1
VC2× 0.5
VC2 (reference)
VC2× 1.5
VC2× 2
VC2× 2.5
[V]
1.10
2.20
3.30
4.40
5.50
TYPE 2
VC2× 0.5
VC2 (reference)
= VC2
VC2× 1.5
VC2× 2
[V]
1.13
2.25
2.25
3.38
4.50
TYPE 3
VC1 (reference)
VC1× 2
= VC2
VC1× 3
VC1× 4
[V]
1.13
2.25
2.25
3.38
4.50
3240-0412
Page 71
SIC63616-(Rev. 1.0) NO. P64
(2) Controlling the LCD system voltage regulator
To start LCD display, turn the LCD system voltage regulator on using the LPWR register. When "1"
is written to LPWR, the LCD system voltage regulator goes on and generates the LCD drive voltages
listed in Table 4.6.2.1. At initial reset, LPWR is set to "0" (Off).
When LCD display is not necessary, turn the LCD system voltage regulator off to reduce power consumption.
To generate stable LCD drive voltages, the LCD system voltage regulator must be driven with a source
voltage higher than the reference voltage VC2 or VC1. When a VC2 reference voltage option (TYPE 1 or
TYPE 2) is selected, the LCD system voltage regulator can be driven with the VD2 voltage generated by
the power supply voltage booster/halver (boost mode) if the supply voltage VDD is less than 2.5 V. The
VD2 voltage is generated by approximately doubling the VDD voltage. Use the VCSEL register to select
VDD or VD2 to drive the LCD system voltage regulator. VDD is selected when VCSEL is "0" and VD2 is
selected when VCSEL is "1". When using VD2, the power supply voltage booster/halver must be turned
on by writing "1" to the DBON register before switching to VD2.
When the VC1 reference voltage option (TYPE 3) is selected, this control is not required. In this case,
VCSEL and DBON should be set to "0".
Furthermore, the LCD system voltage regulator uses the boost clock supplied from the clock manager
for boosting/halving the voltage. The clock supply is controlled by the VCCKS0–VCCKS1 register. Set
VCCKS to "01B" before writing "1" to LPWR. When LCD display is not necessary, stop the clock supply
by setting VCCKS to "00B" to reduce power consumption.
Table 4.6.2.2 Controlling boost clock
VCCKS1
1
0
0
VCCKS0
*
1
0
Boost clock control
Prohibited
On (2 kHz)
Off
Note: The oscillation circuit stops oscillating in SLEEP mode set by the SLP instruction of the CPU.
(3) Heavy load protection mode for LCD system voltage regulator
The LCD system voltage regulator has a heavy load protection function that can be activated with software to stabilize display on the LCD as much as possible (to minimize degradation in display quality)
even if fluctuations in the supply voltage occur due to driving an external load. By writing "1" to the
VCHLMOD register, the LCD system voltage regulator enters heavy load protection mode to stabilize
the VC1 to VC5 outputs. Use the heavy load protection function if the LCD display has inconsistencies in
density when a heavy load such as a lamp or buzzer is driven with a port output. At initial reset, VCHLMOD is set to "0" (Off).
Note: The heavy load protection mode increases current consumption compared with normal operation
mode. Therefore, do not set heavy load protection mode unless it is necessary.
3240-0412
Page 72
SIC63616-(Rev. 1.0) NO. P65
4.6.3 Controlling LCD display
(1) Selecting display mode
In addition to the LPWR register for turning the display on and off, the DSPC0–DSPC1 register is provided to select a display mode. There are four display modes available as shown in Table 4.6.3.1.
Table 4.6.3.1 Display mode
DSPC1
1
1
0
0
DSPC0
1
0
1
0
Normal mode: The screen image written in the display RAM is output without being processed.
(default)
Reverse mode: The screen image written in the display RAM is output in reverse video. The con-
tents in the display RAM are not modified.
All black mode: Turns all the LCD pixels on (black when normal white LCD is used) in static drive.
The contents in the display RAM are not modified.
All white mode: Turns all the LCD pixels off (white when normal white LCD is used) in dynamic
drive. The contents in the display RAM are not modified.
(2) Drive duty and frame frequency
The S1C63616 supports three types of LCD drive duty settings, 1/32, 1/24 and 1/16, and can be
switched using the LDUTY2–LDUTY0 register as shown in Table 4.6.3.2. Select an appropriate drive
duty according to the LCD panel to be used.
The frame frequency is determined by the selected duty and the clock supplied from the clock manager.
The clock to be supplied (8 Hz to 32 Hz) can be selected using the FLCKS0–FLCKS1 register.
Selecting a low frame frequency can reduce current consumption.
Display mode
All white mode
All black mode
Reverse mode
Normal mode
Note: The frame frequency affects the display quality, therefore, it should be determined after the display
quality is evaluated using the actual LCD panel.
Table 4.6.3.2 Combination of frame frequency and duty
LDUTY2
1
1
1
1
0
0
0
0
LDUTY1
1
1
0
0
1
1
0
0
LDUTY0
1
0
1
0
1
0
1
0
Duty
Prohibited
Prohibited
Prohibited
1/16
1/24
1/24
Prohibited
1/32
FLCKS = 11B
–
–
–
8 Hz
5.333 Hz
10.666 Hz
–
8 Hz
Frame frequency
FLCKS = 10B
–
–
–
16 Hz
10.666 Hz
21.333 Hz
–
16 Hz
FLCKS = 01B
–
–
–
21.333 Hz
14.22 Hz
28.44 Hz
–
21.333 Hz
FLCKS = 00B
–
–
–
32 Hz
21.333 Hz
42.666 Hz
–
32 Hz
Drive bias
(mask option)
–
–
–
1/4 bias
1/5 bias
1/5 bias
–
1/5 bias
Table 4.6.3.3 shows the relationship of the drive duty setting, available SEG/COM terminals and the
maximum number of pixels.
Table 4.6.3.3 Drive duty setting, SEG/COM terminals and the maximum number of pixels
Duty
Terminal
1/32
1/24
1/16
SEG0–SEG39
SEG0–SEG39
SEG0–SEG39
SEG0–SEG39
COM31–COM24
COM31–COM24
SEG40–SEG47
SEG40–SEG47
COM23–COM16
COM23–COM16
COM23–COM16
SEG48–SEG55
COM15–COM0
COM15–COM0
COM15–COM0
COM15–COM0
Number of pixels
1,280
1,152
896
The respective drive waveforms are shown in Figures 4.6.3.1 to 4.6.3.3.
3240-0412
Page 73
COM0
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
SIC63616-(Rev. 1.0) NO. P66
32 Hz
31––321031––3210
FR
1
2
3
4
5
6
7
8
9
COM0
COM1
COM2
SEG0
SEG1
123
SEG0
4
COM0–SEG0
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
COM0–SEG1
VDD
VSS
VC5
VC4
VC3
VC2
VC1
VSS
VC5
VC4
VC3
VC2
VC1
VSS
VC5
VC4
VC3
VC2
VC1
VSS
VC5
VC4
VC3
VC2
VC1
VSS
VC5
VC4
VC3
VC2
VC1
VSS
VC5
VC4
VC3
VC2
VC1
V (GND)SS
-VC1
-VC2
-VC3
-VC4
-VC5
VC5
VC4
VC3
VC2
VC1
V (GND)SS
-VC1
-VC2
-VC3
-VC4
-VC5
Fig. 4.6.3.1 Drive waveform for 1/32 duty (FLCKS = "00B")
3240-0412
Page 74
COM0
10
11
12
13
14
15
16
17
18
19
20
21
22
23
SIC63616-(Rev. 1.0) NO. P67
42 (21) Hz
23––321023––3210
FR
1
2
3
4
5
6
7
8
9
COM0
COM1
COM2
SEG0
123
4
SEG0
SEG1
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
COM0–SEG0
~
~
~
~
COM0–SEG1
VDD
VSS
VC5
VC4
VC3
VC2
VC1
VSS
VC5
VC4
VC3
VC2
VC1
VSS
VC5
VC4
VC3
VC2
VC1
VSS
VC5
VC4
VC3
VC2
VC1
VSS
VC5
VC4
VC3
VC2
VC1
VSS
VC5
VC4
VC3
VC2
VC1
V (GND)SS
-VC1
-VC2
-VC3
-VC4
-VC5
VC5
VC4
VC3
VC2
VC1
V (GND)SS
-VC1
-VC2
-VC3
-VC4
-VC5
Fig. 4.6.3.2 Drive waveform for 1/24 duty (FLCKS = "00B")
3240-0412
Page 75
COM0
10
11
12
13
14
15
SIC63616-(Rev. 1.0) NO. P68
32 Hz
15––321015––3210
FR
1
2
3
4
5
6
7
8
9
123
4
SEG0
COM0
COM1
COM2
SEG0
SEG1
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
VDD
VSS
VC5
VC4
VC2=VC3
VC1
VSS
VC5
VC4
VC2=VC3
VC1
VSS
VC5
VC4
VC2=VC3
VC1
VSS
VC5
VC4
VC2=VC3
VC1
VSS
VC5
VC4
VC2=VC3
VC1
VSS
~
~
COM0–SEG0
~
~
COM0–SEG1
Fig. 4.6.3.3 Drive waveform for 1/16 duty (FLCKS = "00B")
VC5
VC4
~
~
~
~
VC2=VC3
VC1
VSS (GND)
-VC1
-VC2=-VC3
-VC4
-VC5
VC5
VC4
VC2=VC3
VC1
VSS (GND)
-VC1
-VC2=-VC3
-VC4
-VC5
3240-0412
Page 76
SIC63616-(Rev. 1.0) NO. P69
4.6.4 Display memory
The display memory is allocated to F000H–F36FH in the data memory area and the addresses and the data
bits correspond to COM and SEG outputs as shown in Figures 4.6.4.1 to 4.6.4.3.
COM0
COM1
COM2
COM3
COM4
COM5
COM6
COM7
COM8
COM9
COM10
COM11
COM12
COM13
COM14
COM15
COM16
COM17
COM18
COM19
COM20
COM21
COM22
COM23
COM24
COM25
COM26
COM27
COM28
COM29
COM30
COM31
SEG0
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
F000H
F001H
F100H
F101H
F200H
F201H
F300H
F301H
SEG1
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
F002H
F003H
F102H
F103H
F202H
F203H
F302H
F303H
SEG2
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
F004H
F005H
F104H
F105H
F204H
F205H
F304H
F305H
SEG3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
F006H
F007H
F106H
F107H
F206H
F207H
F306H
F307H
. . . . .
SEG39
D0
■
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
F04EH
F04FH
F14EH
F14FH
F24EH
F24FH
F34EH
F34FH
Memory addressData bit
Fig. 4.6.4.1 Correspondence between display memory and LCD dot matrix (1/32 duty)
3240-0412
Page 77
SIC63616-(Rev. 1.0) NO. P70
COM0
COM1
COM2
COM3
COM4
COM5
COM6
COM7
COM8
COM9
COM10
COM11
COM12
COM13
COM14
COM15
COM16
COM17
COM18
COM19
COM20
COM21
COM22
COM23
SEG0
■ D0
■ D1
F000H
■ D2
■ D3
■ D0
■ D1
F001H
■ D2
■ D3
■ D0
■ D1
F100H
■ D2
■ D3
■ D0
■ D1
F101H
■ D2
■ D3
■ D0
■ D1
F200H
■ D2
■ D3
■ D0
■ D1
F201H
■ D2
■ D3
Memory addressData bit
SEG1
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
F002H
F003H
F102H
F103H
F202H
F203H
SEG2
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
F004H
F005H
F104H
F105H
F204H
F205H
SEG3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
F006H
F007H
F106H
F107H
F206H
F207H
. . . . .
Fig. 4.6.4.2 Correspondence between display memory and LCD dot matrix (1/24 duty)
SEG47
D0
■
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
F05EH
F05FH
F15EH
F15FH
F25EH
F25FH
3240-0412
Page 78
SIC63616-(Rev. 1.0) NO. P71
LPAGE
= 0
LPAGE
= 1
COM0
COM1
COM2
COM3
COM4
COM5
COM6
COM7
COM8
COM9
COM10
COM11
COM12
COM13
COM14
COM15
COM0
COM1
COM2
COM3
COM4
COM5
COM6
COM7
COM8
COM9
COM10
COM11
COM12
COM13
COM14
COM15
SEG0
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
F000H
F001H
F100H
F101H
F200H
F201H
F300H
F301H
SEG1
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
F002H
F003H
F102H
F103H
F202H
F203H
F302H
F303H
SEG2
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
F004H
F005H
F104H
F105H
F204H
F205H
F304H
F305H
SEG3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
F006H
F007H
F106H
F107H
F206H
F207H
F306H
F307H
. . . . .
SEG55
D0
■
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
■ D0
■ D1
■ D2
■ D3
F06EH
F06FH
F16EH
F16FH
F26EH
F26FH
F36EH
F36FH
Memory addressData bit
Fig. 4.6.4.3 Correspondence between display memory and LCD dot matrix (1/16 duty)
When a bit in the display memory is set to "1", the corresponding LCD pixel goes on, and when it is set to
"0", the pixel goes off.
When 1/16 duty is selected, the display memory area can be used for two screen images. Select either
F000H–F16FH or F200H–F36FH for the area to be displayed using the LPAGE register. This allows the
software to switch the screen in an instant.
At initial reset, the data memory contents become undefined hence, there is need to initialize using the
software. The display memory has read/write capability, and the addresses that have not been used for
LCD display can be used as general purpose registers.
The LCD driver allows the software to adjust the LCD contrast.
It is realized by controlling the voltages VC1–VC5 output from the LCD system voltage regulator. The
contrast can be adjusted to 16 levels using the LC3–LC0 register.
Table 4.6.5.1 LCD contrast
No.
LC3
10
11
12
13
14
15
LC2
0
0
1
0
2
0
3
0
4
0
5
0
6
0
7
0
8
1
9
1
1
1
1
1
1
1
LC1
LC0
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
1
1
0
1
1
0
0
0
1
1
0
1
1
0
0
0
1
1
0
1
1
0
0
0
1
1
0
1
1
Contrast
Light
Dark
At initial reset, the LC3–LC0 register is set to 0000B. The software should initialize the register to get the
desired contrast.
3240-0412
Page 80
SIC63616-(Rev. 1.0) NO. P73
4.6.6 I/O memory of LCD driver
Table 4.6.6.1 shows the I/O addresses and the control bits for the LCD driver. Figure 4.6.6.1 shows the
display memory map.
Table 4.6.6.1 Control bits of LCD driver
AddressComment
VDSEL VCSEL HLONDBON
FF02H
VCHLMOD VDHLMOD
FF03H
FLCKS1 FLCKS0 VCCKS1 VCCKS0
FF12H
General LPAGE DSPC1 DSPC0
FF50H
General LDUTY2 LDUTY1 LDUTY0
FF51H
FF52H
*1 Initial value at initial reset
*2 Not set in the circuit
*3 Constantly "0" when being read
Register
D3D2D1D0Name Init
VDSEL
VCSEL
R/W
General LPWR
R/W
R/W
R/W
R/W
LC3LC2LC1LC0
R/W
HLON
DBON
VCHLMOD
VDHLMOD
General
LPWR
FLCKS1
FLCKS0
VCCKS1
VCCKS0
General
LPAGE
DSPC1
DSPC0
General
LDUTY2
LDUTY1
LDUTY0
LC3
LC2
LC1
LC0
∗1
10
0
1
D2
0
V
On
0
On
0
0
On
0
On
0
1
0
On
0
0
0
0
0
1
F200-F36F0F000-F16F
0
0
0
0
10
0
0
0
0
0
0
0
General-purpose register
0
DD
Power source select for LCD system voltage regulator
V
Off
Power voltage booster/halver halving mode On/Off
Off
Power voltage booster/halver boost mode On/Off
Heavy load protection mode On/Off for LCD system voltage regulator
Off
Heavy load protection mode On/Off for internal voltage regulator
Off
General-purpose register
0
LCD system voltage regulator On/Off
Off
Frame
frequency
selection
VC boost
frequency
selection
General-purpose register
Display memory area (when 1/16 duty is selected)
functions as a general-purpose register when 1/24 or 1/32 is selected
LCD display
mode selection
General-purpose register
LCD
drive duty
selection
LCD contrast adjustment
[LC3—0]
Contrast
[FLCKS1, 0]
Frequency
[VCCKS1, 0]
Frequency
[DSPC1, 0]
Display mode
[LDUTY2—0]
Duty
[LDUTY2—0]
Duty
0
Light——15Dark
0
32 Hz124 Hz216 Hz38 Hz
0
Off
0
Normal1Reverse
0
1/32 (32 Hz)
3
1/24 (21 Hz)
1
2 kHz
All lit3All off
1
Prohibited
4
1/16 (32 Hz)
2
2, 3
Prohibited
2
1/24 (42 Hz)
5—7
Prohibited
3240-0412
Page 81
SIC63616-(Rev. 1.0) NO. P74
Not implemented
(prohibition of read/write)
F000H
:
F04FH
F050H
F05FH
F060H
F06FH
F070H
:
F0FFH
SEG0
:
:
:
:
:
SEG55
SEG0
:
:
:
SEG47
SEG0
:
SEG39
SEG0
:
:
:
:
:
SEG55
SEG0
:
:
:
SEG47
SEG0
:
SEG39
SEG0
:
:
:
:
:
SEG55
SEG0
:
:
:
SEG47
SEG0
:
SEG39
SEG0
:
:
:
:
:
SEG55
SEG0
:
:
:
SEG47
SEG0
:
SEG39
1/32 duty
Not implemented
(prohibition of read/write)
1/24 duty
Not implemented
(prohibition of read/write)
1/16 duty
Display data area
(COM0–COM7)
Display data area
(COM0–COM7)
Unused area
Unused area
Display data area 0
(COM0–COM7)
Not implemented
(prohibition of read/write)
F100H
:
F14FH
F150H
F15FH
F160H
F16FH
F170H
:
F1FFH
Not implemented
(prohibition of read/write)
Not implemented
(prohibition of read/write)
Display data area
(COM8–COM15)
Display data area
(COM8–COM15)
Unused area
Unused area
Display data area 0
(COM8–COM15)
Not implemented
(prohibition of read/write)
F200H
:
F24FH
F250H
F25FH
F260H
F26FH
F270H
:
F2FFH
Not implemented
(prohibition of read/write)
Not implemented
(prohibition of read/write)
Display data area
(COM16–COM23)
Display data area
(COM16–COM23)
Unused area
Unused area
Display data area 1
(COM0–COM7)
Not implemented
(prohibition of read/write)
F300H
:
F34FH
F350H
F35FH
F360H
F36FH
F370H
:
F3FFH
Not implemented
(prohibition of read/write)
Not implemented
(prohibition of read/write)
Display data area
(COM24–COM31)
Unused area
Unused area
Display data area 1
(COM8–COM15)
Fig. 4.6.6.1 Display memory map
3240-0412
Page 82
SIC63616-(Rev. 1.0) NO. P75
DBON: Power supply voltage booster/halver boost mode On/Off register (FF02H•D0)
Activates the power supply voltage booster/halver in boost mode.
When "1" is written: Booster On
When "0" is written: Booster Off
Reading: Valid
When "1" is written to DBON, the power supply voltage booster/halver activates in boost mode and almost
doubles the VDD voltage to generate the VD2 voltage. Turn the power supply voltage booster/halver on
when driving the LCD system voltage regulator with VD2 (VC2 reference voltage, VDD = 1.6 to 2.5 V). When
"0" is written to DBON, the voltage boost operation is deactivated. Be sure to set DBON to "0" (Off) when
driving the LCD system voltage regulator with VDD. Furthermore, do not set both DBON and HLON to "1".
At initial reset, this register is set to "0".
VCSEL: LCD system voltage regulator power source switch register (FF02H•D2)
Selects the power voltage for the LCD system voltage regulator.
When "1" is written: V
When "0" is written: V
D2
DD
Reading: Valid
When "1" is written to VCSEL, the LCD system voltage regulator is driven with VD2 generated by the power
supply voltage booster/halver. Before this setting is made, it is necessary to write "1" to DBON to activate
the power supply voltage booster (boost mode). Furthermore, do not switch the power voltage to VD2 for at
least 1 msec after the power supply voltage booster/halver is turned on to allow VD2 to stabilize. When "0"
is written to VCSEL, the LCD system voltage regulator is driven with VDD.
At initial reset, this register is set to "0".
LPWR: LCD system voltage regulator On/Off register (FF03H•D0)
Turns the LCD system voltage regulator on and off.
When "1" is written: On
When "0" is written: Off
Reading: Valid
When "1" is written to LPWR, the LCD system voltage regulator goes on and generates the LCD drive
voltages. When "0" is written, all the LCD drive voltages go to VSS level.
It takes about 100 msec for the LCD drive voltages to stabilize after starting up the LCD system voltage
regulator by writing "1" to LPWR.
At initial reset, this register is set to "0".
VCHLMOD: LCD system voltage regulator heavy load protection On/Off register (FF03H•D3)
Enables heavy load protection function for the LCD system voltage regulator.
When "1" is written: On
When "0" is written: Off
Reading: Valid
By writing "1" to VCHLMOD, the LCD system voltage regulator enters heavy load protection mode to
minimize degradation in display quality when fluctuations in the supply voltage occurs due to driving a
heavy load. The heavy load protection function is effective when the OSC3 clock is used or the buzzer/FOUT
signal is being output. However, heavy load protection mode increases current consumption compared with
normal operation mode. Therefore, do not set heavy load protection mode unless it is necessary.
At initial reset, this register is set to "0".
3240-0412
Page 83
SIC63616-(Rev. 1.0) NO. P76
VCCKS0, VCCKS1: VC boost frequency select register (FF12H•D0, D1)
Controls the boost clock supply to the LCD system voltage regulator.
Table 4.6.6.2 Controlling boost clock
VCCKS1
1
0
0
VCCKS0
*
1
0
Boost clock control
Prohibited
On (2 kHz)
Off
The LCD system voltage regulator uses the boost clock supplied from the clock manager for boosting/
reducing the voltage. Use this register to control the clock supply. Set VCCKS to "01B" before writing "1"
to LPWR. When LCD display is not necessary, stop the clock supply by setting VCCKS to "00B" to reduce
power consumption.
At initial reset, this register is set to "00B".
FLCKS0, FLCKS1: Frame frequency select register (FF12H•D2, D3)
Selects the frequency of the frame clock supplied from the clock manager.
Table 4.6.6.3 Selecting frame frequency
FLCKS1
1
1
0
0
FLCKS0
1
0
1
0
Frame frequency
8 Hz
16 Hz
24 Hz
32 Hz
(When f
OSC1 = 32.768 Hz)
See Table 4.6.6.5 for the frame frequency when 1/24 duty is selected by the LDUTY0–LDUTY2 register.
At initial reset, this register is set to "00B".
In normal mode, the screen image written in the display RAM is output without being processed.
In reverse mode, the screen image written in the display RAM is output in reverse video.
All black mode turns all the LCD pixels on (black when normal white LCD is used) in static drive.
All white mode turns all the LCD pixels off (white when normal white LCD is used) in dynamic drive.
The contents in the display RAM are not modified by setting this register.
At initial reset, this register is set to "00B".
LPAGE: LCD display memory area select register (FF50H•D2)
Selects the display memory area at 1/16 duty drive.
When "1" is written: F200H–F36FH
When "0" is written: F000H–F16FH
Reading: Valid
By writing "1" to the LPAGE register, the data set in F200H–F36FH (the second half of the display memory)
is displayed, and when "0" is written, the data set in F000H–F16FH (the first half of the display memory) is
displayed.
This function is valid only when 1/16 duty is selected, and when 1/24 or 1/32 duty is selected, this register
can be used as a general purpose register.
At initial reset, this register is set to "0".
Setting this register changes the VC1–VC5 LCD drive voltages.
At initial reset, this register is set to "0000B".
3240-0412
Page 85
SIC63616-(Rev. 1.0) NO. P78
4.6.7 Programming notes
(1) When a program that access no memory implemented area (F070H–F0FFH, F170H–F1FFH, F270H–
F2FFH, F370H–F3FFH) is made, the operation is not guaranteed.
(2) When driving the LCD system voltage regulator with VD2, wait at least 1 msec for stabilization of the
voltage before switching the power voltage for the LCD system voltage regulator to VD2 using VCSEL
after the power supply voltage booster/halver is turned on.
3240-0412
Page 86
SIC63616-(Rev. 1.0) NO. P79
4.7 Clock Timer
4.7.1 Configuration of clock timer
The S1C63616 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
the prescaler. Timer data (128–16 Hz and 8–1 Hz) can be read out by the software.
Figure 4.7.1.1 is the block diagram for the clock timer.
Ordinarily, this clock timer is used for all types of timing functions such as clocks.
4.7.2 Controlling clock manager
The clock manager generates the clock timer operating clock by dividing the OSC1 clock by 128. Before the
clock timer can be run, write "1" to the RTCKE register to supply the operating clock to the clock timer.
Since two addresses are allocated for the clock timer data, a carry is generated from the low-order data (TM0
–TM3: 128–16 Hz) to the high-order data (TM4–TM7: 8–1 Hz) during counting. If this carry is generated
between readings of the low-order data and the high-order data, the combined data does not represent the
correct value (if a carry occurs after the low-order data is read as FFH, the incremented (+1) value is read as
the high-order data). To avoid this problem, the clock timer is designed to latch the high-order data at the
time the low-order data is read. The latched high-order data will be maintained until the next reading of the
low-order data.
Note: The latched value, not the current value, is always read as the high-order data. Therefore, be sure to
read the low-order data first.
3240-0412
Page 87
SIC63616-(Rev. 1.0) NO. P80
4.7.4 Interrupt function
The clock timer can generate an interrupt at the falling edge of 128 Hz, 64 Hz, 32 Hz, 16 Hz, 8 Hz, 4 Hz, 2
Hz and 1 Hz signals. Software can enable or mask any of these frequencies to generate interrupts.
Figure 4.7.4.1 is the timing chart of the clock timer.
Address
FF41H
FF42H
Bit
D0
D1
D2
D3
D0
D1
D2
D3
128 Hz interrupt request
64 Hz interrupt request
32 Hz interrupt request
16 Hz interrupt request
8 Hz interrupt request
4 Hz interrupt request
2 Hz interrupt request
FrequencyClock timer timing chart
128 Hz
64 Hz
32 Hz
16 Hz
8 Hz
4 Hz
2 Hz
1 Hz
1 Hz interrupt request
Fig. 4.7.4.1 Timing chart of clock timer
As shown in Figure 4.7.4.1, an interrupt is generated at the falling edge of each frequency signal (128 Hz, 64
Hz, 32 Hz, 16 Hz, 8 Hz, 4 Hz, 2 Hz, 1 Hz). At this time, the corresponding interrupt factor flag (IT0, IT1, IT2,
IT3, IT4, IT5, IT6, IT7) is set to "1". The interrupt mask registers (EIT0, EIT1, EIT2, EIT3, EIT4, EIT5, EIT6,
EIT7) are used to enable or mask each interrupt factor. However, regardless of the interrupt mask register
setting, the interrupt factor flag is set to "1" at the falling edge of the corresponding signal.
3240-0412
Page 88
4.7.5 I/O memory of clock timer
Table 4.7.5.1 shows the I/O addresses and the control bits for the clock timer.
Controls the operating clock supply to the clock timer.
When "1" is written: On
When "0" is written: Off
Reading: Valid
When "1" is written to RTCKE, the clock timer operating clock is supplied from the clock manager. If it
is not necessary to run the clock timer, stop the clock supply by setting RTCKE to "0" to reduce current
consumption.
At initial reset, this register is set to "0".
3240-0412
Page 89
SIC63616-(Rev. 1.0) NO. P82
TMRUN: Clock timer Run/Stop control register (FF40H•D0)
Controls run/stop of the clock timer.
When "1" is written: Run
When "0" is written: Stop
Reading: Valid
The clock timer starts running when "1" is written to the TMRUN register, and stops when "0" is written.
In stop status, the timer data is maintained until the next run status or the timer is reset. Also, when stop
status changes to run status, the data that is maintained can be used for resuming the count.
At initial reset, this register is set to "0".
TMRST: Clock timer reset (FF40H•D1)
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 run status, counting
restarts immediately. Also, in 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.
TM0–TM7: Timer data (FF41H, FF42H)
The 128–1 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 (FF41H), the high-order data (FF42H) is latched. The latched value, not the
current value, is always read as the high-order data. Therefore, be sure to read the low-order data first.
At initial reset, the timer data is initialized to "00H".
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, EIT4, EIT5, EIT6, EIT7) are used to select whether to
mask the interrupt to the separate frequencies (128 Hz, 64 Hz, 32 Hz, 16 Hz, 8 Hz, 4 Hz, 2 Hz, 1 Hz).
At initial reset, these registers are set to "0".
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 reset
When "0" is written: Invalid
The interrupt factor flags (IT0, IT1, IT2, IT3, IT4, IT5, IT6, IT7) correspond to the clock timer interrupts of
the respective frequencies (128 Hz, 64 Hz, 32 Hz, 16 Hz, 8 Hz, 4 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.6 Programming notes
(1) Be sure to read timer data in the order of low-order data (TM0–TM3) then high-order data (TM4–TM7).
(2) The clock timer count clock does not synch with the CPU clock. Therefore, the correct value may not
be obtained depending on the count data read and count-up timings. To avoid this problem, the clock
timer count data should be read by one of the procedures shown below.
(3) 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.
3240-0412
Page 91
SIC63616-(Rev. 1.0) NO. P84
Clock
manager
[SWCKE]
f
OSC1
/
32
OSC1
oscillation
circuit
(f
OSC1
)
Data bus
1 Hz interrupt request
1,000 / 1,024
prescaler
1/1,000 sec
counter
1/100 sec
counter
1/10 sec
counter
Capture buffer
SWD0–3
reading
SWD4–7
reading
SWD8–11
reading
[SWRST]
10 Hz interrupt request
Capture
control
circuit
[SWRUN]
[EDIR]
[CRNWF]
[DKM2–0]
[LCURF]
Direct RUN interrupt request
Direct LAP interrupt request
(1,000 Hz)
Direct
input
control
[SWDIR]
P11
P10
P12, P13,
P40–P43
4.8 Stopwatch Timer
4.8.1 Configuration of stopwatch timer
The S1C63616 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 P10 and P11.
Figure 4.8.1.1 is the block diagram of the stopwatch timer.
Fig. 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 Controlling clock manager
The clock manager generates the stopwatch timer operating clock by dividing the OSC1 clock by 32.
Before the stopwatch timer can be run, write "1" to the SWCKE register to supply the operating clock to the
stopwatch timer.
If it is not necessary to run the stopwatch timer, stop the clock supply by setting SWCKE to "0" to reduce
current consumption.
Stopwatch timer clock
fOSC1 / 32 (1 kHz)
Off
3240-0412
Page 92
SIC63616-(Rev. 1.0) NO. P85
4.8.3 Counter and prescaler
The stopwatch timer is configured of four-bit BCD counters SWD0–3, SWD4–7 and SWD8–11.
The counter SWD0–3, 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–7 has a 100 Hz signal generated by the counter SWD0–3 for the input clock. It count-up every
1/100 sec, and generated 10 Hz signal. The counter SWD8–11 has an approximated 10 Hz signal generated
by the counter SWD4–7 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
1,000 Hz counting clock for SWD0–3. 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.
<Counter value (msec) in which the pulse correction is performed>
Figure 4.8.3.1 shows the operation of the prescaler.
Prescaler input clock (1,024 Hz)
Prescaler output clock
OSC1
(output from the OSC1 oscillation circuit), and outputs
START
Counter data
000 001 002037 038039040 041
Fig. 4.8.3.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–3 and 10 Hz
generated by SWD4–7 are approximate values.
4.8.4 Capture buffer and hold function
The stopwatch data, 1/1,000 sec, 1/100 sec and 1/10 sec, can be read from SWD0–3 (FF4BH), SWD4–
7 (FF4CH) and SWD8–11 (FF4DH), respectively. The counter data are latched in the capture buffer when
reading, 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–3 (1/1,000 sec) is read. The data hold is released
when SWD8–11 (1/10 sec) reading is completed. Therefore, data should be read in order of SWD0–3 →
SWD4–7 → SWD8–11. If SWD4–7 or SWD8–11 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–11 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 released
if SWD8–11 is read. When SWD8–11 is read after the capture buffer is updated, the capture renewal flag
CRNWF is set to "1" at that point. In this case, it is necessary to read from SWD0–3 again. The capture
renewal flag is renewed by reading SWD8–11.
Figure 4.8.4.1 shows the timing for data holding and reading.
3240-0412
Page 93
SIC63616-(Rev. 1.0) NO. P86
Direct LAP input (P11/P10)
Direct LAP internal signal
Capture renewal flag CRNWF
SWD0–3 reading
SWD4–7 reading
SWD8–11 reading
Data holding
Fig. 4.8.4.1 Timing for data holding and reading
4.8.5 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.5.1 shows the operating timing when controlling the SWRUN register.
fOSC1/32 (1,024 Hz)
SWRUN writing
SWRUN register
Count clock
Fig. 4.8.5.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.
3240-0412
Page 94
SIC63616-(Rev. 1.0) NO. P87
4.8.6 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 P10 and P11 are used as the RUN/STOP and LAP input
ports. The key assignment can be selected using the SWDIR register.
Table 4.8.6.1 RUN/STOP and LAP input ports
SWDIR
0
1
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 P10/P11 (selected by SWDIR). P10/P11 works as a
normal input port, but the input signal is sent to the stopwatch control circuit. The key input signal from
the P10/P11 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–62.5 msec is removed. Therefore, more time is needed for an interval between RUN
and STOP key inputs.
Figure 4.8.6.1 shows the operating timing for the direct RUN input.
P10
RUN/STOP
LAP
P11
LAP
RUN/STOP
fOSC1/32 (1,024 Hz)
Direct RUN input (P10/P11)
Direct RUN internal signal
SWRUN register
Count clock
Direct RUN interrupt
Fig. 4.8.6.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 P11/P10 (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–11 is read. If the LAP key is input when
data has been already held, it renews the content of the capture buffer. When SWD8–11 is read after
renewing, the capture renewal flag is set to "1". In this case, the hold status is not released by reading
SWD8–11, 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–3 again.
3240-0412
Page 95
SIC63616-(Rev. 1.0) NO. P88
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–11 overflow. If the capture buffer shifts into hold status (when SWD0–3 is read or
when LAP is input) while the 1 Hz interrupt factor flag ISW1 is set to "1", the lap data carry-up request
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.6.2 shows the operating timing for the direct LAP input, and Figure 4.8.6.3 shows the timings
for data holding and reading during a direct LAP input and reading.
fOSC1/32 (1,024 Hz)
Direct LAP input (P11/P10)
Direct LAP internal signal
Data holding
SWD8–11 reading
Direct LAP interrupt
Fig. 4.8.6.2 Operating timing for direct LAP input
Direct LAP input (P11/P10)
Capture renewal flag CRNWF
SWD0–3 reading
SWD4–7 reading
SWD8–11 reading
Data holding
1 Hz interrupt factor flag ISW1
Lap data carry-up request flag LCURF
Counter data
999000
Fig. 4.8.6.3 Timing for data holding and reading during direct LAP input
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–DKM2 registers.
Table 4.8.6.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)
P12
P12, P13
P12, P13, P40
P40
P40, P41
P40, P41, P42
P40, P41, P42, P43
3240-0412
Page 96
SIC63616-(Rev. 1.0) NO. P89
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 combination (here in after referred to as mask) are held down.
2. The RUN or LAP key has been pressed when the mask is released.
fOSC1/32 (1,024 Hz)
Direct RUN/LAP input
Key mask
valid
invalid
invalid
invalid
Fig. 4.8.6.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
The 10 Hz and 1 Hz interrupts can be generated through the overflow of stopwatch timers SWD4–7
and SWD8–11 respectively. Also, software can set whether to separately mask the frequencies described
earlier.
Figure 4.8.7.1 is the timing chart for the counters.
SIC63616-(Rev. 1.0) NO. P90
As shown in Figure 4.8.7.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.
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 P10 and P11 ports. Therefore, the direct input interrupt
and the P10–P13 inputs interrupt may generate at the same time depending on the interrupt condition
setting for the input port P10–P13. Consequently, when using the direct input interrupt, set the interrupt select registers SIP10 and SIP11 to "0" so that the input interrupt does not generate by P10 and P11
inputs.
Fig. 4.8.7.2 Timing chart for stopwatch timer
3240-0412
Page 99
4.8.8 I/O memory of stopwatch timer
D3D2D1D0Name Init
∗1
10
AddressComment
Register
FF16H
MDCKE SGCKE SWCKE RTCKE
R/W
MDCKE
SGCKE
SWCKE
RTCKE
0
0
0
0
Enable
Enable
Enable
Enable
Disable
Disable
Disable
Disable
Integer multiplier clock enable
Sound generator clock enable
Stopwatch timer clock enable
Clock timer clock enable
0
None1P122P12–133P12–13,40
[DKM2–0]
Key mask
4
P405P40–416P40–427P40–43
[DKM2–0]
Key mask
Unused
Key mask
selection
FF48H
RR/W
FF49H
0DKM2DKM1DKM0
0
∗
3
DKM2
DKM1
DKM0
–
∗
2
0
0
0
R/WWR
FF4AH
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
FF4CH
SWD7 SWD6 SWD5 SWD4
SWD11
SWD10
SWD9
SWD8
0
0
0
0
Stopwatch timer data
BCD (1/10 sec)
R
FF4DH
SWD11 SWD10 SWD9 SWD8
R
FF4BH
SWD3 SWD2 SWD1 SWD0
SWD3
SWD2
SWD1
SWD0
0
0
0
0
Stopwatch timer data
BCD (1/1000 sec)
00SWDIREDIR
RR/W
0
∗
3
0
∗
3
SWDIR
EDIR
–
∗
2
–
∗
2
0
0Enable Disable
Unused
Unused
Stopwatch direct input switch
0: P10=Run/Stop, P11=Lap 1: P10=Lap, P11=Run/Stop
Direct input enable
FFEDH
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)
FFFDH
IRUNILAPISW1ISW10
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)
Table 4.8.8.1 shows the I/O addresses and the control bits for the stopwatch timer.
Controls the operating clock supply to the stopwatch timer.
When "1" is written: On
When "0" is written: Off
When "1" is written to SWCKE, the stopwatch timer operating clock is supplied from the clock manager.
If it is not necessary to run the stopwatch timer, stop the clock supply by setting SWCKE to "0" to reduce
current consumption.
At initial reset, this register is set to "0".
Reading: Valid
3240-0412
Page 100
SIC63616-(Rev. 1.0) NO. P93
EDIR: Direct input function enable register (FF48H•D0)
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 µsec maximum).
At initial reset, this register is set to "0".
SWDIR: Direct input switch register (FF48H•D1)
Switches the direct-input key assignment for the P10 and P11 ports.
When "1" is written: P10 = LAP, P11 = RUN/STOP
When "0" is written: P10 = RUN/STOP, P11 = LAP
Reading: Valid
The direct-input key assignment is selected using this register. The P10 and P11 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–DKM2: Direct key mask select register (FF49H•D0–D2)
Selects a combination of the key inputs for concurrence judgment with RUN and LAP inputs when the
direct input function is set.
Table 4.8.8.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)
P12
P12, P13
P12, P13, P40
P40
P40, P41
P40, P41, P42
P40, P41, P42, P43
When the concurrence is detected, RUN and LAP inputs cannot be accepted until the concurrence is
released.
At initial reset, this register is set to "0".
SWRST: Stopwatch timer reset (FF4AH•D0)
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.
3240-0412
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.