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 other product names mentioned herein are trademarks and/or registered trademarks of their respective
companies.
Part number for plastic package modified.
Part number for package modified.
Descriptions added.
• VFBGA10H-144 package
(10 mm 10 mm 1.0 mm, ball pitch: 0.8 mm)
TQFP24-144-pin
Figure 1.3.1.1
Part number modified.
QFP24-144-pin→TQFP24-144-pin
1-6Part number modified.
1-7Figure 1.3.1.4 added.
1-81.3.2 Pin DescriptionsTable 1.3.2.1 modified.
1-9Descriptions modified.
6-156.7 Details of Control RegistersDescription deleted.
10-1110.8 Details of Control RegistersDescription modified.
11-911.7 16-bit Timer Output SignalNumerical value modified.
22-322.3.2 Frame SignalDescription deleted.
22-922.6.1 Turning Display On and OffTable 22.6.1.1 modified.
22-1522.8 Details of Control RegistersTable 22.8.2 modified.
26-726.6.3 External Clock
Input AC Characteristics
27-127 PackagePart number modified.
27-3Part number modified.
27-4Figure added.
28-228.2 Pad CoordinatesTable modified.
AP-36Appendix D Precautions on
Mounting
VFBGA7HX161→VFBGA7H-161
Figure 1.3.1.3
Part number modified.
VFBGA7HX161→VFBGA7H-161
Numbers and names of pins
(The interrupts can be used to clear standby mode even if
the corresponding interrupt enable bit is set to disable
interrupt.)
The PxIN[7:0] bits correspond to the Px[7:0] ports respectivel
and the voltage level on the port pin is read out in the input
mode...In the output mode, an indefinite value is read out.
Expression for I
(see Table 22.3.1.)
Description modified.
Description modified.
Table modified.
QFP24-144-pin package→TQFP24-144-pin package
VFBGA7HX161 Package→VFBGA7H-161 Package
VFBGA10H-144 Package
Coordinates modified.
Description for Noise-Induced Erratic Operations modified.
Appendix B Flash Programming ................................................................................. AP-28
B.1 Programming from Debugger ....................................................................................... AP-28
B.2 Self-Programming by Application Program ................................................................... AP-29
Appendix C Power Saving ........................................................................................... AP-30
C.1 Power Saving by Clock Control ................................................................................... AP-30
C.2 Power Saving by Power Supply Control ....................................................................... AP-33
Appendix D Precautions on Mounting ....................................................................... AP-34
Appendix E Initialize Routine ...................................................................................... AP-38
viii
EPSON
S1C17704 TECHNICAL MANUAL
Page 13
1 OVERVIEW
1 Overview
The S1C17704 is a 16-bit MCU that features high-speed operation, low power consumption, small size, large
address space, and on-chip ICE. The S1C17704 consists of an S1C17 CPU Core, a 64K-byte Flash memory,
a 4K-byte RAM, serial interface modules (UART that supports high bit rate and IrDA 1.0, SPI and I
connecting various sensor modules, 8-bit timers, 16-bit timers, a PWM & capture timer, a clock timer, a stopwatch
timer, a watchdog timer, 28 GPIO ports, an LCD driver with 56-segment × 32-common outputs and a voltage
booster, a supply voltage detector, 32 kHz (typ.) and 8.2 MHz (max.) oscillators, and a voltage regulator for
generating the 1.8 V internal voltage. The S1C17704 is capable of high-speed operation (8.2 MHz) with low
operating voltage (1.8 V). Its 16-bit RISC processor executes one instruction in 1 clock cycles.
The S1C17704 also provides an on-chip ICE function that allows on-board erasing/programming of the embedded
Flash memory, on-board debugging and evaluating the program by connecting the S1C17704 to the ICD Mini
(S5U1C17001H) with only three wires. The S1C17704 is suitable for battery driven applications with sensor
interfaces and up to 56 × 32-dot LCD display, such as remote controllers and sports watches.
The product lineup offers two S1C17704 models with a different main oscillator.
Main (OSC3) oscillator • Crystal/ceramic oscillator 8.2 MHz (max.)
• CR oscillator 2.2 MHz (max.)
∗ This product uses SuperFlash® Technology licensed from Silicon Storage Technology, Inc.
2
C) for
S1C17704 TECHNICAL MANUAL EPSON
1-1
Page 14
1 OVERVIEW
1.1 Features
The main functions and features of the S1C17704 are outlined below.
CPU • Seiko Epson original 16-bit RISC CPU core S1C17
Main (OSC3) oscillator • Crystal/ceramic oscillator 8.2 MHz (max.)
• CR oscillator 2.2 MHz (max.)
Sub (OSC1) oscillator • Crystal oscillator 32.786 kHz (typ.)
On-chip Flash memory • 64K bytes (for instructions and data)
• 1,000 erase/program cycles
• Read/program protection
• On-board programming by a debugging tool such as ICD Mini (S5U1C17704H)
and self-programming by software control
On-chip RAM • 4K bytes
On-chip display RAM • 576 bytes
I/O ports • Max. 28 general-purpose I/O ports (Pins are shared with the peripheral I/O.)
Serial interfaces • SPI (master/slave) 1 ch.
• I2C (master) 1 ch.
• UART (115200 bps, IrDA 1.0) 1 ch.
• Remote controller (REMC) 1 ch.
Timers • 8-bit timer (T8F) 1 ch.
• 16-bit timer (T16) 3 ch.
• PWM & capture timer (T16E) 1 ch.
• Clock timer (CT) 1 ch.
• Stopwatch timer (SWT) 1 ch.
• Watchdog timer (WDT) 1 ch.
• 8-bit OSC1 timer (T8OSC1) 1 ch.
LCD driver • 56 SEG × 32 COM or 72 SEG × 16 COM (1/5 bias)
• Built-in voltage booster
Supply voltage detector (SVD) • 13 programmable detection levels (1.8 V to 2.7 V)
Interrupts • Reset
• NMI
• 16 programmable interrupts (8 levels)
Power supply voltage • 1.8 V to 3.6 V (for normal (low-power) operation with the 1.8 V internal voltage)
• 2.7 V to 3.6 V (for Flash erasing/programming with the 2.5 V internal voltage)
I/O I(Pull-UP)Input/output port pin*/ OSC3 dividing clock output
I/O I(Pull-UP)Input/output port pin*/T16E external clock input
I/O I(Pull-UP)Input/output port pin*/T16E PWM signal output pin
I/O I(Pull-UP)Input/output port pin*/UART clock input pin
I/O I(Pull-UP)Input/output port pin*/UART data output pin
I/O I(Pull-UP)Input/output port pin*/UART data input pin
I/O I(Pull-UP)Input/output port pin*/SPI clock input/output pin
I/O I(Pull-UP)Input/output port pin*/SPI data output pin
I/O I(Pull-UP)Input/output port pin*/SPI data input pin
I/O I(Pull-UP)Input/output port pin (with interrupt)*/SPI slave
I/O I(Pull-UP)Input/output port pin (with interrupt)*/T16 Ch.0
Function
circuit output pin
On-chip debugger data input/output pin*/ input/output
port pin
On-chip debugger status output pin*/ input/output
port pin
port pin
pin
pin
select input pin
external clock input pin
1-8
EPSON S1C17704 TECHNICAL MANUAL
Page 21
1 OVERVIEW
Pin No.
QFPPFBGA
VFBGA7
VFBGA10
96C8E13E12
NameI/O
P15/SCL
Default
status
Function
I/O I(Pull-UP)Input/output port pin (with interrupt)*/I2C clock
output pin
97D9E12D12
P14/SDA
I/O I(Pull-UP)Input/output port pin (with interrupt)*/I
2
C data
input/output pin
98D10E11E9
P07/EXCL1
I/O I(Pull-UP)Input/output port pin (with interrupt)*/T16 Ch.1
external clock input pin
99D11E10D9
P06/EXCL2
I/O I(Pull-UP)Input/output port pin (with interrupt)*/T16 Ch.2
external clock input pin
100C9D13D11
P05/REMO
I/O I(Pull-UP)Input/output port pin (with interrupt)*/Remote out-
put pin
101C10D12C12
P04/REMI
I/O I(Pull-UP)Input/output port pin (with interrupt)*/Remote input
pin
102C11D11D10
P13/FOUT1
I/O I(Pull-UP)
Input/output port pin (with interrupt)*/OSC1 clock
Note: Bold text (for pins) and an asterisk (for functions) indicate default settings.
S1C17704 TECHNICAL MANUAL EPSON
1-9
Page 22
1 OVERVIEW
THIS PAGE IS BLANK.
1-10
EPSON S1C17704 TECHNICAL MANUAL
Page 23
2 CPU
2 CPU
The S1C17704 contains the S1C17 Core as its core processor.
The S1C17 Core is a Seiko Epson original 16-bit RISC-type processor.
It features low power consumption, high-speed operation, large address space, main instructions executable in one
clock cycle, and a small sized design. The S1C17 Core is suitable for embedded applications such as controllers
and sequencers for which an eight-bit CPU is commonly used.
For details of the S1C17 Core, refer to the “S1C17 Family S1C17 Core Manual.”
2.1 Features of the S1C17 Core
Processor type
• Seiko Epson original 16-bit RISC processor
• 0.35–0.15 µm low power CMOS process technology
Instruction set
• Code length: 16-bit fixed length
• Number of instructions: 111 basic instructions (184 including variations)
• Execution cycle: Main instructions executed in one cycles
• Extended immediate instructions: Immediate extended up to 24 bits
• Compact and fast instruction set optimized for development in C language
Register set
• Eight 24-bit general-purpose registers
• Two 24-bit special registers
• One 8-bit special register
Memory space and bus
• Up to 16M bytes of memory space (24-bit address)
• Harvard architecture using separated instruction bus (16 bits) and data bus (32 bits)
Interrupts
• Reset, NMI, and 32 external interrupts supported
• Address misaligned interrupt
• Debug interrupt
• Direct branching from vector table to interrupt handler routine
• Programmable software interrupts with a vector number specified (all vector numbers specifiable)
Power saving
• HALT (halt instruction)
• SLEEP (slp instruction)
S1C17704 TECHNICAL MANUAL EPSON
2-1
Page 24
2 CPU
2.2 CPU Registers
The S1C17 Core contains eight general-purpose registers and three special registers.
Special registers
bit 23
PC
SP
765IE4C3V2Z1N0
IL[2:0]
bit 0
PSR
Figure 2.2.1 Registers
General-purpose registers
bit 23bit 0
7
6
5
4
3
2
1
0
R7
R6
R5
R4
R3
R2
R1
R0
2-2
EPSON S1C17704 TECHNICAL MANUAL
Page 25
2 CPU
2.3 Instruction Set
The S1C17 Core instruction codes are all fixed to 16 bits in length which, combined with pipelined processing,
allows most important instructions to be executed in one cycle. For details, refer to the “S1C17 Family S1C17 Core
Manual.”
Table 2.3.1 List of S1C17 Core Instructions
ClassificationMnemonicFunction
Data transfer
ld.b%rd,%rs
ld.ub%rd,%rs
ld%rd,%rs
ld.a%rd,
%rd,[%rb]
%rd,[%rb]+
%rd,[%rb]-
%rd,-[%rb]
%rd,[%sp+imm7]
%rd,[imm7]
[%rb],%rs
[%rb]+,%rs
[%rb]-,%rs
-[%rb],%rs
[%sp+imm7],%rs
[imm7],%rs
%rd,[%rb]
%rd,[%rb]+
%rd,[%rb]-
,-[%rb]
%rd
%rd,[%sp+imm7]
%rd,[imm7]
%rd,sign7
%rd,[%rb]
%rd,[%rb]+
%rd,[%rb]-
%rd,-[%rb]
%rd,[%sp+imm7]
%rd,[imm7]
[%rb],%rs
[%rb]+,%rs
[%rb]-,%rs
-[%rb],%rs
[%sp+imm7],%rs
[imm7],%rs
%rs
%rd,imm7
%rd,[%rb]
%rd,[%rb]+
%rd,[%rb]-
%rd,-[%rb]
%rd,[%sp+imm7]
%rd,[imm7]
[%rb],%rs
[%rb]+,%rs
[%rb]-,%rs
-[%rb],%rs
[%sp+imm7],%rs
[imm7],%rs
%rd,%sp
%rd,%pc
,[%sp]
%rd
%rd,[%sp]+
%rd,[%sp]-
%rd,-[%sp]
General-purpose register (byte) → general-purpose register (sign-extended)
Memory (byte) → general-purpose register (sign-extended)
Memory address post-increment, post-decrement, and pre-decrement
functions can be used.
Stack (byte) → general-purpose register (sign-extended)
Memory (byte) → general-purpose register (sign-extended)
General-purpose register (byte) → memory
Memory address post-increment, post-decrement, and pre-decrement
functions can be used.
General-purpose register (32 bits, zero-extended) → stack (∗1)
Stack pointer post-increment, post-decrement, and pre-decrement functions
can be used.
General-purpose register (24 bits) → SP
Immediate → SP
16-bit addition between general-purpose registers
Supports conditional execution (/c: executed if C = 1, /nc: executed if C = 0).
16-bit addition of general-purpose register and immediate
24-bit addition between general-purpose registers
Supports conditional execution (/c: executed if C = 1, /nc: executed if C = 0).
24-bit addition of SP and general-purpose register
24-bit addition of general-purpose register and immediate
24-bit addition of SP and immediate
16-bit addition with carry between general-purpose registers
Supports conditional execution (/c: executed if C = 1, /nc: executed if C = 0).
16-bit addition of general-purpose register and immediate with carry
16-bit subtraction between general-purpose registers
Supports conditional execution (/c: executed if C = 1, /nc: executed if C = 0).
16-bit subtraction of general-purpose register and immediate
24-bit subtraction between general-purpose registers
Supports conditional execution (/c: executed if C = 1, /nc: executed if C = 0).
24-bit subtraction of SP and general-purpose register
24-bit subtraction of general-purpose register and immediate
24-bit subtraction of SP and immediate
16-bit subtraction with carry between general-purpose registers
Supports conditional execution (/c: executed if C = 1, /nc: executed if C = 0).
16-bit subtraction of general-purpose register and immediate with carry
16-bit comparison between general-purpose registers
Supports conditional execution (/c: executed if C = 1, /nc: executed if C = 0).
16-bit comparison of general-purpose register and immediate
24-bit comparison between general-purpose registers
Supports conditional execution (/c: executed if C = 1, /nc: executed if C = 0).
24-bit comparison of general-purpose register and immediate
16-bit comparison with carry between general-purpose registers
Supports conditional execution (/c: executed if C = 1, /nc: executed if C = 0).
16-bit comparison of general-purpose register and immediate with carry
Logical AND between general-purpose registers
Supports conditional execution (/c: executed if C = 1, /nc: executed if C = 0).
Logical AND of general-purpose register and immediate
Logical OR between general-purpose registers
Supports conditional execution (/c: executed if C = 1, /nc: executed if C = 0).
Logical OR of general-purpose register and immediate
Exclusive OR between general-purpose registers
Supports conditional execution (/c: executed if C = 1, /nc: executed if C = 0).
Exclusive OR of general-purpose register and immediate
Logical inversion between general-purpose registers (1's complement)
Supports conditional execution (/c: executed if C = 1, /nc: executed if C = 0).
Logical inversion of general-purpose register and immediate (1's complement)
2-4
EPSON S1C17704 TECHNICAL MANUAL
Page 27
2 CPU
ClassificationMnemonicFunction
Shift and swap
Immediate extension
Conversion
Branch
System control
ld.a
∗1 The
sr%rd,%rs
sa%rd,%rs
sl%rd,%rs
swap%rd,%rs
extimm13
cv.ab%rd,%rs
cv.as%rd,%rs
cv.al%rd,%rs
cv.la%rd,%rs
cv.ls%rd,%rs
jpr
jpr.d
jpa
ipa.d
jrgt
jrgt.d
jrge
jrge.d
jrlt
jrlt.d
jrle
jrle.d
jrugt
jrugt.d
jruge
jruge.d
jrult
jrult.d
jrule
jrule.d
jreq
jreq.d
jrne
jrne.d
call
call.d
calla
calla.d
ret
ret.d
intimm5
intlimm5,imm3
reti
reti.d
brk
retd
nop
halt
slp
ei
di
%rd,imm7
%rd,imm7
%rd,imm7
sign10
%rb
imm7
%rb
sign7
sign7
sign7
sign7
sign7
sign7
sign7
sign7
sign7
sign7
sign10
%rb
imm7
%rb
Logical shift to the right with the number of bits specifi ed by the register
Logical shift to the right with the number of bits specifi ed by immediate
Arithmetic shift to the right with the number of bits specifi ed by the register
Arithmetic shift to the right with the number of bits specifi ed by immediate
Logical shift to the left with the number of bits specifi ed by the register
Logical shift to the left with the number of bits specifi ed by immediate
Bytewise swap on byte boundary in 16 bits
Extend operand in the following instruction
Convert signed 8-bit data into 24 bits
Convert signed 16-bit data into 24 bits
Convert 32-bit data into 24 bits
Converts 24-bit data into 32 bits
Converts 16-bit data into 32 bits
PC relative jump
Delayed branching possible
Absolute jump
Delayed branching possible
PC relative conditional jump Branch condition: !Z & !(N ^ V)
Delayed branching possible
PC relative conditional jump Branch condition: !(N ^ V)
Delayed branching possible
PC relative conditional jump Branch condition: N ^ V
Delayed branching possible
PC relative conditional jump Branch condition: Z | N ^ V
Delayed branching possible
PC relative conditional jump Branch condition: !Z & !C
Delayed branching possible
PC relative conditional jump Branch condition: !C
Delayed branching possible
PC relative conditional jump Branch condition: C
Delayed branching possible
PC relative conditional jump Branch condition: Z | C
Delayed branching possible
PC relative conditional jump Branch condition: Z
Delayed branching possible
PC relative conditional jump Branch condition: !Z
Delayed branching possible
PC relative subroutine call
Delayed call possible
Absolute subroutine call
Delayed call possible
Return from subroutine
Delayed return possible
Software interrupt
Software interrupt with interrupt level setting
Return from interrupt handling
Delayed call possible
Debug interrupt
Return from debug processing
No operation
T mode
HAL
SLEEP mode
Enable interrupts
Disable interrupts
instruction accesses memories in 32-bit length. During data transfer from a register to a memory, the
32-bit data in which the eight high-order bits are set to 0 is written to the memory. During reading from a memory,
the eight high-order bits of the read data are ignored.
∗2 The S1C17704 does not include a coprocessor. Therefore, the coprocessor instructions are not available.
S1C17704 TECHNICAL MANUAL EPSON
2-5
Page 28
2 CPU
The symbols in the above table each have the meanings specified below.
Table 2.3.2 Symbol Meanings
%rs
%rd
[%rb]
[%rb]+
[%rb]-
-[%rb]
%sp
[%sp],[%sp+imm7]
[%sp]+
[%sp]-
-[%sp]
imm3,imm5,imm7,imm13
sign7,sign10
SymbolDescription
General-purpose register, source
General-purpose register, destination
Memory addressed by general-purpose register
Memory addressed by general-purpose register with address post-incremented
Memory addressed by general-purpose register with address post-decremented
Memory addressed by general-purpose register with address pre-decremented
Stack pointer
Stack
Stack with address post-incremented
Stack with address post-decremented
Stack with address pre-decremented
Unsigned immediate (numerals indicating bit length)
Signed immediate (numerals indicating bit length)
2-6
EPSON S1C17704 TECHNICAL MANUAL
Page 29
2 CPU
2.4 Vector Table
The vector table contains the vectors to the interrupt handler routines (handler routine start address) that will be
read by the S1C17 Core to execute the handler when an interrupt occurs. The boot address from which the program
starts running after a reset must be written to the top of the vector table.
The vector table is located at address 0x8000 in the S1C17704. The vector table base address can be read out from
TTBR (Vector Table Base Register) located at address 0xffff80.
Table 2.4.1 shows the vector table of the S1C17704.
–(0xfffc00)Debugging interrupt
2 (0x02)0x8008NMIWatchdog timer overfl ow
3 (0x03)0x800creserved––
4 (0x04)0x8010P0 port interruptP00–P07 port inputs High
5 (0x05)0x8014P1 port interruptP10–P17 port inputs↑
6 (0x06)0x8018Stopwatch timer interrupt• 100 Hz timer signal
7 (0x07)0x801cClock timer interrupt• 32 Hz timer signal
8 (0x08)0x80208-bit OSC1 timer interruptCompare match
9 (0x09)0x8024SVD interruptLow supply voltage detected
10 (0x0a)0x8028LCD interruptFrame signal
11 (0x0b)0x802cPWM & capture timer interrupt• Compare match A
The CPU operates with CCLK as the operating clock. For CCLK, see Section 8.2, “Controlling the CPU Core
Clock (CCLK).”
The period between a CCLK rising edge and the next rising edge is assumed to be one CCLK (= one bus cycle).
As shown in Figure 3.1, the number of cycles required for one bus access depends on the peripheral or memory
module. Furthermore, the number of bus accesses depends on the CPU instruction (access size) and device size.
Table 3.1.1 Number of Bus Accesses
Device sizeCPU access sizeNumber of bus accesses
8 bits 8 bits1
16 bits2
32 bits*4
16 bits 8 bits1
16 bits1
32 bits*2
32 bits 8 bits1
16 bits1
32 bits*1
∗Handling the eight high-order bits during 32-bit accesses
During writing, the eight high-order bits are written as 0. During reading from a memory, the eight high-order
bits are ignored. However, the stack operation in an interrupt handling reads/writes 32-bit data that consists of the
PSR value as the high-order 8 bits and the return address as the low order 24 bits.
Number of bus cycles calculation example
Number of bus cycles when the CPU accesses the display RAM area (eight-bit device, set to two access cycles)
by a 16-bit read or write instruction.
2 [cycles] × 2 [bus accesses] = 4 [CCLK cycles]
3.1.1 Restrictions on Access Size
The modules shown below have a restriction on the access size. Appropriate instructions should be used in
programming.
Flash memory
The Flash memory allows only 16-bit write instructions for programming. Reading data from the Flash memory
has no such restriction.
SPI, I2C
The SPI and I2C registers allow only 16-bit read/write instructions for accessing.
Other modules can be accessed with an 8-bit, 16-bit, or 32-bit instruction. However, reading for an unnecessary
register may change the peripheral module status and it may cause a problem. Therefore, use the appropriate
instructions according to the device size.
3.1.2 Restrictions on Instruction Execution Cycles
An instruction fetch and a data access are not performed simultaneously under one of the conditions listed below.
This prolongs the instruction fetch cycle for the number of data area access cycles.
• When the S1C17704 executes the instruction stored in the Flash area and accesses data in the Flash area, display
RAM area or internal peripheral area 2 (0x5000–)
• When the S1C17704 executes the instruction stored in the internal RAM area and accesses data in the internal
RAM area
3-2
EPSON S1C17704 TECHNICAL MANUAL
Page 33
3 MEMORY MAP, BUS CONTROL
3.2 Flash Area
3.2.1 Internal Flash Memory
The 64K-byte area from address 0x8000 to address 0x17fff contains a Flash memory (4K bytes × 16 sectors) for
storing application programs and data. Address 0x8000 is defined as the vector table base address, therefore a
vector table (see Section 2.4, “Vector Table”) must be placed from the beginning of the area. The Flash memory
can be read in 1 to 5 cycles.
3.2.2 Flash Programming
The S1C17704 supports on-board programming of the Flash memory, it makes it possible to program the Flash
memory with the application programs/data by using the debugger through the ICD Mini. Furthermore, the
S1C17704 supports self-programming by the application program stored in the Flash memory. The Flash memory
can be programmed in 16-bit units. For programming of the Flash memory, see Appendix B, “Flash Programming.”
The Flash memory supports two erase methods, chip erase and sector erase. The table below lists the
correspondence between addresses and sectors required for sector erase.
Note: The debugger supports chip erase only and does not allow erasing in sector units.
Table 3.2.2.1 Correspondence Between Memory Address and Flash Sector
S1C17704 addressFlash sector numberS1C17704 addressFlash sector number
Note: The 32 bits (0x17ffc–0x17fff) at the end of Sector 15 are reserved for the system as the protect
bits. Do not program this area with data other than protect settings.
3.2.3 Protect Bits
In order to protect the memory contents, the Flash memory provides two protection features, write protection and
data read protection, that can be configured for every 16K-byte areas. The write protection disables writing data
to the configured area. The data-read protection disables reading data from the configured area (the read value is
always 0x0000). However, it does not disable the instruction fetch operation by the CPU.
The Flash memory provides the protect bits listed below. Program the protect bit corresponding to the area to be
protected to 0.
0x17ffc–0x17ffe: Flash Protect Bits
AddressBitFunctionSettingInit. R/WRemarks
0x17ffc
(16 bits)
(16 bits)
Notes: • Be sure not to locate the area with data-read protection into the .data and .rodata sections.
• Be sure to set D0 of address 0x17ffe to 1. If it is set to 0, the program cannot be booted.
D15–4 reserved–––
D3Flash write-protect bit for 0x14000–0x17fff1 Writable0 Protected1 R/W
D2Flash write-protect bit for 0x10000–0x13fff1 Writable0 Protected1 R/W
D1Flash write-protect bit for 0x0c000–0x0ffff1 Writable0 Protected1 R/W
0x17ffe
D0Flash write-protect bit for 0x08000–0x0bfff1 Writable0 Protected1 R/W
D15–4 reserved–––
D3Flash data-read-protect bit for 0x14000–0x17fff 1 Readable0 Protected1 R/W
D2Flash data-read-protect bit for 0x10000–0x13fff 1 Readable0 Protected1 R/W
D1Flash data-read-protect bit for 0x0c000–0x0ffff 1 Readable0 Protected1 R/W
D0reserved11 R/W Always set to 1.
S1C17704 TECHNICAL MANUAL EPSON
3-3
Page 34
3 MEMORY MAP, BUS CONTROL
3.2.4 Access Control for the Flash Controller
The S1C17704 on-chip Flash memory is accessed via the exclusive Flash controller. A MISC register is used to set
the access condition for the Flash controller.
Setting number of read access cycles for the Flash controller
In order to read data from the Flash memory properly, set the appropriate number of read access cycles
according to the CCLK frequency using the FLCYC[2:0] bits (D[2:0]/MISC_FL register).
0x5320: FLASHC Control Register (MISC_FL)
Register name AddressBitNameFunctionSettingInit. R/WRemarks
Note: Be sure to avoid setting a number of read access cycles that exceeds the maximum allowable
CCLK frequency, as it may cause a malfunction.
3-4
EPSON S1C17704 TECHNICAL MANUAL
Page 35
3 MEMORY MAP, BUS CONTROL
3.3 Internal RAM Area
3.3.1 Internal RAM
The S1C17704 contains a RAM in the 4K-byte area from address 0x0 to address 0xfff. The RAM is accessed in
one cycle for both reading and writing and allows high-speed execution of the instruction codes copied into it as
well as storing variables and other data.
Note: The 64-byte area at the end of the RAM (0xfc0–0xfff) is reserved for the on-chip debugger. When
using the debug functions under application development, do not access this area from the
application program.
This area can be used for applications of mass-produced devices that do not need debugging.
S1C17704 TECHNICAL MANUAL EPSON
3-5
Page 36
3 MEMORY MAP, BUS CONTROL
3.4 Display RAM Area
3.4.1 Display RAM
The display RAM for the on-chip LCD driver is located in the 576-byte area from address 0x80000 to address
0x8055f. The display RAM is accessed in two to five cycles as an eight-bit device. It can be used as a generalpurpose RAM when it is not used for display. See Section 22.5, “Display Memory,” for details of the display
memory.
3.4.2 Access Control for the SRAM Controller
The S1C17704 display RAM is accessed via the exclusive SRAM controller. A MISC register is used to set the
access condition for the SRAM controller.
Setting number of access cycles for the SRAM controller
In order to read/write data from/to the display RAM properly, set the appropriate number of access cycles
according to the CCLK frequency using the SRCYC[1:0] bits (D[1:0]/ MISC_SR register).
0x5321: SRAMC Control Register (MISC_SR)
Register name AddressBitNameFunctionSettingInit. R/WRemarks
SRAMC Control
Register
(MISC_SR)
0x5321
(8 bits)
D7–2
D1–0
–
SRCYC[1:0]
reserved––– 0 when being read.
SRAMC access cycleSRCYC[1:0] Access cycle 0x3 R/W
0x3
0x2
0x1
0x0
5 cycles
4 cycles
3 cycles
2 cycles
D[7:2] Reserved
D[1:0] SRCYC[1:0]: SRAMC Access Cycle Setup Bits
Sets the number of SRAM (display RAM) controller access cycle.
Table 3.4.2.1 Setting Access Cycles for the SRAM Controller
The I/O and control registers for the internal peripheral modules are located in the 1K-byte area beginning with
address 0x4000 and the 4K-byte area beginning with address 0x5000.
3.5.1 Internal Peripheral Area 1 (0x4000–)
The internal peripheral area 1 beginning with address 0x4000 contains the I/O memory for the peripheral functions
listed below and this area can be accessed in one cycle.
• Prescaler (PSC, 8-bit device)
• UART (UART, 8-bit device)
• 8-bit timer (T8F, 16-bit device)
• 16-bit timers (T16, 16-bit device)
• Interrupt controller (ITC, 16-bit device)
• SPI (SPI, 16-bit device)
2
• I
C (I2C, 16-bit device)
3.5.2 Internal Peripheral Area 2 (0x5000–)
The internal peripheral area 2 beginning with address 0x5000 contains the I/O memory for the peripheral functions
listed below and this area can be accessed in three cycles.
• Clock timer (CT, 8-bit device)
• Stopwatch timer (SWT, 8-bit device)
• Watchdog timer (WDT, 8-bit device)
• Oscillator (OSC, 8-bit device)
• Clock generator (CLG, 8-bit device)
• LCD driver (LCD, 8-bit device)
• 8-bit OSC1 timer (T8OSC1, 8-bit device)
• SVD circuit (SVD, 8-bit device)
• Power supply circuit (VD1, 8-bit device)
• I/O port & port MUX (P, 8-bit device)
• PWM & capture timer (T16E, 16-bit device)
• MISC register (MISC, 8-bit device)
• Remote controller (REMC, 8-bit device)
S1C17704 TECHNICAL MANUAL EPSON
3-7
Page 38
3 MEMORY MAP, BUS CONTROL
3.5.3 I/O Map
This section shows the I/O map table for the internal peripheral area. For details of each control register, see the I/O
register list in Appendix or description for each peripheral module.
Table 3.5.3.1 I/O Map (Internal Peripheral Area 1)
PeripheralAddressRegister nameFunction
Prescaler
(8-bit device)
UART
(with IrDA)
(8-bit device)
8-bit timer
(with fine mode)
(16-bit device)
16-bit timer
Ch. 0
(16-bit device)
16-bit timer
Ch. 1
(16-bit device)
16-bit timer
Ch. 2
(16-bit device)
Interrupt
controller
(16-bit device)
SPI
(16-bit device)
2
C
I
(16-bit device)
0x4020PSC_CTLPrescaler Control RegisterStarts/stops the prescaler.
0x4021–0x403f ––Reserved
0x4100UART_STUART Status RegisterIndicates transfer, buffer and error statuses.
0x4101UART_TXDUART Transmit Data RegisterTransmit data
0x4102UART_RXDUART Receive Data RegisterReceive data
0x4103UART_MODUART Mode RegisterSets transfer data format.
0x4104UART_CTLUART Control RegisterControls data transfer.
0x4105UART_EXPUART Expansion RegisterSets IrDA mode.
0x4106–0x411f ––Reserved
0x4200T8F_CLK8-bit Timer Input Clock Select RegisterSelects a prescaler output clock.
0x4202T8F_TR8-bit Timer Reload Data RegisterSets reload data.
0x4204T8F_TC8-bit Timer Counter Data RegisterCounter data
0x4206T8F_CTL8-bit Timer Control Register
0x4208–0x421f ––Reserved
0x4220T16_CLK016-bit Timer Ch.0 Input Clock Select Register Selects a prescaler output clock.
0x4222T16_TR016-bit Timer Ch.0 Reload Data RegisterSets reload data.
0x4224T16_TC016-bit Timer Ch.0 Counter Data RegisterCounter data
0x4226T16_CTL016-bit Timer Ch.0 Control Register
0x4228–0x423f ––Reserved
0x4240T16_CLK116-bit Timer Ch.1 Input Clock Select Register Selects a prescaler output clock.
0x4242T16_TR116-bit Timer Ch.1 Reload Data RegisterSets reload data.
0x4244T16_TC116-bit Timer Ch.1 Counter Data RegisterCounter data
0x4246T16_CTL116-bit Timer Ch.1 Control Register
0x4248–0x425f ––Reserved
0x4260T16_CLK216-bit Timer Ch.2 Input Clock Select Register Selects a prescaler output clock.
0x4262T16_TR216-bit Timer Ch.2 Reload Data RegisterSets reload data.
0x4264T16_TC216-bit Timer Ch.2 Counter Data RegisterCounter data
0x4266T16_CTL216-bit Timer Ch.2 Control Register
0x4268–0x427f ––Reserved
0x4300ITC_IFLGInterrupt Flag RegisterIndicates/resets interrupt occurrence status.
0x4302ITC_ENInterrupt Enable RegisterEnables/disables each maskable interrupt.
0x4304ITC_CTLITC Control RegisterEnables/disables the ITC.
0x4306ITC_ELV0External Interrupt Level Setup Register 0Sets the P0 and P1 interrupt levels and
0x4308ITC_ELV1External Interrupt Level Setup Register 1Sets the stopwatch timer and clock timer
0x430aITC_ELV2External Interrupt Level Setup Register 2Sets the 8-bit OSC1 timer and SVD interrupt
0x430cITC_ELV3External Interrupt Level Setup Register 3Sets the LCD and PWM & capture timer
0x430eITC_ILV0Internal Interrupt Level Setup Register 0Sets the 8-bit timer and 16-bit timer Ch. 0
0x4310ITC_ILV1Internal Interrupt Level Setup Register 1Sets the 16-bit timer Ch. 1 and 16-bit timer
0x4312ITC_ILV2Internal Interrupt Level Setup Register 2Sets the UART and remote controller inter-
0x4314ITC_ILV3Internal Interrupt Level Setup Register 3Sets the SPI and I
0x4316–0x431f ––Reserved
0x4320SPI_STSPI Status RegisterIndicates transfer and buffer statuses.
0x4322SPI_TXDSPI Transmit Data RegisterTransmit data
0x4324SPI_RXDSPI Receive Data RegisterReceive data
0x4326SPI_CTLSPI Control Register
0x4328–0x433f ––Reserved
0x4340I2C_ENI2C Enable RegisterEnables the I2C module.
0x4342I2C_CTLI
C Control RegisterControls the I2C operation and indicates
2
C Data RegisterTransmit/receive data
2
C Interrupt Control RegisterControls the I2C interrupt.
Sets the timer mode and starts/stops the timer.
Sets the timer mode and starts/stops the timer.
Sets the timer mode and starts/stops the timer.
Sets the timer mode and starts/stops the timer.
trigger modes.
interrupt levels and trigger modes.
levels and trigger modes.
interrupt levels and trigger modes.
interrupt levels.
Ch. 2 interrupt levels.
rupt levels.
Sets the SPI mode and enables data transfer.
transfer status.
2
C interrupt levels.
3-8
EPSON S1C17704 TECHNICAL MANUAL
Page 39
3 MEMORY MAP, BUS CONTROL
Table 3.5.3.2 I/O Map (Internal Peripheral Area 2)
PeripheralAddressRegister nameFunction
Clock timer
(8-bit device)
Stopwatch
timer
(8-bit device)
Watchdog timer
(8-bit device)
Oscillator
(8-bit device)
Clock generator
(8-bit device)
LCD driver
(8-bit device)
8-bit OSC1
timer
(8-bit device)
SVD circuit
(8-bit device)
Power supply
circuit
(8-bit device)
P port &
port MUX
(8-bit device)
0x5000CT_CTLClock Timer Control RegisterResets and starts/stops the timer.
0x5001CT_CNTClock Timer Counter RegisterCounter data
0x5002CT_IMSKClock Timer Interrupt Mask RegisterEnables/disables interrupt.
0x5003CT_IFLGClock Timer Interrupt Flag RegisterIndicates/resets interrupt occurrence status.
0x5004–0x501f ––Reserved
0x5020SWT_CTLStopwatch Timer Control RegisterResets and starts/stops the timer.
0x5021SWT_BCNTStopwatch Timer BCD Counter RegisterBCD counter data
0x5022SWT_IMSKStopwatch Timer Interrupt Mask RegisterEnables/disables interrupt.
0x5023SWT_IFLGStopwatch Timer Interrupt Flag RegisterIndicates/resets interrupt occurrence status.
0x5024–0x503f ––Reserved
0x5040WDT_CTLWatchdog Timer Control RegisterResets and starts/stops the timer.
0x5041WDT_STWatchdog Timer Status Register
0x5042–0x505f ––Reserved
0x5060OSC_SRCClock Source Select RegisterSelects a clock source.
0x5061OSC_CTLOscillation Control RegisterControls oscillation.
0x5062OSC_NFENNoise Filter Enable RegisterEnables/disables noise filters.
0x5063OSC_LCLKLCD Clock Setup RegisterSets up the LCD clock.
0x5064OSC_FOUTFOUT Control RegisterControls clock output.
0x5065OSC_T8OSC1 T8OSC1 Clock Control RegisterSets up the 8-bit OSC1 timer clock.
0x5066–0x507f ––Reserved
0x5080CLG_PCLKPCLK Control RegisterControls the PCLK output.
0x5081CLG_CCLKCCLK Control RegisterConfigures the CCLK division ratio.
0x5082–0x509f ––Reserved
0x50a0LCD_DCTLLCD Display Control RegisterControls the LCD display.
0x50a1LCD_CADJLCD Contrast Adjust RegisterControls the contrast.
0x50a2LCD_CCTLLCD Clock Control RegisterControls the LCD clock duty.
0x50a3LCD_VREGLCD Voltage Regulator Control RegisterControls the LCD drive voltage regulator.
0x50a4LCD_PWRLCD Power Voltage Booster Control Register Controls the LCD voltage booster.
0x50a5LCD_IMSKLCD Interrupt Mask RegisterEnables/disables interrupt.
0x50a6LCD_IFLGLCD Interrupt Flag RegisterIndicates/resets interrupt occurrence status.
0x50a7–0x50bf ––Reserved
0x50c0T8OSC1_CTL 8-bit OSC1 Timer Control Register
0x50c1T8OSC1_CNT 8-bit OSC1 Timer Counter Data RegisterCounter data
0x50c2T8OSC1_CMP 8-bit OSC1 Timer Compare Data RegisterSets compare data.
0x50c3T8OSC1_IMSK 8-bit OSC1 Timer Interrupt Mask RegisterEnables/disables interrupt.
0x50c4T8OSC1_IFLG 8-bit OSC1 Timer Interrupt Flag RegisterIndicates/resets interrupt occurrence status.
0x50c5–0x50df ––Reserved
0x5100SVD_ENSVD Enable RegisterEnables/disables the SVD operation.
0x5101SVD_CMPSVD Compare Voltage RegisterSets compare voltage.
0x5102SVD_RSLTSVD Detection Result RegisterVoltage detection results
0x5103SVD_IMSKSVD Interrupt Mask RegisterEnables/disables interrupt.
0x5104SVD_IFLGSVD Interrupt Flag RegisterIndicates/resets interrupt occurrence status.
0x5105–0x511f ––Reserved
0x5120VD1_CTLV
0x5121–0x513f ––Reserved
0x5200P0_INP0 Port Input Data RegisterP0 port input data
0x5201P0_OUTP0 Port Output Data RegisterP0 port output data
0x5202P0_IOP0 Port I/O Direction Control RegisterSelects the P0 port I/O direction.
0x5203P0_PUP0 Port Pull-up Control RegisterControls the P0 port pull-up resistor.
0x5204P0_SMP0 Port Schmitt Trigger Control RegisterControls the P0 port Schmitt trigger input.
0x5205P0_IMSKP0 Port Interrupt Mask RegisterEnables/disables the P0 port interrupt.
0x5206P0_EDGEP0 Port Interrupt Edge Select RegisterSelects the signal edge for generating P0
0x5207P0_IFLGP0 Port Interrupt Flag RegisterIndicates/resets the P0 port interrupt occur-
0x5208P0_CHATP0 Port Chattering Filter Control RegisterControls the P0 port chattering filter.
0x5209P0_KRST
0x520a–0x520f ––Reserved
0x5210P1_INP1 Port Input Data RegisterP1 port input data
0x5211P1_OUTP1 Port Output Data RegisterP1 port output data
0x5212P1_IOP1 Port I/O Direction Control RegisterSelects the P1 port I/O direction.
0x5213P1_PUP1 Port Pull-up Control RegisterControls the P1 port pull-up resistor.
0x5214P1_SMP1 Port Schmitt Trigger Control RegisterControls the P1 port Schmitt trigger input.
0x5215P1_IMSKP1 Port Interrupt Mask RegisterEnables/disables the P1 port interrupt.
D1 Control RegisterControls the VD1 voltage and heavy load
P0 Port Key-Entry Reset Configuration Register
Sets the timer mode and indicates NMI status.
Sets the timer mode and starts/stops the timer.
protection mode.
port interrupts.
rence status.
Configures the P0 port key-entry reset function.
S1C17704 TECHNICAL MANUAL EPSON
3-9
Page 40
3 MEMORY MAP, BUS CONTROL
PeripheralAddressRegister nameFunction
P port &
port MUX
(8-bit device)
PWM &
timer
(16-bit device)
MISC register
(8-bit device)
Remote controller
(8-bit device)
0x5216P1_EDGEP1 Port Interrupt Edge Select RegisterSelects the signal edge for generating P1
0x5217P1_IFLGP1 Port Interrupt Flag RegisterIndicates/resets the P1 port interrupt occur-
0x5218–0x521f ––Reserved
0x5220P2_INP2 Port Input Data RegisterP2 port input data
0x5221P2_OUTP2 Port Output Data RegisterP2 port output data
0x5222P2_IOP2 Port I/O Direction Control RegisterSelects the P2 port I/O direction.
0x5223P2_PUP2 Port Pull-up Control RegisterControls the P2 port pull-up resistor.
0x5224P2_SMP2 Port Schmitt Trigger Control RegisterControls the P2 port Schmitt trigger input.
0x5225–0x522f ––Reserved
0x5230P3_INP3 Port Input Data RegisterP3 port input data
0x5231P3_OUTP3 Port Output Data RegisterP3 port output data
0x5232P3_IOP3 Port I/O Direction Control RegisterSelects the P3 port I/O direction.
0x5233P3_PUP3 Port Pull-up Control RegisterControls the P3 port pull-up resistor.
0x5234P3_SMP3 Port Schmitt Trigger Control RegisterControls the P3 port Schmitt trigger input.
0x5235–0x527f ––Reserved
0x52a0P0_PMUXP0 Port Function Select RegisterSelects the P0 port function.
0x52a1P1_PMUXP1 Port Function Select RegisterSelects the P1 port function.
0x52a2P2_PMUXP2 Port Function Select RegisterSelects the P2 port function.
0x52a3P3_PMUXP3 Port Function Select RegisterSelects the P3 port function.
0x52a4–0x52bf ––Reserved
capture
0x5300T16E_CAPWM Timer Compare Data A RegisterSets compare data A.
0x5302T16E_CBPWM Timer Compare Data B RegisterSets compare data B.
0x5304T16E_TCPWM Timer Counter Data RegisterCounter data
0x5306T16E_CTLPWM Timer Control Register
0x5308T16E_CLKPWM Timer Input Clock Select RegisterSelects a prescaler output clock.
0x530aT16E_IMSKPWM Timer Interrupt Mask RegisterEnables/disables interrupt.
0x530cT16E_IFLGPWM Timer Interrupt Flag RegisterIndicates/resets interrupt occurrence status.
0x530e–0x531f ––Reserved
0x5320MISC_FLFLASHC Control RegisterSets FLASHC access condition.
0x5321MISC_SRSRAMC Control RegisterSets SRAMC access condition.
0x5322MISC_OSC1OSC1 Peripheral Control RegisterSelects the OSC1 peripheral operation in
0x5323–0x533f ––Reserved
0x5340REMC_CFGREMC Configuration RegisterSelects/enables transmission/reception
0x5341REMC_PSCREMC Prescaler Clock Select RegisterSelects a prescaler output clock.
0x5342REMC_CARH REMC H Carrier Length Setup RegisterSets up the H period of the carrier.
0x5343REMC_CARL REMC L Carrier Length Setup RegisterSets up the L period of the carrier.
0x5344REMC_STREMC Status RegisterTransmit/receive bit
0x5345REMC_LCNT REMC Length Counter RegisterSets the transmit/receive data length.
0x5346REMC_IMSK REMC Interrupt Mask RegisterEnables/disables interrupt.
0x5347REMC_IFLGREMC Interrupt Flag RegisterIndicates/resets interrupt occurrence status.
0x5348–0x535f ––Reserved
port interrupts.
rence status.
Sets the timer mode and starts/stops the timer.
debug mode.
Note: Do not access the “Reserved” address in the table above and unused areas in the peripheral area
that are not described in the table from the application program.
3-10
EPSON S1C17704 TECHNICAL MANUAL
Page 41
3 MEMORY MAP, BUS CONTROL
3.6 S1C17 Core I/O Area
The 1K-byte area from address 0xfffc00 to address 0xffffff is the I/O area for the CPU core in which the I/O
registers listed in the table below are located.
Table 3.6.1 I/O Map (S1C17 Core I/O Area)
PeripheralAddressRegister nameFunction
S1C17 Core I/O 0xffff80TTBRVector Table Base RegisterIndicates the vector table base address.
See Section 2.4, “Vector Table,” and Section 2.5, “Processor Information,” for TTBR and IDIR, respectively. For
DBRAM, see Chapter 24, “On-chip Debugger (DBG).”
0xffff84IDIRProcessor ID RegisterIndicates the processor ID.
0xffff90DBRAMDebug RAM Base RegisterIndicates the debug RAM base address.
S1C17704 TECHNICAL MANUAL EPSON
3-11
Page 42
3 MEMORY MAP, BUS CONTROL
THIS PAGE IS BLANK.
3-12
EPSON S1C17704 TECHNICAL MANUAL
Page 43
4 Power Supply
4.1 Power Supply Voltage
The operating voltage range of the S1C17704 is as follows:
For normal operation: 1.8 V to 3.6 V
For Flash programming: 2.7 V to 3.6 V
4 POWER SUPPLY
Supply a voltage within the range to the V
V
DD pins and three VSS pins. Do not leave any pins open and be sure to connect them to + power source and GND.
DD pins with the VSS pins as the GND level. The S1C17704 provides two
S1C17704 TECHNICAL MANUAL EPSON
4-1
Page 44
4 POWER SUPPLY
4.2 Internal Power Supply Circuit
The S1C17704 has a built-in power supply circuit shown in Figure 4.2.1 to generate all the power voltages required
for the internal circuits. The power supply module consists of three circuits.
Table 4.2.1 Power Supply Circuit
CircuitPower supply circuitOutput voltage
Oscillator and internal logic circuits Internal logic voltage regulatorVD1
LCD system voltage regulatorPower voltage boosterVDD or VD2
LCD driverLCD system voltage regulatorVC1 to VC5
External
power
supply
VDD
VD1
VD2
CF
CG
VC1
VC2
VC3
VC4
VC5
CA
CB
CC
CD
CE
VSS
VD1MD
Internal logic
voltage regulator
Power
voltage booster
LCD system
voltage regulator
HVLD
VD2VDD
VD1
VC1~VC5
PBON
VDSEL
LHVLD
Oscillation circuit
Internal circuit
LCD driver
OSC1, OSC2
OSC3, OSC4
COM0–COM31
SEG0–SEG55
Figure 4.2.1 Configuration of Power Supply Circuit
Note: Be sure to avoid using the VD1, VD2, and VC1–VC5 pin outputs to drive external circuits.
Internal logic voltage regulator
The internal logic voltage regulator generates the VD1 operating voltage for the internal logic circuits and
oscillators. The V
V for Flash programming.
D1 voltage value can be switched in the program; set it to 1.8 V for normal operation and 2.5
Power voltage booster
The power voltage booster generates the VD2 operating voltage for the LCD system voltage regulator. Either
V
DD or VD2 can be selected as the power source for the LCD system voltage regulator according to the VDD
supply voltage value.
Table 4.2.2 Power Source for LCD System Voltage Regulator
Power supply voltage VDDPower source for the LCD system voltage regulator
1.8 to 2.5 VVD2 (≅ VDD× 2)
2.5 to 3.6 VV
DD
LCD system voltage regulator
The LCD system voltage regulator generates the 1/5-bias LCD drive voltages VC1, VC2, VC3, VC4, and VC5.
In the S1C17704, the LCD drive voltage is supplied to the built-in LCD driver that drives the LCD panel
connected to the SEG and COM pins.
Note: If V
4-2
EPSON S1C17704 TECHNICAL MANUAL
DD is used as the power source for the LCD system voltage regulator when VDD is 2.5 V or
less, the V
C1 to VC5 voltages cannot be generated within the specifications.
Page 45
4 POWER SUPPLY
4.3 Controlling the Power Supply Circuit
In order to generate the internal operating voltage properly according to the power supply voltage and operating
mode, or to reduce current consumption, the power supply circuit is designed to be controlled with software.
Switching the operating mode
The S1C17704 has two kinds of operating modes.
1. Normal operation mode
This mode is provided for running the application program.
V
DD = 1.8 to 3.6 V, internal operating voltage VD1 = 1.8 V
2. Flash erase/program mode
This mode is provided for erasing and programming the Flash memory.
V
DD = 2.7 to 3.6 V, internal operating voltage VD1 = 2.5 V
The V
Note: When the operating mode is switched, the internal operating voltage requires 5 ms (max.) to
D1 voltage value must be switched according to the operating mode as shown above using the VD1MD bit
(D0/VD1_CTL register). Normally set VD1MD to 0 (V
D1 = 1.8 V, default setting). It should be set to 1 before
erasing/programming the Flash memory.
∗VD1MD: Flash Erase/Program Mode Bit in the VD1 Control (VD1_CTL) Register (D0/0x5120)
stabilize. Flash memory programming should be started after the stabilization time has elapsed.
Controlling the LCD power source
The LCD system voltage regulator must be driven with a 2.5 V or more power voltage to generate appropriate
LCD drive voltages V
use the power voltage booster to generate double the V
with the V
D2 output voltage. Set the PBON bit (D0/LCD_PWR register) to 1 to turn the power voltage booster
on. In addition, set the VDSEL bit (D1/LCD_PWR register) to 1 to drive the LCD system voltage regulator
with the V
D2 voltage output from the power voltage booster. PBON must be set to 1 before the drive voltage can
be switched to V
∗ PBON: Power Voltage Booster Control Bit in the LCD Power Voltage Booster Control (LCD_PWR) Register
∗ VDSEL: Regulator Power Source Select Bit in the LCD Power Voltage Booster Control (LCD_PWR) Register
When the power supply voltage (VDD) is 2.5 V or more, drive the LCD system voltage regulator with VDD. The
power voltage booster should be turned off to reduce current consumption. In this case, PBON and VDSEL are
both set to 0 (default).
Note: When the power voltage booster is turned on, the V
stabilize. Do not switch the power source for the LCD system voltage regulator to V
stabilization time has elapsed.
The LCD drive voltages V
LCD_DCTL register) to a value other than 0x0 (display off).
∗ DSPC[1:0]: LCD Display Control Bits in the LCD Display Control (LCD_DCTL) Register (D[1:0]/0x50a0)
When the internal LCD driver is not used, the power voltage booster and LCD system voltage regulator should
be turned off to reduce current consumption. Set PBON, VDSEL, and DSPC[1:0] to 0 (default).
C1 to VC5. When the power supply voltage (VDD) is within the range from 1.8 V to 2.5 V,
DD voltage and drive the LCD system voltage regulator
D2.
(D0/0x50a4)
(D1/0x50a4)
D2 output voltage requires about 1 ms to
D2 until the
C1 to VC5 will be supplied to the LCD driver by setting the DSPC[1:0] bits (D[1:0]/
S1C17704 TECHNICAL MANUAL EPSON
4-3
Page 46
4 POWER SUPPLY
Power control bit settings
Table 4.3.1 lists the power control bit settings in different operating conditions.
Table 4.3.1 Power Control Bit Settings
ConditionControl bits
Operating modeV
Normal
operation
Flash erase/
program
For the DSPC[1:0] settings, see “0x50a0: LCD Display Control Register (LCD_DCTL)” in Section 22.8.
DDLCD driverVD1MDPBONVDSELDSPC[1:0]
1.8 to 2.5 VUsed011Other than 0x0
2.5 to 3.6 VUsed000Other than 0x0
1.8 to 3.6 VNot used0000x0
1.8 to 2.7 V–(use prohibited)
2.7 to 3.6 VUsed100Other than 0x0
2.7 to 3.6 VNot used1000x0
4-4
EPSON S1C17704 TECHNICAL MANUAL
Page 47
4 POWER SUPPLY
4.4 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 logic voltage regulator and the LCD system voltage regulator have a heavy
load protection function.
The internal logic voltage regulator enters heavy load protection mode by writing 1 to the HVLD bit (D4/VD1_CTL
register) and it ensures stable V
or buzzer is driven with a port output.
∗ HVLD: VD1 Heavy Load Protection Mode Bit in the VD1 Control (VD1_CTL) Register (D4/0x5120)
The LCD system voltage regulator enters heavy load protection mode by writing 1 to the LHVLD bit (D4/
LCD_VREG register) and it ensures stable V
display has inconsistencies in density.
∗LHVLD: LCD Heavy Load Protection Mode Bit in the LCD Voltage Regulator Control (LCD_VREG) Register
(D4/0x50a3)
Note: Current consumption increases in heavy load protection mode, therefore do not set heavy load
protection mode with software if unnecessary.
D1 output. Use the heavy load protection function when a heavy load such as a lamp
C1–VC5 outputs. Use the heavy load protection function when the LCD
S1C17704 TECHNICAL MANUAL EPSON
4-5
Page 48
4 POWER SUPPLY
4.5 Details of Control Registers
Table 4.5.1 List of Power Control Registers
AddressRegister nameFunction
0x5120VD1_CTLVD1 Control RegisterControls the VD1 voltage and heavy load protection mode.
0x50a3LCD_VREG LCD Voltage Regulator Control RegisterControls the LCD drive voltage regulator.
0x50a4LCD_PWR LCD Power Voltage Booster Control RegisterControls the LCD voltage booster.
The following describes each power control register. These are all 8-bit registers.
Note: When setting the registers, be sure to write a 0, and not a 1, for all “reserved bits.”
4-6
EPSON S1C17704 TECHNICAL MANUAL
Page 49
4 POWER SUPPLY
0x5120: VD1 Control Register (VD1_CTL)
Register name AddressBitNameFunctionSettingInit. R/WRemarks
V
D1 Control
Register
(VD1_CTL)
D[7:5] Reserved
D4 HVLD: V
Sets the internal logic voltage regulator into heavy load protection mode.
1 (R/W): Heavy load protection On
0 (R/W): Heavy load protection Off (default)
The internal logic voltage regulator enters heavy load protection mode by writing 1 to HVLD and it
D[3:1] Reserved
D0 VD1MD: Flash Erase/Program Mode Bit
Selects the V
1 (R/W): V
0 (R/W): V
0x5120
(8 bits)
ensures stable V
–
D7–5
HVLD
D4
–
D3–1
VD1MD
D0
D1 Heavy Load Protection Mode Bit
D1 output. Use the heavy load protection function when a heavy load such as a lamp
reserved––– 0 when being read.
D1 heavy load protection mode1 On0 Off0 R/W
V
reserved––– 0 when being read.
Flash erase/program mode1
Flash (2.5 V)0Norm.(1.8 V)
0 R/W
or buzzer is driven with a port output. Current consumption increases in heavy load protection mode,
therefore do not set if unnecessary.
D1 internal operating voltage value (operating mode).
D1 = 2.5 V, Flash erase/program mode
D1 = 1.8 V, Normal operation mode (default)
Normally set VD1MD to 0 (VD1 = 1.8 V, default setting). It should be set to 1 before erasing/
programming the Flash memory.
Note: When the operating mode is switched, the internal operating voltage requires 5 ms (max.)
to stabilize. Flash memory programming should be started after the stabilization time has
elapsed.
S1C17704 TECHNICAL MANUAL EPSON
4-7
Page 50
4 POWER SUPPLY
0x50a3: LCD Voltage Regulator Control Register (LCD_VREG)
Register name AddressBitNameFunctionSettingInit. R/WRemarks
LCD Voltage
Regulator
Control Register
(LCD_VREG)
D[7:5] Reserved
D4 LHVLD: LCD Heavy Load Protection Mode Bit
Sets the LCD system voltage regulator into heavy load protection mode.
1 (R/W): Heavy load protection On
0 (R/W): Heavy load protection Off (default)
The LCD system voltage regulator enters heavy load protection mode by writing 1 to LHVLD and it
D[3:0] Reserved
0x50a3
(8 bits)
ensures stable V
–
D7–5
LHVLD
D4
–
D3–0
C1–VC5 outputs. Use the heavy load protection function when the LCD display has
reserved––– 0 when being read.
LCD heavy load protection mode
reserved––– 0 when being read.
1 On0 Off0 R/W
inconsistencies in density. Current consumption increases in heavy load protection mode, therefore do
not set if unnecessary.
4-8
EPSON S1C17704 TECHNICAL MANUAL
Page 51
4 POWER SUPPLY
0x50a4: LCD Power Voltage Booster Control Register (LCD_PWR)
Register name AddressBitNameFunctionSettingInit. R/WRemarks
LCD Power
Voltage Booster
Control Register
(LCD_PWR)
D[7:2] Reserved
D1 VDSEL: Regulator Power Source Select Bit
Selects the power source voltage for the LCD system voltage regulator.
1 (R/W): VD2
0 (R/W): VDD (default)
When the power supply voltage (V
When the power supply voltage (V
D0 PBON: Power Voltage Booster Control Bit
Controls the power voltage booster.
1 (R/W): On
0 (R/W): Off (default)
0x50a4
(8 bits)
drive the LCD system voltage regulator with the V
D7–2
D1
D0
–
VDSEL
PBON
reserved––– 0 when being read.
Regulator power source select
Power voltage booster control1 On0 Off0 R/W
DD) is within the range from 1.8 V to 2.5 V, write 1 to VDSEL to
1VD20VDD0 R/W
D2 voltage output from the power voltage booster.
Before this setting though, write 1 to PBON (D0) to turn the power voltage booster on.
DD) is 2.5 V or more, write 0 to VDSEL to drive the LCD system
voltage regulator with V
DD. In this case, the power voltage booster should be turned off to reduce
current consumption.
When the power supply voltage (V
the power voltage booster on. The power voltage booster doubles the V
DD) is within the range from 1.8 V to 2.5 V, write 1 to PBON to turn
DD voltage to generate VD2 for
driving the LCD system voltage regulator. In addition, set VDSEL (D1) to 1 to drive the LCD system
voltage regulator with V
D2. It is not necessary to generate VD2 when the power supply voltage (VDD) is 2.5
V or more. In this case, the power voltage booster should be turned off to reduce current consumption.
Note: When the power voltage booster is turned on, the V
D2 output voltage requires about 1 ms to
stabilize. Do not switch the power source for the LCD system voltage regulator to V
stabilization time has elapsed.
D2 until the
S1C17704 TECHNICAL MANUAL EPSON
4-9
Page 52
4 POWER SUPPLY
4.6 Precautions
• Be sure to avoid using the VD1, VD2, and VC1–VC5 pin outputs to drive external circuits.
DD is used as the power source for the LCD system voltage regulator when VDD is 2.5 V or less, the VC1 to
• If V
V
C5 voltages cannot be generated within the specifications.
• When the operating mode is switched, the internal operating voltage requires 5 ms (max.) to stabilize. Flash
memory programming should be started after the stabilization time has elapsed.
• When the power voltage booster is turned on, the V
switch the power source for the LCD system voltage regulator to V
D2 output voltage requires about 1 ms to stabilize. Do not
D2 until the stabilization time has elapsed.
• Current consumption increases in heavy load protection mode, therefore do not set heavy load protection mode
with software if unnecessary.
4-10
EPSON S1C17704 TECHNICAL MANUAL
Page 53
5 Initial Reset
5.1 Initial Reset Sources
The S1C17704 has three initial reset sources that initialize the internal circuits.
Figure 5.1.1 shows the configuration of the initial reset circuit.
Oscillator
stabilization
wait circuit
#RESET
SRQ
5 INITIAL RESET
Internal reset
P00
P01
P02
P03
Chattering filter
Key-entry reset
control circuit
P0KRST
Watchdog
timer
WDTMD
Figure 5.1.1 Configuration of Initial Reset Circuit
Digital
noise filter
The CPU and peripheral circuits are initialized by the active signal from an initial reset source. When the reset
signal is negated, the CPU starts reset handling. The reset handling reads the reset vector (reset handler start
address) from the beginning of the vector table and starts executing the program (initial routine) beginning with the
read address.
5.1.1 #RESET Pin
By setting the #RESET pin to low level, the S1C17704 enters initial reset state. In order to initialize the
S1C17704 for sure, the #RESET pin must be held at low for more than the prescribed time (see Section 26.6, “AC
Characteristics”) after the power supply voltage is supplied.
Initial reset state is canceled when the #RESET pin at low level is set to high level and the CPU starts executing the
reset interrupt handler.
The #RESET pin is equipped with a pull-up resistor.
S1C17704 TECHNICAL MANUAL EPSON
5-1
Page 54
5 INITIAL RESET
5.1.2 P0 Port Key-Entry Reset
Entering low level simultaneously to the ports (P00–P03) selected with software triggers an initial reset. The ports
used for the reset function can be selected with the P0KRST[1:0] bits (D[1:0]/P0_KRST register).
∗ P0KRST[1:0]: P0 Port Key-Entry Reset Configuration Bits in the P0 Port Key-Entry Reset Configuration
For example, if P0KRST[1:0] is set to 0x3, an initial reset will take place when the four ports P00–P03 are set to
low level at the same time.
Notes: • When using the P0 port key-entry reset function, make sure that the designated input ports
will not be simultaneously set to low level while the application program is running.
• The P0 port key-entry reset function cannot be used for power-on reset as it must be enabled
with software.
• The P0 port key-entry reset function cannot be used in SLEEP mode.
(P0_KRST) Register (D[1:0]/0x5209)
Table 5.1.2.1 Configuration of P0 Port Key-Entry Reset
The S1C17704 has a built-in watchdog timer to detect runaway of the CPU. The watchdog timer overflows if it is
not reset with software (due to CPU runaway) in four-second cycles. The overflow signal can generate either NMI
or reset. Write 1 to the WDTMD bit (D1/WDT_ST register) to generate reset (NMI occurs when WDTMD = 0).
∗ WDTMD: NMI/Reset Mode Select Bit in the Watchdog Timer Status (WDT_ST) Register (D1/0x5041)
For details of the watchdog timer, see Chapter 17, “Watchdog Timer (WDT).”
Notes: • When using the reset function of the watchdog timer, program the watchdog timer so that it
will be reset within four-second cycles to avoid occurrence of an unnecessary reset.
• The reset function of the watchdog timer cannot be used for power-on reset as it must be
enabled with software.
5-2
EPSON S1C17704 TECHNICAL MANUAL
Page 55
5 INITIAL RESET
5.2 Initial Reset Sequence
Even if the #RESET pin input negates the reset signal after power is turned on, the CPU cannot boot up until the
oscillation stabilization waiting time (1024/f
Figure 5.2.1 shows the operating sequence following cancellation of initial reset.
The CPU starts operating in synchronization with the OSC3 clock after reset state is canceled.
∗ f
OSC3: OSC3 clock frequency
Note: The oscillation stabilization time described in this section does not include oscillation start time.
Therefore the time interval until the CPU starts executing instructions after power is turned on or
SLEEP mode is canceled may be longer than that indicated in the figure below.
OSC3 clock
OSC3 seconds*) has elapsed.
#RESET
Internal reset
Internal data request
Internal data address
Figure 5.2.1 Operation Sequence Following Cancellation of Initial Reset
Reset canceled
Oscillation stabilization
waiting time
Internal reset canceled
Boot vector
Booting
S1C17704 TECHNICAL MANUAL EPSON
5-3
Page 56
5 INITIAL RESET
5.3 Initial Settings After an Initial Reset
The CPU internal registers are initialized as follows at initial reset.
R0–R7: 0x0
PSR: 0x0 (interrupt level = 0, interrupt disabled)
SP: 0x0
PC: Reset vector stored at the beginning of the vector table is loaded by the reset handling.
The internal RAM and display memory should be initialized with software as they are not initialized at initial reset.
The internal peripheral modules are initialized to the default values (except some undefined registers). Change the
settings with software if necessary. For the default values set at initial reset, see the list of I/O registers in Appendix
or descriptions for each peripheral module.
5-4
EPSON S1C17704 TECHNICAL MANUAL
Page 57
6 INTERRUPT CONTROLLER (ITC)
6 Interrupt Controller (ITC)
6.1 Configuration of ITC
The S1C17704 provides 16 interrupt systems listed below.
1. P00–P07 input interrupt (8 types)
2. P10–P17 input interrupt (8 types)
3. Stopwatch timer interrupt (3 types)
4. Clock timer interrupt (4 types)
5. 8-bit OSC1 timer interrupt (1 type)
6. SVD interrupt (1 type)
7. LCD interrupt (1 type)
8. PWM & capture timer interrupt (2 types)
9. 8-bit timer interrupt (1 type)
10. 16-bit timer Ch.0 interrupt (1 type)
11. 16-bit timer Ch.1 interrupt (1 type)
12. 16-bit timer Ch.2 interrupt (1 type)
13. UART interrupt (3 types)
14. Remote controller interrupt (3 types)
15. SPI interrupt (2 types)
2
16. I
C interrupt (2 types)
Each interrupt system provides an interrupt flag that indicates the occurrence of an interrupt request from the
peripheral module and an interrupt enable bit that enables/disables interrupts. In addition, the ITC allows the
application program to set the interrupt level (priority) of each interrupt system that determines the order of
handling when two or more interrupts occur at the same time.
( ) in the list above represents the number of interrupt causes supported in each interrupt system. Use the control
register in the peripheral module to select the interrupt causes for generating an interrupt request. For more
information on interrupt causes and control, see the description for each peripheral module.
Figure 6.1.1 shows the structure of the interrupt system.
S1C17 Core
Interrupt
request
Interrupt
level
Vector
number
NMI
Interrupt controller
Interrupt
control
Watchdog timer
Debug signal
Reset signal
Interrupt
Interrupt flag
Interrupt enable bit
Interrupt level
Vector number
• • • • •
Interrupt flag
Interrupt enable bit
Interrupt level
Vector number
request
Interrupt
request
Figure 6.1.1 Interrupt System
Peripheral module
• •
Peripheral module
• •
Interrupt flag
Interrupt enable
Interrupt flag
Interrupt enable
• • • • • • •
Interrupt flag
Interrupt enable
Interrupt flag
Interrupt enable
Cause of
interrupt 1
Cause of
interrupt n
Cause of
interrupt 1
Cause of
interrupt n
S1C17704 TECHNICAL MANUAL EPSON
6-1
Page 58
6 INTERRUPT CONTROLLER (ITC)
6.2 Vector Table
The vector table contains the vectors to the interrupt handler routines (handler routine start address) that will be
read by the S1C17 Core to execute the handler when an interrupt occurs.
The vector table is located at address 0x8000 in the S1C17704. The vector table base address can be read out from
TTBR (Vector Table Base Register) located at address 0xffff80.
Table 6.2.1 shows the vector table of the S1C17704.
–(0xfffc00)Debugging interrupt
2 (0x02)0x8008NMIWatchdog timer overfl ow
3 (0x03)0x800creserved––
4 (0x04)0x8010P0 port interruptP00–P07 port inputs High
5 (0x05)0x8014P1 port interruptP10–P17 port inputs↑
6 (0x06)0x8018Stopwatch timer interrupt• 100 Hz timer signal
7 (0x07)0x801cClock timer interrupt• 32 Hz timer signal
8 (0x08)0x80208-bit OSC1 timer interruptCompare match
9 (0x09)0x8024SVD interruptLow supply voltage detected
10 (0x0a)0x8028LCD interruptFrame signal
11 (0x0b)0x802cPWM & capture timer interrupt• Compare match A
∗1 When the same interrupt level is set
∗2 Either reset or NMI can be selected as the watchdog timer interrupt with software.
Vector numbers 4 to 19 are assigned to the maskable interrupts supported by the S1C17704.
Vector addressHardware interrupt nameCause of hardware interruptPriority
• Watchdog timer overfl ow
brk
instruction, etc.3
• 10 Hz timer signal
• 1 Hz timer signal
• 8 Hz timer signal
• 2 Hz timer signal
• 1 Hz timer signal
• Compare match B
• Receive buffer full
• Receive error
• Input rising edge detected
• Input falling edge detected
2
C interrupt• Transmit buffer empty
• Receive buffer full
• Receive buffer full
∗2
∗2
1
4
1
∗
1
∗
6-2
EPSON S1C17704 TECHNICAL MANUAL
Page 59
6 INTERRUPT CONTROLLER (ITC)
6.3 Control of Maskable Interrupts
6.3.1 Enabling ITC
Before the ITC can be used, set the ITEN bit (D0/ITC_CTL register) to 1.
∗ ITEN: ITC Enable Bit in the ITC Control (ITC_CTL) Register (D0/0x4304)
6.3.2 Interrupt Request from Peripheral Module and Interrupt Flag
When an enabled interrupt cause occurs in a peripheral module, the module sends an interrupt request signal to the
ITC. The interrupt request signal sets the interrupt flag in the ITC corresponding to the cause of interrupt to 1. The
interrupt flag holds 1 until it is reset to 0 to indicate that an interrupt request has sent from the peripheral module.
The flag status can be read from the ITC_IFLG register (0x4300).
Table 6.3.2.1 lists the relationship between the causes of interrupt and the interrupt flags.
Table 6.3.2.1 Causes of Hardware Interrupt and Interrupt Flags
Vector No.Cause of hardware interruptInterrupt flag
4P0 port interrupt: P00–P07 port inputsEIFT0 (D0/ITC_IFLG register)
5P1 port interrupt: P10–P17 port inputsEIFT1 (D1/ITC_IFLG register)
The ITC uses the interrupt flags to generate an interrupt to the S1C17 Core.
When an interrupt flag is set to 1, the ITC sends the interrupt request, interrupt level and vector number signals to
the S1C17 Core if the interrupt has been enabled (see the next section).
The interrupt flag that has been set to 1 can be reset by writing 1. Reset the interrupt flag to 0 in the interrupt
handler. If the interrupt handler does not reset the interrupt flag, the same interrupt will be generated again when
the interrupt handling has finished (interrupts are disabled during interrupt handling and enabled by executing the
reti instruction placed at the end of the interrupt handler).
Note, however, that the interrupt flags (EIFT0–EIFT7) for the level triggered interrupts (see Section 6.3.5) cannot
be reset by writing 1. Those interrupt flags are reset when the interrupt signal is negated by the interrupt source.
For the occurrence conditions of the causes of interrupt and the module specific settings, refer to the section that
describes the interrupt source module.
S1C17704 TECHNICAL MANUAL EPSON
6-3
Page 60
6 INTERRUPT CONTROLLER (ITC)
6.3.3 Enabling/Disabling Interrupts
To send an interrupt request to the S1C17 Core, the interrupt must be enabled one by one using the interrupt enable
bit in the ITC_EN register (0x4302) corresponding to the interrupt flag. To enable an interrupt, set the interrupt
enable bit to 1; to disable an interrupt, set the interrupt enable bit to 0 (default). The interrupt enable bit does not
affect the interrupt flag status, so the interrupt flag will be set when an interrupt request from the peripheral module
occurs regardless of how the interrupt enable bit is set.
Table 6.3.3.1 lists the correspondence between the interrupt enable bit and the interrupt flag.
Table 6.3.3.1 List of Interrupt Enable Bits
Vector No.Hardware interruptInterrupt flagInterrupt enable bit
Notes: • To avoid unexpected interrupts being generated, always be sure to reset the interrupt flag
before enabling the interrupt by writing 1 to the interrupt enable bit.
• In addition to the interrupt enable bit, the IE bit of the Processor Status Register (PSR) in the
S1C17 Core must be set to 1 to actually generate an interrupt. If the IE bit has been set to 0,
the S1C17 Core cannot accept a maskable interrupt request. In this case, the interrupt request
sent from the ITC is held and it will be accepted after the IE bit is set to 1.
6-4
EPSON S1C17704 TECHNICAL MANUAL
Page 61
6 INTERRUPT CONTROLLER (ITC)
6.3.4 Processing when Multiple Interrupts Occur
The ITC provides the ITC_ELVx and ITC_ILVx registers (0x4306 to 0x4314) to set an interrupt level (zero to
seven) for each cause of interrupt.
C interruptIILV7[2:0] (D[10:8]/ITC_ILV3 register)0x4314
The highest interrupt level is 7 and the lowest is 0.
The set interrupt level is sent to the S1C17 Core at the same time the ITC sends an interrupt request and is used by
the S1C17 Core to disable subsequent interrupts that have the same or a lower interrupt level. (See Section 6.3.6 for
more information.)
At initial reset, the interrupt levels are all set to 0. The S1C17 Core does not accept an interrupt request whose
interrupt level is set to 0.
IILV4[2:0] (D[2:0]/ITC_ILV2 register)0x4312
In the ITC, the interrupt level is used when two or more causes of interrupt occur simultaneously.
If two or more causes of interrupt that have been enabled by the interrupt enable bits occur simultaneously, the
cause of interrupt whose ITC_ELVx or ITC_ILVx register contains the highest value is allowed by the ITC to send
an interrupt request to the S1C17 Core.
If two or more causes of interrupt that have the same interrupt level occur, the interrupt with the smallest vector
number is processed first.
Other causes of interrupt are kept pending until all interrupts of higher priority are accepted by the S1C17 Core.
If another cause of interrupt of higher priority occurs during outputting an interrupt request signal, the ITC changes
the vector number and interrupt level to that of the new cause of interrupt. The first interrupt request is left pending.
S1C17704 TECHNICAL MANUAL EPSON
6-5
Page 62
6 INTERRUPT CONTROLLER (ITC)
6.3.5 Interrupt Trigger Mode
The ITC provides two trigger modes, the pulse trigger mode and the level trigger mode, to accept either a pulse
signal or a level signal as interrupt requests from the interrupt sources that set EIFT flags.
The trigger mode can be selected using the EITGx bit in the
set to 1, level trigger mode is selected; when EITGx is set to 0 (default), pulse trigger mode is selected.
Note: Set all EITGx bits to 1 (level trigger mode) in the S1C17704.
The interrupt source modules that set the IIFT flags output only a pulse signal to the ITC to request an interrupt,
therefore, no trigger mode select bit is provided.
Pulse trigger mode
In pulse trigger mode, the ITC samples interrupt signals at the rising edge of the system clock. When a high
pulse is sampled, the ITC sets the interrupt flag (IIFTx) to 1 and stops sampling of that interrupt signal. The
ITC resumes the sampling operation for the interrupt signal after the interrupt flag (IIFTx) is reset to 0 in the
application program (interrupt handler).
ITC_ELVx
registers (0x4
306 to 0x430c). When EITGx is
pclk
Interrupt signal
from an interrupt source
Interrupt flag in ITC
The software writes 1 to the interrupt flag to reset.
Figure 6.3.5.1 Pulse Trigger Mode
Note: The following S1C17704 interrupts use pulse trigger mode. When an interrupt occurs, reset (write
1 to) the interrupt flag IIFTx in the interrupt handler routine.
• 8-bit timer interrupt
• 16-bit timer Ch.0 interrupt
• 16-bit timer Ch.1 interrupt
• 16-bit timer Ch.2 interrupt
• UART interrupt
• Remote controller interrupt
• SPI interrupt
• I
2
C interrupt
6-6
EPSON S1C17704 TECHNICAL MANUAL
Page 63
6 INTERRUPT CONTROLLER (ITC)
Level trigger mode
In level trigger mode, the ITC continuously samples interrupt signals at every rising edge of the system clock.
The interrupt flag (EIFTx) is set to 1 when a high level is sampled and is reset to 0 when a low level is sampled.
In this mode, writing 1 cannot reset the interrupt flag (EIFTx). Therefore, the interrupt source module must hold
the interrupt signal to high until the S1C17 Core accepts the interrupt request and must reset the interrupt signal
after that.
pclk
Interrupt signal
from an interrupt source
Interrupt flag in ITC
The interrupt source negates the interrupt signal.
Figure 6.3.5.2 Level Trigger Mode
Note: The following S1C17704 interrupts use level trigger mode. The interrupt handler routine must
reset (write 1 to) the interrupt flag provided in the peripheral module, not EIFTx.
• P0 port interrupt
• P1 port interrupt
• Stopwatch timer interrupt
• Clock timer interrupt
• 8-bit OSC1 timer interrupt
• SVD interrupt
• LCD interrupt
• PWM & capture timer interrupt
For the interrupt flag to be reset, see the description for each peripheral module.
S1C17704 TECHNICAL MANUAL EPSON
6-7
Page 64
6 INTERRUPT CONTROLLER (ITC)
6.3.6 Interrupt Processing by the S1C17 Core
A maskable interrupt to the S1C17 Core occurs when all of the conditions described below are met.
• The ITEN bit (D0/ITC_CTL register) is set to 1.
∗ ITEN: ITC Enable Bit in the ITC Control (ITC_CTL) Register (D0/0x4304)
• The interrupt enable bit for the cause of interrupt that has occurred is set to 1.
• The IE (Interrupt Enable) bit of the PSR (Processor Status Register) in the S1C17 Core is set to 1.
• The cause of interrupt that has occurred has a higher interrupt level than the value that is set in the IL field of the
PSR.
• No other cause of interrupt having higher priority, such as NMI, has occurred.
When a cause of interrupt occurs, the corresponding interrupt flag is set to 1 and the flag remains set until it is reset
in the software program or by the hardware for a level triggered interrupt. Therefore, in no cases can the generated
cause of interrupt be inadvertently cleared even if the above conditions are not met when the cause of interrupt has
occurred. The interrupt will occur when the above conditions are met.
If two or more maskable causes of interrupt occur simultaneously, the cause of interrupt that has the highest priority
is allowed to signal an interrupt request to the S1C17 Core. The other interrupts with lower priorities are kept
pending until the above conditions are met.
The S1C17 Core keeps sampling interrupt requests every cycle. When the S1C17 Core accepts an interrupt request,
it enters interrupt processing after completing execution of the instruction that was being executed.
The following lists the contents executed in interrupt processing.
(1) The PSR and the current program counter (PC) value are saved to the stack.
(2) The IE bit of the PSR is reset to 0 (following maskable interrupts are disabled).
(3) The IL of the PSR is set to the interrupt level of the accepted interrupt (NMI does not change the interrupt
level).
(4) The vector of the interrupt occurred is loaded into the PC, thus executing the interrupt handler routine.
Thus, once an interrupt is accepted, all maskable interrupts that may follow are disabled in (2). Multiple interrupts
can also be handled by setting the IE bit to 1 in the interrupt handler routine. In this case, since the IL has been
changed in (3), only an interrupt that has a higher level than that of the currently processed interrupt is accepted.
When the interrupt handler routine is terminated by the reti instruction, the PSR is restored to its previous status
before the interrupt has occurred. The program restarts processing after branching to the instruction next to the one
that was being executed when the interrupt occurred.
6-8
EPSON S1C17704 TECHNICAL MANUAL
Page 65
6 INTERRUPT CONTROLLER (ITC)
6.4 NMI
In the S1C17704, the watchdog timer generates a non-maskable interrupt (NMI). The vector number of NMI is 2,
with the vector address set to the vector table's starting address + 8 bytes.
This interrupt is prioritized over other interrupts and is unconditionally accepted by the S1C17 Core.
For how to generate NMI, see Chapter 17, “Watchdog Timer (WDT).”
S1C17704 TECHNICAL MANUAL EPSON
6-9
Page 66
6 INTERRUPT CONTROLLER (ITC)
6.5 Software Interrupts
The S1C17 Core provides the int imm5 and intl imm5,imm3 instructions allowing the software to generate
any interrupts. The operand imm5 specifies a vector number (0–31) in the vector table. In addition to this, the intl
instruction has the operand imm3 to specify the interrupt level (0–7) to be set to the IL field in the PSR.
The processor performs the same interrupt handling as that of the hardware interrupt.
6-10
EPSON S1C17704 TECHNICAL MANUAL
Page 67
6 INTERRUPT CONTROLLER (ITC)
6.6 Clearing HALT and SLEEP Modes by Interrupt Causes
A cause of interrupt clears HALT or SLEEP mode to start up the CPU.
The program execution sequence (whether it branches to the interrupt handler routine) after the CPU starts up
depends on the clock status in HALT/SLEEP mode.
See “C.1 Power Saving by Clock Control” in Appendix C for details.
S1C17704 TECHNICAL MANUAL EPSON
6-11
Page 68
6 INTERRUPT CONTROLLER (ITC)
6.7 Details of Control Registers
Table 6.7.1 List of ITC Registers
AddressRegister nameFunction
0x4300 ITC_IFLG Interrupt Flag RegisterIndicates/resets interrupt occurrence status.
0x4302 ITC_ENInterrupt Enable RegisterEnables/disables each maskable interrupt.
0x4304 ITC_CTL ITC Control RegisterEnables/disables the ITC.
0x4306 ITC_ELV0 External Interrupt Level Setup Register 0 Sets the P0 and P1 interrupt levels and trigger modes.
0x4308 ITC_ELV1 External Interrupt Level Setup Register 1 Sets the stopwatch timer and clock timer interrupt levels and trigger modes.
0x430a ITC_ELV2 External Interrupt Level Setup Register 2 Sets the 8-bit OSC1 timer and SVD interrupt levels and trigger modes.
0x430c ITC_ELV3 External Interrupt Level Setup Register 3 Sets the LCD and PWM & capture timer interrupt levels and trigger modes.
0x430e ITC_ILV0 Internal Interrupt Level Setup Register 0 Sets the 8-bit timer and 16-bit timer Ch.0 interrupt levels.
0x4310 ITC_ILV1 Internal Interrupt Level Setup Register 1 Sets the 16-bit timer Ch.1 and 16-bit timer Ch.2 interrupt levels.
0x4312 ITC_ILV2 Internal Interrupt Level Setup Register 2 Sets the UART and remote controller interrupt levels.
0x4314 ITC_ILV3 Internal Interrupt Level Setup Register 3 Sets the SPI and I
The following describes each ITC register. These are all 16-bit registers.
Note: When setting the registers, be sure to write a 0, and not a 1, for all “reserved bits.”
2
C interrupt levels.
6-12
EPSON S1C17704 TECHNICAL MANUAL
Page 69
6 INTERRUPT CONTROLLER (ITC)
0x4300: Interrupt Flag Register (ITC_IFLG)
Register name AddressBitNameFunctionSettingInit. R/WRemarks
These bits are interrupt flags to indicate the interrupt cause occurrence status.
1 (R): Cause of interrupt has occurred
0 (R): No cause of interrupt has occurred (default)
1 (W): Flag is reset
0 (W): Has no effect
The interrupt flag is set to 1 when a cause of interrupt occurs in each peripheral circuit.
If the following conditions are met at this time, an interrupt is generated to the S1C17 Core:
1. The corresponding bit of the Interrupt Enable Register is set to 1.
2. No other interrupt request of higher priority has occurred.
3. The IE bit of the PSR is set to 1 (interrupt enabled).
4. The corresponding interrupt level setup bits are set to a level higher than the S1C17 Core's interrupt
level (IL).
These bits are interrupt flags to indicate the interrupt cause occurrence status.
1 (R): Cause of interrupt has occurred
0 (R): No cause of interrupt has occurred (default)
1 (W): Has no effect
0 (W): Has no effect
See the description for IIFT[7:0].
However, these interrupts must be set to level trigger mode using the ITC_ELVx register (0x4306 to
0x430c). Therefore, EIFTx cannot be reset by writing 1. To reset the EIFTx, write 1 to the interrupt flag
in the peripheral module.
Table 6.7.3 Causes of Hardware Interrupt and Interrupt Flags
Interrupt flagCause of hardware interrupt
EIFT0 (D0)P0 port interrupt: P00–P07 port inputs
EIFT1 (D1)P1 port interrupt: P10–P17 port inputs
EIFT2 (D2)Stopwatch timer interrupt: 100 Hz/10 Hz/1 Hz signal
EIFT3 (D3)Clock timer interrupt: 32 Hz/8 Hz/2 Hz/1 Hz signal
EIFT4 (D4)8-bit OSC1 timer interrupt: compare match
EIFT5 (D5)SVD interrupt: low supply voltage detection
EIFT6 (D6)LCD interrupt: frame signal
EIFT7 (D7)PWM & capture timer interrupt: compare A/compare B match
Note: Even when a maskable interrupt request is accepted by the S1C17 Core and control branches off
to the interrupt handler routine, the interrupt flag is not reset. Consequently, if control is returned
from the interrupt handler routine by the reti instruction without resetting the interrupt flag in
a program, the same cause of interrupt occurs again. The interrupt flag of the level triggered
interrupt must be reset using the control register in the peripheral module.
6-14
EPSON S1C17704 TECHNICAL MANUAL
Page 71
6 INTERRUPT CONTROLLER (ITC)
0x4302: Interrupt Enable Register (ITC_EN)
Register name AddressBitNameFunctionSettingInit. R/WRemarks
D12 EITG1: P1 Port Interrupt Trigger Mode Select Bit
Selects the trigger mode of the P1 port interrupt. Set this bit 1 in the S1C17704.
1 (R/W): Level trigger mode
0 (R/W): Pulse trigger mode (default)
In pulse trigger mode, the ITC samples interrupt signals at the rising edge of the system clock. When a
high pulse is sampled, the ITC sets the interrupt flag (EIFTx) to 1 and stops sampling of that interrupt
signal. The ITC resumes the sampling operation for the interrupt signal after the interrupt flag (EIFTx)
is reset to 0 in the application program (interrupt handler).
In level trigger mode, the ITC continuously samples interrupt signals at every rising edge of the system
clock. The interrupt flag (EIFTx) is set to 1 when a high level is sampled and is reset to 0 when a low
level is sampled. In this mode, writing 1 cannot reset the interrupt flag (EIFTx). Therefore, the interrupt
source module must hold the interrupt signal to high until the S1C17 Core accepts the interrupt request
and must reset the interrupt signal after that.
D11 Reserved
D15–13
D12
D11
D10–8
D7–5
D4
D3
D2–0
–
EITG1
–
EILV1[2:0]
–
EITG0
–
EILV0[2:0]
reserved––– 0 when being read.
P1 interrupt trigger mode1 Level0 Pulse0 R/W Be sure to set to 1.
reserved––– 0 when being read.
P1 interrupt level0 to 70x0 R/W
reserved––– 0 when being read.
P0 interrupt trigger mode1 Level0 Pulse0 R/W Be sure to set to 1.
reserved––– 0 when being read.
P0 interrupt level0 to 70x0 R/W
D[10:8] EILV1[2:0]: P1 Port Interrupt Level Bits
Sets the interrupt level (0 to 7) of the P1 port interrupt. (Default: 0)
If the level is set below the IL value of the PSR, the S1C17 Core does not accept the interrupt request.
In the ITC, the interrupt level is used when two or more causes of interrupt occur simultaneously.
If two or more causes of interrupt that have been enabled by the interrupt enable register occur
simultaneously, the cause of interrupt whose Interrupt Level Setup Register contains the highest value
is allowed by the ITC to send an interrupt request to the S1C17 Core. If two or more causes of interrupt
that have the same interrupt level occur, the interrupt with the smallest vector number is processed
first. Other causes of interrupt are kept pending until all interrupts of higher priority are accepted by
the S1C17 Core. If another cause of interrupt of higher priority occurs during outputting an interrupt
request signal, the ITC changes the vector number and interrupt level to those of the new cause of
interrupt. The first interrupt request is left pending.
D[7:5] Reserved
D4 EITG0: P0 Port Interrupt Trigger Mode Select Bit
Selects the trigger mode of the P0 port interrupt. Set this bit 1 in the S1C17704.
1 (R/W): Level trigger mode
0 (R/W): Pulse trigger mode (default)
See the description of EITG1 (D12).
D3 Reserved
D[2:0] EILV0[2:0]: P0 Port Interrupt Level Bits
Sets the interrupt level (0 to 7) of the P0 port interrupt. (Default: 0)
See the description of EILV1[2:0] (D[10:8]).
D12 EITG3: Clock Timer Interrupt Trigger Mode Select Bit
Selects the trigger mode of the clock timer interrupt. Set this bit 1 in the S1C17704.
1 (R/W): Level trigger mode
0 (R/W): Pulse trigger mode (default)
See the description of EITG1 (D12) in the ITC_ELV0 register (0x4306).
Sets the interrupt level (0 to 7) of the clock timer interrupt. (Default: 0)
See the description of EILV1[2:0] (D[10:8]) in the ITC_ELV0 register (0x4306).
D[7:5] Reserved
D15–13
D12
D11
D10–8
D7–5
D4
D3
D2–0
–
EITG3
–
EILV3[2:0]
–
EITG2
–
EILV2[2:0]
reserved––– 0 when being read.
CT interrupt trigger mode1 Level0 Pulse0 R/W Be sure to set to 1.
reserved––– 0 when being read.
CT interrupt level0 to 70x0 R/W
reserved––– 0 when being read.
SWT interrupt trigger mode1 Level0 Pulse0 R/W Be sure to set to 1.
reserved––– 0 when being read.
SWT interrupt level0 to 70x0 R/W
D4 EITG2: Stopwatch Timer Interrupt Trigger Mode Select Bit
Selects the trigger mode of the stopwatch timer interrupt. Set this bit 1 in the S1C17704.
1 (R/W): Level trigger mode
0 (R/W): Pulse trigger mode (default)
See the description of EITG1 (D12) in the ITC_ELV0 register (0x4306).
Sets the interrupt level (0 to 7) of the stopwatch timer interrupt. (Default: 0)
See the description of EILV1[2:0] (D[10:8]) in the ITC_ELV0 register (0x4306).
Selects the trigger mode of the SVD interrupt. Set this bit 1 in the S1C17704.
1 (R/W): Level trigger mode
0 (R/W): Pulse trigger mode (default)
See the description of EITG1 (D12) in the ITC_ELV0 register (0x4306).
D11 Reserved
D[10:8] EILV5[2:0]: SVD Interrupt Level Bits
Sets the interrupt level (0 to 7) of the SVD interrupt. (Default: 0)
See the description of EILV1[2:0] (D[10:8]) in the ITC_ELV0 register (0x4306).
D[7:5] Reserved
D15–13
D12
D11
D10–8
D7–5
D4
D3
D2–0
–
EITG5
–
EILV5[2:0]
–
EITG4
–
EILV4[2:0]
reserved––– 0 when being read.
SVD interrupt trigger mode1 Level0 Pulse0 R/W Be sure to set to 1.
reserved––– 0 when being read.
SVD interrupt level0 to 70x0 R/W
reserved––– 0 when being read.
T8OSC1 interrupt trigger mode1 Level0 Pulse0 R/W Be sure to set to 1.
reserved––– 0 when being read.
T8OSC1 interrupt level0 to 70x0 R/W
D4 EITG4: 8-bit OSC1 Timer Interrupt Trigger Mode Select Bit
Selects the trigger mode of the 8-bit OSC1 timer interrupt. Set this bit 1 in the S1C17704.
1 (R/W): Level trigger mode
0 (R/W): Pulse trigger mode (default)
See the description of EITG1 (D12) in the ITC_ELV0 register (0x4306).
Sets the interrupt level (0 to 7) of the 8-bit OSC1 timer interrupt. (Default: 0)
See the description of EILV1[2:0] (D[10:8]) in the ITC_ELV0 register (0x4306).
Selects the trigger mode of the PWM & capture timer interrupt. Set this bit 1 in the S1C17704.
1 (R/W): Level trigger mode
0 (R/W): Pulse trigger mode (default)
See the description of EITG1 (D12) in the ITC_ELV0 register (0x4306).
Sets the interrupt level (0 to 7) of the PWM & capture timer interrupt. (Default: 0)
See the description of EILV1[2:0] (D[10:8]) in the ITC_ELV0 register (0x4306).
D[7:5] Reserved
D15–13
D12
D11
D10–8
D7–5
D4
D3
D2–0
–
EITG7
–
EILV7[2:0]
–
EITG6
–
EILV6[2:0]
reserved––– 0 when being read.
T16E interrupt trigger mode1 Level0 Pulse0 R/W Be sure to set to 1.
reserved––– 0 when being read.
T16E interrupt level0 to 70x0 R/W
reserved––– 0 when being read.
LCD interrupt trigger mode1 Level0 Pulse0 R/W Be sure to set to 1.
reserved––– 0 when being read.
LCD interrupt level0 to 70x0 R/W
D4 EITG6: LCD Interrupt Trigger Mode Select Bit
Selects the trigger mode of the LCD interrupt. Set this bit 1 in the S1C17704.
1 (R/W): Level trigger mode
0 (R/W): Pulse trigger mode (default)
See the description of EITG1 (D12) in the ITC_ELV0 register (0x4306).
D3 Reserved
D[2:0] EILV6[2:0]: LCD Interrupt Level Bits
Sets the interrupt level (0 to 7) of the LCD interrupt. (Default: 0)
See the description of EILV1[2:0] (D[10:8]) in the ITC_ELV0 register (0x4306).
Sets the interrupt level (0 to 7) of the 16-bit timer Ch.0 interrupt. (Default: 0)
If the level is set below the IL value of the PSR, the S1C17 Core does not accept the interrupt request.
In the ITC, the interrupt level is used when two or more causes of interrupt occur simultaneously.
If two or more causes of interrupt that have been enabled by the interrupt enable register occur
simultaneously, the cause of interrupt whose Interrupt Level Setup Register contains the highest value
is allowed by the ITC to send an interrupt request to the S1C17 Core.
If two or more causes of interrupt that have the same interrupt level occur, the interrupt with the
smallest vector number is processed first.
Other causes of interrupt are kept pending until all interrupts of higher priority are accepted by the
S1C17 Core.
If another cause of interrupt of higher priority occurs during outputting an interrupt request signal,
the ITC changes the vector number and interrupt level to those of the new cause of interrupt. The first
interrupt request is left pending.
D[7:3] Reserved
D15–11
D10–8
D7–3
D2–0
–
IILV1[2:0]
–
IILV0[2:0]
reserved––– 0 when being read.
T16 Ch.0 interrupt level0 to 70x0 R/W
reserved––– 0 when being read.
T8 interrupt level0 to 70x0 R/W
Sets the interrupt level (0 to 7) of the 16-bit timer Ch.2 interrupt. (Default: 0)
See the description of IILV1[2:0] (D[10:8]) in the ITC_ILV0 register (0x430e).
Sets the interrupt level (0 to 7) of the 16-bit timer Ch.1 interrupt. (Default: 0)
See the description of IILV1[2:0] (D[10:8]) in the ITC_ILV0 register (0x430e).
D15–11
D10–8
D7–3
D2–0
–
IILV3[2:0]
–
IILV2[2:0]
reserved––– 0 when being read.
T16 Ch.2 interrupt level0 to 70x0 R/W
reserved––– 0 when being read.
T16 Ch.1 interrupt level0 to 70x0 R/W
Sets the interrupt level (0 to 7) of the remote controller interrupt. (Default: 0)
See the description of IILV1[2:0] (D[10:8]) in the ITC_ILV0 register (0x430e).
D[7:3] Reserved
D[2:0] IILV4[2:0]: UART Interrupt Level Bits
Sets the interrupt level (0 to 7) of the UART interrupt. (Default: 0)
See the description of IILV1[2:0] (D[10:8]) in the ITC_ILV0 register (0x430e).
D15–11
D10–8
D7–3
D2–0
–
IILV5[2:0]
–
IILV4[2:0]
reserved––– 0 when being read.
REMC interrupt level0 to 70x0 R/W
reserved––– 0 when being read.
UART interrupt level0 to 70x0 R/W
Sets the interrupt level (0 to 7) of the I
See the description of IILV1[2:0] (D[10:8]) in the ITC_ILV0 register (0x430e).
D[7:3] Reserved
D[2:0] IILV6[2:0]: SPI Interrupt Level Bits
Sets the interrupt level (0 to 7) of the SPI interrupt. (Default: 0)
See the description of IILV1[2:0] (D[10:8]) in the ITC_ILV0 register (0x430e).
–
D15–11
IILV7[2:0]
D10–8
–
D7–3
IILV6[2:0]
D2–0
2
C Interrupt Level Bits
reserved––– 0 when being read.
2
C interrupt level0 to 70x0 R/W
I
reserved––– 0 when being read.
SPI interrupt level0 to 70x0 R/W
2
C interrupt. (Default: 0)
6-24
EPSON S1C17704 TECHNICAL MANUAL
Page 81
6 INTERRUPT CONTROLLER (ITC)
6.8 Precautions
• To prevent another interrupt from being generated for the same cause again after generation of an interrupt,
be sure to reset the interrupt flag before enabling interrupts and setting the PSR again or executing the reti
instruction.
• The following S1C17704 interrupts use level trigger mode.
- P0 port interrupt
- P1 port interrupt
- Stopwatch timer interrupt
- Clock timer interrupt
- 8-bit OSC1 timer interrupt
- SVD interrupt
- LCD interrupt
- PWM & capture timer interrupt
Set all EITGx bits in the ITC_ELVx register (0x4306 to 0x430c) to 1 (level trigger mode).
Furthermore, the interrupt handler routine must reset (write 1 to) the interrupt flag provided in the peripheral
module, not EIFTx. For the interrupt flag to be reset, see the description for each peripheral module.
S1C17704 TECHNICAL MANUAL EPSON
6-25
Page 82
6 INTERRUPT CONTROLLER (ITC)
THIS PAGE IS BLANK.
6-26
EPSON S1C17704 TECHNICAL MANUAL
Page 83
7 OSCILLATOR (OSC)
7 Oscillator (OSC)
7.1 Configuration of OSC Module
The S1C17704 has two built-in oscillators (OSC3 and OSC1). The OSC3 oscillator generates the main clock (Max.
8.2 MHz) for operating the S1C17 Core and peripheral circuits at high speed. The OSC1 oscillator generates the
sub clock (Typ. 32.768 kHz) for operating timers and for power saving operations.
At initial reset, the OSC3 clock is selected as the system clock.
The oscillators can be turned on and off and the system clock can be switched between OSC1 and OSC3 with
software.
The OSC module allows the software to turn the oscillators on and off and to switch the system clock source
between OSC1 and OSC3.
Furthermore, the clocks generated in the OSC module can be output outside the IC.
Figure 7.1.1 shows the structure of the clock system and the OSC3 module.
Current consumption can be reduced by controlling the clocks according to the processing requirements as well as by
using the standby mode. For methods to reduce current consumption, see Appendix C, “Power Saving.”
S1C17704 TECHNICAL MANUAL EPSON
7-1
Page 84
7 OSCILLATOR (OSC)
7.2 OSC3 Oscillator
The OSC3 oscillator generates the main clock (Max. 8.2 MHz) for operating the S1C17 Core and peripheral
circuits at high speed. Depending on the product number, the oscillator type is crystal/ceramic oscillation (Max. 8.2
MHz) or CR oscillation (Max. 2.2 MHz).
Table 7.2.1 Lineup
Model No.Main (OSC3) oscillator
S1C17704F00B100
S1C17704F00E100
Figure 7.2.1 shows the structure of the OSC3 oscillator circuit.
Crystal/Ceramic
CR
CG3
CD3
R
VSS
f
OSC3
OSC3
X'tal3
or
Ceramic
OSC4
(1) Crystal/ceramic oscillator circuit
fOSC3
Oscillator control signal
SLEEP status
fOSC3
CR3
R
OSC4
(2) CR oscillator circuit
Figure 7.2.1 OSC3 Oscillator Circuit
Oscillator control signal
SLEEP status
When the crystal/ceramic oscillator model is selected, connect a crystal (X’tal3) or ceramic resonator (Ceramic)
and a feedback resistor (R
OSC4 pins and V
SS.
When the CR oscillator model is selected, connect only a resistor (R
f) between the OSC3 and OSC4 pins, and two capacitors (CG3, CD3) to the OSC3 and
CR3) between the OSC3 and OSC4 pins.
Controlling the OSC3 oscillation on and off
Setting OSC3EN (D0/OSC_CTL register) to 0 causes the OSC3 oscillator circuit to stop; setting it to 1 causes
the OSC3 oscillator circuit to start oscillating. Also the OSC3 oscillator circuit stops when the S1C17 Core
enters SLEEP mode.
∗ OSC3EN: OSC3 Enable Bit in the Oscillation Control (OSC_CTL) Register (D0/0x5061)
At initial reset, OSC3EN is set to 1 for enabling OSC3 oscillation. Furthermore, the OSC3 clock is selected as
the system clock, so the S1C17 Core starts operating with the OSC3 clock.
7-2
EPSON S1C17704 TECHNICAL MANUAL
Page 85
7 OSCILLATOR (OSC)
Stable oscillation wait time when OSC3 starts oscillating
The OSC3 oscillator circuit provides an oscillation stabilization-wait timer to prevent malfunctions caused by
an unstable clock immediately after the OSC3 oscillator starts oscillating such as when the power is turned
on, when the S1C17 Core is woken from SLEEP mode or when software turns the OSC3 oscillator circuit on.
The OSC3 clock supply is disabled until the time set to the timer has elapsed after the OSC3 oscillator starts
oscillating.
The stable oscillation wait time can be selected from four kinds of number of clock cycles using OSC3WT[1:0]
(D[5:4]/OSC_CTL register).
∗
OSC3WT[1:0]: OSC3 Wait Cycle Select Bits in the Oscillation Control (OSC_CTL) Register (D[5:4]/0x5061)
The stable oscillation wait time is set to 1024 OSC3 clock cycles at initial reset, the S1C17 Core does not start
operating until the set time has elapsed after releasing reset status.
Note: The oscillation start time varies depending on the resonator and externally attached parts. Set
the stable oscillation wait time with a safety margin. Refer to the oscillation start time example
described in Chapter 26, “Electrical Characteristics.”
S1C17704 TECHNICAL MANUAL EPSON
7-3
Page 86
7 OSCILLATOR (OSC)
7.3 OSC1 Oscillator
The OSC3 oscillator generates the 32.768 kHz (Typ.) sub-clock. Normally, the OSC1 clock is used as the operating
clock for timers (clock timer, stopwatch timer, watchdog timer, and 8-bit OSC1 timer). Furthermore, it can be used
as the system clock instead of the OSC3 clock to reduce current consumption when high-speed processing is not
required.
The oscillator type is crystal oscillation.
Figure 7.3.1 shows the structure of the OSC1 oscillator circuit.
SLEEP status
OSC1
CG1
X'tal1
fOSC1
OSC2
VSS
Figure 7.3.1 OSC1 Oscillator Circuit
VSS
To configure a crystal oscillator, connect a crystal X’tal1 (Typ. 32.768 kHz) between the OSC1 and OSC1 pins, and
a trimmer capacitor C
G1 (0–25 pF) between the OSC1 and VSS.
Controlling the OSC1 oscillation on and off
Setting OSC1EN (D1/OSC_CTL register) to 0 causes the OSC1 oscillator circuit to stop; setting it to 1 causes
the OSC1 oscillator circuit to start oscillating. Also the OSC1 oscillator circuit stops when the S1C17 Core
enters SLEEP mode.
∗ OSC1EN: OSC1 Enable Bit in the Oscillation Control (OSC_CTL) Register (D1/0x5061)
Stable oscillation wait time when OSC1 starts oscillating
The OSC1 oscillator circuit provides an oscillation stabilization-wait timer to prevent malfunctions caused by
an unstable clock immediately after the OSC1 oscillator starts oscillating such as when the power is turned
on, when the S1C17 Core is woken from SLEEP mode or when software turns the OSC1 oscillator circuit on.
The OSC1 clock supply to the system is disabled for 256 OSC1 clock cycles after the OSC1 oscillator starts
oscillating.
7-4
EPSON S1C17704 TECHNICAL MANUAL
Page 87
7 OSCILLATOR (OSC)
7.4 Switching the System Clock
The OSC module allows software to switch the system clock between the OSC3 and OSC1 clocks. Current
consumption can be reduced by disabling the OSC3 oscillation after the system clock is switched to OSC1.
The following shows the control procedure:
OSC3 to OSC1
1. Set OSC1EN (D1/OSC_CTL register) to 1 to start the OSC1 oscillation if it is disabled.
∗ OSC1EN: OSC1 Enable Bit in the Oscillation Control (OSC_CTL) Register (D1/0x5061)
2. Set CLKSRC (D0/OSC_SRC register) to 1 to switch the system clock from OSC3 to OSC1.
∗ CLKSRC: System Clock Source Select Bit in the Clock Source Select (OSC_SRC) Register (D0/0x5060)
3. If the application does not need the peripheral modules clocked with OSC3 to operate, set OSC3EN (D0/
OSC_CTL register) to 0 to stop the OSC3 oscillation.
∗ OSC3EN: OSC3 Enable Bit in the Oscillation Control (OSC_CTL) Register (D0/0x5061)
Notes: • When the system clock is switched from OSC3 to OSC1 immediately after the OSC1 oscillator
starts oscillating, the system clock is halted until the OSC1 clock is activated (256 OSC1
clock-cycle period).
• The OSC3 oscillation cannot be stopped before switching the system clock to OSC1.
OSC1 to OSC3
1. Set a stable oscillation wait time (see Table 7.2.2) longer than the OSC3 oscillation start time using
OSC3WT[1:0] (D[5:4]/OSC_CTL register). (This control is not necessary if it has been set already.)
∗ OSC3WT[1:0]: OSC3 Wait Cycle Select Bits in the Oscillation Control (OSC_CTL) Register (D[5:4]/0x5061)
2. Set OSC3EN (D0/OSC_CTL register) to 1 to start the OSC3 oscillation if it is disabled. The OSC3 clock is
not supplied to the system until the wait time set in OSC3WT[1:0] (D[5:4]/OSC_CTL register) has elapsed
after the OSC3 oscillator starts oscillating.
3. Set CLKSRC (D0/OSC_SRC register) to 0 to switch the system clock from OSC1 to OSC3.
4. If the application does not need the peripheral modules clocked with OSC1 to operate, set OSC1EN (D1/
OSC_CTL register) to 0 to stop the OSC1 oscillation.
Notes: • Skip Steps 1 and 2 when the OSC2 oscillator circuit is operating.
• The OSC3 oscillation start time varies depending on the resonator and externally attached
parts. Set the stable oscillation wait time with a safety margin. Refer to the oscillation start time
example described in Chapter 26, “Electrical Characteristics.”
• The OSC1 oscillation cannot be stopped before switching the system clock to OSC3.
S1C17704 TECHNICAL MANUAL EPSON
7-5
Page 88
7 OSCILLATOR (OSC)
7.5 Controlling the LCD Clock
The OSC module incorporates the LCD clock generator to generate the operating clock (LCLK) for the LCD driver.
See Chapter 22, “LCD Driver (LCD),” for details of the LCD driver.
Division ratio select
OSC3 clock
OSC1 clock
Selecting the source clock
Use LCKSRC (D1/OSC_LCLK register) to select either OSC1 or OSC3 as the source clock to generate the
LCD clock. When LCKSRC is 1 (default), OSC1 is selected and when it is set to 1, OSC3 is selected.
∗ LCKSRC: LCD Clock Source Select Bit in the LCD Clock Setup (OSC_LCLK) Register (D1/0x5063)
Selecting a clock division ratio
When the OSC1 clock is used
When OSC1 is selected as the source clock, it is not necessary to select a division ratio. The OSC1 clock (Typ.
32.768 kHz) is sent directly to the LCD driver.
Divider
(1/32–1/512)
Figure 7.5.1 LCD Clock Generator
Clock source
select
Gate
On/Off control
LCLK
LCD driver
When the OSC3 clock is used
When OSC3 is selected as the source clock, select a division ratio using LCKDV[2:0] (D[4:2]/OSC_LCLK
register).
∗LCKDV[2:0]: LCD Clock Division Ratio Select Bits in the LCD Clock Setup (OSC_LCLK) Register
(D[4:2]/0x5063)
Table 7.5.1 Selecting Division Ratio for LCD Clock
Use LCKEN (D0/OSC_LCLK register) to control the clock supply to the LCD driver. LCKEN is set to 0 by
default and the clock supply is disabled. When LCKEN is set to 1, the clock generated with the above conditions is
supplied to the LCD driver. If display on the LCD is not necessary, disable the clock supply to reduce current
consumption.
∗ LCKEN: LCD Clock Enable Bit in the LCD Clock Setup (OSC_LCLK) Register (D0/0x5063)
7-6
EPSON S1C17704 TECHNICAL MANUAL
Page 89
7 OSCILLATOR (OSC)
7.6 Controlling the 8-bit OSC1 Timer Clock
The OSC module incorporates a frequency divider and a clock supply control circuit for the 8-bit OSC1 timer. The
8-bit OSC1 timer is a programmable timer that operates with a divided OSC1 clock. See Chapter 14, “8-bit OSC1
Timer (T8OSC1),” for details of the 8-bit OSC1 timer.
OSC1 clock
Divider
(1/1–1/32)
Division ratio selectOn/Off control
Figure 7.6.1 8-bit OSC1 Timer Clock Control Circuit
Selecting a clock division ratio
Select a clock division ratio of the OSC1 clock using T8O1CK[2:0] (D[3:1]/OSC_T8OSC1 register).
∗T8O1CK[2:0]: T8OSC1 Clock Division Ratio Select Bits in the T8OSC1 Clock Control (OSC_T8OSC1)
Register (D[3:1]/0x5065)
Table 7.6.1 Selecting Division Ratio for Generating T8OSC1 Clock
Use T8O1CE (D0/OSC_T8OSC1 register) to control the clock supply to the 8-bit OSC1 timer. T8O1CE is set
to 0 by default and the clock supply is disabled. When T8O1CE is set to 1, the clock generated with the above
conditions is supplied to the 8-bit OSC1 timer. When the application does not need the 8-bit OSC1 timer to run,
disable the clock supply to reduce current consumption.
∗ T8O1CE: T8OSC1 Clock Enable Bit in the T8OSC1 Clock Control (OSC_T8OSC1) Register (D0/0x5065)
S1C17704 TECHNICAL MANUAL EPSON
7-7
Page 90
7 OSCILLATOR (OSC)
7.7 External Output Clock (FOUT3, FOUT1)
A divided OSC3 clock (FOUT3) and the OSC1 clock (FOUT1) can be output to external devices.
P30 port
OSC3 clock
OSC1 clock
Divider
(1/1–1/4)
Division ratio select
Figure 7.7.1 Clock Output Circuit
FOUT3
output circuit
P13 port
FOUT1
output circuit
On/Off
control
On/Off
control
P30 function
select
P13 function
select
FOUT3(P30)
FOUT1(P13)
FOUT3 output
FOUT3 is a divided OSC3 clock.
Setting up the output pin
The FOUT3 output pin is shared with the P30 port and it functions as the P30 port pin by default. Write 1
to P30MUX (D0/P3_PMUX register) to switch the P30 pin function for the FOUT3 output.
∗P30MUX: P30 Port Function Select Bit in the P3 Port Function Select (P3_PMUX) Register (D0/0x52a3)
Selecting the FOUT3 clock frequency
The output clock frequency can be selected from three kinds. Select an OSC3 clock division ratio using
FOUT3D[1:0] (D[3:2]/OSC_FOUT register) to set up the clock frequency.
∗ FOUT3D[1:0]: FOUT3 Clock Division Ratio Select Bits in the FOUT Control (OSC_FOUT) Register
Controlling the clock output
Use FOUT3E (D1/OSC_FOUT register) to control the clock output. When FOUT3E is set to 1, the FOUT3
clock is output from the FOUT3 pin and the output is disabled when FOUT3E is set to 0.
∗FOUT3E: FOUT3 Output Enable Bit in the FOUT Control (OSC_FOUT) Register (D1/0x5064)
(D[3:2]/0x5064)
Table 7.7.1 Selecting Division Ratio for Generating FOUT3 Clock
FOUT3D[1:0]Division ratio
0x3Reserved
0x2OSC3•1/4
0x1OSC3•1/2
0x0OSC3•1/1
(Default: 0x0)
FOUT3E
FOUT3 output (P30)
001
Figure 7.7.2 FOUT3 Output
Note: The FOUT3 signal is generated asynchronously with writing to FOUT3E, therefore, a hazard will
occur when the output is enabled or disabled.
7-8
EPSON S1C17704 TECHNICAL MANUAL
Page 91
7 OSCILLATOR (OSC)
FOUT1 output
FOUT1 is the OSC1 clock.
Setting up the output pin
The FOUT1 output pin is shared with the P13 port and it functions as the P13 port pin by default. Write 1
to P13MUX (D3/P1_PMUX register) to switch the P13 pin function for the FOUT1 output.
∗ P13MUX: P13 Port Function Select Bit in the P1 Port Function Select (P1_PMUX) Register (D3/0x52a1)
Controlling the clock output
Use FOUT1E (D0/OSC_FOUT register) to control the clock output. When FOUT1E is set to 1, the FOUT1
clock is output from the FOUT1 pin and the output is disabled when FOUT1E is set to 0.
∗FOUT1E: FOUT1 Output Enable Bit in the FOUT Control (OSC_FOUT) Register (D0/0x5064)
FOUT1E
FOUT1 output (P13)
001
Figure 7.7.3 FOUT1 Output
Note: The FOUT1 signal is generated asynchronously with writing to FOUT1E, therefore, a hazard will
occur when the output is enabled or disabled.
S1C17704 TECHNICAL MANUAL EPSON
7-9
Page 92
7 OSCILLATOR (OSC)
7.8 Noise Filters for RESET and NMI Inputs
If the RESET or NMI signal in the S1C17 Core input signals become active due to noise, the S1C17 Core executes
unnecessary reset ot NMI handling. To avoid this, the OSC module incorporates noise filters that operate with the
system clock to remove noise from these signals before they are input to the S1C17 Core.
The noise filter is provided for each signal, and can be enabled or bypassed individually.
RESET input noise filter: Noise will be removed when RSTFE (D1/OSC_NFEN register) = 1; the filter is bypassed
when RSTFE = 0.
NMI input noise filter: Noise will be removed when NMIFE (D0/OSC_NFEN register) = 1; the filter is bypassed
when NMIFE = 0.
∗ RSTFE: Reset Noise Filter Enable Bit in the Noise Filter Enable (OSC_NFEN) Register (D1/0x5062)
∗ NMIFE: NMI Noise Filter Enable Bit in the Noise Filter Enable (OSC_NFEN) Register (D0/0x5062)
The noise filter operates with a divide-by-8 system clock (OSC3 or OSC1 clock). When it is enabled, pulses that
have a width of less than two cycles of this operating clock will be removed as noise. Therefore, 16 system clock
cycles or longer pulse width is required to accept as a valid signal.
Notes: • Enable the filter for the RESET input under normal circumstances.
• Although the S1C17704 has no external NMI input pin, the NMI request signal of the
watchdog timer pass through the filter.
7-10
EPSON S1C17704 TECHNICAL MANUAL
Page 93
7 OSCILLATOR (OSC)
7.9 Details of Control Registers
Table 7.9.1 List of OSC Registers
AddressRegister nameFunction
0x5060OSC_SRCClock Source Select RegisterSelects a clock source.
0x5061OSC_CTLOscillation Control RegisterControls oscillation.
0x5062OSC_NFENNoise Filter Enable RegisterEnables/disables noise filters.
0x5063OSC_LCLKLCD Clock Setup RegisterSets up the LCD clock.
0x5064OSC_FOUTFOUT Control RegisterControls clock output.
0x5065OSC_T8OSC1 T8OSC1 Clock Control RegisterSets up the 8-bit OSC1 timer clock.
The following describes each OSC module control register. These are all 8-bit registers.
Note: When setting the registers, be sure to write a 0, and not a 1, for all “reserved bits.”
S1C17704 TECHNICAL MANUAL EPSON
7-11
Page 94
7 OSCILLATOR (OSC)
0x5060: Clock Source Select Register (OSC_SRC)
Register name AddressBitNameFunctionSettingInit. R/WRemarks
Clock Source
Select
Register
(OSC_SRC)
D[7:1] Reserved
D0 CLKSRC: System Clock Source Select Bit
Selects the system clock source.
1 (R/W): OSC1
0 (R/W): OSC3 (default)
Select OSC3 for normal (high-speed) operation. When the OSC3 clock is not necessary, select OSC1 as
Note: When the system clock is switched from OSC3 to OSC1 immediately after the OSC1 oscillator
0x5060
(8 bits)
D7–1
D0
–
CLKSRC
reserved––– 0 when being read.
System clock source select1 OSC10 OSC30 R/W
the system clock and stop OSC3 oscillation to reduce current consumption.
starts oscillating, the system clock is halted until the OSC1 clock is activated (256 OSC1
clock-cycle period).
7-12
EPSON S1C17704 TECHNICAL MANUAL
Page 95
7 OSCILLATOR (OSC)
0x5061: Oscillation Control Register (OSC_CTL)
Register name AddressBitNameFunctionSettingInit. R/WRemarks
Oscillation
Control Register
(OSC_CTL)
D[7:6] Reserved
D[5:4] OSC3WT[1:0]: OSC3 Wait Cycle Select Bits
Sets the stable oscillation wait time to avoid malfunctions caused by the unstable clock when the OSC3
The OSC3 clock is not supplied to the system until the wait time set here has elapsed after the OSC3
At initial reset, the oscillation stabilization wait time is set to 1024 cycles (OSC3 clock). The CPU does
0x5061
(8 bits)
D7–6
D5–4
D3–2
D1
D0
–
OSC3WT[1:0]
–
OSC1EN
OSC3EN
reserved––– 0 when being read.
OSC3 wait cycle selectOSC3WT[1:0]Wait cycle0x0 R/W
reserved––– 0 when being read.
OSC1 enable1 Enable0 Disable1 R/W
OSC3 enable1 Enable0 Disable1 R/W
0x3
0x2
0x1
0x0
128 cycles
256 cycles
512 cycles
1024 cycles
starts oscillating.
starts oscillating such as at power on, at wakeup from SLEEP status, or when the OSC3 oscillator is
turned on with software.
Table 7.9.2 Setting the Stable OSC3 Oscillation Wait Time
not start operating until the set time has elapsed after the reset state is canceled.
Note: The oscillation start time will vary somewhat depending on the resonator and externally
attached parts. Set the oscillation stabilization wait time allowing an adequate margin. For the
oscillation start time, see an example indicated in Chapter 26, “Electrical Characteristics.”
Notes: • The OSC1 oscillator cannot be disabled when OSC1 is used as the system clock.
• In order to avoid malfunctions, the OSC1 clock will not be supplied to the system for 256
OSC1 clock-cycle period when the OSC1 oscillation is started by setting OSC1EN from 0 to 1.
Note: The OSC3 oscillator cannot be disabled when OSC3 is used as the system clock.
S1C17704 TECHNICAL MANUAL EPSON
7-13
Page 96
7 OSCILLATOR (OSC)
0x5062: Noise Filter Enable Register (OSC_NFEN)
Register name AddressBitNameFunctionSettingInit. R/WRemarks
Noise Filter
Enable Register
(OSC_NFEN)
0x5062
(8 bits)
D[7:2] Reserved
D1 RSTFE: Reset Noise Filter Enable Bit
Enables/disables the noise filter for the RESET input.
1 (R/W): Enable (reject noise) (default)
0 (R/W): Disable (bypass)
When the noise filter is enabled, RESET pulses that have a width of 16 system clock (OSC1 or OSC3
clock) cycles or more will pass through the filter and are input to the S1C17 Core. Pulses that have a
width of less than 16 cycles will be rejected as noise. Enable the filter under normal circumstances.
D0 NMIFE: NMI Noise Filter Enable Bit
Enables/disables the noise filter for the NMI input.
1 (R/W): Enable (reject noise)
0 (R/W): Disable (bypass) (default)
When the noise filter is enabled, NMI pulses that have a width of 16 system clock (OSC1 or OSC3
clock) cycles or more will pass through the filter and are input to the S1C17 Core. Pulses that have a
width of less than 16 cycles will be rejected as noise.
Note: Although the S1C17704 has no external NMI input pin, the NMI request signal of the
watchdog timer passes through the filter.
D7–2
D1
D0
–
RSTFE
NMIFE
reserved––– 0 when being read.
Reset noise filter enable1 Enable0 Disable1 R/W
NMI noise filter enable1 Enable0 Disable0 R/W
7-14
EPSON S1C17704 TECHNICAL MANUAL
Page 97
7 OSCILLATOR (OSC)
0x5063: LCD Clock Setup Register (OSC_LCLK)
Register name AddressBitNameFunctionSettingInit. R/WRemarks
LCD Clock
Setup Register
(OSC_LCLK
D[7:5] Reserved
D[4:2] LCKDV[2:0]: LCD Clock Division Ratio Select Bits
Selects a division ratio when OSC3 is selected for the LCD clock source.
It is not necessary to select a division ratio when OSC1 is selected for the LCD clock source.
0x5063
(8 bits)
)
D7–5
D4–2
D1
D0
–
LCKDV[2:0]
LCKSRC
LCKEN
reserved––– 0 when being read.
LCD clock division ratio selectLCKDV[2:0] Division ratio 0x0 R/W
Enables/disables supplying the LCD clock to the LCD driver.
1 (R/W): Enable (On)
0 (R/W): Disable (Off) (default)
LCKEN is set to 0 and the clock supply is disabled by default. By setting LCKEN to 1, the clock
configured using the control bits above is supplied to the LCD driver. If an LCD display is unnecessary,
disable the clock supply to reduce current consumption.
S1C17704 TECHNICAL MANUAL EPSON
7-15
Page 98
7 OSCILLATOR (OSC)
0x5064: FOUT Control Register (OSC_FOUT)
Register name AddressBitNameFunctionSettingInit. R/WRemarks
FOUT Control
Register
(OSC_FOUT
0x5064
(8 bits)
)
D[7:4] Reserved
D[3:2] FOUT3D[1:0]: FOUT3 Clock Division Ratio Select Bits
Selects a division ratio of the OSC3 clock to set the FOUT3 clock frequency.
D1 FOUT3E: FOUT3 Output Enable Bit
Enables/Disables the FOUT3 clock (OSC3 divide clock) to be output to a device outside the IC.
1 (R/W): Enable (On)
0 (R/W): Disable (Off) (default)
D7–4
D3–2
D1
D0
–
FOUT3D[1:0]
FOUT3E
FOUT1E
reserved––– 0 when being read.
FOUT3 clock division ratio select FOUT3D[1:0] Division ratio 0x0 R/W
Enables/disables supplying the operating clock to the 8-bit OSC1 timer.
1 (R/W): Enable (On)
0 (R/W): Disable (Off) (default)
T8O1CE is set to 0 and the clock supply is disabled by default. By setting T8O1CE to 1, the clock
configured using the control bits above is supplied to the 8-bit OSC1 timer. If 8-bit OSC1 timer function
is unnecessary, disable the clock supply to reduce current consumption.
S1C17704 TECHNICAL MANUAL EPSON
7-17
Page 100
7 OSCILLATOR (OSC)
7.10 Precautions
• The oscillation start time will vary somewhat depending on the resonator and externally attached parts. Set
the OSC3 oscillation stabilization wait time allowing an adequate margin. For the oscillation start time, see an
example indicated in Chapter 26, “Electrical Characteristics.”
• When the system clock is switched from OSC3 to OSC1 immediately after the OSC1 oscillator starts oscillating,
the system clock is halted until the OSC1 clock is activated (256 OSC1 clock-cycle period).
• The OSC3 oscillator cannot be disabled when OSC3 is used as the system clock.
• The OSC1 oscillator cannot be disabled when OSC1 is used as the system clock.
• Since the FOUT3/FOUT1 signals are generated asynchronously with writing to FOUT3E/FOUT1E, a hazard
may be generated when the signal is turned on or off.
7-18
EPSON S1C17704 TECHNICAL MANUAL
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.