Waveform distortion due to input noise or a reflected wave may cause malfunction. If the input of the
CMOS device stays in the area between V
malfunction. Take care to prevent chattering noise from entering the device when the input level is fixed,
and also in the transition period when the input level passes through the area between V
V
IH
(MIN).
HANDLING OF UNUSED INPUT PINS
2
Unconnected CMOS device inputs can be cause of malfunction. If an input pin is unconnected, it is
possible that an internal input level may be generated due to noise, etc., causing malfunction. CMOS
devices behave differently than Bipolar or NMOS devices. Input levels of CMOS devices must be fixed
high or low by using pull-up or pull-down circuitry. Each unused pin should be connected to V
via a resistor if there is a possibility that it will be an output pin. All handling related to unused pins must
be judged separately for each device and according to related specifications governing the device.
3
PRECAUTION AGAINST ESD
A strong electric field, when exposed to a MOS device, can cause destruction of the gate oxide and
ultimately degrade the device operation. Steps must be taken to stop generation of static electricity as
much as possible, and quickly dissipate it when it has occurred. Environmental control must be
adequate. When it is dry, a humidifier should be used. It is recommended to avoid using insulators that
easily build up static electricity. Semiconductor devices must be stored and transported in an anti-static
container, static shielding bag or conductive material. All test and measurement tools including work
benches and floors should be grounded. The operator should be grounded using a wrist strap.
Semiconductor devices must not be touched with bare hands. Similar precautions need to be taken for
PW boards with mounted semiconductor devices.
IL
(MAX) and VIH (MIN) due to noise, etc., the device may
IL
(MAX) and
DD
or GND
4
STATUS BEFORE INITIALIZATION
Power-on does not necessarily define the initial status of a MOS device. Immediately after the power
source is turned ON, devices with reset functions have not yet been initialized. Hence, power-on does
not guarantee output pin levels, I/O settings or contents of registers. A device is not initialized until the
reset signal is received. A reset operation must be executed immediately after power-on for devices
with reset functions.
5
POWER ON/OFF SEQUENCE
In the case of a device that uses different power supplies for the internal operation and external
interface, as a rule, switch on the external power supply after switching on the internal power supply.
When switching the power supply off, as a rule, switch off the external power supply and then the
internal power supply. Use of the reverse power on/off sequences may result in the application of an
overvoltage to the internal elements of the device, causing malfunction and degradation of internal
elements due to the passage of an abnormal current.
The correct power on/off sequence must be judged separately for each device and according to related
specifications governing the device.
6
INPUT OF SIGNAL DURING POWER OFF STATE
Do not input signals or an I/O pull-up power supply while the device is not powered. The current
injection that results from input of such a signal or I/O pull-up power supply may cause malfunction and
the abnormal current that passes in the device at this time may cause degradation of internal elements.
Input of signals during the power off state must be judged separately for each device and according to
related specifications governing the device.
User’s Manual U16928EJ2V0UD
3
EEPROM is a trademark of NEC Electronics Corporation.
Windows, Windows NT, and Windows XP are registered trademarks or trademarks of Microsoft Corporation in
the United States and/or other countries.
PC/AT is a trademark of International Business Machines Corporation.
HP9000 series 700 and HP-UX are trademarks of Hewlett-Packard Company.
SPARCstation is a trademark of SPARC International, Inc.
Solaris and SunOS are trademarks of Sun Microsystems, Inc.
TRON is an abbreviation of The Realtime Operating system Nucleus.
ITRON is an abbreviation of Industrial TRON.
®
SuperFlash
is a registered trademark of Silicon Storage Technology, Inc. in several countries including the
United States and Japan.
4
User’s Manual U16928EJ2V0UD
Caution: This product uses SuperFlash
®
technology licensed from Silicon Storage Technology, inc.
•
The information in this document is current as of August, 2007. The information is subject to
change without notice. For actual design-in, refer to the latest publications of NEC Electronics data
sheets or data books, etc., for the most up-to-date specifications of NEC Electronics products. Not
all products and/or types are available in every country. Please check with an NEC Electronics sales
representative for availability and additional information.
No part of this document may be copied or reproduced in any form or by any means without the prior
•
written consent of NEC Electronics. NEC Electronics assumes no responsibility for any errors that may
appear in this document.
•
NEC Electronics does not assume any liability for infringement of patents, copyrights or other intellectual
property rights of third parties by or arising from the use of NEC Electronics products listed in this document
or any other liability arising from the use of such products. No license, express, implied or otherwise, is
granted under any patents, copyrights or other intellectual property rights of NEC Electronics or others.
Descriptions of circuits, software and other related information in this document are provided for illustrative
•
purposes in semiconductor product operation and application examples. The incorporation of these
circuits, software and information in the design of a customer's equipment shall be done under the full
responsibility of the customer. NEC Electronics assumes no responsibility for any losses incurred by
customers or third parties arising from the use of these circuits, software and information.
•
While NEC Electronics endeavors to enhance the quality, reliability and safety of NEC Electronics products,
customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely. To
minimize risks of damage to property or injury (including death) to persons arising from defects in NEC
Electronics products, customers must incorporate sufficient safety measures in their design, such as
redundancy, fire-containment and anti-failure features.
•
NEC Electronics products are classified into the following three quality grades: "Standard", "Special" and
"Specific".
The "Specific" quality grade applies only to NEC Electronics products developed based on a customerdesignated "quality assurance program" for a specific application. The recommended applications of an NEC
Electronics product depend on its quality grade, as indicated below. Customers must check the quality grade of
each NEC Electronics product before using it in a particular application.
The quality grade of NEC Electronics products is "Standard" unless otherwise expressly specified in NEC
Electronics data sheets or data books, etc. If customers wish to use NEC Electronics products in applications
not intended by NEC Electronics, they must contact an NEC Electronics sales representative in advance to
determine NEC Electronics' willingness to support a given application.
(Note)
(1)
"NEC Electronics" as used in this statement means NEC Electronics Corporation and also includes its
majority-owned subsidiaries.
(2)
"NEC Electronics products" means any product developed or manufactured by or for NEC Electronics (as
defined above).
M8 E 02 . 11-1
User’s Manual U16928EJ2V0UD
5
INTRODUCTION
Readers This manual is intended for user engineers who wish to understand the functions of the
μ
PD78F0714 and design and develop application systems and programs for this
device.
The target product is as follows.
μ
PD78F0714
Purpose This manual is intended to give users an understanding of the functions described in the
Organization below.
Organization The
How to Read This Manual It is assumed that the readers of this manual have general knowledge of electrical
Conventions Data significance: Higher digits on the left and lower digits on the right
Active low representations: ××× (overscore over pin and signal name)
Note: Footnote for item marked with Note in the text.
Caution: Information requiring particular attention
Remark: Supplementary information
Numerical representations: Binary
Decimal
Hexadecimal
μ
PD78F0714 manual is separated into two parts: this manual and the instructions
edition (common to the 78K/0 Series).
μ
PD78F0714
User’s Manual
(This Manual)
• Pin functions
• Internal block functions
• Interrupts
• Other on-chip peripheral functions
• Electrical specifications
engineering, logic circuits, and microcontrollers.
• To gain a general understanding of functions:
→ Read this manual in the order of the CONTENTS. The mark “<R>” shows major
revised points. The revised points can be easily searched by copying an “<R>” in
the PDF file and specifying it in the “Find what:” field.
• How to interpret the register format:
→ For a bit number enclosed in brackets, the bit name is defined as a reserved word
in the assembler, and is already defined in the header file named sfrbit.h in the C
compiler.
• To check the details of a register when you know the register name.
→ See APPENDIX B REGISTER INDEX.
• To know details of the 78K/0 Series instructions.
→ Refer to the separate document 78K/0 Series Instructions User’s Manual
(U12326E).
78K/0 Series
User’s Manual
Instructions
• CPU functions
• Instruction set
• Explanation of each instruction
...
×××× or ××××B
...
××××
...
××××H
6
User’s Manual U16928EJ2V0UD
<R>
Related DocumentsThe related documents indicated in this publication may include preliminary versions.
However, preliminary versions are not marked as such.
Documents Related to Devices
Document Name Document No.
μ
PD78F0714 User’s Manual
78K/0 Series Instructions User’s Manual U12326E
This manual
Documents Related to Development Tools (Software) (User’s Manuals)
2.2.13 X1 and X2..................................................................................................................................... 30
2.2.14 VDD and EVDD ............................................................................................................................... 30
2.2.15 VSS and EVSS................................................................................................................................31
CHAPTER 4 PORT FUNCTIONS ........................................................................................................... 62
4.1 Port Functions .......................................................................................................................... 62
4.2 Port Configuration .................................................................................................................... 64
4.2.1 Port 0 ............................................................................................................................................65
4.2.2 Port 1 ............................................................................................................................................66
4.2.3 Port 2 ............................................................................................................................................70
4.2.4 Port 3 ............................................................................................................................................71
4.2.5 Port 4 ............................................................................................................................................73
4.2.6 Port 5 ............................................................................................................................................74
4.2.7 Port 6 ............................................................................................................................................76
4.2.8 Port 7 ............................................................................................................................................77
4.3 Registers Controlling Port Function....................................................................................... 78
4.4 Port Function Operations ........................................................................................................82
4.4.1 Writing to I/O port..........................................................................................................................82
4.4.2 Reading from I/O port....................................................................................................................82
4.4.3 Operations on I/O port...................................................................................................................82
4.5 Cautions on 1-Bit Manipulation Instruction for Port Register n (Pn) .................................. 83
25.5.5 Port pins......................................................................................................................................402
25.5.6 Other signal pins .........................................................................................................................402
25.5.7 Power supply ..............................................................................................................................402
FFBCH Real-time output port mode register 1 RTPM01 R/W
FFBDH Real-time output port control register 1 RTPC01 R/W
FFC0H Flash protect command register PFCMD W
FFC2H Flash status register PFS R/W
FFC4H Flash programming mode control register FLPMC R/W
IT20C
C0
IT20C
C1
IT20C
C0L
−
IT20C
C1L
−
R/W
R/W
− √ √
−
− √ √
−
√ √ −
√ √ −
√ √ −
√ √ −
− √ −
− √ −
− √ −
− √ −
√ √ −
√ √ −
√ √ −
√ √ −
− √ −
√ √ −
− √ −
√ √ −
√ √ −
√ √ −
√ √ −
√ √ −
√ √ −
√ √ −
√ √ −
− √ −
√ √ −
√ √ −
0000H
0000H
9AH
00H
Undefined
0XH
Notes 1. This value varies depending on the reset source.
2. Differs depending on the operation mode.
• User mode: 08H
• On-board mode: 0CH
00H
00H
00H
00H
67H
00H
00H
00H
00H
00H
00H
05H
00H
Note 1
00H
00H
00H
00H
00H
00H
00H
00H
00H
Note 2
User’s Manual U16928EJ2V0UD
47
CHAPTER 3 CPU ARCHITECTURE
Table 3-3. Special Function Register List (5/5)
Address Special Function Register (SFR) Name Symbol R/WManipulatable Bit Unit After
1 Bit 8 Bits 16 Bits Reset
FFE0H Interrupt request flag register 0L IF0 IF0L R/W
FFE1H Interrupt request flag register 0H IF0H R/W
FFE2H Interrupt request flag register 1L IF1 IF1L R/W
FFE3H Interrupt request flag register 1H IF1H R/W
FFE4H Interrupt mask flag register 0L MK0 MK0L R/W
FFE5H Interrupt mask flag register 0H MK0H R/W
FFE6H Interrupt mask flag register 1L MK1 MK1L R/W
FFE7H Interrupt mask flag register 1H MK1H R/W
FFE8H Priority specification flag register 0L PR0 PR0L R/W
FFE9H Priority specification flag register 0H PR0H R/W
FFEAH Priority specification flag register 1L PR1 PR1L R/W
FFEBH Priority specification flag register 1H PR1H R/W
FFF0H Internal memory size switching register
FFFBH Processor clock control register PCC R/W
FFFDH System wait control register VSWC R/W
Note
IMS R/W
√ √ √
√ √
√ √ √
√ √
√ √ √
√ √
√ √ √
√ √
√ √ √
√ √
√ √ √
√ √
− √ −
√ √ −
√ √ −
00H
00H
00H
00H
FFH
FFH
FFH
DFH
FFH
FFH
FFH
FFH
CFH
00H
00H
Note Because the initial value of the internal memory size switching register (IMS) is CFH, set to C8H by
initialization.
48
User’s Manual U16928EJ2V0UD
CHAPTER 3 CPU ARCHITECTURE
3.3 Instruction Address Addressing
An instruction address is determined by program counter (PC) contents and is normally incremented (+1 for each
byte) automatically according to the number of bytes of an instruction to be fetched each time another instruction is
executed. When a branch instruction is executed, the branch destination information is set to the PC and branched by
the following addressing (for details of instructions, refer to 78K/0 Series Instructions User’s Manual (U12326E)).
3.3.1 Relative addressing
[Function]
The value obtained by adding 8-bit immediate data (displacement value: jdisp8) of an instruction code to the
start address of the following instruction is transferred to the program counter (PC) and branched. The
displacement value is treated as signed two’s complement data (−128 to +127) and bit 7 becomes a sign bit.
In other words, relative addressing consists of relative branching from the start address of the following
instruction to the −128 to +127 range.
This function is carried out when the BR $addr16 instruction or a conditional branch instruction is executed.
[Illustration]
150
PC
+
150
876
PC indicates the start address
...
of the instruction after the BR instruction.
α
150
PC
When S = 0, all bits of are 0.
When S = 1, all bits of are 1.
α
α
S
jdisp8
User’s Manual U16928EJ2V0UD
49
CHAPTER 3 CPU ARCHITECTURE
3.3.2 Immediate addressing
[Function]
Immediate data in the instruction word is transferred to the program counter (PC) and branched.
This function is carried out when the CALL !addr16 or BR !addr16 or CALLF !addr11 instruction is executed.
CALL !addr16 and BR !addr16 instructions can be branched to the entire memory space. The CALLF !addr11
instruction is branched to the 0800H to 0FFFH area.
[Illustration]
In the case of CALL !addr16 and BR !addr16 instructions
70
CALL or BR
Low Addr.
High Addr.
150
PC
In the case of CALLF !addr11 instruction
150
PC
00001
87
70
643
10–8
fa
CALLF
fa
7–0
11 10
87
50
User’s Manual U16928EJ2V0UD
CHAPTER 3 CPU ARCHITECTURE
<R>
3.3.3 Table indirect addressing
[Function]
Table contents (branch destination address) of the particular location to be addressed by bits 1 to 5 of the
immediate data of an operation code are transferred to the program counter (PC) and branched.
This function is carried out when the CALLT [addr5] instruction is executed.
This instruction references the address stored in the memory table from 0040H to 007FH, which is indicated by
addr5, and allows branching to the entire memory space.
[Illustration]
addr5
Operation code
Effective address
151
01
00000000
76510
ta4-0
151
01
00000000
87650
0
111
87
ta
4-0
650
0
have the same value
The effective address and addr5
...
Effective address+1
Memory (Table)
70
Low Addr.
High Addr.
150
PC
87
User’s Manual U16928EJ2V0UD
51
CHAPTER 3 CPU ARCHITECTURE
3.3.4 Register addressing
[Function]
Register pair (AX) contents to be specified with an instruction word are transferred to the program counter (PC)
and branched.
This function is carried out when the BR AX instruction is executed.
[Illustration]
70
07
rp
150
PC
AX
87
52
User’s Manual U16928EJ2V0UD
CHAPTER 3 CPU ARCHITECTURE
3.4 Operand Address Addressing
The following methods are available to specify the register and memory (addressing) to undergo manipulation
during instruction execution.
3.4.1 Implied addressing
[Function]
The register that functions as an accumulator (A and AX) among the general-purpose registers is automatically
(implicitly) addressed.
Of the
μ
PD78F0714 instruction words, the following instructions employ implied addressing.
Instruction Register to Be Specified by Implied Addressing
MULU A register for multiplicand and AX register for product storage
DIVUW AX register for dividend and quotient storage
ADJBA/ADJBS A register for storage of numeric values that become decimal correction targets
ROR4/ROL4 A register for storage of digit data that undergoes digit rotation
[Operand format]
Because implied addressing can be automatically employed with an instruction, no particular operand format is
necessary.
[Description example]
In the case of MULU X
With an 8-bit × 8-bit multiply instruction, the product of A register and X register is stored in AX. In this example,
the A and AX registers are specified by implied addressing.
User’s Manual U16928EJ2V0UD
53
CHAPTER 3 CPU ARCHITECTURE
3.4.2 Register addressing
[Function]
The general-purpose register to be specified is accessed as an operand with the register bank select flags
(RBS0 to RBS1) and the register specify codes (Rn and RPn) of an operation code.
Register addressing is carried out when an instruction with the following operand format is executed. When an
8-bit register is specified, one of the eight registers is specified with 3 bits in the operation code.
[Operand format]
Identifier Description
r X, A, C, B, E, D, L, H
rp AX, BC, DE, HL
‘r’ and ‘rp’ can be described by absolute names (R0 to R7 and RP0 to RP3) as well as function names (X, A, C,
B, E, D, L, H, AX, BC, DE, and HL).
[Description example]
MOV A, C; when selecting C register as r
Operation code 0 1100010
Register specify code
INCW DE; when selecting DE register pair as rp
Operation code 1 0000100
Register specify code
54
User’s Manual U16928EJ2V0UD
CHAPTER 3 CPU ARCHITECTURE
3.4.3 Direct addressing
[Function]
The memory to be manipulated is directly addressed with immediate data in an instruction word becoming an
operand address.
[Operand format]
Identifier Description
addr16 Label or 16-bit immediate data
[Description example]
MOV A, !0FE00H; when setting !addr16 to FE00H
Operation code 1 0 0 0 1 1 1 0 OP code
00000000 00H
11111110 FEH
[Illustration]
07
OP code
addr16 (lower)
addr16 (upper)
Memory
User’s Manual U16928EJ2V0UD
55
CHAPTER 3 CPU ARCHITECTURE
3.4.4 Short direct addressing
[Function]
The memory to be manipulated in the fixed space is directly addressed with 8-bit data in an instruction word.
This addressing is applied to the 256-byte space FE20H to FF1FH. Internal RAM and special function registers
(SFRs) are mapped at FE20H to FEFFH and FF00H to FF1FH, respectively.
The SFR area (FF00H to FF1FH) where short direct addressing is applied is a part of the overall SFR area.
Ports that are frequently accessed in a program and compare and capture registers of the timer/event counter
are mapped in this area, allowing SFRs to be manipulated with a small number of bytes and clocks.
When 8-bit immediate data is at 20H to FFH, bit 8 of an effective address is cleared to 0. When it is at 00H to
1FH, bit 8 is set to 1. Refer to the [Illustration].
[Operand format]
Identifier Description
saddr Immediate data that indicate label or FE20H to FF1FH
saddrp Immediate data that indicate label or FE20H to FF1EH (even address only)
[Description example]
MOV 0FE30H, A; when transferring value of A register to saddr (FE30H)
Operation code 1 1110010 OP code
0 0110000 30H (saddr-offset)
[Illustration]
07
OP code
saddr-offset
15
Effective address
1
111111
When 8-bit immediate data is 20H to FFH,
When 8-bit immediate data is 00H to 1FH,
56
87
α
α
= 0
α
= 1
User’s Manual U16928EJ2V0UD
Short direct memory
0
CHAPTER 3 CPU ARCHITECTURE
3.4.5 Special function register (SFR) addressing
[Function]
A memory-mapped special function register (SFR) is addressed with 8-bit immediate data in an instruction word.
This addressing is applied to the 240-byte spaces FF00H to FFCFH and FFE0H to FFFFH. However, the SFRs
mapped at FF00H to FF1FH can be accessed with short direct addressing.
[Operand format]
Identifier Description
sfr Special function register name
sfrp 16-bit manipulatable special function register name (even address only)
[Description example]
MOV PM0, A; when selecting PM0 (FF20H) as sfr
Operation code 1 1 1 1 0 1 1 0 OP code
0 0 1 0 0 0 0 0 20H (sfr-offset)
[Illustration]
07
Effective address
OP code
sfr-offset
15
1
111111
87
1
SFR
0
User’s Manual U16928EJ2V0UD
57
CHAPTER 3 CPU ARCHITECTURE
3.4.6 Register indirect addressing
[Function]
Register pair contents specified by a register pair specify code in an instruction word and by a register bank
select flag (RBS0 and RBS1) serve as an operand address for addressing the memory. This addressing can be
carried out for all the memory spaces.
[Operand format]
Identifier Description
−
[DE], [HL]
[Description example]
MOV A, [DE]; when selecting [DE] as register pair
Operation code 10000101
[Illustration]
1608D7
DE
The contents of the memory
addressed are transferred.
7 0
A
E
Memory
The memory address
07
specified with the
register pair DE
58
User’s Manual U16928EJ2V0UD
CHAPTER 3 CPU ARCHITECTURE
3.4.7 Based addressing
[Function]
8-bit immediate data is added as offset data to the contents of the base register, that is, the HL register pair in
the register bank specified by the register bank select flag (RBS0 and RBS1), and the sum is used to address
the memory. Addition is performed by expanding the offset data as a positive number to 16 bits. A carry from
the 16th bit is ignored. This addressing can be carried out for all the memory spaces.
[Operand format]
Identifier Description
−
[HL + byte]
User’s Manual U16928EJ2V0UD
59
CHAPTER 3 CPU ARCHITECTURE
3.4.8 Based indexed addressing
[Function]
The B or C register contents specified in an instruction word are added to the contents of the base register, that
is, the HL register pair in the register bank specified by the register bank select flag (RBS0 and RBS1), and the
sum is used to address the memory. Addition is performed by expanding the B or C register contents as a
positive number to 16 bits. A carry from the 16th bit is ignored. This addressing can be carried out for all the
memory spaces.
[Operand format]
Identifier Description
−
[HL + B], [HL + C]
[Description example]
In the case of MOV A, [HL + B] (selecting B register)
Operation code 10101011
[Illustration]
160
78
HL
The contents of the memory
addressed are transferred.
7 0
A
H
+
L
B
Memory
07
07
60
User’s Manual U16928EJ2V0UD
CHAPTER 3 CPU ARCHITECTURE
3.4.9 Stack addressing
[Function]
The stack area is indirectly addressed with the stack pointer (SP) contents.
This addressing method is automatically employed when the PUSH, POP, subroutine call and return
instructions are executed or the register is saved/reset upon generation of an interrupt request.
With stack addressing, only the internal high-speed RAM area can be accessed.
[Description example]
In the case of PUSH DE (saving DE register)
Operation code 1 0 1 1 0 1 0 1
[Illustration]
Memory07
SP
SP
FEE0H
FEDEH
FEE0H
FEDFH
FEDEH
D
E
User’s Manual U16928EJ2V0UD
61
CHAPTER 4 PORT FUNCTIONS
4.1 Port Functions
There are two types of pin I/O buffer power supplies: AV
supplies and the pins is shown below.
Table 4-1. Pin I/O Buffer Power Supplies
Power Supply Corresponding Pins
AVREFP20 to P27
EVDDPort pins other than P20 to P27
Note Connect AV
REF to EVDD when port 2 is used as a digital port.
μ
PD78F0714 products are provided with the ports shown in Figure 4-1, which enable variety of control operations.
The functions of each port are shown in Table 4-2.
In addition to the function as digital I/O ports, these ports have several alternate functions. For details of the
alternate functions, see CHAPTER 2 PIN FUNCTIONS.
Figure 4-1. Port Types
REF and EVDD. The relationship between these power
Note
Port 5
Port 6
Port 7
P50
P57
P64
P67
P70
P73
P00
Port 0
P03
P10
Port 1
P17
P20
Port 2
P27
P30
Port 3
P33
P40
62
Port 4
P47
User’s Manual U16928EJ2V0UD
CHAPTER 4 PORT FUNCTIONS
Table 4-2. Port Functions
Pin Name I/O Function After Reset Alternate Function
P00 INTP0/TW0TOFFP
P01 INTP1
P02 INTP2
P03
P10
P11
P12
P13 RxD00
P14 TxD00
P15 SCK10
P16 SI10
P17
P20 to P27 Input
P30 BUZ
P31 PCL
P32
P33
P40 to P47 I/O
P50 TI50/TO50
P51 TI51/TO51
P52 TOH0/INTP4
P53 TI000/INTP5
P54 TI001/TO00
P55 TIT20IUD/INTP6
P56
P57
P64 to P67 I/O
P70 to P73 I/O
I/O
I/O
I/O
I/O
Port 0.
4-bit I/O port.
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a
software setting.
Port 1.
8-bit I/O port.
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a
software setting.
Port 2.
8-bit input-only port.
Port 3.
4-bit I/O port.
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a
software setting.
Port 4.
8-bit I/O port.
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a
software setting.
Port 5.
8-bit I/O port.
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a
software setting.
Port 6.
4-bit I/O port.
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a
software setting.
Port 7.
4-bit I/O port.
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a
software setting.
Input
INTP3/ADTRG
Input
SO10/FLMD1
Input ANI0 to ANI7
Input
Input RTP00 to RTP07
Input
TIT20CUD
/TIT20CC0/INTP7
TIT20CLR
/TIT20CC1
/TIT20TO
Input
Input
−
−
−
−
−
−
−
User’s Manual U16928EJ2V0UD
63
CHAPTER 4 PORT FUNCTIONS
4.2 Port Configuration
Ports consist of the following hardware.
Table 4-3. Port Configuration
Item Configuration
Control registers
Port Total: 48 (CMOS I/O: 40, CMOS input: 8)
Pull-up resistor Total: 40 (software control: 40)
Port mode register (PM0, PM1, PM3 to PM7)
Port register (P0 to P7)
Pull-up resistor option register (PU0, PU1, PU3 to PU7)
64
User’s Manual U16928EJ2V0UD
CHAPTER 4 PORT FUNCTIONS
4.2.1 Port 0
Port 0 is a 4-bit I/O port with an output latch. Port 0 can be set to the input mode or output mode in 1-bit units
using port mode register 0 (PM0). When the P00 to P03 pins are used as an input port, use of an on-chip pull-up
resistor can be specified by pull-up resistor option register 0 (PU0).
This port can also be used for external interrupt request input, timer output stop external signal, and A/D converter
Port 6 is a 4-bit I/O port with an output latch. Port 6 can be set to the input mode or output mode in 1-bit units
using port mode register 6 (PM6). When used as an input port, use of an on-chip pull-up resistor can be specified by
pull-up resistor option register 6 (PU6).
RESET input sets port 6 to input mode.
Figure 4-13 shows a block diagram of port 6.
Figure 4-13. Block Diagram of P64 to P67
EV
DD
PU
WR
PU6
PU64 to PU67
RD
Internal bus
WR
PORT
Output latch
(P64 to P67)
WR
PM
PM6
PM64 to PM67
PU6: Pull-up resistor option register 6
PM6: Port mode register 6
RD: Read signal
WR××: Write signal
P-ch
Selector
P64 to P67
76
User’s Manual U16928EJ2V0UD
CHAPTER 4 PORT FUNCTIONS
4.2.8 Port 7
Port 7 is an 4-bit I/O port with an output latch. Port 7 can be set to the input mode or output mode in 1-bit units
using port mode register 7 (PM7). When the P70 to P73 pins are used as an input port, use of an on-chip pull-up
resistor can be specified by pull-up resistor option register 7 (PU7).
RESET input sets port 7 to input mode.
Figure 4-14 shows a block diagram of port 7.
Figure 4-14. Block Diagram of P70 to P73
EV
DD
PU
WR
PU7
PU70 to PU73
RD
Internal bus
WR
PORT
Output latch
(P70 to P73)
WR
PM
PM7
PM70 to PM73
PU7: Pull-up resistor option register 7
PM7: Port mode register 7
RD: Read signal
WR××: Write signal
P-ch
Selector
P70 to P73
User’s Manual U16928EJ2V0UD
77
CHAPTER 4 PORT FUNCTIONS
4.3 Registers Controlling Port Function
Port functions are controlled by the following three types of registers.
• Port mode registers (PM0, PM1, PM3 to PM7)
• Port registers (P0 to P7)
• Pull-up resistor option registers (PU0, PU1, PU3 to PU7)
(1) Port mode registers (PM0, PM1, PM3 to PM7)
These registers specify input or output mode for the port in 1-bit units.
These registers can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input sets these registers to FFH.
When port pins are used as alternate-function pins, set the port mode register and output latch as shown in Table
4-4.
Figure 4-15. Format of Port Mode Register
Symbol
PM0
7
1
6
1
5
1
4
1
3
PM032PM021PM010PM00
Address
FF20H
After reset
FFH
R/W
R/W
PM1
PM3
PM4
PM5
PM6
PM7
7
PM17
7
1
7
PM47
7
PM57
7
PM67
7
1
6
PM165PM154PM143PM132PM121PM110PM10FF21HFFHR/W
6
1
6
PM465PM454PM443PM432PM421PM410PM40FF24HFFHR/W
6
PM565PM554PM543PM532PM521PM510PM50FF25HFFHR/W
6
PM665PM654PM64
6
1
5
1
5
1
PMmn
0 Output mode (output buffer on)
1 Input mode (output buffer off)
4
1
4
1
3
PM332PM321PM310PM30FF23HFFHR/W
3
1
3
PM732PM721PM710PM70FF27HFFHR/W
2
1
Pmn pin I/O mode selection
(m = 0, 1, 3 to 7; n = 0 to 7)
1
1
0
1FF26HFFHR/W
78
User’s Manual U16928EJ2V0UD
CHAPTER 4 PORT FUNCTIONS
Table 4-4. Settings of Port Mode Register and Output Latch When Using Alternate Function
Pin Name
INTP0
TW0TOFFP
P01 INTP1
P02 INTP2
INTP3
ADTRG
P13 RxD00
P14 TxD00
P15 SCK10
P16 SI10
SO10
FLMD1
P20-P27 ANI0-ANI7
P30 BUZ
P31 PCL
P40-P47 RTP00-RTP07
TI50
TO50
TI51
TO51
INTP4
TOH0
INTP5
Alternate Function
Function Name I/O
Input
Input
Input
Input
Input
Input
Input
Output
Input
Output
Input
Output
Input
Input
Output
Output
Output
Input
Output
Input
Output
Input
Output
Input
PM×× P××
1 × P00
1 ×
1 ×
1 ×
1 × P03
1 ×
1 ×
0 1
1 ×
0 1
1 ×
0 0 P17
1 ×
1 ×
0 0
0 0
0 0
1 × P50
0 0
1 × P51
0 0
1 × P52
0 0
1 × ×
User’s Manual U16928EJ2V0UD
79
CHAPTER 4 PORT FUNCTIONS
(2) Port registers (P0 to P7)
These registers write the data that is output from the chip when data is output from a port.
If the data is read in the input mode, the pin level is read. If it is read in the output mode, the value of the output
latch is read.
These registers can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears these registers to 00H (but P2 is undefined).
Figure 4-16. Format of Port Register
Symbol
P0
7
0
6
0
5
0
4
0
3
P03
2
P02
1
P01
0
P00
Address
FF00H
After reset
00H (output latch)
R/W
R/W
P1
P2
P3
P4
P5
P6
P7
7
P17
7
P27
7
0
7
P47
7
P57
7
P67
7
0
6
P16
6
P26
6
0
6
P46
6
P56
6
P66
6
0
5
P15
5
P25
5
0
5
P45
5
P55
5
P65
5
0
4
P14
4
P24
4
0
4
P44
4
P54
4
P64
4
0
3
P13
3
P23
3
P33
3
P43
3
P53
3
0
3
P73
2
P12
2
P22
2
P32
2
P42
2
P52
2
0
2
P72
1
P11
1
P21
1
P31
1
P41
1
P51
1
0
1
P71
m = 0 to 7; n = 0 to 7
0 Output 0 Input low level
1 Output 1 Input high level
Pmn
Output data control (in output mode) Input data read (in input mode)
0
P10FF01H00H (output latch) R/W
0
P20FF02HUndefined
0
P30FF03H00H (output latch) R/W
0
P40FF04H00H (output latch) R/W
0
P50FF05H00H (output latch) R/W
0
0FF06H00H (output latch) R/W
0
P70FF07H00H (output latch) R/W
R
80
User’s Manual U16928EJ2V0UD
CHAPTER 4 PORT FUNCTIONS
(3) Pull-up resistor option registers (PU0, PU1, and PU3 to PU7)
These registers specify whether the on-chip pull-up resistors of P00 to P03, P10 to P17, P30 to P33, P40 to P47,
P50 to P57, P64 to P67, P70 to P73 are to be used or not. On-chip pull-up resistors can be used in 1-bit units
only for the bits set to input mode of the pins to which the use of an on-chip pull-up resistor has been specified.
On-chip pull-up resistors cannot be connected for bits set to output mode and bits used as alternate-function
output pins, regardless of the settings of PU0, PU1, and PU3 to PU7.
These registers can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears these registers to 00H.
Figure 4-17. Format of Pull-up Resistor Option Register
Symbol
PU0
7
0
6
0
5
0
4
0
3
PU032PU021PU010PU00
Address
FF30H
After reset
00H
R/W
R/W
PU1
PU3
PU4
PU5
PU6
PU7
7
PU17
7
0
7
PU47
7
PU57
7
PU67
7
0
6
PU165PU154PU143PU132PU121PU110PU10FF31H00HR/W
6
0
6
PU465PU454PU443PU432PU421PU410PU40FF34H00HR/W
6
PU565PU554PU543PU532PU521PU510PU50FF35H00HR/W
6
PU665PU654PU64
6
0
5
0
5
0
4
0
4
0
PUmn
0 On-chip pull-up resistor not connected
1 On-chip pull-up resistor connected
3
PU332PU321PU310PU30FF33H00HR/W
3
0
3
PU732PU721PU710PU70FF37H00HR/W
Pmn pin on-chip pull-up resistor selection
2
0
(m = 0, 1, 3 to 7; n = 0 to 7)
1
0
0
0FF36H00HR/W
User’s Manual U16928EJ2V0UD
81
CHAPTER 4 PORT FUNCTIONS
4.4 Port Function Operations
Port operations differ depending on whether the input or output mode is set, as shown below.
Caution In the case of a 1-bit memory manipulation instruction, although a single bit is manipulated, the
port is accessed as an 8-bit unit. Therefore, on a port with a mixture of input and output pins,
the output latch contents for pins specified as input are undefined, even for bits other than the
manipulated bit.
4.4.1 Writing to I/O port
(1) Output mode
A value is written to the output latch by a transfer instruction, and the output latch contents are output from the pin.
Once data is written to the output latch, it is retained until data is written to the output latch again.
The data of the output latch is cleared by reset.
(2) Input mode
A value is written to the output latch by a transfer instruction, but since the output buffer is off, the pin status does
not change.
Once data is written to the output latch, it is retained until data is written to the output latch again.
4.4.2 Reading from I/O port
(1) Output mode
The output latch contents are read by a transfer instruction. The output latch contents do not change.
(2) Input mode
The pin status is read by a transfer instruction. The output latch contents do not change.
4.4.3 Operations on I/O port
(1) Output mode
An operation is performed on the output latch contents, and the result is written to the output latch. The output
latch contents are output from the pins.
Once data is written to the output latch, it is retained until data is written to the output latch again.
The data of the output latch is cleared by reset.
(2) Input mode
The pin level is read and an operation is performed on its contents. The result of the operation is written to the
output latch, but since the output buffer is off, the pin status does not change.
82
User’s Manual U16928EJ2V0UD
CHAPTER 4 PORT FUNCTIONS
<R>
4.5 Cautions on 1-Bit Manipulation Instruction for Port Register n (Pn)
When a 1-bit manipulation instruction is executed on a port that provides both input and output functions, the
output latch value of an input port that is not subject to manipulation may be written in addition to the targeted bit.
Therefore, it is recommended to rewrite the output latch when switching a port from input mode to output mode.
<Example> When P10 is an output port, P11 to P17 are input ports (all pin statuses are high level), and the port
latch value of port 1 is 00H, if the output of output port P10 is changed from low level to high level
via a 1-bit manipulation instruction, the output latch value of port 1 is FFH.
Explanation: The targets of writing to and reading from the Pn register of a port whose PMnm bit is 1 are the
output latch and pin status, respectively.
A 1-bit manipulation instruction is executed in the following order in the
<1> The Pn register is read in 8-bit units.
<2> The targeted one bit is manipulated.
<3> The Pn register is written in 8-bit units.
In step <1>, the output latch value (0) of P10, which is an output port, is read, while the pin statuses
of P11 to P17, which are input ports, are read. If the pin statuses of P11 to P17 are high level at
this time, the read value is FEH.
The value is changed to FFH by the manipulation in <2>.
FFH is written to the output latch by the manipulation in <3>.
Figure 4-18. Bit Manipulation Instruction (P10)
1-bit manipulation
P10
Low-level output
P11 to P17
Pin status: High-level
instruction
(set1 P1.0)
is executed for P10
bit.
P10
P11 to P17
μ
PD78F0714.
High-level output
Pin status: High-level
Port 1 output latch
00000000
1-bit manipulation instruction for P10 bit
<1> Port register 1 (P1) is read in 8-bit units.
• In the case of P10, an output port, the value of the port output latch (0) is read.
• In the case of P11 to P17, input ports, the pin status (1) is read.
<2> Set the P10 bit to 1.
<3> Write the results of <2> to the output latch of port register 1 (P1)
in 8-bit units.
User’s Manual U16928EJ2V0UD
Port 1 output latch
11111111
83
CHAPTER 5 CLOCK GENERATOR
5.1 Functions of Clock Generator
The clock generator generates the clock to be supplied to the CPU and peripheral hardware.
The following two system clock oscillators are available.
• X1 oscillator
The X1 oscillator oscillates a clock of f
XP = 5.0 to 20.0 MHz. Oscillation can be stopped by executing the STOP
instruction or setting the main OSC control register (MOC) and processor clock control register (PCC).
• Internal oscillator
The Internal oscillator oscillates a clock of f
R = 240 kHz (TYP.). Oscillation can be stopped by setting the
internal oscillation mode register (RCM) when “Can be stopped by software” is set by an option byte and the X1
input clock is used as the CPU clock.
Remarks 1. f
XP: X1 input clock oscillation frequency
2. fR: internal oscillation clock frequency
5.2 Configuration of Clock Generator
The clock generator consists of the following hardware.
Table 5-1. Configuration of Clock Generator
Control registers
Oscillator
Item Configuration
Processor clock control register (PCC)
Internal oscillation mode register (RCM)
Main clock mode register (MCM)
Main OSC control register (MOC)
Oscillation stabilization time counter status register (OSTC)
Oscillation stabilization time select register (OSTS)
System wait control register (VSWC)
X1 oscillator
Internal oscillator
84
User’s Manual U16928EJ2V0UD
CHAPTER 5 CLOCK GENERATOR
Figure 5-1. Block Diagram of Clock Generator
Internal bus
Oscillation
stabilization time
select register
(OSTS)
OSTS1 OSTS0OSTS2
3
X1 oscillation
MOST
MOST
MOST
14
13
15
Oscillation
stabilization
MOST
time counter
16
status
register
(OSTC)
PCC2
3
Processor clock
control register
(PCC)
PCC1 PCC0
Controller
Control signal
C
P
U
CPU clock
(f
CPU
)
STOP
MSTOP
Main OSC
control
register
(MOC)
MCS
Main clock
mode register
(MCM)
MCM0
stabilization time counter
MOST
11
X1
X2
X1 oscillator
oscillator
Option byte
(LSROSC)
1: Cannot be stopped
0: Can be stopped
Internal oscillation
mode register (RCM)
Internal
RSTOP
f
XP
Operation
clock switch
f
R
Internal bus
Prescaler
f
X
8-bit timer 51,
watchdog timer
f
X
2
Prescaler
f
X
f
X
2
3
2
2
f
X
4
2
Prescaler
Clock to peripheral
hardware
Selector
f
CPU
User’s Manual U16928EJ2V0UD
85
CHAPTER 5 CLOCK GENERATOR
5.3 Registers Controlling Clock Generator
The following seven registers are used to control the clock generator.
• Processor clock control register (PCC)
• Internal oscillation mode register (RCM)
• Main clock mode register (MCM)
• Main OSC control register (MOC)
• Oscillation stabilization time counter status register (OSTC)
• Oscillation stabilization time select register (OSTS)
• System wait control register (VSWC)
(1) Processor clock control register (PCC)
The PCC register is used to set the CPU clock division ratio.
The PCC is set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears PCC to 00H.
Figure 5-2. Format of Processor Clock Control Register (PCC)
Address: FFFBH After reset: 00H R/W
Symbol 7 6 5 4 3 2 1 0
PCC 0 0 0 0 0 PCC2 PCC1 PCC0
CPU clock (fCPU) selection
0 0 0 fX fR fXP
0 0 1 fX/2 fR/2 fXP/2
0 1 0 fX/22
0 1 1 fX/23
1 0 0 fX/24
Other than above Setting prohibited
Note Setting prohibited.
Caution Be sure to clear bit 3 to 7 to 0.
Remarks 1. MCM0: Bit 0 of main clock mode register (MCM)
2. f
3. f
4. f
PCC2 PCC1 PCC0
MCM0 = 0 MCM0 = 1
Note
−
Note
−
Note
−
X: Main system clock oscillation frequency (X1 input clock oscillation frequency or internal
XP/2
f
XP/2
f
XP/2
f
2
3
4
oscillation clock frequency)
R: Internal oscillation clock frequency
XP: X1 input clock oscillation frequency
86
User’s Manual U16928EJ2V0UD
CHAPTER 5 CLOCK GENERATOR
The fastest instruction can be executed in 2 clocks of the CPU clock in the μPD78F0714. Therefore, the
relationship between the CPU clock (fCPU) and minimum instruction execution time is as shown in the Table 5-2.
Table 5-2. Relationship Between CPU Clock and Minimum Instruction Execution Time
CPU Clock (fCPU)
fX
fX/2
fX/22
fX/23
fX/24
X1 Input Clock
At 20 MHz Operation At 16 MHz Operation At 240 kHz (TYP.) Operation
0.1
μ
s 0.125
0.2
μ
s 0.25
0.4
μ
s 0.5
0.8
μ
s 1.0
1.6
μ
s 2.0
Minimum Instruction Execution Time: 2/fCPU
Note 1
Internal Oscillation Clock
μ
s 8.3
μ
s 16.6
μ
s −
μ
s −
μ
s −
μ
s (TYP.)
μ
s (TYP.)
Note 2
Note 2
Note 2
Note 1
Notes 1. The main clock mode register (MCM) is used to set the CPU clock (X1 input clock/internal oscillation
clock) (see Figure 5-4).
2. Setting prohibited.
(2) Internal oscillation mode register (RCM)
This register sets the operation mode of internal oscillator.
This register is valid when “Can be stopped by software” is set for internal oscillator by an option byte, and the X1
input clock is selected as the CPU clock. If “Cannot be stopped” is selected for internal oscillator by an option
byte, settings for this register are invalid.
RCM can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Figure 5-3. Format of Internal Oscillation Mode Register (RCM)
Address: FFA0H After reset: 00H R/W
Symbol 7 6 5 4 3 2 1 <0>
RCM 0 0 0 0 0 0 0 RSTOP
RSTOP Internal oscillator oscillating/stopped
0 Internal oscillator oscillating
1 Internal oscillator stopped
Caution Make sure that the bit 1 (MCS) of the main clock mode register (MCM) is 1 before
setting RSTOP.
User’s Manual U16928EJ2V0UD
87
CHAPTER 5 CLOCK GENERATOR
(3) Main clock mode register (MCM)
This register sets the CPU clock (X1 input clock/internal oscillation clock).
MCM can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Figure 5-4. Format of Main Clock Mode Register (MCM)
Address: FFA1H After reset: 00H R/W
Symbol 7 6 5 4 3 2 <1> <0>
MCM 0 0 0 0 0 0 MCS MCM0
Note
MCS CPU clock status
0 Operates with internal oscillation clock
1 Operates with X1 input clock
MCM0 Selection of source clock to CPU
0 Internal oscillation clock
1 X1 input clock
Note Bit 1 is read-only.
Caution When internal oscillation clock is selected as the source clock to the CPU, the
divided clock of the internal oscillator output (f
X) is supplied to the peripheral
hardware (fX = 240 kHz (TYP.)).
Operation of the peripheral hardware with internal oscillation clock cannot be
guaranteed. Therefore, when internal oscillation clock is selected as the source
clock to the CPU, do not use peripheral hardware. In addition, stop the peripheral
hardware before switching the source clock to the CPU from the X1 input clock to
the internal oscillation clock. Note, however, that the following peripheral hardware
can be used when the CPU operates on the internal oscillation clock.
• Watchdog timer
• 8-bit timer 51 when f
7
R/2
is selected as count clock
• Peripheral hardware selecting external clock as the clock source
(Except when external count clock of 16-bit up/down counter ITENC20 or 16-
bit timer/event counter 00 is selected)
88
User’s Manual U16928EJ2V0UD
CHAPTER 5 CLOCK GENERATOR
(4) Main OSC control register (MOC)
This register selects the operation mode of the X1 input clock.
This register is used to stop the X1 oscillator operation when the CPU is operating with the internal oscillation
clock. Therefore, this register is valid only when the CPU is operating with the internal oscillation clock.
MOC can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Figure 5-5. Format of Main OSC Control Register (MOC)
Address: FFA2H After reset: 00H R/W
Symbol <7> 6 5 4 3 2 1 0
MOC MSTOP 0 0 0 0 0 0 0
MSTOP Control of X1 oscillator operation
0 X1 oscillator operating
1 X1 oscillator stopped
Caution Make sure that bit 1 (MCS) of the main clock mode register (MCM) is 0 before setting
MSTOP.
User’s Manual U16928EJ2V0UD
89
CHAPTER 5 CLOCK GENERATOR
(5) Oscillation stabilization time counter status register (OSTC)
This is the status register of the X1 input clock oscillation stabilization time counter. If the internal oscillation clock
is used as the CPU clock, the X1 input clock oscillation stabilization time can be checked.
OSTC can be read by a 1-bit or 8-bit memory manipulation instruction.
When reset is released (reset by RESET input, POC, LVI, and WDT), the STOP instruction, MSTOP = 1 clear
OSTC to 00H.
Figure 5-6. Format of Oscillation Stabilization Time Counter Status Register (OSTC)
Address: FFA3H After reset: 00H R
Symbol 7 6 5 4 3 2 1 0
OSTC 0 0 0 MOST11 MOST13 MOST14 MOST15 MOST16
Oscillation stabilization time status
1 0 0 0 0 211/fXP min.
1 1 0 0 0 213/fXP min.
1 1 1 0 0 214/fXP min.
1 1 1 1 0 215/fXP min. 1.64 ms min.
1 1 1 1 1 216/fXP min. 3.27 ms min.
MOST11 MOST13 MOST14 MOST15 MOST16
fXP = 20 MHz
102.4
μ
s min.
409.6
μ
s min.
819.2
μ
s min.
Cautions 1. After the above time has elapsed, the bits are set to 1 in order from MOST11 and
remain 1.
2. If the STOP mode is entered and then released while the internal oscillation clock
is being used as the CPU clock, set the oscillation stabilization time as follows.
• Desired OSTC oscillation stabilization time ≤ Oscillation stabilization time
set by OSTS
The X1 oscillation stabilization time counter counts up to the oscillation
stabilization time set by OSTS. Note, therefore, that only the status up to the
oscillation stabilization time set by OSTS is set to OSTC after STOP mode is
released.
3. The wait time when STOP mode is released does not include the time after STOP
mode release until clock oscillation starts (“a” below) regardless of whether
STOP mode is released by RESET input or interrupt generation.
STOP mode release
90
Remark f
X1 pin voltage
waveform
a
XP: X1 input clock oscillation frequency
User’s Manual U16928EJ2V0UD
CHAPTER 5 CLOCK GENERATOR
(6) Oscillation stabilization time select register (OSTS)
This register is used to select the X1 oscillation stabilization wait time when STOP mode is released.
The wait time set by OSTS is valid only after STOP mode is released with the X1 input clock selected as CPU
clock. After STOP mode is released with internal oscillation clock selected as CPU clock, the oscillation
stabilization time must be confirmed by OSTC.
OSTS can be set by an 8-bit memory manipulation instruction.
RESET input sets OSTS to 05H.
Figure 5-7. Format of Oscillation Stabilization Time Select Register (OSTS)
Address: FFA4H After reset: 05H R/W
Symbol 7 6 5 4 3 2 1 0
OSTS 0 0 0 0 0 OSTS2 OSTS1 OSTS0
Oscillation stabilization time selection
0 0 1 211/fXP
0 1 0 213/fXP
0 1 1 214/fXP
1 0 0 215/fXP1.64 ms
1 0 1 216/fXP3.27 ms
Other than above Setting prohibited
OSTS2 OSTS1 OSTS0
fXP = 20 MHz
102.4
μ
s
409.6
μ
s
819.2
μ
s
Cautions 1. If the STOP mode is entered and then released while the internal oscillation
clock is being used as the CPU clock, set the oscillation stabilization time as
follows.
• Desired OSTC oscillation stabilization time ≤ Oscillation stabilization time
set by OSTS
The X1 oscillation stabilization time counter counts up to the oscillation
stabilization time set by OSTS. Note, therefore, that only the status up to the
oscillation stabilization time set by OSTS is set to OSTC after STOP mode is
released.
2. The wait time when STOP mode is released does not include the time after STOP
mode release until clock oscillation starts (“a” below) regardless of whether
STOP mode is released by RESET input or interrupt generation.
STOP mode release
X1 pin voltage
waveform
a
Remark fXP: X1 input clock oscillation frequency
User’s Manual U16928EJ2V0UD
91
CHAPTER 5 CLOCK GENERATOR
(7) System wait control register (VSWC)
This register is used to control wait states when a high-speed CPU and a low-speed peripheral I/O are connected.
VSWC can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Figure 5-8. Format of System Wait Control Register (VSWC)
Address: FFFDH After reset: 00H R/W
Symbol 7 6 5 4 3 2 1 0
VSWC 0 0 0 0 0 0 PDW1 0
PDW1 Control of system clock data wait
0 No wait
1 Two wait states inserted
Cautions 1. Be sure to insert two wait states if the minimum instruction execution time is
μ
0.125
s or less (fXP = 16 MHz or more).
2. Be sure to clear bits 0 and 2 to 7 to 0.
92
User’s Manual U16928EJ2V0UD
CHAPTER 5 CLOCK GENERATOR
5.4 System Clock Oscillator
5.4.1 X1 oscillator
The X1 oscillator oscillates with a crystal resonator or ceramic resonator (Standard: 20 MHz) connected to the X1
and X2 pins.
An external clock can be input to the X1 oscillator. In this case, input the clock signal to the X1 pin and input the
inverse signal to the X2 pin.
Figure 5-9 shows examples of the external circuit of the X1 oscillator.
Figure 5-9. Examples of External Circuit of X1 Oscillator