ChipFind - документация

Электронный компонент: uPD78F0114

Скачать:  PDF   ZIP

Document Outline

Document No. U16227EJ1V0UD00 (1st edition)
Date Published June 2002 N CP(K)
Printed in Japan
2002



PD780111



PD780111(A)



PD780111(A1)



PD780112



PD780112(A)



PD780112(A1)



PD780113



PD780113(A)



PD780113(A1)



PD780114



PD780114(A)



PD780114(A1)



PD78F0114



PD78F0114(A)
78K0/KC1
8-Bit Single-Chip Microcontrollers
Preliminary User's Manual
Preliminary User's
Manual U16227EJ1V0UD
2
[MEMO]
Preliminary User's Manual U16227EJ1V0UD
3
NOTES FOR CMOS DEVICES
1
PRECAUTION AGAINST ESD FOR SEMICONDUCTORS
Note:
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 once, when it has occurred. Environmental control
must be adequate. When it is dry, humidifier should be used. It is recommended to avoid using
insulators that easily build 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 bench and floor should be grounded. The operator should be grounded using
wrist strap. Semiconductor devices must not be touched with bare hands. Similar precautions need
to be taken for PW boards with semiconductor devices on it.
2
HANDLING OF UNUSED INPUT PINS FOR CMOS
Note:
No connection for CMOS device inputs can be cause of malfunction. If no connection is provided
to the input pins, it is possible that an internal input level may be generated due to noise, etc., hence
causing malfunction. CMOS devices behave differently than Bipolar or NMOS devices. Input levels
of CMOS devices must be fixed high or low by using a pull-up or pull-down circuitry. Each unused
pin should be connected to V
DD
or GND with a resistor, if it is considered to have a possibility of
being an output pin. All handling related to the unused pins must be judged device by device and
related specifications governing the devices.
3
STATUS BEFORE INITIALIZATION OF MOS DEVICES
Note:
Power-on does not necessarily define initial status of MOS device. Production process of MOS
does not define the initial operation status of the device. Immediately after the power source is
turned ON, the devices with reset function have not yet been initialized. Hence, power-on does
not guarantee out-pin levels, I/O settings or contents of registers. Device is not initialized until the
reset signal is received. Reset operation must be executed immediately after power-on for devices
having reset function.
Windows and Windows NT are either 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.
Ethernet is a trademark of Xerox Corp.
OSF/Motif is a trademark of Open Software Foundation, Inc.
TRON stands for The Realtime Operating system Nucleus.
ITRON is an abbreviation of Industrial TRON.
Preliminary User's
Manual U16227EJ1V0UD
4
The export of these products from Japan is regulated by the Japanese government. The export of some or all of these
products may be prohibited without governmental license. To export or re-export some or all of these products from a
country other than Japan may also be prohibited without a license from that country. Please call an NEC sales
representative.
License not needed:
PD78F0114 and 78F0114(A)
The customer must judge the need for a license:
PD780111, 780112, 780113, 780114, 780111(A), 780112(A),
780113(A), 780114(A), 780111(A1), 780112(A1), 780113(A1),
and 780114(A1)
The information contained in this document is being issued in advance of the production cycle for the
device. The parameters for the device may change before final production or NEC Corporation, at its own
discretion, may withdraw the device prior to its production.
Not all devices/types available in every country. Please check with local NEC 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 Corporation. NEC Corporation assumes no responsibility for any errors which may appear in
this document.
NEC Corporation does not assume any liability for infringement of patents, copyrights or other intellectual property
rights of third parties by or arising from use of a device described herein or any other liability arising from use
of such device. No license, either express, implied or otherwise, is granted under any patents, copyrights or other
intellectual property rights of NEC Corporation 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 the customer's equipment shall be done under the full responsibility
of the customer. NEC Corporation assumes no responsibility for any losses incurred by the customer or third
parties arising from the use of these circuits, software, and information.
While NEC Corporation has been making continuous effort to enhance the reliability of its semiconductor devices,
the possibility of defects cannot be eliminated entirely. To minimize risks of damage or injury to persons or
property arising from a defect in an NEC semiconductor device, customers must incorporate sufficient safety
measures in its design, such as redundancy, fire-containment, and anti-failure features.
NEC devices are classified into the following three quality grades:
"Standard", "Special", and "Specific". The Specific quality grade applies only to devices developed based on a
customer designated "quality assurance program" for a specific application. The recommended applications of
a device depend on its quality grade, as indicated below. Customers must check the quality grade of each device
before using it in a particular application.
Standard: Computers, office equipment, communications equipment, test and measurement equipment,
audio and visual equipment, home electronic appliances, machine tools, personal electronic
equipment and industrial robots
Special: Transportation equipment (automobiles, trains, ships, etc.), traffic control systems, anti-disaster
systems, anti-crime systems, safety equipment and medical equipment (not specifically designed
for life support)
Specific: Aircraft, aerospace equipment, submersible repeaters, nuclear reactor control systems, life
support systems or medical equipment for life support, etc.
The quality grade of NEC devices is "Standard" unless otherwise specified in NEC's Data Sheets or Data Books.
If customers intend to use NEC devices for applications other than those specified for Standard quality grade,
they should contact an NEC sales representative in advance.
M5D 98. 12
Preliminary User's Manual U16227EJ1V0UD
5
Regional Information
Some information contained in this document may vary from country to country. Before using any NEC
product in your application, pIease contact the NEC office in your country to obtain a list of authorized
representatives and distributors. They will verify:
Device availability
Ordering information
Product release schedule
Availability of related technical literature
Development environment specifications (for example, specifications for third-party tools and
components, host computers, power plugs, AC supply voltages, and so forth)
Network requirements
In addition, trademarks, registered trademarks, export restrictions, and other legal issues may also vary
from country to country.
NEC Electronics Inc. (U.S.)
Santa Clara, California
Tel: 408-588-6000
800-366-9782
Fax: 408-588-6130
800-729-9288
NEC Electronics Hong Kong Ltd.
Hong Kong
Tel: 2886-9318
Fax: 2886-9022/9044
NEC Electronics Hong Kong Ltd.
Seoul Branch
Seoul, Korea
Tel: 02-528-0303
Fax: 02-528-4411
NEC Electronics Shanghai, Ltd.
Shanghai, P.R. China
Tel: 021-6841-1138
Fax: 021-6841-1137
NEC Electronics Taiwan Ltd.
Taipei, Taiwan
Tel: 02-2719-2377
Fax: 02-2719-5951
NEC Electronics Singapore Pte. Ltd.
Novena Square, Singapore
Tel: 253-8311
Fax: 250-3583
NEC do Brasil S.A.
Electron Devices Division
Guarulhos-SP, Brasil
Tel: 11-6462-6810
Fax: 11-6462-6829
J02.4
NEC Electronics (Europe) GmbH
Duesseldorf, Germany
Tel: 0211-65 03 01
Fax: 0211-65 03 327
Sucursal en Espaa
Madrid, Spain
Tel: 091-504 27 87
Fax: 091-504 28 60
Vlizy-Villacoublay, France
Tel: 01-30-67 58 00
Fax: 01-30-67 58 99
Succursale Franaise
Filiale Italiana
Milano, Italy
Tel: 02-66 75 41
Fax: 02-66 75 42 99
Branch The Netherlands
Eindhoven, The Netherlands
Tel: 040-244 58 45
Fax: 040-244 45 80
Branch Sweden
Taeby, Sweden
Tel: 08-63 80 820
Fax: 08-63 80 388
United Kingdom Branch
Milton Keynes, UK
Tel: 01908-691-133
Fax: 01908-670-290
Preliminary User's Manual U16227EJ1V0UD
6
INTRODUCTION
Readers
This manual is intended for user engineers who wish to understand the functions of the
78K0/KC1 Series and design and develop application systems and programs for these
devices.
The target products are as follows.
78K0/KC1 Series:
PD780111, 780112, 780113, 780114, 78F0114, 780111(A),
780112(A), 780113(A), 780114(A), 78F0114(A), 780111(A1),
780112(A1), 780113(A1), and 780114(A1)
Purpose
This manual is intended to give users an understanding of the functions described in the
Organization below.
Organization
The 78K0/KC1 Series manual is separated into two parts: this manual and the
instructions edition (common to the 78K/0 Series).
78K0/KC1
User's Manual
(This Manual)
78K/0 Series
User's Manual
Instructions
Pin functions
Internal block functions
Interrupts
Other on-chip peripheral functions
Electrical specifications (Target values)
CPU functions
Instruction set
Explanation of each instruction
Preliminary User's Manual U16227EJ1V0UD
7
How to Read This Manual
It is assumed that the readers of this manual have general knowledge of electrical
engineering, logic circuits, and microcontrollers.
When using this manual as the manual for (A) products and (A1) products:
Only the quality grade differs between standard products and (A) and (A1)
products. Read the part number as follows.
PD780111 PD780111(A), 780111(A1)
PD780112 PD780112(A), 780112(A1)
PD780113 PD780113(A), 780113(A1)
PD780114 PD780114(A), 780114(A1)
PD78F0114 PD78F0114(A)
To gain a general understanding of functions:
Read this manual in the order of the CONTENTS.
How to interpret the register format:
For a bit number enclosed in square, 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.
Refer to APPENDIX C REGISTER INDEX.
To know details of the 78K/0 Series instructions.
Refer to the separate document 78K/0 Series Instructions User's Manual
(U12326E).
Caution
Examples in this manual employ the "standard" quality grade for
general electronics. When using examples in this manual for the
"special" quality grade, review the quality grade of each part and/or
circuit actually used.
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
...
or B
Decimal
...
Hexadecimal
...
H
Preliminary User's Manual U16227EJ1V0UD
8
Related Documents
The 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.
78K0/KC1 User's Manual
This manual
78K/0 Series Instructions User's Manual
U12326E
Documents Related to Development Tools (Software) (User's Manuals)
Document Name
Document No.
Operation
U14445E
Language
U14446E
RA78K0 Assembler Package
Structured Assembly Language
U11789E
Operation
U14297E
CC78K0 C Compiler
Language
U14298E
SM78K0S, SM78K0 System Simulator Ver. 2.10 or Later
Operation (Windows
TM
Based)
U14611E
SM78K Series System Simulator Ver. 2.10 or Later
External Part User Open Interface
Specifications
U15006E
ID78K Series Integrated Debugger Ver. 2.30 or Later
Operation (Windows Based)
U15185E
Fundamentals
U11537E
RX78K0 Real-Time OS
Installation
U11536E
Project Manager Ver. 3.12 or Later (Windows Based)
U14610E
Documents Related to Development Tools (Hardware) (User's Manuals)
Document Name
Document No.
IE-78K0-NS In-Circuit Emulator
U13731E
IE-78K0-NS-A In-Circuit Emulator
U14889E
IE-780148-NS-EM1 Emulation Board
To be prepared
Documents Related to Flash Memory Programming
Document Name
Document No.
PG-FP3 Flash Memory Programmer User's Manual
U13502E
PG-FP4 Flash Memory Programmer User's Manual
U15260E
Other Documents
Document Name
Document No.
SEMICONDUCTOR SELECTION GUIDE
- Product & Packages -
X13769E
Semiconductor Device Mounting Technology Manual
C10535E
Quality Grades on NEC Semiconductor Devices
C11531E
NEC Semiconductor Device Reliability/Quality Control System
C10983E
Guide to Prevent Damage for Semiconductor Devices by Electrostatic Discharge (ESD)
C11892E
Caution
The related documents listed above are subject to change without notice. Be sure to use the latest
version of each document when designing.
Preliminary User's Manual U16227EJ1V0UD
9
CONTENTS
CHAPTER 1 OUTLINE .............................................................................................................................25
1.1
Features .......................................................................................................................................25
1.2
Applications.................................................................................................................................26
1.3
Ordering Information ..................................................................................................................27
1.4
Pin Configuration (Top View).....................................................................................................29
1.5
78K0/Kxx Series Lineup .............................................................................................................31
1.6
Block Diagram .............................................................................................................................33
1.7
Outline of Functions ...................................................................................................................34
CHAPTER 2 PIN FUNCTIONS ................................................................................................................36
2.1
Pin Function List .........................................................................................................................36
2.2
Description of Pin Functions .....................................................................................................38
2.2.1
P00 and P01 (port 0) ......................................................................................................................38
2.2.2
P10 to P17 (port 1) .........................................................................................................................39
2.2.3
P20 to P27 (port 2) .........................................................................................................................39
2.2.4
P30 to P33 (port 3) .........................................................................................................................40
2.2.5
P60 to P63 (port 6) .........................................................................................................................40
2.2.6
P70 to P73 (port 7) .........................................................................................................................40
2.2.7
P120 (port 12).................................................................................................................................41
2.2.8
P130 (port 13).................................................................................................................................41
2.2.9
AV
REF
..............................................................................................................................................41
2.2.10
AV
SS
...............................................................................................................................................41
2.2.11
RESET ...........................................................................................................................................41
2.2.12
X1 and X2.......................................................................................................................................41
2.2.13
XT1 and XT2 ..................................................................................................................................41
2.2.14
V
DD
and EV
DD
.................................................................................................................................41
2.2.15
V
SS
and EV
SS
..................................................................................................................................41
2.2.16
V
PP
(flash memory versions only) ...................................................................................................41
2.2.17
IC (mask ROM versions only).........................................................................................................42
2.3
Pin I/O Circuits and Recommended Connection of Unused Pins..........................................43
CHAPTER 3 CPU ARCHITECTURE .......................................................................................................46
3.1
Memory Space.............................................................................................................................46
3.1.1
Internal program memory space.....................................................................................................52
3.1.2
Internal data memory space ...........................................................................................................53
3.1.3
Special function register (SFR) area...............................................................................................53
3.1.4
Data memory addressing ...............................................................................................................54
3.2
Processor Registers ...................................................................................................................59
3.2.1
Control registers .............................................................................................................................59
3.2.2
General-purpose registers ..............................................................................................................62
3.2.3
Special Function Registers (SFRs).................................................................................................63
3.3
Instruction Address Addressing ...............................................................................................67
3.3.1
Relative addressing ........................................................................................................................67
3.3.2
Immediate addressing ....................................................................................................................68
Preliminary User's Manual U16227EJ1V0UD
10
3.3.3
Table indirect addressing............................................................................................................... 69
3.3.4
Register addressing....................................................................................................................... 69
3.4
Operand Address Addressing .................................................................................................. 70
3.4.1
Implied addressing......................................................................................................................... 70
3.4.2
Register addressing....................................................................................................................... 71
3.4.3
Direct addressing........................................................................................................................... 72
3.4.4
Short direct addressing .................................................................................................................. 73
3.4.5
Special function register (SFR) addressing ................................................................................... 74
3.4.6
Register indirect addressing .......................................................................................................... 75
3.4.7
Based addressing .......................................................................................................................... 76
3.4.8
Based indexed addressing ............................................................................................................ 77
3.4.9
Stack addressing ........................................................................................................................... 77
CHAPTER 4 PORT FUNCTIONS ........................................................................................................... 78
4.1
Port Functions ............................................................................................................................ 78
4.2
Port Configuration...................................................................................................................... 80
4.2.1
Port 0 ............................................................................................................................................. 81
4.2.2
Port 1 ............................................................................................................................................. 83
4.2.3
Port 2 ............................................................................................................................................. 89
4.2.4
Port 3 ............................................................................................................................................. 90
4.2.5
Port 6 ............................................................................................................................................. 92
4.2.6
Port 7 ............................................................................................................................................. 93
4.2.7
Port 12 ........................................................................................................................................... 94
4.2.8
Port 13 ........................................................................................................................................... 95
4.3
Registers Controlling Port Function ........................................................................................ 96
4.4
Port Function Operations ........................................................................................................ 100
4.4.1
Writing to I/O port......................................................................................................................... 100
4.4.2
Reading from I/O port .................................................................................................................. 100
4.4.3
Operations on I/O port ................................................................................................................. 100
CHAPTER 5 CLOCK GENERATOR .................................................................................................... 101
5.1
Functions of Clock Generator................................................................................................. 101
5.2
Configuration of Clock Generator .......................................................................................... 102
5.3
Registers Controlling Clock Generator.................................................................................. 103
5.4
System Clock Oscillator .......................................................................................................... 109
5.4.1
X1 oscillator ................................................................................................................................. 109
5.4.2
Subsystem clock oscillator........................................................................................................... 109
5.4.3
When subsystem clock is not used.............................................................................................. 112
5.4.4
Ring-OSC oscillator ..................................................................................................................... 112
5.4.5
Prescaler ..................................................................................................................................... 112
5.5
Clock Generator Operation ..................................................................................................... 112
5.6
Time Required to Switch Between Ring-OSC Clock and X1 Input Clock........................... 119
5.7
Changing System Clock and CPU Clock Settings................................................................ 120
5.7.1
Time required for switching between system clock and CPU clock ............................................. 120
5.8
Clock Switching Flowchart and Register Setting ................................................................. 121
5.8.1
Switching from Ring-OSC clock to X1 input clock........................................................................ 121
5.8.2
Switching from X1 input clock to Ring-OSC clock........................................................................ 122
5.8.3
Switching from X1 input clock to subsystem clock....................................................................... 123
Preliminary User's Manual U16227EJ1V0UD
11
5.8.4
Switching from subsystem clock to X1 input clock........................................................................124
5.8.5
Register settings...........................................................................................................................125
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00............................................................................126
6.1
Functions of 16-Bit Timer/Event Counter 00..........................................................................126
6.2
Configuration of 16-Bit Timer/Event Counter 00 ...................................................................127
6.3
Registers Controlling 16-Bit Timer/Event Counter 00...........................................................130
6.4
Operation of 16-Bit Timer/Event Counter 00 ..........................................................................136
6.4.1
Interval timer operation.................................................................................................................136
6.4.2
PPG output operations .................................................................................................................138
6.4.3
Pulse width measurement operations...........................................................................................140
6.4.4
External event counter operation..................................................................................................147
6.4.5
Square-wave output operation .....................................................................................................149
6.4.6
One-shot pulse output operation ..................................................................................................150
6.5
Cautions for 16-Bit Timer/Event Counter 00 ..........................................................................155
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51 ...........................................................159
7.1
Functions of 8-Bit Timer/Event Counters 50 and 51 .............................................................159
7.2
Configuration of 8-Bit Timer/Event Counters 50 and 51 .......................................................161
7.3
Registers Controlling 8-Bit Timer/Event Counters 50 and 51 ..............................................162
7.4
Operations of 8-Bit Timer/Event Counters 50 and 51............................................................168
7.4.1
Operation as interval timer ...........................................................................................................168
7.4.2
Operation as external event counter.............................................................................................170
7.4.3
Square-wave output operation .....................................................................................................171
7.4.4
PWM output operation..................................................................................................................173
7.5
Cautions for 8-Bit Timer/Event Counters 50 and 51..............................................................175
CHAPTER 8 8-BIT TIMERS H0 AND H1 ...........................................................................................176
8.1
Functions of 8-Bit Timers H0 and H1 ......................................................................................176
8.2
Configuration of 8-Bit Timers H0 and H1 ...............................................................................176
8.3
Registers Controlling 8-Bit Timers H0 and H1.......................................................................178
8.4
Operation of 8-Bit Timers H0 and H1 ......................................................................................181
8.4.1
Operation as interval timer ...........................................................................................................181
8.4.2
Operation as PWM pulse generator .............................................................................................184
8.4.3
Carrier generator mode operation (8-bit timer H1 only) ................................................................190
CHAPTER 9 WATCH TIMER ................................................................................................................197
9.1
Functions of Watch Timer........................................................................................................197
9.2
Configuration of Watch Timer .................................................................................................199
9.3
Register Controlling Watch Timer...........................................................................................199
9.4
Watch Timer Operations ..........................................................................................................201
9.4.1
Watch timer operation ..................................................................................................................201
9.4.2
Interval timer operation.................................................................................................................202
CHAPTER 10 WATCHDOG TIMER ......................................................................................................204
10.1 Functions of Watchdog Timer .................................................................................................204
Preliminary User's Manual U16227EJ1V0UD
12
10.2 Configuration of Watchdog Timer .......................................................................................... 206
10.3 Registers Controlling Watchdog Timer ................................................................................. 207
10.4 Operation of Watchdog Timer................................................................................................. 209
10.4.1
Watchdog timer operation when "Ring-OSC cannot be stopped" is selected by a mask option .. 209
10.4.2
Watchdog timer operation when "Ring-OSC can be stopped by software" is selected
by mask option............................................................................................................................. 210
10.4.3
Watchdog timer operation in STOP mode (when "Ring-OSC can be stopped by software" is
selected by mask option) ............................................................................................................. 211
10.4.4
Watchdog timer operation in HALT mode (when "Ring-OSC can be stopped by software" is
selected by mask option) ............................................................................................................. 213
CHAPTER 11 A/D CONVERTER ......................................................................................................... 214
11.1 Functions of A/D Converter .................................................................................................... 214
11.2 Configuration of A/D Converter .............................................................................................. 216
11.3 Registers Controlling A/D Converter ..................................................................................... 218
11.4 A/D Converter Operations ....................................................................................................... 222
11.4.1
Basic operations of A/D converter ............................................................................................... 222
11.4.2
Input voltage and conversion results ........................................................................................... 224
11.4.3
A/D converter operation mode ..................................................................................................... 225
11.5 How to Read A/D Converter Characteristics Table............................................................... 228
11.6 Cautions for A/D Converter ..................................................................................................... 230
CHAPTER 12 SERIAL INTERFACE UART0 ...................................................................................... 235
12.1 Functions of Serial Interface UART0...................................................................................... 235
12.2 Configuration of Serial Interface UART0 ............................................................................... 236
12.3 Registers Controlling Serial Interface UART0....................................................................... 239
12.4 Operation of Serial Interface UART0 ...................................................................................... 243
12.4.1
Operation stop mode ................................................................................................................... 243
12.4.2
Asynchronous serial interface (UART) mode............................................................................... 244
12.4.3
Dedicated baud rate generator .................................................................................................... 252
CHAPTER 13 SERIAL INTERFACE UART6 ...................................................................................... 258
13.1 Functions of Serial Interface UART6...................................................................................... 258
13.2 Configuration of Serial Interface UART6 ............................................................................... 262
13.3 Registers Controlling Serial Interface UART6....................................................................... 265
13.4 Operation of Serial Interface UART6 ...................................................................................... 273
13.4.1
Operation stop mode ................................................................................................................... 273
13.4.2
Asynchronous serial interface (UART) mode............................................................................... 274
13.4.3
Dedicated baud rate generator .................................................................................................... 292
CHAPTER 14 SERIAL INTERFACE CSI10 ........................................................................................ 301
14.1 Functions of Serial Interface CSI10........................................................................................ 301
14.2 Configuration of Serial Interface CSI10 ................................................................................. 301
14.3 Registers Controlling Serial Interface CSI10......................................................................... 303
14.4 Operation of Serial Interface CSI10 ........................................................................................ 305
14.4.1
Operation stop mode ................................................................................................................... 305
14.4.2
3-wire serial I/O mode.................................................................................................................. 306
Preliminary User's Manual U16227EJ1V0UD
13
CHAPTER 15 INTERRUPT FUNCTIONS .............................................................................................314
15.1 Interrupt Function Types..........................................................................................................314
15.2 Interrupt Sources and Configuration ......................................................................................314
15.3 Registers Controlling Interrupt Functions .............................................................................317
15.4 Interrupt Servicing Operations ................................................................................................324
15.4.1
Maskable interrupt acknowledgement ..........................................................................................324
15.4.2
Software interrupt request acknowledgement ..............................................................................326
15.4.3
Multiple interrupt servicing ............................................................................................................327
15.4.4
Interrupt request hold ...................................................................................................................330
CHAPTER 16 KEY INTERRUPT FUNCTION ......................................................................................331
16.1 Functions of Key Interrupt .......................................................................................................331
16.2 Configuration of Key Interrupt.................................................................................................331
16.3 Register Controlling Key Interrupt ..........................................................................................332
CHAPTER 17 STANDBY FUNCTION ...................................................................................................333
17.1 Standby Function and Configuration .....................................................................................333
17.1.1
Standby function...........................................................................................................................333
17.1.2
Registers controlling standby function ..........................................................................................335
17.2 Standby Function Operation....................................................................................................337
17.2.1
HALT mode ..................................................................................................................................337
17.2.2
STOP mode..................................................................................................................................341
CHAPTER 18 RESET FUNCTION ........................................................................................................344
18.1 Register for Confirming Reset Source ...................................................................................349
CHAPTER 19 CLOCK MONITOR .........................................................................................................350
19.1 Functions of Clock Monitor .....................................................................................................350
19.2 Configuration of Clock Monitor ...............................................................................................350
19.3 Registers Controlling Clock Monitor ......................................................................................351
19.4 Operation of Clock Monitor......................................................................................................352
CHAPTER 20 POWER-ON-CLEAR CIRCUIT ......................................................................................356
20.1 Functions of Power-on-Clear Circuit ......................................................................................356
20.2 Configuration of Power-on-Clear Circuit ................................................................................357
20.3 Operation of Power-on-Clear Circuit ......................................................................................357
20.4 Cautions for Power-on-Clear Circuit.......................................................................................358
CHAPTER 21 LOW-VOLTAGE DETECTOR ........................................................................................360
21.1 Functions of Low-Voltage Detector ........................................................................................360
21.2 Configuration of Low-Voltage Detector ..................................................................................360
21.3 Registers Controlling Low-Voltage Detector .........................................................................361
21.4 Operation of Low-Voltage Detector.........................................................................................364
21.5 Cautions for Low-Voltage Detector.........................................................................................368
Preliminary User's Manual U16227EJ1V0UD
14
CHAPTER 22 MASK OPTIONS ........................................................................................................... 372
CHAPTER 23



PD78F0114 ................................................................................................................... 373
23.1 Internal Memory Size Switching Register.............................................................................. 374
23.2 Flash Memory Programming................................................................................................... 375
23.2.1
Selection of communication mode ............................................................................................... 375
23.2.2
Flash memory programming function .......................................................................................... 376
23.2.3
Connecting Flashpro III/Flashpro IV ............................................................................................ 377
23.2.4
Connection on adapter for flash memory writing.......................................................................... 379
CHAPTER 24 INSTRUCTION SET....................................................................................................... 384
24.1 Conventions Used in Operation List ...................................................................................... 384
24.1.1
Operand identifiers and specification methods ............................................................................ 384
24.1.2
Description of operation column .................................................................................................. 385
24.1.3
Description of flag operation column............................................................................................ 385
24.2 Operation List ........................................................................................................................... 386
24.3 Instructions Listed by Addressing Type................................................................................ 394
CHAPTER 25 ELECTRICAL SPECIFICATIONS (TARGET VALUES) ............................................. 397
CHAPTER 26 PACKAGE DRAWING................................................................................................... 413
CHAPTER 27 CAUTIONS FOR WAIT................................................................................................. 414
27.1 Cautions for Wait...................................................................................................................... 414
27.2 Peripheral Hardware That Generates Wait ............................................................................ 415
27.3 Example of Wait Occurrence .................................................................................................. 416
APPENDIX A DEVELOPMENT TOOLS............................................................................................... 417
A.1
Software Package..................................................................................................................... 419
A.2
Language Processing Software.............................................................................................. 420
A.3
Flash Memory Writing Tools ................................................................................................... 421
A.4
Debugging Tools ...................................................................................................................... 422
A.4.1
Hardware ..................................................................................................................................... 422
A.4.2
Software ...................................................................................................................................... 423
APPENDIX B EMBEDDED SOFTWARE ............................................................................................. 424
APPENDIX C REGISTER INDEX ......................................................................................................... 425
C.1
Register Index (In Alphabetical Order with Respect to Register Names) .......................... 425
C.2
Register Index (In Alphabetical Order with Respect to Register Symbol) ......................... 428
Preliminary User's Manual U16227EJ1V0UD
15
LIST OF FIGURES (1/7)
Figure No.
Title
Page
2-1
Pin I/O Circuit List .................................................................................................................................... 44
3-1
Memory Map (
PD780111)......................................................................................................................47
3-2
Memory Map (
PD780112)......................................................................................................................48
3-3
Memory Map (
PD780113)......................................................................................................................49
3-4
Memory Map (
PD780114)......................................................................................................................50
3-5
Memory Map (
PD78F0114).................................................................................................................... 51
3-6
Data Memory Addressing (
PD780111) .................................................................................................. 54
3-7
Data Memory Addressing (
PD780112) .................................................................................................. 55
3-8
Data Memory Addressing (
PD780113) .................................................................................................. 56
3-9
Data Memory Addressing (
PD780114) .................................................................................................. 57
3-10
Data Memory Addressing (
PD78F0114) ................................................................................................ 58
3-11
Format of Program Counter ..................................................................................................................... 59
3-12
Format of Program Status Word .............................................................................................................. 59
3-13
Format of Stack Pointer ........................................................................................................................... 61
3-14
Data to Be Saved to Stack Memory ......................................................................................................... 61
3-15
Data to Be Restored from Stack Memory................................................................................................. 61
3-16
Configuration of General-Purpose Registers............................................................................................ 62
4-1
Port Types................................................................................................................................................ 78
4-2
Block Diagram of P00 .............................................................................................................................. 81
4-3
Block Diagram of P01 .............................................................................................................................. 82
4-4
Block Diagram of P10 .............................................................................................................................. 83
4-5
Block Diagram of P11 and P14 ................................................................................................................ 84
4-6
Block Diagram of P12 .............................................................................................................................. 85
4-7
Block Diagram of P13 .............................................................................................................................. 86
4-8
Block Diagram of P15 .............................................................................................................................. 87
4-9
Block Diagram of P16 and P17 ................................................................................................................ 88
4-10
Block Diagram of P20 to P27 ................................................................................................................... 89
4-11
Block Diagram of P30 to P32 ................................................................................................................... 90
4-12
Block Diagram of P33 .............................................................................................................................. 91
4-13
Block Diagram of P60 to P63 ................................................................................................................... 92
4-14
Block Diagram of P70 to P73 ................................................................................................................... 93
4-15
Block Diagram of P120 ............................................................................................................................ 94
4-16
Block Diagram of P130 ............................................................................................................................ 95
4-17
Format of Port Mode Register .................................................................................................................. 96
4-18
Format of Pull-up Resistor Option Register.............................................................................................. 98
4-19
Format of Input Switch Control Register (ISC) ......................................................................................... 99
5-1
Block Diagram of Clock Generator......................................................................................................... 102
5-2
Subsystem Clock Feedback Resistor..................................................................................................... 103
5-3
Format of Processor Clock Control Register (PCC) ............................................................................... 104
5-4
Format of Ring-OSC Mode Register (RCM)........................................................................................... 105
5-5
Format of Main Clock Mode Register (MCM) ......................................................................................... 106
Preliminary User's Manual U16227EJ1V0UD
16
LIST OF FIGURES (2/7)
Figure No.
Title
Page
5-6
Format of Main OSC Control Register (MOC) ........................................................................................107
5-7
Format of Oscillation Stabilization Time Counter Status Register (OSTC) .............................................107
5-8
Format of Oscillation Stabilization Time Select Register (OSTS) ...........................................................108
5-9
External Circuit of X1 Oscillator..............................................................................................................109
5-10
External Circuit of Subsystem Clock Oscillator.......................................................................................109
5-11
Examples of Incorrect Resonator Connection ........................................................................................110
5-12
Timing Diagram of CPU Default Start Using Ring-OSC .........................................................................113
5-13
Status Transition Diagram ......................................................................................................................114
5-14
Switching from Ring-OSC Clock to X1 Input Clock (Flowchart)..............................................................121
5-15
Switching from X1 Input Clock to Ring-OSC Clock (Flowchart)..............................................................122
5-16
Switching from X1 Input Clock to Subsystem Clock (Flowchart) ............................................................123
5-17
Switching from Subsystem Clock to X1 Input Clock (Flowchart) ............................................................124
6-1
Block Diagram of 16-Bit Timer/Event Counter 00...................................................................................127
6-2
Format of 16-Bit Timer Mode Control Register 00 (TMC00)...................................................................131
6-3
Format of Capture/Compare Control Register 00 (CRC00)....................................................................132
6-4
Format of 16-Bit Timer Output Control Register 00 (TOC00) .................................................................133
6-5
Format of Prescaler Mode Register 00 (PRM00) ...................................................................................134
6-6
Format of Port Mode Register 0 (PM0)...................................................................................................135
6-7
Control Register Settings for Interval Timer Operation ...........................................................................136
6-8
Interval Timer Configuration Diagram.....................................................................................................137
6-9
Timing of Interval Timer Operation .........................................................................................................137
6-10
Control Register Settings for PPG Output Operation .............................................................................138
6-11
Configuration of PPG Output..................................................................................................................139
6-12
PPG Output Operation Timing................................................................................................................139
6-13
Control Register Settings for Pulse Width Measurement with Free-Running Counter
and One Capture Register......................................................................................................................140
6-14
Configuration Diagram for Pulse Width Measurement with Free-Running Counter................................141
6-15
Timing of Pulse Width Measurement Operation with Free-Running Counter
and One Capture Register (with Both Edges Specified).........................................................................141
6-16
Control Register Settings for Measurement of Two Pulse Widths with Free-Running Counter ..............142
6-17
CR010 Capture Operation with Rising Edge Specified ..........................................................................143
6-18
Timing of Pulse Width Measurement Operation with Free-Running Counter
(with Both Edges Specified) ...................................................................................................................143
6-19
Control Register Settings for Pulse Width Measurement with Free-Running Counter and
Two Capture Registers...........................................................................................................................144
6-20
Timing of Pulse Width Measurement Operation with Free-Running Counter
and Two Capture Registers (with Rising Edge Specified) ......................................................................145
6-21
Control Register Settings for Pulse Width Measurement by Means of Restart.......................................146
6-22
Timing of Pulse Width Measurement Operation by Means of Restart
(with Rising Edge Specified)...................................................................................................................146
6-23
Control Register Settings in External Event Counter Mode ....................................................................147
6-24
Configuration Diagram of External Event Counter..................................................................................148
6-25
External Event Counter Operation Timing (with Rising Edge Specified) ................................................148
Preliminary User's Manual U16227EJ1V0UD
17
LIST OF FIGURES (3/7)
Figure No.
Title
Page
6-26
Control Register Settings in Square-Wave Output Mode ....................................................................... 149
6-27
Square-Wave Output Operation Timing ................................................................................................. 149
6-28
Control Register Settings for One-Shot Pulse Output with Software Trigger ......................................... 151
6-29
Timing of One-Shot Pulse Output Operation with Software Trigger ....................................................... 152
6-30
Control Register Settings for One-Shot Pulse Output with External Trigger .......................................... 153
6-31
Timing of One-Shot Pulse Output Operation with External Trigger (with Rising Edge Specified) .......... 154
6-32
Start Timing of 16-Bit Timer Counter 00 (TM00) .................................................................................... 155
6-33
Timings After Change of Compare Register During Timer Count Operation.......................................... 155
6-34
Capture Register Data Retention Timing ............................................................................................... 156
6-35
Operation Timing of OVF00 Flag ........................................................................................................... 157
7-1
Block Diagram of 8-Bit Timer/Event Counter 50..................................................................................... 159
7-2
Block Diagram of 8-Bit Timer/Event Counter 51..................................................................................... 160
7-3
Format of Timer Clock Selection Register 50 (TCL50)........................................................................... 162
7-4
Format of Timer Clock Selection Register 51 (TCL51)........................................................................... 163
7-5
Format of 8-Bit Timer Mode Control Register 50 (TMC50) .................................................................... 164
7-6
Format of 8-Bit Timer Mode Control Register 51 (TMC51) .................................................................... 165
7-7
Format of Port Mode Register 1 (PM1) .................................................................................................. 167
7-8
Format of Port Mode Register 3 (PM3) .................................................................................................. 167
7-9
Interval Timer Operation Timing............................................................................................................. 168
7-10
External Event Counter Operation Timing (with Rising Edge Specified) ................................................ 170
7-11
Square-Wave Output Operation Timing ................................................................................................. 172
7-12
PWM Output Operation Timing .............................................................................................................. 174
7-13
Timing of Operation with CR5n Changed............................................................................................... 175
7-14
8-Bit Timer Counter 5n Start Timing....................................................................................................... 175
8-1
Block Diagram of 8-Bit Timer H0............................................................................................................ 176
8-2
Block Diagram of 8-Bit Timer H1............................................................................................................ 177
8-3
Format of 8-Bit Timer H Mode Register 0 (TMHMD0) ............................................................................ 178
8-4
Format of 8-Bit Timer H Mode Register 1 (TMHMD1) ............................................................................ 179
8-5
Format of 8-Bit Timer H Carrier Control Register 1 (TMCYC1) .............................................................. 180
8-6
Register Setting in Interval Timer Mode ................................................................................................. 181
8-7
Timing of Interval Timer Operation......................................................................................................... 182
8-8
Register Setting in PWM Pulse Generator Mode ................................................................................... 184
8-9
Operation Timing in PWM Pulse Generator Mode ................................................................................. 186
8-10
Example of Connection Between 8-Bit Timer H1 and 8-Bit Timer/Event Counter 51 ............................. 190
8-11
Transfer Timing ...................................................................................................................................... 191
8-12
Register Setting in Carrier Generator Mode ........................................................................................... 192
8-13
Carrier Generator Mode Operation Timing............................................................................................. 194
9-1
Watch Timer Block Diagram................................................................................................................... 197
9-2
Format of Watch Timer Operation Mode Register (WTM)...................................................................... 200
9-3
Operation Timing of Watch Timer/Interval Timer.................................................................................... 203
Preliminary User's Manual U16227EJ1V0UD
18
LIST OF FIGURES (4/7)
Figure No.
Title
Page
10-1
Block Diagram of Watchdog Timer .........................................................................................................206
10-2
Format of Watchdog Timer Mode Register (WDTM) ..............................................................................207
10-3
Format of Watchdog Timer Enable Register (WDTE) ............................................................................208
10-4
Operation in STOP Mode (CPU Clock and WDT Operation Clock: X1 Input Clock) ..............................211
10-5
Operation in STOP Mode (CPU Clock: X1 Input Clock, WDT Operation Clock: Ring-OSC Clock) ........211
10-6
Operation in STOP Mode (CPU Clock: Ring-OSC Clock, WDT Operation Clock: X1 Input Clock) ........212
10-7
Operation in STOP Mode (CPU Clock and WDT Operation Clock: Ring-OSC Clock) ...........................213
10-8
Operation in HALT Mode........................................................................................................................213
11-1
Block Diagram of A/D Converter ............................................................................................................214
11-2
Block Diagram of Power-Fail Detection Function ...................................................................................215
11-3
Format of A/D Conversion Register (ADCR) ..........................................................................................216
11-4
Format of A/D Converter Mode Register (ADM) .....................................................................................218
11-5
Timing Chart When Boost Reference Voltage Generator Is Used..........................................................219
11-6
Format of Analog Input Channel Specification Register (ADS) ..............................................................220
11-7
Format of Power-Fail Comparison Mode Register (PFM).......................................................................221
11-8
Format of Power-Fail Comparison Threshold Register (PFT) ................................................................221
11-9
Basic Operation of A/D Converter ..........................................................................................................223
11-10
Relationship Between Analog Input Voltage and A/D Conversion Result ..............................................224
11-11
A/D Conversion Operation......................................................................................................................225
11-12
Power-Fail Detection (When PFEN = 1 and PFCM = 0).........................................................................226
11-13
Overall Error ...........................................................................................................................................228
11-14
Quantization Error ..................................................................................................................................228
11-15
Zero-Scale Error .....................................................................................................................................229
11-16
Full-Scale Error ......................................................................................................................................229
11-17
Integral Linearity Error ............................................................................................................................229
11-18
Differential Linearity Error.......................................................................................................................229
11-19
Circuit Configuration of Series Resistor String .......................................................................................230
11-20
Storing Conversion Result in ADCR and Timing of Data Read from ADCR ...........................................231
11-21
Analog Input Pin Connection ..................................................................................................................232
11-22
Timing of A/D Conversion End Interrupt Request Generation ................................................................233
11-23
Timing of A/D Converter Sampling and A/D Conversion Start Delay .....................................................234
12-1
Block Diagram of Serial Interface UART0 ..............................................................................................237
12-2
Format of Asynchronous Serial Interface Operation Mode Register 0 (ASIM0) .....................................239
12-3
Format of Asynchronous Serial Interface Reception Error Status Register 0 (ASIS0) ...........................241
12-4
Format of Baud Rate Generator Control Register 0 (BRGC0)................................................................242
12-5
Format of Normal UART Transmit/Receive Data ...................................................................................247
12-6
Example of Normal UART Transmit/Receive Data Format.....................................................................247
12-7
Normal Transmission Completion Interrupt Request Timing ..................................................................249
12-8
Reception Completion Interrupt Request Timing....................................................................................250
12-9
Noise Filter Circuit ..................................................................................................................................251
12-10
Configuration of Baud Rate Generator ...................................................................................................252
12-11
Permissible Baud Rate Range During Reception...................................................................................256
Preliminary User's Manual U16227EJ1V0UD
19
LIST OF FIGURES (5/7)
Figure No.
Title
Page
13-1
LIN Transmission Operation................................................................................................................... 259
13-2
LIN Reception Operation........................................................................................................................ 260
13-3
Port Configuration for LIN Reception Operation..................................................................................... 261
13-4
Block Diagram of Serial Interface UART6 .............................................................................................. 263
13-5
Format of Asynchronous Serial Interface Operation Mode Register 6 (ASIM6) ..................................... 265
13-6
Format of Asynchronous Serial Interface Reception Error Status Register 6 (ASIS6) ........................... 267
13-7
Format of Asynchronous Serial Interface Transmission Status Register 6 (ASIF6) ............................... 268
13-8
Format of Clock Selection Register 6 (CKSR6)...................................................................................... 269
13-9
Format of Baud Rate Generator Control Register 6 (BRGC6) ............................................................... 270
13-10
Format of Asynchronous Serial Interface Control Register 6 (ASICL6).................................................. 271
13-11
Format of Normal UART Transmit/Receive Data ................................................................................... 280
13-12
Example of Normal UART Transmit/Receive Data Format .................................................................... 281
13-13
Normal Transmission Completion Interrupt Request Timing .................................................................. 283
13-14
Processing Flow of Continuous Transmission........................................................................................ 285
13-15
Timing of Starting Continuous Transmission.......................................................................................... 286
13-16
Timing of Ending Continuous Transmission ........................................................................................... 287
13-17
Reception Completion Interrupt Request Timing.................................................................................... 288
13-18
Reception Error Interrupt........................................................................................................................ 289
13-19
Noise Filter Circuit.................................................................................................................................. 290
13-20
SBF Transmission.................................................................................................................................. 290
13-21
SBF Reception ....................................................................................................................................... 291
13-22
Configuration of Baud Rate Generator ................................................................................................... 293
13-23
Permissible Baud Rate Range During Reception................................................................................... 298
13-24
Transfer Rate During Continuous Transmission .................................................................................... 300
14-1
Block Diagram of Serial Interface CSI10 ................................................................................................ 302
14-2
Format of Serial Operation Mode Register 10 (CSIM10) ....................................................................... 303
14-3
Format of Serial Clock Selection Register 10 (CSIC10) ......................................................................... 304
14-4
Timing in 3-Wire Serial I/O Mode ........................................................................................................... 309
14-5
Timing of Clock/Data Phase................................................................................................................... 311
14-6
Output Operation of First Bit................................................................................................................... 312
14-7
Output Value of SO10 Pin (Last Bit)....................................................................................................... 313
15-1
Basic Configuration of Interrupt Function ............................................................................................... 316
15-2
Format of Interrupt Request Flag Registers (IF0L, IF0H, IF1L).............................................................. 319
15-3
Format of Interrupt Mask Flag Registers (MK0L, MK0H, MK1L) ............................................................ 320
15-4
Format of Priority Specification Flag Registers (PR0L, PR0H, PR1L).................................................... 321
15-5
Format of External Interrupt Rising Edge Enable Register (EGP)
and External Interrupt Falling Edge Enable Register (EGN) .................................................................. 322
15-6
Format of Program Status Word ............................................................................................................ 323
15-7
Interrupt Request Acknowledgement Processing Algorithm................................................................... 325
15-8
Interrupt Request Acknowledgement Timing (Minimum Time)............................................................... 326
15-9
Interrupt Request Acknowledgement Timing (Maximum Time).............................................................. 326
15-10
Examples of Multiple Interrupt Servicing ................................................................................................ 328
Preliminary User's Manual U16227EJ1V0UD
20
LIST OF FIGURES (6/7)
Figure No.
Title
Page
15-11
Interrupt Request Hold ...........................................................................................................................330
16-1
Block Diagram of Key Interrupt...............................................................................................................331
16-2
Format of Key Return Mode Register (KRM)..........................................................................................332
17-1
Operation Timing When STOP Mode Is Released .................................................................................334
17-2
Format of Oscillation Stabilization Time Counter Status Register (OSTC) .............................................335
17-3
Format of Oscillation Stabilization Time Select Register (OSTS) ...........................................................336
17-4
HALT Mode Release by Interrupt Request Generation ..........................................................................339
17-5
HALT Mode Release by RESET Input ...................................................................................................340
17-6
STOP Mode Release by Interrupt Request Generation .........................................................................342
17-7
STOP Mode Release by RESET Input ...................................................................................................343
18-1
Block Diagram of Reset Function ...........................................................................................................345
18-2
Timing of Reset by RESET Input............................................................................................................346
18-3
Timing of Reset Due to Watchdog Timer Overflow ................................................................................346
18-4
Timing of Reset in STOP Mode by RESET Input ...................................................................................346
18-5
Format of Reset Control Flag Register (RESF) ......................................................................................349
19-1
Block Diagram of Clock Monitor .............................................................................................................350
19-2
Format of Clock Monitor Mode Register (CLM) ......................................................................................351
19-3
Timing of Clock Monitor..........................................................................................................................353
20-1
Block Diagram of Power-on-Clear Circuit ...............................................................................................357
20-2
Timing of Internal Reset Signal Generation in Power-on-Clear Circuit ...................................................357
20-3
Example of Software Processing After Release of Reset.......................................................................358
21-1
Block Diagram of Low-Voltage Detector.................................................................................................360
21-2
Format of Low-Voltage Detection Register (LVIM) .................................................................................362
21-3
Format of Low-Voltage Detection Level Selection Register (LVIS) ........................................................363
21-4
Timing of Low-Voltage Detector Internal Reset Signal Generation ........................................................365
21-5
Timing of Low-Voltage Detector Interrupt Signal Generation .................................................................367
21-6
Example of Software Processing After Release of Reset.......................................................................369
21-7
Example of Software Processing of LVI Interrupt ...................................................................................371
23-1
Format of Internal Memory Size Switching Register (IMS) .....................................................................374
23-2
Communication Mode Selection Format.................................................................................................376
23-3
Connection of Flashpro III/Flashpro IV in 3-Wire Serial I/O Mode ..........................................................377
23-4
Connection of Flashpro III/Flashpro IV in 3-Wire Serial I/O Mode (Using Handshake) ..........................377
23-5
Connection of Flashpro III/Flashpro IV in UART (UART0) Mode............................................................378
23-6
Connection of Flashpro III/Flashpro IV in UART (UART0) Mode (Using Handshake) ............................378
23-7
Connection of Flashpro III/Flashpro IV in UART (UART6) Mode............................................................378
23-8
Example of Wiring Adapter for Flash Memory Writing in 3-Wire Serial I/O Mode...................................379
23-9
Example of Wiring Adapter for Flash Memory Writing in 3-Wire Serial I/O Mode (Using Handshake) ...380
Preliminary User's Manual U16227EJ1V0UD
21
LIST OF FIGURES (7/7)
Figure No.
Title
Page
23-10
Example of Wiring Adapter for Flash Memory Writing in UART (UART0) Mode .................................... 381
23-11
Example of Wiring Adapter for Flash Memory Writing in UART (UART0) Mode (Using Handshake)..... 382
23-12
Example of Wiring Adapter for Flash Memory Writing in UART (UART6) Mode .................................... 383
A-1
Development Tool Configuration............................................................................................................ 418
Preliminary User's Manual U16227EJ1V0UD
22
LIST OF TABLES (1/3)
Table No.
Title
Page
1-1
Flash Memory Versions Corresponding to Mask Options of Mask ROM Versions...................................28
2-1
Pin I/O Circuit Types ................................................................................................................................43
3-1
Set Value of Internal Memory Size Switching Register (IMS)...................................................................46
3-2
Internal Memory Capacity.........................................................................................................................52
3-3
Vector Table .............................................................................................................................................52
3-4
Internal High-Speed RAM Capacity..........................................................................................................53
3-5
Special Function Register List ..................................................................................................................64
4-1
Port Functions ..........................................................................................................................................79
4-2
Port Configuration ....................................................................................................................................80
4-3
Pull-up Resistor of Port 6..........................................................................................................................92
4-4
Settings of Port Mode Register and Output Latch When Using Alternate Function..................................97
5-1
Configuration of Clock Generator ...........................................................................................................102
5-2
Relationship Between CPU Clock and Minimum Instruction Execution Time.........................................105
5-3
Relationship Between Operation Clocks in Each Operation Status........................................................118
5-4
Oscillation Control Flags and Clock Oscillation Status ...........................................................................118
5-5
Time Required to Switch Between Ring-OSC Clock and X1 Input Clock ...............................................119
5-6
Maximum Time Required for CPU Clock Switchover .............................................................................120
5-7
Clock and Register Setting .....................................................................................................................125
6-1
Configuration of 16-Bit Timer/Event Counter 00.....................................................................................127
6-2
TI000 Pin Valid Edge and CR000, CR010 Capture Trigger....................................................................128
6-3
TI010 Pin Valid Edge and CR000 Capture Trigger.................................................................................128
7-1
Configuration of 8-Bit Timer/Event Counters 50 and 51 .........................................................................161
8-1
Configuration of 8-Bit Timers H0 and H1................................................................................................176
9-1
Watch Timer Interrupt Time....................................................................................................................198
9-2
Interval Timer Interval Time....................................................................................................................198
9-3
Watch Timer Configuration.....................................................................................................................199
9-4
Watch Timer Interrupt Time....................................................................................................................201
9-5
Interval Timer Interval Time....................................................................................................................202
10-1
Loop Detection Time of Watchdog Timer ...............................................................................................204
10-2
Mask Option Setting and Watchdog Timer Operation Mode ..................................................................205
10-3
Configuration of Watchdog Timer ...........................................................................................................206
11-1
Configuration of A/D Converter ..............................................................................................................216
11-2
Settings of ADCS and ADCE..................................................................................................................219
11-3
A/D Converter Sampling Time and A/D Conversion Start Delay Time (ADM Set Value) .......................234
Preliminary User's Manual U16227EJ1V0UD
23
LIST OF TABLES (2/3)
Table No.
Title
Page
12-1
Configuration of Serial Interface UART0 ................................................................................................ 236
12-2
Cause of Reception Error....................................................................................................................... 251
12-3
Set Data of Baud Rate Generator .......................................................................................................... 255
12-4
Maximum/Minimum Permissible Baud Rate Error.................................................................................. 257
13-1
Configuration of Serial Interface UART6 ................................................................................................ 262
13-2
Write Processing and Writing to TXB6 During Execution of Continuous Transmission.......................... 284
13-3
Cause of Reception Error....................................................................................................................... 289
13-4
Set Data of Baud Rate Generator .......................................................................................................... 297
13-5
Maximum/Minimum Permissible Baud Rate Error.................................................................................. 299
14-1
Configuration of Serial Interface CSI10 .................................................................................................. 301
15-1
Interrupt Source List ............................................................................................................................... 315
15-2
Flags Corresponding to Interrupt Request Sources ............................................................................... 318
15-3
Ports Corresponding to EGPn and EGNn .............................................................................................. 322
15-4
Time from Generation of Maskable Interrupt Until Servicing .................................................................. 324
15-5
Interrupt Request Enabled for Multiple Interrupt Servicing During Interrupt Servicing ........................... 327
16-1
Assignment of Key Interrupt Detection Pins ........................................................................................... 331
16-2
Configuration of Key Interrupt ................................................................................................................ 331
17-1
Relationship Between HALT Mode, STOP Mode, and Clock ................................................................. 333
17-2
Operating Statuses in HALT Mode......................................................................................................... 337
17-3
Operation After HALT Mode Release..................................................................................................... 340
17-4
Operating Statuses in STOP Mode ........................................................................................................ 341
17-5
Operation After STOP Mode Release .................................................................................................... 343
18-1
Hardware Statuses After Reset.............................................................................................................. 347
18-2
RESF Status When Reset Request Is Generated.................................................................................. 349
19-1
Configuration of Clock Monitor ............................................................................................................... 350
19-2
Operation Status of Clock Monitor (When CLME = 1)............................................................................ 352
22-1
Flash Memory Versions Supporting Mask Options of Mask ROM Versions........................................... 372
23-1
Differences Between
PD78F0114 and Mask ROM Versions ............................................................... 373
23-2
Internal Memory Size Switching Register Settings................................................................................. 374
23-3
Communication Mode List...................................................................................................................... 375
23-4
Main Functions of Flash Memory Programming..................................................................................... 376
24-1
Operand Identifiers and Specification Methods...................................................................................... 384
Preliminary User's Manual U16227EJ1V0UD
24
LIST OF TABLES (3/3)
Table No.
Title
Page
27-1
Registers That Generate Wait and Number of CPU Wait Clocks ...........................................................415
27-2
Number of Wait Clocks and Number of Execution Clocks on Occurrence of Wait (A/D Converter) .......416
Preliminary User's Manual U16227EJ1V0UD
25
CHAPTER 1 OUTLINE
1.1 Features
ROM, RAM capacities
Item
Part Number
Program Memory
(ROM)
Data Memory
(Internal High-Speed RAM)
PD780111
8 KB
PD780112
16 KB
512 bytes
PD780113
24 KB
PD780114
Mask ROM
32 KB
1024 bytes
PD78F0114
Flash memory
32 KB
Note
1024 bytes
Note
Note The internal flash memory and internal high-speed RAM capacities can be changed using the internal
memory size switching register (IMS).
On-chip power-on-clear (POC) circuit and low-voltage detector (LVI)
Short startup is possible via the CPU default start using the on-chip Ring-OSC
On-chip clock monitor function using on-chip Ring-OSC
On-chip watchdog timer (operable with Ring-OSC clock)
On-chip UART supporting LIN (Local Interconnect Network) bus
On-chip key interrupt function
Minimum instruction execution time can be changed from high speed (0.2
s: @ 10 MHz operation with X1
input clock) to ultra low-speed (122
s: @ 32.768 kHz operation with subsystem clock)
I/O ports: 32 (N-ch open drain: 4)
Timer: 7 channels
Serial interface: 3 channels
(UART: 2 channels, CSI: 1 channel)
10-bit resolution A/D converter: 8 channels
Supply voltage: V
DD
= 2.7 to 5.5 V
CHAPTER 1 OUTLINE
Preliminary User's Manual U16227EJ1V0UD
26
1.2 Applications
Automotive equipment
System control for body electricals (power windows, keyless entry reception, etc.)
Sub-microcontrollers for control
Home audio, car audio
AV equipment
PC peripheral equipment (keyboards, etc.)
Household electrical appliances
Outdoor air conditioner units
Microwave ovens, electric rice cookers
Industrial equipment
Pumps
Vending machines
FA
CHAPTER 1 OUTLINE
Preliminary User's Manual U16227EJ1V0UD
27
1.3 Ordering Information
Part Number
Package
Quality Grade
PD780111GB--8ES
44-pin plastic LQFP (10
10)
Standard
PD780112GB--8ES
44-pin plastic LQFP (10
10)
Standard
PD780113GB--8ES
44-pin plastic LQFP (10
10)
Standard
PD780114GB--8ES
44-pin plastic LQFP (10
10)
Standard
PD780111GB(A)--8ES
44-pin plastic LQFP (10
10)
Special
PD780112GB(A)--8ES
44-pin plastic LQFP (10
10)
Special
PD780113GB(A)--8ES
44-pin plastic LQFP (10
10)
Special
PD780114GB(A)--8ES
44-pin plastic LQFP (10
10)
Special
PD780111GB(A1)--8ES
44-pin plastic LQFP (10
10)
Special
PD780112GB(A1)--8ES
44-pin plastic LQFP (10
10)
Special
PD780113GB(A1)--8ES
44-pin plastic LQFP (10
10)
Special
PD780114GB(A1)--8ES
44-pin plastic LQFP (10
10)
Special
PD78F0114M1GB-8ES
44-pin plastic LQFP (10
10)
Standard
PD78F0114M2GB-8ES
44-pin plastic LQFP (10
10)
Standard
PD78F0114M3GB-8ES
44-pin plastic LQFP (10
10)
Standard
PD78F0114M4GB-8ES
44-pin plastic LQFP (10
10)
Standard
PD78F0114M5GB-8ES
44-pin plastic LQFP (10
10)
Standard
PD78F0114M6GB-8ES
44-pin plastic LQFP (10
10)
Standard
PD78F0114M1GB(A)-8ES
44-pin plastic LQFP (10
10)
Special
PD78F0114M2GB(A)-8ES
44-pin plastic LQFP (10
10)
Special
PD78F0114M3GB(A)-8ES
44-pin plastic LQFP (10
10)
Special
PD78F0114M4GB(A)-8ES
44-pin plastic LQFP (10
10)
Special
PD78F0114M5GB(A)-8ES
44-pin plastic LQFP (10
10)
Special
PD78F0114M6GB(A)-8ES
44-pin plastic LQFP (10
10)
Special
Remark
indicates ROM code suffix.
P l e a s e r e f e r t o " Q u a l i t y G r a d e s o n N E C S e m i c o n d u c t o r D e v i c e s " ( D o c u m e n t N o . C 1 1 5 3 1 E ) p u b l i s h e d b y
NEC Corporation to know the specification of quality grade on the devices and its recommended applications.
CHAPTER 1 OUTLINE
Preliminary User's Manual U16227EJ1V0UD
28
Mask ROM versions (
PD780111, 780112, 780113, and 780114) include mask options. When ordering, it is
possible to select "Power-on-clear (POC) circuit can be used/cannot be used", "Ring-OSC clock can be
stopped/cannot be stopped by software" and "Pull-up resistor incorporated/not incorporated in 1-bit units (P60 to
P63)".
Flash memory versions corresponding to the mask options of the mask ROM versions are as follows.
Table 1-1. Flash Memory Versions Corresponding to Mask Options of Mask ROM Versions
Mask Option
POC Circuit
Ring-OSC
Flash Memory Versions
(Part Number)
Cannot be stopped
PD78F0114M1GB-8ES
PD78F0114M1GB(A)-8ES
POC cannot be used
Can be stopped by software
PD78F0114M2GB-8ES
PD78F0114M2GB(A)-8ES
Cannot be stopped
PD78F0114M3GB-8ES
PD78F0114M3GB(A)-8ES
POC used (V
POC
= 2.85 V
0.15 V)
Can be stopped by software
PD78F0114M4GB-8ES
PD78F0114M4GB(A)-8ES
Cannot be stopped
PD78F0114M5GB-8ES
PD78F0114M5GB(A)-8ES
POC used (V
POC
= 3.5 V
0.2 V)
Can be stopped by software
PD78F0114M6GB-8ES
PD78F0114M6GB(A)-8ES
CHAPTER 1 OUTLINE
Preliminary User's Manual U16227EJ1V0UD
29
1.4 Pin Configuration (Top View)
44-pin plastic LQFP (10 10)
PD780111GB--8ES, 780112GB--8ES, 780113GB--8ES, 780114GB--8ES,
PD780111GB(A)--8ES, 780112GB(A)--8ES, 780113GB(A)--8ES,
PD780114GB(A)--8ES, 780111GB(A1)--8ES, 780112GB(A1)--8ES,
PD780113GB(A1)--8ES, 780114GB(A1)--8ES, 78F0114M1GB-8ES,
PD78F0114M2GB-8ES, 78F0114M3GB-8ES, 78F0114M4GB-8ES, 78F0114M5GB-8ES,
PD78F0114M6GB-8ES, 78F0114M1GB(A)-8ES, 78F0114M2GB(A)-8ES, 78F0114M3GB(A)-8ES,
PD78F0114M4GB(A)-8ES, 78F0114M5GB(A)-8ES, 78F0114M6GB(A)-8ES
1
2
3
4
5
6
7
8
9
10
11
33
32
31
30
29
28
27
26
25
24
23
AV
REF
AV
SS
IC (V
PP
)
V
DD
V
SS
X1
X2
RESET
XT1
XT2
P130
P73/KR3
P00/TI000
P01/TI010/TO00
P10/SCK10/TxD0
P11/SI10/RxD0
P12/SO10
P13/TxD6
P14/RxD6
P15/TOH0
P16/TOH1/INTP5
EV
DD
12 13 14 15 16 17 18 19 20 21 22
44 43 42 41 40 39 38 37 36 35 34
P120/INTP0
P33/TI51/TO51/INTP4
P32/INTP3
P31/INTP2
P30/INTP1
P17/TI50/TO50
P60
P61
P62
P63
EV
SS
P20/ANI0
P21/ANI1
P22/ANI2
P23/ANI3
P24/ANI4
P25/ANI5
P26/ANI6
P27/ANI7
P70/KR0
P71/KR1
P72/KR2
Cautions 1. Connect the IC (Internally Connected) pin directly to V
SS
.
2. Connect the AV
REF
pin to V
DD
.
3. Connect the AV
SS
pin to V
SS
.
Remark
Figures in parentheses apply only to the
PD78F0114.
CHAPTER 1 OUTLINE
Preliminary User's Manual U16227EJ1V0UD
30
Pin Identification
ANI0 to ANI7:
Analog input
AV
REF
:
Analog reference voltage
AV
SS
:
Analog ground
EV
DD
:
Power supply for port
EV
SS
:
Ground for port
IC:
Internally connected
INTP0 to INTP5: External interrupt input
KR0 to KR3:
Key return
P00, P01:
Port 0
P10 to P17:
Port 1
P20 to P27:
Port 2
P30 to P33:
Port 3
P60 to P63:
Port 6
P70 to P73:
Port 7
P120:
Port 12
P130:
Port 13
RESET:
Reset
RxD0, RxD6:
Receive data
SCK10:
Serial clock input/output
SI10:
Serial data input
SO10:
Serial data output
TI000, TI010,
TI50, TI51:
Timer input
TO00, TO50, TO51,
TOH0, TOH1:
Timer output
TxD0, TxD6:
Transmit data
V
DD
:
Power supply
V
PP
:
Programming power supply
V
SS
:
Ground
X1, X2:
Crystal (X1 input clock)
XT1, XT2:
Crystal (Subsystem clock)
CHAPTER 1 OUTLINE
Preliminary User's Manual U16227EJ1V0UD
31
1.5 78K0/Kxx Series Lineup
The lineup of products in the 78K0/Kxx Series (under development or in planning) is shown below.
PD78F0103
Flash memory: 24 KB, RAM: 768 bytes
Mask ROM: 24 KB, RAM: 768 bytes
Mask ROM: 16 KB, RAM: 768 bytes
Mask ROM: 8 KB, RAM: 512 bytes
PD780103
PD780102
PD780101
78K0/KB1 Series: 30-pin (7.62 mm 0.65 mm pitch)
PD78F0114
Flash memory: 32 KB, RAM: 1 KB
Mask ROM: 32 KB, RAM: 1 KB
Mask ROM: 24 KB, RAM: 1 KB
Mask ROM: 16 KB, RAM: 512 bytes
PD780114
PD780113
PD780112
Mask ROM: 8 KB, RAM: 512 bytes
PD780111
78K0/KC1 Series: 44-pin (10
10 mm 0.8 mm pitch)
PD78F0124
Flash memory: 32 KB, RAM: 1 KB
Mask ROM: 32 KB, RAM: 1 KB
Mask ROM: 24 KB, RAM: 1 KB
Mask ROM: 16 KB, RAM: 512 bytes
PD780124
PD780123
PD780122
Mask ROM: 8 KB, RAM: 512 bytes
PD780121
78K0/KD1 Series: 52-pin (10
10 mm 0.65 mm pitch)
PD78F0148
Flash memory: 60 KB, RAM: 2 KB
Mask ROM: 60 KB, RAM: 2 KB
Mask ROM: 48 KB, RAM: 2 KB
Mask ROM: 32 KB, RAM: 1 KB
PD780148
PD780146
PD780144
Mask ROM: 24 KB, RAM: 1 KB
PD780143
78K0/KF1 Series: 80-pin (12
12 mm 0.5 mm pitch, 14 14 mm 0.65 mm pitch)
PD78F0134
Flash memory: 32 KB, RAM: 1 KB
Mask ROM: 32 KB, RAM: 1 KB
Mask ROM: 24 KB, RAM: 1 KB
Mask ROM: 16 KB, RAM: 512 bytes
PD780134
PD780133
PD780132
Mask ROM: 8 KB, RAM: 512 bytes
PD780131
PD78F0138
Flash memory: 60 KB, RAM: 2 KB
Mask ROM: 60 KB, RAM: 2 KB
Mask ROM: 48 KB, RAM: 2 KB
PD780138
PD780136
78K0/KE1 Series: 64-pin (10
10 mm 0.5 mm pitch, 12 12 mm 0.65 mm pitch, 14 14 mm 0.8 mm pitch)
CHAPTER 1 OUTLINE
Preliminary User's Manual U16227EJ1V0UD
32
The function list in the 78K0/Kxx Series (under development or in planning) is shown below.
Part Number
Item
78K0/KB1
78K0/KC1
78K0/KD1
78K0/KE1
78K0/KF1
Package
30 pins
44 pins
52 pins
64 pins
80 pins
Mask ROM
8 K
16 K
24 K
-
8 K
16 K
24 K
32 K
-
8 K
16 K
24 K
32 K
-
8 K
16 K
24 K
32 K
-
48 K
60 K
-
24 K
32 K
48 K
60 K
-
Flash memory
-
24 K
-
32 K
-
32 K
-
32 K
-
60 K
-
60 K
Internal
memory
(bytes)
RAM
512
768
512
1 K
512
1 K
512
1 K
2 K
1 K
2 K
Power supply voltage
V
DD
= 2.7 to 5.5 V
Minimum instruction
execution time
0.2
s (when 10 MHz, V
DD
= 4.0 to 5.5 V)
0.24
s (when 8.38 MHz, V
DD
= 3.3 to 5.5 V)
0.4
s (when 5 MHz, V
DD
= 2.7 to 5.5 V)
<Connect REGC pin to V
DD
>
0.2
s (when 10 MHz, V
DD
= 4.0 to 5.5 V)
0.24
s (when 8.38 MHz, V
DD
= 3.3 to 5.5 V)
0.4
s (when 5 MHz, V
DD
= 2.7 to 5.5 V)
X1 input
2 to 10 MHz
Sub
-
32.768 kHz
Clock
Ring-OSC
240 kHz (TYP.)
CMOS I/O
17
19
26
38
54
CMOS input
4
8
CMOS output
1
Port
N-ch open-drain
I/O
-
4
16 bits (TM0)
1 ch
2 ch
1 ch
2 ch
8 bits (TM5)
1 ch
2 ch
8 bits (TMH)
2 ch
For watch
-
1 ch
Timer
WDT
1 ch
3-wire CSI
1 ch
2 ch
1 ch
2 ch
Automatic
transmit/receive
3-wire CSI
-
1 ch
UART
-
1 ch
Serial
interface
UART
supporting LIN-
bus
1 ch
10-bit A/D converter
4 ch
8 ch
External
6
7
8
9
9
Interrupt
Internal
11
12
15
16
19
17
20
Key return input
-
4 ch
8 ch
RESET pin
Provided
POC
2.85 V
0.15 V/3.5 V 0.20 V (selectable by mask option)
LVI
3.1 V
0.15 V/3.3 V/3.5 V/3.7 V/3.9 V/4.1 V/4.3 V 0.2 V (selectable by software)
Clock monitor
Provided
Reset
WDT
Provided
Multiplier/divider
-
16 bits
16 bits, 32 bits 16 bits
ROM correction
-
Provided
-
Standby function
HALT/STOP mode
Operating ambient
temperature
Standard products, special (A) products:
-40 to +85C
Special (A1) products:
-40 to +110C (mask ROM version only)
CHAPTER 1 OUTLINE
Preliminary User's Manual U16227EJ1V0UD
33
1.6 Block Diagram
16-bit timer/
event counter 00
TO00/TI010/P01
TI000/P00
Port 0
P00, P01
2
Port 1
P10 to P17
Port 2
P20 to P27
8
Port 3
P30 to P33
4
78K/0
CPU
core
Internal
high-speed
RAM
ROM
(Flash
memory)
V
SS
,
EV
SS
IC
(V
PP
)
V
DD
,
EV
DD
Serial
interface CSI10
SI10/P11
SO10/P12
SCK10/P10
ANI0/P20 to
ANI7/P27
Interrupt control
8-bit timer H0
TOH0/P15
8-bit timer H1
TOH1/P16
TI50/TO50/P17
8-bit timer/
event counter 50
8
A/D converter
RxD0/P11
TxD0/P10
Serial
interface UART0
Watchdog timer
RxD6/P14
TxD6/P13
Serial
interface UART6
AV
REF
AV
SS
INTP1/P30 to
INTP4/P33
4
INTP0/P120
8
System control
RESET
X1
X2
Clock monitor
Power on clear/
low voltage
indicator
Reset control
Port 6
P60 to P63
4
Port 7
P70 to P73
Port 12
P120
Port 13
P130
4
Ring-OSC
XT1
XT2
TI51/TO51/P33
8-bit timer/
event counter 51
Watch timer
INTP5/P16
Key return
4
KR0/P70 to
KR3/P73
Remark
Items in parentheses are available only in the
PD78F0114.
CHAPTER 1 OUTLINE
Preliminary User's Manual U16227EJ1V0UD
34
1.7 Outline of Functions
Item
PD780111
PD780112
PD780113
PD780114
PD78F0114
ROM
8 KB
16 KB
24 KB
32 KB
32 KB
Note
(flash memory)
Internal memory
High-speed RAM
512 bytes
1 KB
1 KB
Note
Memory space
64 KB
X1 input clock (oscillation frequency)
Ceramic/crystal/external clock oscillation
(10 MHz: V
DD
= 4.0 to 5.5 V, 8.38 MHz: V
DD
= 3.3 to 5.5 V, 5 MHz: V
DD
= 2.7 to 5.5 V)
Ring-OSC clock
(oscillation frequency)
On-chip Ring oscillation (240 kHz (TYP.))
Subsystem clock
(oscillation frequency)
Crystal/external clock oscillation (32.768 kHz)
General-purpose registers
8 bits
32 registers (8 bits 8 registers 4 banks)
0.2
s/0.4 s/0.8 s/1.6 s/3.2 s (X1 input clock: @ f
XP
= 10 MHz operation)
8.3
s/16.6 s/33.2 s/66.4 s/132.8 s (TYP.) (Ring-OSC clock: @ f
R
= 240 kHz (TYP.)
operation)
Minimum instruction execution time
122
s (subsystem clock: when operating at f
XT
= 32.768 kHz)
Instruction set
16-bit operation Multiply/divide (8 bits
8 bits 4 banks)
Bit manipulate (set, reset, test, and Boolean operation) BCD adjust, etc.
I/O ports
Total:
32
CMOS I/O
19
CMOS input
8
CMOS output
1
N-ch open-drain I/O
4
Timers
16-bit timer/event counter: 1 channel
8-bit timer/event counter:
2 channels
8-bit timer:
2 channels
Watch timer
1 channel
Watchdog timer:
1 channel
Timer outputs
5 (PWM output: 3)
A/D converter
10-bit resolution
8 channels
Serial interface
UART mode supporting LIN-bus:
1 channel
3-wire serial I/O mode:
1 channel
UART mode:
1 channel
Internal
15
Vectored interrupt
sources
External
7
Key interrupt
Key interrupt (INTKR) occurs by detecting falling edge of key input pins (KR0 to KR3).
Reset
Reset using RESET pin
Internal reset by watchdog timer
Internal reset by clock monitor
Internal reset by power-on-clear
Internal reset by low-voltage detector
Supply voltage
V
DD
= 2.7 to 5.5 V
Operating ambient temperature
Standard products, (A) products: T
A
=
-40 to +85C
(A1) products: T
A
=
-40 to +110C (
PD780111, 780112, 780113, and 780114 only)
Package
44-pin plastic LQFP (10
10)
Note The internal flash memory capacity and internal high-speed RAM capacity can be changed using the internal
memory size switching register (IMS).
CHAPTER 1 OUTLINE
Preliminary User's Manual U16227EJ1V0UD
35
An outline of the timer is shown below.
16-Bit Timer/
Event Counter 00
8-Bit Timer/
Event Counters
50 and 51
8-Bit Timers H0
and H1
Watch Timer
Watchdog Timer
Interval timer
1 channel
2 channels
2 channels
1 channel
Note
1 channel
Operation
mode
External event counter
1 channel
2 channels
-
-
-
Timer output
1 output
2 outputs
2 outputs
-
-
PPG output
1 output
-
-
-
-
PWM output
-
2 outputs
2 outputs
-
-
Pulse width measurement
2 inputs
-
-
-
-
Square-wave output
1 output
2 outputs
-
-
-
Function
Interrupt source
2
2
2
1
-
Note In the watch timer, the watch timer function and interval timer function can be used simultaneously.
Preliminary User's Manual U16227EJ1V0UD
36
CHAPTER 2 PIN FUNCTIONS
2.1 Pin Function List
(1) Port pins
Pin Name
I/O
Function
After Reset
Alternate Function
P00
TI000
P01
I/O
Port 0.
2-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
TI010/TO00
P10
SCK10/TxD0
P11
SI10/RxD0
P12
SO10
P13
TxD6
P14
RxD6
P15
TOH0
P16
TOH1/INTP5
P17
I/O
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.
Input
TI50/TO50
P20 to P27
Input
Port 2.
8-bit input-only port.
Input
ANI0 to ANI7
P30 to P32
INTP1 to INTP3
P33
I/O
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.
Input
INTP4/TI51/TO51
P60 to P63
I/O
Port 6.
4-bit I/O port (N-ch open drain).
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a mask
option only for mask ROM versions.
Input
-
P70 to P73
I/O
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
KR0 to KR3
P120
I/O
Port 12.
1-bit I/O port.
Use of an on-chip pull-up resistor can be specified by a
software setting.
Input
INTP0
P130
Output
Port 13.
1-bit output-only port.
Output
-
CHAPTER 2 PIN FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
37
(2) Non-port pins
Pin Name
I/O
Function
After Reset
Alternate Function
INTP0
P120
INTP1 to INTP3
P30 to P32
INTP4
P33/TI51/TO51
INTP5
Input
External interrupt request input for which the valid edge (rising
edge, falling edge, or both rising and falling edges) can be
specified
Input
P16/TOH1
SI10
Input
Serial data input to serial interface
Input
P11/RxD0
SO10
Output
Serial data output from serial interface
Input
P12
SCK10
I/O
Clock input/output for serial interface
Input
P10/TxD0
RxD0
P11/SI10
RxD6
Input
Serial data input to asynchronous serial interface
Input
P14
TxD0
P10/SCK10
TxD6
Output
Serial data output from asynchronous serial interface
Input
P13
TI000
External count clock input to 16-bit timer/event counter 00
Capture trigger input to capture registers (CR000, CR010) of
16-bit timer/event counter 00
P00
TI010
Input
Capture trigger input to capture register (CR000) of 16-bit
timer/event counter 00
Input
P01/TO00
TO00
Output
16-bit timer/event counter 00 output
Input
P01/TI010
TI50
External count clock input to 8-bit timer/event counter 50
P17/TO50
TI51
Input
External count clock input to 8-bit timer/event counter 51
Input
P33/TO51/INTP4
TO50
8-bit timer/event counter 50 output
P17/TI50
TO51
8-bit timer/event counter 51 output
P33/TI51/INTP4
TOH0
8-bit timer H0 output
P15
TOH1
Output
8-bit timer H1 output
Input
P16/INTP5
ANI0 to ANI7
Input
A/D converter analog input
Input
P20 to P27
AV
REF
Input
A/D converter reference voltage input
-
-
AV
SS
-
A/D converter ground potential. Make the same potential as
EV
SS
or V
SS
.
-
-
KR0 to KR3
Input
Key interrupt input
Input
P70 to P73
RESET
Input
System reset input
-
-
X1
Input
-
-
X2
-
Connecting crystal resonator for X1 input clock oscillation
-
-
XT1
Input
-
-
XT2
-
Connecting crystal resonator for subsystem clock oscillation
-
-
V
DD
-
Positive power supply (except for ports)
-
-
EV
DD
-
Positive power supply for ports
-
-
V
SS
-
Ground potential (except for ports)
-
-
EV
SS
-
Ground potential for ports
-
-
IC
-
Internally connected. Connect directly to EV
SS
or V
SS
.
-
-
V
PP
-
Flash memory programming mode setting. High-voltage
application for program write/verify. Connect directly to EV
SS
or V
SS
in normal operation mode.
-
-
CHAPTER 2 PIN FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
38
2.2 Description of Pin Functions
2.2.1 P00 and P01 (port 0)
P00 and P01 function as a 2-bit I/O port. These pins also function as timer I/O.
The following operation modes can be specified in 1-bit units.
(1) Port mode
P00 and P01 function as a 2-bit I/O port. P00 to P06 can be set to input or output in 1-bit units using port mode
register 0 (PM0). Use of an on-chip pull-up resistor can be specified by pull-up resistor option register 0 (PU0).
(2) Control mode
P00 and P01 function as timer I/O.
(a) TI000
This is the pin for inputting an external count clock to 16-bit timer/event counter 00 and is also for inputting a
capture trigger signal to the capture registers (CR000 or CR001) of 16-bit timer/event counter 00.
(b) TI010
This is the pin for inputting a capture trigger signal to the capture register (CR000) of 16-bit timer/event
counter 00.
(c) TO00
This is timer output pin.
CHAPTER 2 PIN FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
39
2.2.2 P10 to P17 (port 1)
P10 to P17 function as an 8-bit I/O port. These pins also function as pins for external interrupt request input, serial
interface data I/O, clock I/O, and timer I/O.
The following operation modes can be specified in 1-bit units.
(1) Port mode
P10 to P17 function as an 8-bit I/O port. P10 to P17 can be set to input or output in 1-bit units using port mode
register 1 (PM1). Use of an on-chip pull-up resistor can be specified by pull-up resistor option register 1 (PU1).
(2) Control mode
P10 to P17 function as external interrupt request input, serial interface data I/O, clock I/O, and timer I/O.
(a) SI10, SO10
These are serial interface serial data I/O pins.
(b) SCK10
This is the serial interface serial clock I/O pin.
(c) RxD0, RxD6, TxD0, and TxD6
These are the serial data I/O pins of the asynchronous serial interface.
(d) TI50
This is the pin for inputting an external count clock to 8-bit timer/event counter 50.
(e) TO50, TOH0, and TOH1
These are timer output pins.
(f)
INTP5
This is an external interrupt request input pin for which the valid edge (rising edge, falling edge, or both rising
and falling edges) can be specified.
2.2.3 P20 to P27 (port 2)
P20 to P27 function as an 8-bit input-only port. These pins also function as pins for A/D converter analog input.
The following operation modes can be specified in 1-bit units.
(1) Port mode
P20 to P27 function as an 8-bit input-only port.
(2) Control mode
P20 to P27 function as A/D converter analog input pins (ANI0 to ANI7).
CHAPTER 2 PIN FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
40
2.2.4 P30 to P33 (port 3)
P30 to P33 function as a 4-bit I/O port. These pins also function as pins for external interrupt request input and
timer I/O.
The following operation modes can be specified in 1-bit units.
(1) Port mode
P30 to P33 function as a 4-bit I/O port. P30 to P33 can be set to input or output in 1-bit units using port mode
register 3 (PM3). Use of an on-chip pull-up resistor can be specified by pull-up resistor option register 3 (PU3).
(2) Control mode
P30 to P33 function as external interrupt request input pins and timer I/O pins.
(a) INTP1 to INTP4
These are the external interrupt request input pins for which the valid edge (rising edge, falling edge, or both
rising and falling edges) can be specified.
(b) TI51
This is an external count clock input pin to 8-bit timer/event counter 51.
(c) TO51
This is a timer output pin.
2.2.5 P60 to P63 (port 6)
P60 to P63 function as a 4-bit I/O port. P60 to P63 can be set to input port or output port in 1-bit units using port
mode register 6 (PM6).
P60 to P63 are N-ch open-drain pins. Use of an on-chip pull-up resistor can be specified by a mask option only for
mask ROM versions.
2.2.6 P70 to P73 (port 7)
P70 to P73 function as a 4-bit I/O port. These pins also function as key interrupt input pins.
The following operation modes can be specified in 1-bit units.
(1) Port mode
P70 to P73 function as a 4-bit I/O port. P70 to P73 can be set to input or output in 1-bit units using port mode
register 7 (PM7). Use of an on-chip pull-up resistor can be specified by pull-up resistor option register 7 (PU7).
(2) Control mode
P70 to P73 function as key interrupt input pins.
CHAPTER 2 PIN FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
41
2.2.7 P120 (port 12)
P120 functions as a 1-bit I/O port. This pin also functions as a pin for external interrupt request input.
The following operation modes can be specified.
(1) Port mode
P120 functions as a 1-bit I/O port. P120 can be set to input or output using port mode register 12 (PM12). Use of
an on-chip pull-up resistor can be specified by pull-up resistor option register 12 (PU12).
(2) Control mode
P120 functions as an external interrupt request input pin (INTP0) for which the valid edge (rising edge, falling
edge, or both rising and falling edges) can be specified.
2.2.8 P130 (port 13)
P130 functions as a 1-bit output-only port.
2.2.9 AV
REF
This is the A/D converter reference voltage input pin.
When A/D converter is not used, connect this pin to V
DD
.
2.2.10 AV
SS
This is the A/D converter ground potential pin. Even when the A/D converter is not used, always use this pin with
the same potential as the EV
SS
pin or V
SS
pin.
2.2.11 RESET
This is the active-low system reset input pin.
2.2.12 X1 and X2
These are the pins for connecting a crystal resonator for X1 input clock oscillation.
When supplying an external clock, input a signal to the X1 pin and input the inverse signal to the X2 pin.
2.2.13 XT1 and XT2
These are the pins for connecting a crystal resonator for subsystem clock oscillation.
When supplying an external clock, input a signal to the XT1 pin and input the inverse signal to the XT2 pin.
2.2.14 V
DD
and EV
DD
V
DD
is the positive power supply pin for other than ports.
EV
DD
is the positive power supply pin for ports.
2.2.15 V
SS
and EV
SS
V
SS
is the ground potential pin for other than ports.
EV
SS
is the ground potential pin for ports.
2.2.16 V
PP
(flash memory versions only)
This is a pin for flash memory programming mode setting and high-voltage application for program write/verify.
Connect directly to EV
SS
or V
SS
in the normal operation mode.
CHAPTER 2 PIN FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
42
2.2.17 IC (mask ROM versions only)
The IC (Internally Connected) pin is provided to set the test mode to check the 78K0/KC1 Series at shipment.
Connect it directly to EV
SS
or V
SS
pin with the shortest possible wire in the normal operation mode.
When a potential difference is produced between the IC pin and the EV
SS
or V
SS
pin because the wiring between
these two pins is too long or external noise is input to the IC pin, the user's program may not operate normally.
Connect the IC pin directly to EV
SS
or V
SS
.
As short as possible
IC
EV
SS
or V
SS
CHAPTER 2 PIN FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
43
2.3 Pin I/O Circuits and Recommended Connection of Unused Pins
Table 2-1 shows the types of pin I/O circuits and the recommended connections of unused pins.
Refer to Figure 2-1 for the configuration of the I/O circuit of each type.
Table 2-1. Pin I/O Circuit Types
Pin Name
I/O Circuit Type
I/O
Recommended Connection of Unused Pins
P00/TI000
P01/TI010/TO00
8-A
P12/SO10
P13/TxD6
5-A
P14/RxD6
8-A
P15/TOH0
5-A
P16/TOH1/INTP5
P17/TI50/TO50
8-A
I/O
Input:
Independently connect to EV
DD
or EV
SS
via a resistor.
Output: Leave open.
P20/ANI0 to P27/ANI7
9-C
Input
Connect to EV
DD
or EV
SS
.
P30/INTP1 to P32/INTP3
P33/TI51/TO51/INTP4
8-A
Input:
Independently connect to EV
DD
or EV
SS
via a resistor.
Output: Leave open.
P60, P61 (Mask ROM version)
13-S
P60, P61 (Flash memory version)
13-R
P62, P63 (Mask ROM version)
13-W
P62, P63 (Flash memory version)
13-V
Input:
Connect to EV
SS
.
Output: Leave open and keep this pin to low.
P70/KR0 to P73/KR3
P120/INTP0
8-A
I/O
Input:
Independently connect to EV
DD
or EV
SS
via a resistor.
Output: Leave open.
P130
3-C
Output
Leave open.
RESET
2
-
XT1
Input
Connect directly to EV
DD
or V
DD
.
XT2
16
-
Leave open.
AV
REF
-
-
Connect directly to EV
DD
or V
DD
.
AV
SS
-
-
Connect directly to EV
SS
or V
SS
.
IC
V
PP
-
-
Connect directly to EV
SS
or V
SS
.
CHAPTER 2 PIN FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
44
Figure 2-1. Pin I/O Circuit List (1/2)
Type 3-C
Type 2
Type 8-A
Type 5-A
Type 9-C
Schmitt-triggered input with hysteresis characteristics
IN
Pullup
enable
Data
Output
disable
EV
DD
P-ch
V
DD
P-ch
IN/OUT
N-ch
EV
DD
P-ch
N-ch
Data
OUT
IN
Comparator
V
REF
(threshold voltage)
AV
SS
P-ch
N-ch
Input
enable
+
Pullup
enable
Data
Output
disable
Input
enable
EV
DD
P-ch
V
DD
P-ch
IN/OUT
N-ch
Data
Output disable
IN/OUT
N-ch
Type 13-R
CHAPTER 2 PIN FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
45
Figure 2-1. Pin I/O Circuit List (2/2)
Type 13-V
Type 13-S
Type 13-W
Type 16
Data
Output disable
IN/OUT
N-ch
EV
DD
Mask
option
Data
Output disable
IN/OUT
N-ch
Input
enable
Middle-voltage input buffer
Data
Output disable
IN/OUT
N-ch
EV
DD
Mask
option
Input
enable
Middle-voltage input buffer
P-ch
Feedback
cut-off
XT1
XT2
Preliminary User's Manual U16227EJ1V0UD
46
CHAPTER 3 CPU ARCHITECTURE
3.1 Memory Space
Products in the 78K0/KC1 Series can each access a 64 KB memory space. Figures 3-1 to 3-5 show the memory
maps.
Caution
Regardless of the internal memory capacity, the initial value of the internal memory size
switching register (IMS) of all products in the 78K0/KC1 Series is fixed (CFH). Therefore, set the
value corresponding to each product as indicated below.
Table 3-1. Set Value of Internal Memory Size Switching Register (IMS)
Internal Memory Size Switching Register (IMS)
PD780111
42H
PD780112
44H
PD780113
C6H
PD780114
C8H
PD78F0114
Value corresponding to mask ROM version
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
47
Figure 3-1. Memory Map (



PD780111)
0000H
Data memory
space
General-purpose
registers
32
8 bits
Internal ROM
8192
8 bits
1FFFH
1000H
0FFFH
0800H
07FFH
0080H
007FH
0040H
003FH
0000H
CALLF entry area
CALLT table area
Vector table area
Program area
Program area
Program
memory
space
2000H
1FFFH
FEE0H
FEDFH
FF00H
FEFFH
FFFFH
Internal high-speed RAM
512
8 bits
Special function
registers (SFRs)
256
8 bits
Reserved
FD00H
FCFFH
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
48
Figure 3-2. Memory Map (



PD780112)
0000H
Data memory
space
General-purpose
registers
32
8 bits
Internal ROM
16384
8 bits
3FFFH
1000H
0FFFH
0800H
07FFH
0080H
007FH
0040H
003FH
0000H
CALLF entry area
CALLT table area
Vector table area
Program area
Program area
Program
memory
space
4000H
3FFFH
FEE0H
FEDFH
FF00H
FEFFH
FFFFH
Internal high-speed RAM
512
8 bits
Special function
registers (SFRs)
256
8 bits
Reserved
FD00H
FCFFH
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
49
Figure 3-3. Memory Map (



PD780113)
0000H
Data memory
space
General-purpose
registers
32
8 bits
Internal ROM
24576
8 bits
5FFFH
1000H
0FFFH
0800H
07FFH
0080H
007FH
0040H
003FH
0000H
CALLF entry area
CALLT table area
Vector table area
Program area
Program area
Program
memory
space
6000H
5FFFH
FEE0H
FEDFH
FF00H
FEFFH
FFFFH
Internal high-speed RAM
1024
8 bits
Special function
registers (SFRs)
256
8 bits
Reserved
FB00H
FAFFH
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
50
Figure 3-4. Memory Map (



PD780114)
0000H
Data memory
space
Internal ROM
32768
8 bits
7FFFH
1000H
0FFFH
0800H
07FFH
0080H
007FH
0040H
003FH
0000H
CALLF entry area
CALLT table area
Vector table area
Program area
Program area
Program
memory
space
8000H
7FFFH
FEE0H
FEDFH
FF00H
FEFFH
FFFFH
Internal high-speed RAM
1024
8 bits
Special function
registers (SFRs)
256
8 bits
Reserved
FB00H
FAFFH
General-purpose
registers
32
8 bits
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
51
Figure 3-5. Memory Map (



PD78F0114)
0000H
Data memory
space
General-purpose
registers
32
8 bits
Flash memory
32768
8 bits
7FFFH
1000H
0FFFH
0800H
07FFH
0080H
007FH
0040H
003FH
0000H
CALLF entry area
CALLT table area
Vector table area
Program area
Program area
Program
memory
space
8000H
7FFFH
FEE0H
FEDFH
FF00H
FEFFH
FFFFH
Internal high-speed RAM
1024
8 bits
Special function
registers (SFRs)
256
8 bits
Reserved
FB00H
FAFFH
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
52
3.1.1 Internal program memory space
The internal program memory space stores the program and table data. Normally, it is addressed with the program
counter (PC).
78K0/KC1 Series products incorporate internal ROM (or flash memory), as shown below.
Table 3-2. Internal Memory Capacity
Internal ROM
Part Number
Structure
Capacity
PD780111
8192
8 bits (0000H to 1FFFH)
PD780112
16384
8 bits (0000H to 3FFFH)
PD780113
24576
8 bits (0000H to 5FFFH)
PD780114
Mask ROM
32768
8 bits (0000H to 7FFFH)
PD78F0114
Flash memory
32768
8 bits (0000H to 7FFFH)
The internal program memory space is divided into the following areas.
(1) Vector table area
The 64-byte area 0000H to 003FH is reserved as a vector table area. The program start addresses for branch
upon RESET input or generation of each interrupt request are stored in the vector table area.
Of the 16-bit address, the lower 8 bits are stored at even addresses and the higher 8 bits are stored at odd
addresses.
Table 3-3. Vector Table
Vector Table Address
Interrupt Source
Vector Table Address
Interrupt Source
0018H
INTCSI10/INTST0
0000H
RESET input, POC, LVI,
clock monitor, WDT
001AH
INTTMH1
0004H
INTLVI
001CH
INTTMH0
0006H
INTP0
001EH
INTTM50
0008H
INTP1
0020H
INTTM000
000AH
INTP2
0022H
INTTM010
000CH
INTP3
0024H
INTAD
000EH
INTP4
0026H
INTSR0
0010H
INTP5
0028H
INTWTI
0012H
INTSRE6
002AH
INTTM51
0014H
INTSR6
002CH
INTKR
0016H
INTST6
002EH
INTWT
(2) CALLT instruction table area
The 64-byte area 0040H to 007FH can store the subroutine entry address of a 1-byte call instruction (CALLT).
(3) CALLF instruction entry area
The area 0800H to 0FFFH can perform a direct subroutine call with a 2-byte call instruction (CALLF).
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
53
3.1.2 Internal data memory space
78K0/KC1 Series products incorporate the following internal high-speed RAMs.
Table 3-4. Internal High-Speed RAM Capacity
Part Number
Internal Expansion RAM
PD780111
PD780112
512
8 bits (FD00H to FEFFH)
PD780113
PD780114
PD78F0114
1024
8 bits (FB00H to FEFFH)
The 32-byte area FEE0H to FEFFH is assigned to four general-purpose register banks consisting of eight 8-bit
registers per one bank.
This area cannot be used as a program area in which instructions are written and executed.
The internal high-speed RAM can also be used as a stack memory.
3.1.3 Special function register (SFR) area
On-chip peripheral hardware special function registers (SFRs) are allocated in the area FF00H to FFFFH (refer to
Table 3-5 Special Function Register List in 3.2.3 Special Function Registers (SFRs)).
Caution
Do not access addresses to which SFRs are not assigned.
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
54
3.1.4 Data memory addressing
Addressing refers to the method of specifying the address of the instruction to be executed next or the address of
the register or memory relevant to the execution of instructions.
The address of an instruction to be executed next is addressed by the program counter (PC) (for details, see 3.3
Instruction Address Addressing).
Several addressing modes are provided for addressing the memory relevant to the execution of instructions for the
78K0/KC1 Series, based on operability and other considerations. For areas containing data memory in particular,
special addressing methods designed for the functions of special function registers (SFR) and general-purpose
registers are available for use. Data memory addressing is illustrated in Figures 3-6 to 3-10. For the details of each
addressing mode, see 3.4 Operand Address Addressing.
Figure 3-6. Data Memory Addressing (



PD780111)
0000H
General-purpose registers
32
8 bits
Internal ROM
8192
8 bits
2000H
1FFFH
FEE0H
FEDFH
FF00H
FEFFH
FFFFH
Internal high-speed RAM
512
8 bits
Reserved
FD00H
FCFFH
FF20H
FF1FH
FE20H
FE1FH
Special function
registers (SFRs)
256
8 bits
SFR addressing
Register addressing
Short direct
addressing
Direct addressing
Register indirect
addressing
Based addressing
Based indexed
addressing
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
55
Figure 3-7. Data Memory Addressing (



PD780112)
0000H
General-purpose registers
32
8 bits
Internal ROM
16384
8 bits
4000H
3FFFH
FEE0H
FEDFH
FF00H
FEFFH
FFFFH
Internal high-speed RAM
512
8 bits
Reserved
FD00H
FCFFH
FF20H
FF1FH
FE20H
FE1FH
Special function
registers (SFRs)
256
8 bits
SFR addressing
Register addressing
Short direct
addressing
Direct addressing
Register indirect
addressing
Based addressing
Based indexed
addressing
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
56
Figure 3-8. Data Memory Addressing (



PD780113)
0000H
General-purpose registers
32
8 bits
Internal ROM
24576
8 bits
6000H
5FFFH
FEE0H
FEDFH
FF00H
FEFFH
FFFFH
Internal high-speed RAM
1024
8 bits
Reserved
FB00H
FAFFH
FF20H
FF1FH
FE20H
FE1FH
Special function
registers (SFRs)
256
8 bits
SFR addressing
Register addressing
Short direct
addressing
Direct addressing
Register indirect
addressing
Based addressing
Based indexed
addressing
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
57
Figure 3-9. Data Memory Addressing (



PD780114)
0000H
General-purpose registers
32
8 bits
Internal ROM
32768
8 bits
8000H
7FFFH
FEE0H
FEDFH
FF00H
FEFFH
FFFFH
Internal high-speed RAM
1024
8 bits
Reserved
FB00H
FAFFH
FF20H
FF1FH
FE20H
FE1FH
Special function
registers (SFRs)
256
8 bits
SFR addressing
Register addressing
Short direct
addressing
Direct addressing
Register indirect
addressing
Based addressing
Based indexed
addressing
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
58
Figure 3-10. Data Memory Addressing (



PD78F0114)
0000H
General-purpose registers
32
8 bits
Flash memory
32768
8 bits
8000H
7FFFH
FEE0H
FEDFH
FF00H
FEFFH
FFFFH
Internal high-speed RAM
1024
8 bits
Reserved
FB00H
FAFFH
FF20H
FF1FH
FE20H
FE1FH
Special function
registers (SFRs)
256
8 bits
SFR addressing
Register addressing
Short direct
addressing
Direct addressing
Register indirect
addressing
Based addressing
Based indexed
addressing
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
59
3.2 Processor Registers
The 78K0/KC1 Series products incorporate the following processor registers.
3.2.1 Control registers
The control registers control the program sequence, statuses and stack memory. The control registers consist of a
program counter (PC), a program status word (PSW) and a stack pointer (SP).
(1) Program counter (PC)
The program counter is a 16-bit register that holds the address information of the next program to be executed.
In normal operation, the PC is automatically incremented according to the number of bytes of the instruction to be
fetched. When a branch instruction is executed, immediate data and register contents are set.
RESET input sets the reset vector table values at addresses 0000H and 0001H to the program counter.
Figure 3-11. Format of Program Counter
15
0
PC
PC15 PC14 PC13 PC12 PC11 PC10 PC9
PC8
PC7
PC6
PC5
PC4
PC3
PC2
PC1
PC0
(2) Program status word (PSW)
The program status word is an 8-bit register consisting of various flags set/reset by instruction execution.
Program status word contents are automatically stacked upon interrupt request generation or PUSH PSW
instruction execution and are automatically restored upon execution of the RETB, RETI and POP PSW
instructions.
RESET input sets the PSW to 02H.
Figure 3-12. Format of Program Status Word
7
0
PSW
IE
Z
RBS1
AC
RBS0
0
ISP
CY
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
60
(a) Interrupt enable flag (IE)
This flag controls the interrupt request acknowledge operations of the CPU.
When 0, the IE flag is set to the interrupt disabled (DI) state, and only non-maskable interrupt requests
become acknowledgeable. Other interrupt requests are all disabled.
When 1, the IE flag is set to the interrupt enabled (EI) state and interrupt request acknowledgement is
controlled with an in-service priority flag (ISP), an interrupt mask flag for various interrupt sources, and a
priority specification flag.
The IE flag is reset (0) upon DI instruction execution or interrupt acknowledgement and is set (1) upon EI
instruction execution.
(b) Zero flag (Z)
When the operation result is zero, this flag is set (1). It is reset (0) in all other cases.
(c) Register bank select flags (RBS0 and RBS1)
These are 2-bit flags to select one of the four register banks.
In these flags, the 2-bit information that indicates the register bank selected by SEL RBn instruction
execution is stored.
(d) Auxiliary carry flag (AC)
If the operation result has a carry from bit 3 or a borrow at bit 3, this flag is set (1). It is reset (0) in all other
cases.
(e) In-service priority flag (ISP)
This flag manages the priority of acknowledgeable maskable vectored interrupts. When this flag is 0, low-
level vectored interrupt requests specified by a priority specification flag register (PR0L, PR0H, PR1L) (refer
to 15.3 (3) Priority specification flag registers (PR0L, PR0H, PR1L)) can not be acknowledged. Actual
request acknowledgement is controlled by the interrupt enable flag (IE).
(f)
Carry flag (CY)
This flag stores overflow and underflow upon add/subtract instruction execution. It stores the shift-out value
upon rotate instruction execution and functions as a bit accumulator during bit operation instruction
execution.
(3) Stack pointer (SP)
This is a 16-bit register to hold the start address of the memory stack area. Only the internal high-speed RAM
area can be set as the stack area.
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
61
Figure 3-13. Format of Stack Pointer
15
0
SP
SP15 SP14 SP13 SP12 SP11 SP10 SP9
SP8
SP7
SP6
SP5
SP4
SP3
SP2
SP1
SP0
The SP is decremented ahead of write (save) to the stack memory and is incremented after read (restored) from
the stack memory.
Each stack operation saves/restores data as shown in Figures 3-14 and 3-15.
Caution Since RESET input makes the SP contents undefined, be sure to initialize the SP before
instruction execution.
Figure 3-14. Data to Be Saved to Stack Memory
Interrupt and
BRK instructions
PSW
PC15 to PC8
PC15 to PC8
PC7 to PC0
Register pair lower
SP SP _ 2
SP _ 2
Register pair upper
CALL, CALLF, and
CALLT instructions
PUSH rp instruction
SP _ 1
SP
SP SP _ 2
SP _ 2
SP _ 1
SP
PC7 to PC0
SP _ 3
SP _ 2
SP _ 1
SP
SP SP _ 3
Figure 3-15. Data to Be Restored from Stack Memory
RETI and RETB
instructions
PSW
PC15 to PC8
PC15 to PC8
PC7 to PC0
Register pair lower
SP SP + 2
SP
Register pair upper
RET instruction
POP rp instruction
SP + 1
PC7 to PC0
SP SP + 2
SP
SP + 1
SP + 2
SP
SP + 1
SP SP + 3
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
62
3.2.2 General-purpose registers
General-purpose registers are mapped at particular addresses (FEE0H to FEFFH) of the data memory. The
general-purpose registers consists of 4 banks, each bank consisting of eight 8-bit registers (X, A, C, B, E, D, L, and H).
Each register can be used as an 8-bit register, and two 8-bit registers can also be used in a pair as a 16-bit register
(AX, BC, DE, and HL).
These registers can be described in terms of function names (X, A, C, B, E, D, L, H, AX, BC, DE, and HL) and
absolute names (R0 to R7 and RP0 to RP3).
Register banks to be used for instruction execution are set by the CPU control instruction (SEL RBn). Because of
the 4-register bank configuration, an efficient program can be created by switching between a register for normal
processing and a register for interrupts for each bank.
Figure 3-16. Configuration of General-Purpose Registers
(a) Absolute Name
BANK0
BANK1
BANK2
BANK3
FEFFH
FEF8H
FEE0H
RP3
RP2
RP1
RP0
R7
15
0
7
0
R6
R5
R4
R3
R2
R1
R0
16-bit processing
8-bit processing
FEF0H
FEE8H
(b) Function Name
BANK0
BANK1
BANK2
BANK3
FEFFH
FEF8H
FEE0H
HL
DE
BC
AX
H
15
0
7
0
L
D
E
B
C
A
X
16-bit processing
8-bit processing
FEF0H
FEE8H
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
63
3.2.3 Special Function Registers (SFRs)
Unlike a general-purpose register, each special function register has a special function.
SFRs are allocated to the FF00H to FFFFH area.
Special function registers can be manipulated like general-purpose registers, using operation, transfer and bit
manipulation instructions. The manipulatable bit units, 1, 8, and 16, depend on the special function register type.
Each manipulation bit unit can be specified as follows.
1-bit manipulation
Describe the symbol reserved by the assembler for the 1-bit manipulation instruction operand (sfr.bit).
This manipulation can also be specified with an address.
8-bit manipulation
Describe the symbol reserved by the assembler for the 8-bit manipulation instruction operand (sfr).
This manipulation can also be specified with an address.
16-bit manipulation
Describe the symbol reserved by the assembler for the 16-bit manipulation instruction operand (sfrp).
When specifying an address, describe an even address.
Table 3-5 gives a list of the special function registers. The meanings of items in the table are as follows.
Symbol
Symbol indicating the address of a special function register. It is a reserved word in the RA78K0, and is defined
by the header file "sfrbit.h" in the CC78K0. When using the RA78K0, ID78K0-NS, ID78K0, or SM78K0, symbols
can be written as an instruction operand.
R/W
Indicates whether the corresponding special function register can be read or written.
R/W: Read/write enable
R:
Read only
W:
Write only
Manipulatable bit units
Indicates the manipulatable bit unit (1, 8, or 16). "
-" indicates a bit unit for which manipulation is not possible.
After reset
Indicates each register status upon RESET input.
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
64
Table 3-5. Special Function Register List (1/3)
Manipulatable Bit Unit
Address
Special Function Register (SFR) Name
Symbol
R/W
1 Bit
8 Bits
16 Bits
After
Reset
FF00H
Port 0
P0
R/W
-
00H
FF01H
Port 1
P1
R/W
-
00H
FF02H
Port 2
P2
R
-
00H
FF03H
Port 3
P3
R/W
-
00H
FF06H
Port 6
P6
R/W
-
00H
FF07H
Port 7
P7
R/W
-
00H
FF08H
FF09H
A/D conversion result register
ADCR
R
-
-
Undefined
FF0AH
Receive buffer register 6
RXB6
R
-
-
FFH
FF0BH
Transmit buffer register 6
TXB6
R/W
-
-
FFH
FF0CH
Port 12
P12
R/W
-
00H
FF0DH
Port 13
P13
R/W
-
00H
FF0FH
Serial I/O shift register 10
SIO10
R
-
-
00H
FF10H
FF11H
16-bit timer counter 00
TM00
R
-
-
0000H
FF12H
FF13H
16-bit timer capture/compare register 000
CR000
R/W
-
-
0000H
FF14H
FF15H
16-bit timer capture/compare register 010
CR010
R/W
-
-
0000H
FF16H
8-bit timer counter 50
TM50
R
-
-
00H
FF17H
8-bit timer compare register 50
CR50
R/W
-
-
00H
FF18H
8-bit timer H compare register 00
CMP00
R/W
-
-
00H
FF19H
8-bit timer H compare register 10
CMP10
R/W
-
-
00H
FF1AH
8-bit timer H compare register 01
CMP01
R/W
-
-
00H
FF1BH
8-bit timer H compare register 11
CMP11
R/W
-
-
00H
FF1FH
8-bit timer counter 51
TM51
R
-
-
00H
FF20H
Port mode register 0
PM0
R/W
-
FFH
FF21H
Port mode register 1
PM1
R/W
-
FFH
FF23H
Port mode register 3
PM3
R/W
-
FFH
FF26H
Port mode register 6
PM6
R/W
-
FFH
FF27H
Port mode register 7
PM7
R/W
-
FFH
FF28H
A/D converter mode register
ADM
R/W
-
00H
FF29H
Analog input channel specification register
ADS
R/W
-
00H
FF2AH
Power-fail comparison mode register
PFM
R/W
-
00H
FF2BH
Power-fail comparison threshold register
PFT
R/W
-
-
00H
FF2CH
Port mode register 12
PM12
R/W
-
FFH
FF30H
Pull-up resistor option register 0
PU0
R/W
-
00H
FF31H
Pull-up resistor option register 1
PU1
R/W
-
00H
FF33H
Pull-up resistor option register 3
PU3
R/W
-
00H
FF37H
Pull-up resistor option register 7
PU7
R/W
-
00H
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
65
Table 3-5. Special Function Register List (2/3)
Manipulatable Bit Unit
Address
Special Function Register (SFR) Name
Symbol
R/W
1 Bit
8 Bits
16 Bits
After
Reset
FF3CH
Pull-up resistor option register 12
PU12
R/W
-
00H
FF41H
8-bit timer compare register 51
CR51
R/W
-
-
00H
FF43H
8-bit timer mode control register 51
TMC51
R/W
-
00H
FF48H
External interrupt rising edge enable register
EGP
R/W
-
00H
FF49H
External interrupt falling edge enable register
EGN
R/W
-
00H
FF4FH
Input switch control register
ISC
R/W
-
00H
FF50H
Asynchronous serial interface operation mode
register 6
ASIM6
R/W
-
01H
FF53H
Asynchronous serial interface reception error
status register 6
ASIS6
R
-
-
00H
FF55H
Asynchronous serial interface transmission
status register 6
ASIF6
R
-
-
00H
FF56H
Clock selection register 6
CKSR6
R/W
-
-
00H
FF57H
Baud rate generator control register 6
BRGC6
R/W
-
-
FFH
FF58H
Asynchronous serial interface control register 6
ASICL6
R/W
-
16H
FF69H
8-bit timer H mode register 0
TMHMD0
R/W
-
00H
FF6AH
Timer clock selection register 50
TCL50
R/W
-
-
00H
FF6BH
8-bit timer mode control register 50
TMC50
R/W
-
00H
FF6CH
8-bit timer H mode register 1
TMHMD1
R/W
-
00H
FF6DH
8-bit timer H carrier control register 1
TMCYC1
R/W
-
00H
FF6EH
Key return mode register
KRM
R/W
-
00H
FF6FH
Watch timer operation mode register
WTM
R/W
-
00H
FF70H
Asynchronous serial interface operation mode
register 0
ASIM0
R/W
-
01H
FF71H
Baud rate generator control register 0
BRGC0
R/W
-
-
1FH
FF72H
Receive buffer register 0
RXB0
R
-
-
FFH
FF73H
Asynchronous serial interface reception error
status register 0
ASIS0
R
-
-
00H
FF74H
Transmit shift register 0
TXS0
W
-
-
FFH
FF80H
Serial operation mode register 10
CSIM10
R/W
-
00H
FF81H
Serial clock selection register 10
CSIC10
R/W
-
00H
FF84H
Transmit buffer register 10
SOTB10
R/W
-
-
Undefined
FF8CH
Timer clock selection register 51
TCL51
R/W
-
-
00H
FF98H
Watchdog timer mode register
WDTM
R/W
-
-
67H
FF99H
Watchdog timer enable register
WDTE
R/W
-
-
9AH
FFA0H
Ring-OSC mode register
RCM
R/W
-
00H
FFA1H
Main clock mode register
MCM
R/W
-
00H
FFA2H
Main OSC control register
MOC
R/W
-
00H
FFA3H
Oscillation stabilization time counter status register OSTC
R
-
00H
FFA4H
Oscillation stabilization time select register
OSTS
R/W
-
-
05H
FFA9H
Clock monitor mode register
CLM
R/W
-
00H
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
66
Table 3-5. Special Function Register List (3/3)
Manipulatable Bit Unit
Address
Special Function Register (SFR) Name
Symbol
R/W
1 Bit
8 Bits
16 Bits
After
Reset
FFACH
Reset control flag register
RESF
R
-
-
00H
Note 1
FFBAH
16-bit timer mode control register 00
TMC00
R/W
-
00H
FFBBH
Prescaler mode register 00
PRM00
R/W
-
00H
FFBCH
Capture/compare control register 00
CRC00
R/W
-
00H
FFBDH
16-bit timer output control register 00
TOC00
R/W
-
00H
FFBEH
Low-voltage detection register
LVIM
R/W
-
00H
FFBFH
Low-voltage detection level selection register
LVIS
R/W
-
-
00H
FFE0H
Interrupt request flag register 0L
IF0
IF0L
R/W
00H
FFE1H
Interrupt request flag register 0H
IF0H
R/W
00H
FFE2H
Interrupt request flag register 1L
IF1L
R/W
-
00H
FFE4H
Interrupt mask flag register 0L
MK0
MK0L R/W
FFH
FFE5H
Interrupt mask flag register 0H
MK0H R/W
FFH
FFE6H
Interrupt mask flag register 1L
MK1L
R/W
-
FFH
FFE8H
Priority specification flag register 0L
PR0
PR0L R/W
FFH
FFE9H
Priority specification flag register 0H
PR0H R/W
FFH
FFEAH
Priority specification flag register 1L
PR1L
R/W
-
FFH
FFF0H
Internal memory size switching register
Note 2
IMS
R/W
-
-
CFH
FFFBH
Processor clock control register
PCC
R/W
-
00H
Notes 1.
This value varies depending on the reset source.
2.
The default value of IMS is fixed (CFH) in all products in the 78K0/KC1 Series regardless of the internal
memory capacity. Therefore, set the following value to each product.
Internal Memory Size Switching Register (IMS)
PD780111
42H
PD780112
44H
PD780113
C6H
PD780114
C8H
PD78F0114
Value corresponding to mask ROM version
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
67
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]
15
0
PC
+
15
0
8
7
6
S
15
0
PC
jdisp8
When S = 0, all bits of are 0.
When S = 1, all bits of are 1.
PC indicates the start address
of the instruction after the BR instruction.
...
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
68
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
15
0
PC
8 7
7
0
CALL or BR
Low Addr.
High Addr.
In the case of CALLF !addr11 instruction
15
0
PC
8 7
7
0
fa
108
11 10
0
0
0
0
1
6
4
3
CALLF
fa
70
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
69
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 40H to 7FH, and allows branching to
the entire memory space.
[Illustration]
15
1
15
0
PC
7
0
Low Addr.
High Addr.
Memory (Table)
Effective address+1
Effective address
0
1
0
0
0
0
0
0
0
0
8
7
8
7
6
5
0
0
1
1
1
7
6
5
1
0
ta
40
Operation code
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]
7
0
rp
0
7
A
X
15
0
PC
8
7
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
70
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 78K0/KC1 Series 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.
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
71
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
1
1
0
0
0
1
0
Register specify code
INCW DE; when selecting DE register pair as rp
Operation code
1
0
0
0
0
1
0
0
Register specify code
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
72
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
0
0
0
0
0
0
0
0
00H
1
1
1
1
1
1
1
0
FEH
[Illustration]
Memory
0
7
addr16 (lower)
addr16 (upper)
OP code
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
73
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 set to 0. When it is at 00H to 1FH,
bit 8 is set to 1. Refer to the [Illustration] shown below.
[Operand format]
Identifier
Description
saddr
Label or FE20H to FF1FH immediate data
saddrp
Label or FE20H to FF1FH immediate data (even address only)
[Description example]
MOV 0FE30H, #50H; when setting saddr to FE30H and immediate data to 50H
Operation code
0
0
0
1
0
0
0
1
OP code
0
0
1
1
0
0
0
0
30H (saddr-offset)
0
1
0
1
0
0
0
0
50H (immediate data)
[Illustration]
15
0
Short direct memory
Effective address
1
1
1
1
1
1
1
8 7
0
7
OP code
saddr-offset
When 8-bit immediate data is 20H to FFH,
= 0
When 8-bit immediate data is 00H to 1FH,
= 1
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
74
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]
15
0
SFR
Effective address
1
1
1
1
1
1
1
8 7
0
7
OP code
sfr-offset
1
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
75
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
1
0
0
0
0
1
0
1
[Illustration]
16
0
8
D
7
E
0
7
7 0
A
DE
The contents of the memory
addressed are transferred.
Memory
The memory address
specified with the
register pair DE
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
76
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]
[Description example]
MOV A, [HL + 10H]; when setting byte to 10H
Operation code
1
0
1
0
1
1
1
0
0
0
0
1
0
0
0
0
CHAPTER 3 CPU ARCHITECTURE
Preliminary User's Manual U16227EJ1V0UD
77
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]
Operation code
1
0
1
0
1
0
1
1
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
Operation code
1
0
1
1
0
1
0
1
Preliminary User's Manual U16227EJ1V0UD
78
CHAPTER 4 PORT FUNCTIONS
4.1 Port Functions
78K0/KC1 Series 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-1.
In addition to the function as digital I/O ports, these ports have several alternate functions. For details of the
alternate functions, refer to CHAPTER 2 PIN FUNCTIONS.
Figure 4-1. Port Types
Port 2
P20
P27
Port 3
P30
P33
Port 0
P00
P01
Port 1
P10
P17
Port 6
P60
P63
Port 7
P70
P73
P120
Port 12
P130
Port 13
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
79
Table 4-1. Port Functions
Pin Name
I/O
Function
After Reset
Alternate Function
P00
TI000
P01
I/O
Port 0.
2-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
TI010/TO00
P10
SCK10/TxD0
P11
SI10/RxD0
P12
SO10
P13
TxD6
P14
RxD6
P15
TOH0
P16
TOH1/INTP5
P17
I/O
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.
Input
TI50/TO50
P20 to P27
Input
Port 2.
8-bit input-only port.
Input
ANI0 to ANI7
P30 to P32
INTP1 to INTP3
P33
I/O
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.
Input
INTP4/TI51/TO51
P60 to P63
I/O
Port 6.
4-bit I/O port (N-ch open drain).
Input/output can be specified in 1-bit units.
Use of an on-chip pull-up resistor can be specified by a mask
option only for mask ROM versions.
Input
-
P70 to P73
I/O
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
KR0 to KR3
P120
I/O
Port 12.
1-bit I/O port.
Use of an on-chip pull-up resistor can be specified by a
software setting.
Input
INTP0
P130
Output
Port 13.
1-bit output-only port.
Output
-
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
80
4.2 Port Configuration
Ports consist of the following hardware.
Table 4-2. Port Configuration
Item
Configuration
Control registers
Port mode register (PM0, PM1, PM3, PM6, PM7, PM12)
Pull-up resistor option register (PU0, PU1, PU3, PU7, PU12)
Input switch control register (ISC)
Port
Total: 32 (CMOS I/O: 19, CMOS input: 8, CMOS output: 1, N-ch open drain I/O: 4)
Pull-up resistor
Mask ROM version
Total: 23 (software control: 19, mask option specification: 4)
Flash memory version: Total: 19
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
81
4.2.1 Port 0
Port 0 is a 2-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 and P01 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 timer I/O.
RESET input sets port 0 to input mode.
Figures 4-2 and 4-3 show block diagrams of port 0.
Figure 4-2. Block Diagram of P00
P00/TI000
WR
PU
RD
WR
PORT
WR
PM
PU00
Alternate function
Output latch
(P00)
PM00
EV
DD
P-ch
Selector
Internal bus
PU0:
Pull-up resistor option register 0
PM:
Port mode register
RD:
Port 0 read signal
WR:
Port 0 write signal
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
82
Figure 4-3. Block Diagram of P01
P01/TI010/TO00
WR
PU
RD
WR
PORT
WR
PM
PU01
Alternate
function
Output latch
(P01)
PM01
Alternate
function
EV
DD
P-ch
Selector
Internal bus
PU0:
Pull-up resistor option register 0
PM:
Port mode register
RD:
Port 0 read signal
WR:
Port 0 write signal
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
83
4.2.2 Port 1
Port 1 is an 8-bit I/O port with an output latch. Port 1 can be set to the input mode or output mode in 1-bit units
using port mode register 1 (PM1). When the P10 to P17 pins are used as an input port, use of an on-chip pull-up
resistor can be specified by pull-up resistor option register 1 (PU1).
This port can also be used for external interrupt request input, serial interface data I/O, clock I/O, and timer I/O.
RESET input sets port 1 to input mode.
Figures 4-4 to 4-9 show block diagrams of port 1.
Caution
When P10/SCK10/TxD0, P11/SI10/RxD0, and P12/SO10 are used as general-purpose ports, do not
write to serial clock selection register 10 (CSIC10).
Figure 4-4. Block Diagram of P10
P10/SCK10/TxD0
WR
PU
RD
WR
PORT
WR
PM
PU10
Alternate
function
Output latch
(P10)
PM10
Alternate
function
EV
DD
P-ch
Selector
Internal bus
PU1:
Pull-up resistor option register 1
PM:
Port mode register
RD:
Port 1 read signal
WR:
Port 1 write signal
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
84
Figure 4-5. Block Diagram of P11 and P14
P11/SI10/RxD0,
P14/RxD6
WR
PU
RD
WR
PORT
WR
PM
PU11, PU14
Alternate
function
Output latch
(P11, P14)
PM11, PM14
EV
DD
P-ch
Selector
Internal bus
PU1:
Pull-up resistor option register 1
PM:
Port mode register
RD:
Port 1 read signal
WR:
Port 1 write signal
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
85
Figure 4-6. Block Diagram of P12
P12/SO10
WR
PU
RD
WR
PORT
WR
PM
PU12
Output latch
(P12)
PM12
Alternate
function
EV
DD
P-ch
Selector
Internal bus
PU1:
Pull-up resistor option register 1
PM:
Port mode register
RD:
Port 1 read signal
WR:
Port 1 write signal
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
86
Figure 4-7. Block Diagram of P13
P13/TxD6
WR
PU
RD
WR
PORT
WR
PM
PU13
Output latch
(P13)
PM13
Alternate
function
EV
DD
P-ch
Internal bus
Selector
PU1:
Pull-up resistor option register 1
PM:
Port mode register
RD:
Port 1 read signal
WR:
Port 1 write signal
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
87
Figure 4-8. Block Diagram of P15
P15/TOH0
WR
PU
RD
WR
PORT
WR
PM
PU15
Output latch
(P15)
PM15
Alternate
function
EV
DD
P-ch
Selector
Internal bus
PU1:
Pull-up resistor option register 1
PM:
Port mode register
RD:
Port 1 read signal
WR:
Port 1 write signal
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
88
Figure 4-9. Block Diagram of P16 and P17
P16/TOH1/INTP5,
P17/TI50/TO50
WR
PU
RD
WR
PORT
WR
PM
PU16, PU17
Alternate
function
Output latch
(P16, P17)
PM16, PM17
Alternate
function
EV
DD
P-ch
Selector
Internal bus
PU1:
Pull-up resistor option register 1
PM:
Port mode register
RD:
Port 1 read signal
WR:
Port 1 write signal
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
89
4.2.3 Port 2
Port 2 is an 8-bit input-only port.
This port can also be used for A/D converter analog input.
Figure 4-10 shows a block diagram of port 2.
Figure 4-10. Block Diagram of P20 to P27
V
REF
RD
A/D converter
P20/ANI0 to P27/ANI7
+
Internal bus
RD:
Port 2 read signal
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
90
4.2.4 Port 3
Port 3 is a 4-bit I/O port with an output latch. Port 3 can be set to the input mode or output mode in 1-bit units
using port mode register 3 (PM3). When used as an input port, use of an on-chip pull-up resistor can be specified by
pull-up resistor option register 3 (PU3).
This port can also be used for external interrupt request input.
RESET input sets port 3 to input mode.
Figures 4-11 and 4-12 show block diagrams of port 3.
Figure 4-11. Block Diagram of P30 to P32
P30/INTP1 to
P32/INTP3
WR
PU
RD
WR
PORT
WR
PM
PU30 to PU32
Alternate
function
Output latch
(P30 to P32)
PM30 to PM32
EV
DD
P-ch
Selector
Internal bus
PU3:
Pull-up resistor option register 3
PM:
Port mode register
RD:
Port 3 read signal
WR:
Port 3 write signal
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
91
Figure 4-12. Block Diagram of P33
P33/INTP4/TI51/TO51
WR
PU
RD
WR
PORT
WR
PM
PU33
Alternate
function
Output latch
(P33)
PM33
Alternate
function
EV
DD
P-ch
Selector
Internal bus
PU3:
Pull-up resistor option register 3
PM:
Port mode register
RD:
Port 3 read signal
WR:
Port 3 write signal
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
92
4.2.5 Port 6
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).
This port has the following functions for pull-up resistors. These functions differ depending on whether the product
is a mask ROM version or a flash memory version.
Table 4-3. Pull-up Resistor of Port 6
Pins P60 to P63
Mask ROM version
An on-chip pull-up resistor can be
specified in 1-bit units by mask option
Flash memory version
On-chip pull-up resistors are not provided
RESET input sets port 6 to input mode.
Figure 4-13 shows block diagram of port 6.
Figure 4-13. Block Diagram of P60 to P63
RD
P60 to P63
WR
PORT
WR
PM
Output latch
(P60 to P63)
PM60 to PM63
Selector
EV
DD
Mask option resistor
Internal bus
Mask ROM versions only
No pull-up resistor for
flash memory versions
PM:
Port mode register
RD:
Port 6 read signal
WR:
Port 6 write signal
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
93
4.2.6 Port 7
Port 7 is a 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).
This port can also be used for key return input.
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
P70/KR0 to
P73/KR3
WR
PU
RD
WR
PORT
WR
PM
PU70 to PU73
Alternate function
Output latch
(P70 to P73)
PM70 to PM73
EV
DD
P-ch
Selector
Internal bus
PU7:
Pull-up resistor option register 7
PM:
Port mode register
RD:
Port 7 read signal
WR:
Port 7 write signal
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
94
4.2.7 Port 12
Port 12 is a 1-bit I/O port with an output latch. Port 12 can be set to the input mode or output mode in 1-bit units
using port mode register 12 (PM12). When used as an input port, use of an on-chip pull-up resistor can be specified
by pull-up resistor option register 12 (PU12).
This port can also be used for external interrupt input.
RESET input sets port 12 to input mode.
Figure 4-15 shows a block diagram of port 12.
Figure 4-15. Block Diagram of P120
P120/INTP0
WR
PU
RD
WR
PORT
WR
PM
PU120
Alternate
function
Output latch
(P120)
PM120
EV
DD
P-ch
Selector
Internal bus
PU12: Pull-up resistor option register 12
PM:
Port mode register
RD:
Port 12 read signal
WR:
Port 12 write signal
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
95
4.2.8 Port 13
Port 13 is a 1-bit output-only port.
Figure 4-16 shows a block diagram of port 13.
Figure 4-16. Block Diagram of P130
RD
Output latch
(P130)
WR
PORT
P130
Internal bus
RD:
Port 13 read signal
WD:
Port 13 write signal
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
96
4.3 Registers Controlling Port Function
Port functions are controlled by the following three types of registers.
Port mode registers (PM0, PM1, PM3, PM6, PM7, PM12)
Pull-up resistor option registers (PU0, PU1, PU3, PU7, PU12)
Input switch control register (ISC)
(1) Port mode registers (PM0, PM1, PM3, PM6, PM7, and PM12)
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-17. Format of Port Mode Register
7
1
Symbol
PM0
6
1
5
1
4
1
3
1
2
1
1
PM01
0
PM00
Address
FF20H
After reset
FFH
R/W
R/W
7
PM17
PM1
6
PM16
5
PM15
4
PM14
3
PM13
2
PM12
1
PM11
0
PM10
FF21H
FFH
R/W
7
1
PM3
6
1
5
1
4
1
3
PM33
2
PM32
1
PM31
0
PM30
FF23H
FFH
R/W
7
1
PM6
6
1
5
1
4
1
3
PM63
2
PM62
1
PM61
0
PM60
FF26H
FFH
R/W
7
1
PM7
6
1
5
1
4
1
3
PM73
2
PM72
1
PM71
0
PM70
FF27H
FFH
R/W
7
1
PM12
6
1
5
1
4
1
3
1
2
1
1
1
0
PM120
FF2CH
FFH
R/W
PMmn
Pmn pin I/O mode selection
(m = 0, 1, 3, 6, 7, 12; n = 0 to 7)
0
Output mode (output buffer on)
1
Input mode (output buffer off)
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
97
Table 4-4. Settings of Port Mode Register and Output Latch When Using Alternate Function
Alternate Function
Pin Name
Function Name
I/O
PM
P
P00
TI000
Input
1
TI010
Input
1
P01
TO00
Output
0
0
Input
1
SCK10
Output
0
1
P10
TxD0
Output
0
1
SI10
Input
1
P11
RxD0
Input
1
P12
SO10
Output
0
0
P13
TxD6
Output
0
1
P14
RxD6
Input
1
P15
TOH0
Output
0
0
TOH1
Output
0
0
P16
INTP5
Input
1
TI50
Input
1
P17
TO50
Output
0
0
P30 to P32
INTP1 to INTP3
Input
1
INTP4
Input
1
TI51
Input
1
P33
TO51
Output
0
0
P70 to P73
KR0 to KR3
Input
1
P120
INTP0
Input
1
Remark
:
Don't care
PM
: Port mode register
P
: Port output latch
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
98
(2) Pull-up resistor option registers (PU0, PU1, PU3, PU7, and PU12)
These registers specify whether the on-chip pull-up resistors of P00, P01, P10 to P17, P30 to P33, P70 to P73, or
P120 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 in PU0, PU1, PU3, PU7, and PU12.
On-chip pull-up resistors cannot be used for bits set to output mode and bits used as alternate-function output
pins, regardless of the settings of PU0, PU1, PU3, PU7, and PU12.
These registers can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears these registers to 00H.
Figure 4-18. Format of Pull-up Resistor Option Register
7
0
Symbol
PU0
6
0
5
0
4
0
3
0
2
0
1
PU01
0
PU00
Address
FF30H
After reset
00H
R/W
R/W
7
PU17
PU1
6
PU16
5
PU15
4
PU14
3
PU13
2
PU12
1
PU11
0
PU10
FF31H
00H
R/W
7
0
PU3
6
0
5
0
4
0
3
PU33
2
PU32
1
PU31
0
PU30
FF33H
00H
R/W
7
0
PU7
6
0
5
0
4
0
3
PU73
2
PU72
1
PU71
0
PU70
FF37H
00H
R/W
7
0
PU12
6
0
5
0
4
0
3
0
2
0
1
0
0
PU120
FF3CH
00H
R/W
PUmn
Pmn pin on-chip pull-up resistor selection
(m = 0, 1, 3, 7, 12; n = 0 to 7)
0
On-chip pull-up resistor not connected
1
On-chip pull-up resistor connected
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
99
(3) Input switch control register (ISC)
This register is used to receive a status signal transmitted from the master during LIN (Local Interconnect
Network) reception. The input signal is switched by setting ISC.
For the port configuration during LIN reception, refer to Figure 13-3 Port Configuration for LIN Reception
Operation in CHAPTER 13 SERIAL INTERFACE UART6.
This register can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Figure 4-19. Format of Input Switch Control Register (ISC)
Address: FF4FH After reset: 00H R/W
Symbol
7
6
5
4
3
2
1
0
ISC
0
0
0
0
0
0
ISC1
ISC0
ISC1
Input signal selection
0
TI000 input
1
RxD6 input
ISC0
Input signal selection
0
INTP0 input
1
RxD6 input
CHAPTER 4 PORT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
100
4.4 Port Function Operations
Port operations differ depending on whether the input or output mode is set, as shown below.
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.
(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.
(2) Input mode
The output latch contents are undefined, but since the output buffer is off, the pin status does not change.
Caution
In the case of 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.
Preliminary User's Manual U16227EJ1V0UD
101
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 three system clock oscillators are available.
X1 oscillator
The X1 oscillator oscillates a clock of 2.0 to 10.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).
Ring-OSC oscillator
The Ring-OSC oscillator oscillates a clock of 240 kHz (TYP.). Oscillation can be stopped by setting the Ring-
OSC mode register (RCM) when "Can be stopped by software" is set by a mask option and the X1 input clock is
used as the CPU clock.
Subsystem clock oscillator
The subsystem clock oscillator oscillates a clock of 32.768 kHz. Oscillation cannot be stopped. When
subsystem clock oscillator is not used, setting not to use the on-chip feedback resistor is possible using the
processor clock control register (PCC), and the power consumption can be reduced in the STOP mode.
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
102
5.2 Configuration of Clock Generator
The clock generator consists of the following hardware.
Table 5-1. Configuration of Clock Generator
Item
Configuration
Control registers
Processor clock control register (PCC)
Ring-OSC 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)
Oscillator
X1 oscillator
Ring-OSC oscillator
Subsystem clock oscillator
Figure 5-1. Block Diagram of Clock Generator
X1
X2
f
XP
f
XT
FRC
XT1
XT2
f
X
2
2
STOP
MSTOP
f
X
2
3
f
X
2
4
f
X
2
4
RSTOP
CSS PCC2
CLS
MCM0
MCS
CLS
MCC
OSTS1 OSTS0
OSTS2
1/2
3
MOST
16
MOST
15
MOST
14
MOST
13
MOST
11
C
P
U
f
R
f
X
PCC1 PCC0
X1 oscillator
Internal bus
Ring-OSC mode
register (RCM)
Main OSC
control
register
(MOC)
Internal bus
Ring-OSC
oscillator
Mask option
1: Cannot be stopped
0. Can be stopped
CPU clock
(f
CPU
)
Controller
Processor clock
control register
(PCC)
Main clock
mode register
(MCM)
X1 oscillation
stabilization time counter
Oscillation
stabilization time
select register
(OSTS)
Oscillation
stabilization
time counter
status
register
(OSTC)
Clock to peripheral
hardware
Prescaler
Operation
clock switch
8-bit timer H1,
watchdog timer
Prescaler
Prescaler
Selector
Subsystem
clock oscillator
Watch clock
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
103
5.3 Registers Controlling Clock Generator
The following six registers are used to control the clock generator.
Processor clock control register (PCC)
Ring-OSC 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)
(1) Processor clock control register (PCC)
The PCC register is used to select the CPU clock, the division ratio, main system clock oscillator operation/stop
and whether to use the on-chip feedback resistor of the subsystem clock oscillator.
The PCC is set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears PCC to 00H.
Figure 5-2. Subsystem Clock Feedback Resistor
FRC
P-ch
Feedback resistor
XT1
XT2
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
104
Figure 5-3. Format of Processor Clock Control Register (PCC)
Address: FFFBH After reset: 00H R/W
Note 1
Symbol
7
6
5
4
3
2
1
0
PCC
MCC
FRC
CLS
CSS
0
PCC2
PCC1
PCC0
MCC
Control of X1 oscillator operation
Note 2
0
Oscillation possible
1
Oscillation stopped
FRC
Subsystem clock feedback resistor selection
Note 3
0
On-chip feedback resistor used
1
On-chip feedback resistor not used
CLS
CPU clock status
0
X1 input clock or Ring-OSC clock
1
Subsystem clock
CPU Clock (f
CPU
) Selection
CSS
Note 4
PCC2
PCC1
PCC0
MCM0 = 0
MCM0 = 1
0
0
0
f
X
f
R
f
XP
0
0
1
f
X
/2
f
R
/2
f
XP
/2
0
1
0
f
X
/2
2
f
R
/2
2
f
XP
/2
2
0
1
1
f
X
/2
3
f
R
/2
3
f
XP
/2
3
0
1
0
0
f
X
/2
4
f
R
/2
4
f
XP
/2
4
0
0
0
0
0
1
0
1
0
0
1
1
1
1
0
0
f
XT
/2
Other than above
Setting prohibited
Notes 1.
Bit 5 is read-only.
2.
When the CPU is operating on the subsystem clock, MCC should be used to stop the X1 oscillator
operation. When the CPU is operating on the Ring-OSC clock, use bit 7 (MSTOP) of the main OSC
control register (MOC) to stop the X1 oscillator operation (this cannot be set by MCC). A STOP
instruction should not be used.
3.
The feedback resistor is required to adjust the bias point of the oscillation waveform to close to the
middle of the power supply voltage. Setting FRC to 1 can further reduce the current consumption in
the STOP mode, but only when the subsystem clock is not used.
4.
Be sure to switch CSS from 1 to 0 when bits 1 (MCS) and 0 (MCM0) of the main clock mode register
(MCM) are 1.
Caution
Be sure to set bit 3 to 0.
Remarks 1. MCM0: Bit 0 of the main clock mode register (MCM)
2. f
X
:
Main system clock oscillation frequency (X1 input clock oscillation frequency or Ring-OSC
clock oscillation frequency)
3. f
R
:
Ring-OSC clock oscillation frequency
4. f
XP
:
X1 input clock oscillation frequency
5. f
XT
:
Subsystem clock oscillation frequency
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
105
The fastest instruction can be executed in 2 clocks of the CPU clock in the 78K0/KC1 Series. Therefore, the
relationship between the CPU clock (f
CPU
) 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
Minimum Instruction Execution Time: 2/f
CPU
CPU Clock (f
CPU
)
X1 Input Clock
Note
(at 10 MHz Operation)
Ring-OSC Clock
Note
(at 240 kHz (TYP.) Operation)
Subsystem Clock
(at 32.768 kHz Operation)
f
X
0.2
s
8.3
s (TYP.)
-
f
X
/2
0.4
s
16.6
s (TYP.)
-
f
X
/2
2
0.8
s
33.2
s (TYP.)
-
f
X
/2
3
1.6
s
66.4
s (TYP.)
-
f
X
/2
4
3.2
s
132.8
s (TYP.)
-
f
XT
/2
-
-
122.1
s
Note The main clock mode register (MCM) is used to set the CPU clock (X1 input clock/Ring-OSC clock) (see
Figure 5-5).
(2) Ring-OSC mode register (RCM)
This register sets the operation mode of Ring-OSC.
This register is valid when "Can be stopped by software" is set for Ring-OSC by a mask option, and the X1 input
clock or subsystem clock is selected as the CPU clock. If "Cannot be stopped" is selected for Ring-OSC by a
mask option, 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-4. Format of Ring-OSC 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
Ring-OSC oscillating/stopped
0
Ring-OSC oscillating
1
Ring-OSC stopped
Caution
Make sure that the bit 1 (MCS) of the main clock mode register (MCM) is 1 before
setting RSTOP.
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
106
(3) Main clock mode register (MCM)
This register sets the CPU clock (X1 input clock/Ring-OSC clock).
MCM 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 Clock Mode Register (MCM)
Address: FFA1H After reset: 00H R/W
Note
Symbol
7
6
5
4
3
2
1
0
MCM
0
0
0
0
0
0
MCS
MCM0
MCS
CPU clock status
0
Operates with Ring-OSC clock
1
Operates with X1 input clock
MCM0
Selection of clock supplied to CPU
0
Ring-OSC clock
1
X1 input clock
Note Bit 1 is read-only.
Cautions 1. When Ring-OSC clock is selected as the clock to be supplied to the CPU, the
divided clock of the Ring-OSC oscillator output (f
X
) is supplied to the peripheral
hardware (f
X
= 240 kHz (TYP.)).
Operation of the peripheral hardware with Ring-OSC clock cannot be
guaranteed. Therefore, when Ring-OSC clock is selected as the clock supplied
to the CPU, do not use peripheral hardware. In addition, stop the peripheral
hardware before switching the clock supplied to the CPU from the X1 input clock
to the Ring-OSC clock. Note, however, that the following peripheral hardware
can be used when the CPU operates on the Ring-OSC clock.



Watchdog timer



Clock monitor



8-bit timer H1 when f
R
/2
7
is selected as count clock



Peripheral hardware selecting external clock as the clock source
(Except when external count clock of TM00 is selected (TI000 valid edge))
2. Set MCS = 1 and MCM0 = 1 before switching subsystem clock operation to X1
input clock operation (bit 4 (CSS) of the processor clock control register (PCC)
is changed from 1 to 0).
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
107
(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 Ring-OSC clock.
Therefore, this register is valid only when the CPU is operating with the Ring-OSC clock.
MOC can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Figure 5-6. 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
Cautions 1. Make sure that bit 1 (MCS) of the main clock mode register (MCM) is 1 before
setting MSTOP.
2. To stop X1 oscillation during operation with the subsystem clock, set bit 7 (MCC)
of the processor clock control register (PCC) to 1 (setting by MSTOP is not
possible).
(5) Oscillation stabilization time counter status register (OSTC)
This is the status register of the X1 input clock oscillation stabilization time counter. If the Ring-OSC 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.
RESET input, the STOP instruction, MSTOP = 1, and MCC = 1 clear OSTC to 00H.
Figure 5-7. 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
MOST11
MOST13
MOST14
MOST15
MOST16
Oscillation stabilization time status
1
0
0
0
0
2
11
/f
XP
min. (204.8
s min.)
1
1
0
0
0
2
13
/f
XP
min. (819.2
s min.)
1
1
1
0
0
2
14
/f
XP
min. (1.64 ms min.)
1
1
1
1
0
2
15
/f
XP
min. (3.27 ms min.)
1
1
1
1
1
2
16
/f
XP
min. (6.55 ms min.)
Caution
After the above time has elapsed, the bits are set to 1 in order from MOST11 and
remain 1.
Remarks 1. Values in parentheses are for operation with f
XP
= 10 MHz.
2. f
XP
: X1 input clock oscillation frequency
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
108
(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 Ring-OSC 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-8. 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
OSTS2
OSTS1
OSTS0
Oscillation stabilization time selection
0
0
1
2
11
/f
XP
(204.8
s)
0
1
0
2
13
/f
XP
(819.2
s)
0
1
1
2
14
/f
XP
(1.64 ms)
1
0
0
2
15
/f
XP
(3.27 ms)
1
0
1
2
16
/f
XP
(6.55 ms)
Other than above
Setting prohibited
Cautions 1. If the STOP mode is entered and then released while the Ring-OSC 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
V
SS
a
Remarks 1. Values in parentheses are for operation with f
XP
= 10 MHz.
2. f
XP
: X1 input clock oscillation frequency
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
109
5.4 System Clock Oscillator
5.4.1 X1 oscillator
The X1 oscillator oscillates with a crystal resonator or ceramic resonator (Standard: 10 MHz) connected to the X1
and X2 pins.
External clocks 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 the external circuit of the X1 oscillator.
Figure 5-9. External Circuit of X1 Oscillator
(a) Crystal, ceramic oscillation
(b) External clock
IC
X1
X2
Crystal resonator or
ceramic resonator
V
SS
External
clock
X1
X2
5.4.2 Subsystem clock oscillator
The subsystem clock oscillator oscillates with a crystal resonator (Standard: 32.768 kHz) connected to the XT1
and XT2 pins.
External clocks can be input to the subsystem clock oscillator. In this case, input the clock signal to the XT1 pin
and the inverse signal to the XT2 pin.
Figure 5-10 shows an external circuit of the subsystem clock oscillator.
Figure 5-10. External Circuit of Subsystem Clock Oscillator
(a) Crystal oscillation
(b) External clock
XT2
IC
XT1
32.768
kHz
XT1
XT2
External
clock
V
SS
Cautions are listed on the next page.
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
110
Cautions 1. When using the X1 oscillator and subsystem clock oscillator, wire as follows in the area
enclosed by the broken lines in the Figure 5-11 to avoid an adverse effect from wiring
capacitance.
Keep the wiring length as short as possible.
Do not cross the wiring with the other signal lines.
Do not route the wiring near a signal line through which a high fluctuating current flows.
Always make the ground point of the oscillator capacitor the same potential as V . Do
not ground the capacitor to a ground pattern through which a high current flows.
Do not fetch signals from the oscillator.
Note that the subsystem clock oscillator is designed as a low-amplitude circuit for reducing
power consumption.
Figure 5-11 shows examples of incorrect resonator connection.
Figure 5-11. Examples of Incorrect Resonator Connection (1/2)
(a) Too long wiring
(b) Crossed signal line
X1
IC
X2
X2
IC
X1
PORT
V
SS
V
SS
Remark When using the subsystem clock, replace X1 and X2 with XT1 and XT2, respectively. Also, insert
resistors in series on the XT2 side.
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
111
Figure 5-11. Examples of Incorrect Resonator Connection (2/2)
(c) Wiring near high alternating current
(d) Current flowing through ground line of oscillator
(potential at points A, B, and C fluctuates)
IC
X2
X1
IC
X2
X1
A
B
C
Pmn
V
DD0
High current
High current
V
SS
V
SS
(e) Signals are fetched
IC
X2
X1
V
SS
Remark When using the subsystem clock, replace X1 and X2 with XT1 and XT2, respectively. Also, insert
resistors in series on the XT2 side.
Cautions 2. When X2 and XT1 are wired in parallel, the crosstalk noise of X2 may increase with XT1,
resulting in malfunctioning.
To prevent that from occurring, it is recommended to wire X2 and XT1 so that they are not in
parallel, and to connect the IC pin between X2 and XT1 directly to V .
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
112
5.4.3 When subsystem clock is not used
If it is not necessary to use the subsystem clock for low power consumption operations and watch operations,
connect the XT1 and XT2 pins as follows.
XT1: Connect to EV
DD
or V
DD
XT2: Leave open
In this state, however, some current may leak via the on-chip feedback resistor of the subsystem clock oscillator
when the X1 input clock and Ring-OSC clock stop. To minimize leakage current, the above on-chip feedback resistor
can be set not to be used via bit 6 (FRC) of the processor clock control register (PCC). In this case also, connect the
XT1 and XT2 pins as described above.
5.4.4 Ring-OSC oscillator
Ring-OSC oscillator is incorporated in the
PD780111, 780112, 780113, 780114, and 78F0114.
"Can be stopped by software" or "Cannot be stopped" can be selected by a mask option. The Ring-OSC clock
always oscillates after RESET release (240 kHz (TYP.)).
5.4.5 Prescaler
The prescaler generates various clocks by dividing the X1 oscillator output (f
X
) when the X1 input clock is selected
as the clock to be supplied to the CPU.
Caution
When the Ring-OSC clock is selected as the clock supplied to the CPU, the prescaler generates
various clocks by dividing the Ring-OSC oscillator output (f
X
) (f
X
= 240 kHz (TYP.)).
5.5 Clock Generator Operation
The clock generator generates the following clocks and controls the operation modes of the CPU, such as standby
mode.
X1 input clock f
XP
Ring-OSC clock f
R
Subsystem clock f
XT
CPU clock f
CPU
Clock to peripheral hardware
The CPU starts operation when the on-chip Ring-OSC oscillator starts outputting after reset release in the
78K0/KC1 Series, thus enabling the following.
(1) Enhancement of security function
When the X1 input clock is set as the CPU clock by the default setting, the device cannot operate if the X1 input
clock is damaged or badly connected and therefore does not operate after reset is released. However, the start
clock of the CPU is the on-chip Ring-OSC clock, so the device can be started by the Ring-OSC clock after reset
release by the clock monitor (detection of X1 input clock stop). Consequently, the system can be safely shut
down by performing a minimum operation, such as acknowledging a reset source by software or performing
safety processing when there is a malfunction.
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
113
(2) Improvement of performance
Because the CPU can be started without waiting for the X1 input clock oscillation stabilization time, the total
performance can be improved.
A timing diagram of the CPU default start using Ring-OSC is shown in Figure 5-12.
Figure 5-12. Timing Diagram of CPU Default Start Using Ring-OSC
Ring-OSC clock
(f
R
)
CPU clock
X1 input clock
(f
XP
)
Operation
stopped: 17/f
R
X1 oscillation stabilization time: 2
11
/f
XP
to 2
16
/f
XP
Note
RESET
Ring-OSC clock
X1 input clock
Switched by software
Subsystem clock
(f
XT
)
Note Check using the oscillation stabilization time counter status register (OSTC).
(a) When the RESET signal is generated, bit 0 of the main clock mode register (MCM) is set to 0 and the Ring-
OSC clock is set as the CPU clock. However, a clock is supplied to the CPU after 17 clocks of the Ring-OSC
clock have elapsed after RESET release (or clock supply to the CPU stops for 17 clocks). During the
RESET period, oscillation of the X1 input clock and Ring-OSC clock is stopped.
(b) After RESET release, the CPU clock can be switched from the Ring-OSC clock to the X1 input clock using bit
0 (MCM0) of the main clock mode register (MCM) after the X1 input clock oscillation stabilization time has
elapsed. At this time, check the oscillation stabilization time using the oscillation stabilization time counter
status register (OSTC) before switching the CPU clock. The CPU clock status can be checked using bit 1
(MCS) of MCM.
(c) Ring-OSC can be set to stopped/oscillating using the Ring-OSC mode register (RCM) when "Can be stopped
by software" is selected for the Ring-OSC by a mask option, if the X1 input or subsystem clock is used as the
CPU clock. Make sure that MCS is 1 at this time.
(d) When Ring-OSC is used as the CPU clock, the X1 input clock can be set to stopped/oscillating using the
main OSC control register (MOC). Make sure that MCS is 0 at this time.
When the subsystem clock is used as the CPU clock, whether the X1 input clock stops or oscillates can be
set by the processor clock control register (PCC). In addition, HALT mode can be used during operation with
the subsystem clock, but STOP mode cannot be used (subsystem clock oscillation cannot be stopped by the
STOP instruction).
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
114
(e) Select the X1 input clock oscillation stabilization time (2
11
/f
XP
, 2
13
/f
XP
, 2
14
/f
XP
, 2
15
/f
XP
, 2
16
/f
XP
) using the oscillation
stabilization time select register (OSTS) when releasing STOP mode while X1 input clock is being used as
the CPU clock. In addition, when releasing STOP mode while RESET is released and Ring-OSC is being
used as the CPU clock, check the X1 input clock oscillation stabilization time using the oscillation
stabilization time counter status register (OSTC).
A status transition diagram of this product is shown in Figure 5-13, and the relationship between the operation
clocks in each operation status and between the oscillation control flag and oscillation status of each clock are shown
in Tables 5-3 and 5-4, respectively.
Figure 5-13. Status Transition Diagram (1/4)
(1) When "Ring-OSC can be stopped by software" is selected by mask option
(when subsystem clock is not used)
Status 4
CPU clock: f
XP
f
XP
: Oscillating
f
R
: Oscillation stopped
Status 3
CPU clock: f
XP
f
XP
: Oscillating
f
R
: Oscillating
Status 1
CPU clock: f
R
f
XP
: Oscillation stopped
f
R
: Oscillating
Status 2
CPU clock: f
R
f
XP
: Oscillating
f
R
: Oscillating
HALT
Note 4
Interrupt
Interrupt
Interrupt
Interrupt
Interrupt
Interrupt
Reset release
Interrupt
Interrupt
HALT
instruction
STOP
instruction
STOP
instruction
STOP
instruction
STOP
instruction
RSTOP = 0
RSTOP = 1
Note 1
MCM0 = 0
MCM0 = 1
Note 2
MSTOP = 1
Note 3
MSTOP = 0
HALT
instruction
HALT instruction
HALT
instruction
STOP
Note 4
Reset
Note 5
Notes 1.
When shifting from status 3 to status 4, make sure that bit 1 (MCS) of the main clock mode register
(MCM) is 1.
2.
Before shifting from status 2 to status 3 after reset and STOP are released, check the X1 input clock
oscillation stabilization time status using the oscillation stabilization time counter status register
(OSTC).
3.
When shifting from status 2 to status 1, make sure that MCS is 0.
4.
When "Ring-OSC can be stopped by software" is selected by a mask option, the watchdog timer
stops operating in the HALT and STOP modes, regardless of the source clock of the watchdog timer.
However, oscillation of Ring-OSC does not stop even in the HALT and STOP modes if RSTOP = 0.
5.
All reset sources (RESET input, POC, LVI, clock monitor, and WDT)
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
115
Figure 5-13. Status Transition Diagram (2/4)
(2) When "Ring-OSC can be stopped by software" is selected by mask option
(when subsystem clock is used)
HALT
Note 4
Interrupt
Interrupt
Interrupt
Interrupt
Interrupt
Interrupt
Interrupt
HALT
instruction
HALT
instruction
STOP
instruction
STOP
instruction
STOP
instruction
RSTOP = 0
RSTOP = 1
Note 1
MCC = 0
CSS = 0
Note 6
MCC = 1
CSS = 1
Note 5
MCM0 = 0
MCM0 = 1
Note 2
MSTOP = 1
Note 3
MSTOP = 0
HALT
instruction
HALT
instruction
STOP
Note 4
Reset
Note 7
Status 4
CPU clock: f
XP
f
XP
: Oscillating
f
R
: Oscillation
stopped
Status 3
CPU clock: f
XP
f
XP
: Oscillating
f
R
: Oscillating
Status 1
CPU clock: f
R
f
XP
: Oscillation
stopped
f
R
: Oscillating
Status 2
CPU clock: f
R
f
XP
: Oscillating
f
R
: Oscillating
Reset release
Interrupt
HALT
instruction
Status 6
CPU clock: f
XT
f
XP
: Oscillation
stopped
f
R
: Oscillating/
oscillation
stopped
Status 5
CPU clock: f
XT
f
XP
: Oscillating
f
R
: Oscillating/
oscillation
stopped
Notes 1.
When shifting from status 3 to status 4, make sure that bit 1 (MCS) of the main clock mode register
(MCM) is 1.
2.
Before shifting from status 2 to status 3 after reset and STOP are released, check the X1 input clock
oscillation stabilization time status using the oscillation stabilization time counter status register
(OSTC).
3.
When shifting from status 2 to status 1, make sure that MCS is 0.
4.
When "Ring-OSC can be stopped by software" is selected by a mask option, the watchdog timer
stops operating in the HALT and STOP modes, regardless of the source clock of the watchdog timer.
However, oscillation of Ring-OSC does not stop even in the HALT and STOP modes if RSTOP = 0.
5.
Shifting to status 5 (subsystem clock operation) can be performed only from status 3 or 4 (X1 input
clock operation).
6.
Shifting to status 1 or status 2 from status 5 is not possible.
7.
All reset sources (RESET input, POC, LVI, clock monitor, and WDT)
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
116
Figure 5-13. Status Transition Diagram (3/4)
(3) When "Ring-OSC cannot be stopped" is selected by mask option
(when subsystem clock is not used)
Status 3
CPU clock: f
XP
f
XP
: Oscillating
f
R
: Oscillating
HALT
Interrupt
Interrupt
Interrupt
STOP
instruction
MCM0 = 0
MCM0 = 1
Note 1
HALT
instruction
HALT
instruction
STOP
Note 3
Reset
Note 4
Status 2
CPU clock: f
R
f
XP
: Oscillating
f
R
: Oscillating
Status 1
CPU clock: f
R
f
XP
: Oscillation stopped
f
R
: Oscillating
Interrupt
STOP
instruction
Interrupt
Interrupt
STOP
instruction
MSTOP = 1
Note 2
MSTOP = 0
HALT instruction
Reset release
Notes 1.
Before shifting from status 2 to status 3 after reset and STOP are released, check the X1 input clock
oscillation stabilization time status using the oscillation stabilization time counter status register
(OSTC).
2.
When shifting from status 2 to status 1, make sure that MCS is 0.
3.
The watchdog timer operates using Ring-OSC even in STOP mode if "Ring-OSC cannot be stopped"
is selected by a mask option. Ring-OSC division can be selected as the count source of 8-bit timer
H1 (TMH1), so clear the watchdog timer using the TMH1 interrupt request before watchdog timer
overflow. If this processing is not performed, an internal reset signal is generated at watchdog timer
overflow after STOP instruction execution.
4.
All reset sources (RESET input, POC, LVI, clock monitor, and WDT)
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
117
Figure 5-13. Status Transition Diagram (4/4)
(4) When "Ring-OSC cannot be stopped" is selected by mask option
(when subsystem clock is used)
HALT
Interrupt
Interrupt
Interrupt
STOP
instruction
MCM0 = 0
MCM0 = 1
Note 1
HALT
instruction
HALT
instruction
STOP
Note 3
Reset
Note 6
Interrupt
STOP
instruction
Interrupt
Interrupt
STOP
instruction
MSTOP = 1
Note 2
MSTOP = 0
HALT instruction
Reset release
MCC = 0
CSS = 0
Note 5
MCC = 1
CSS = 1
Note 4
Interrupt
Interrupt
HALT instruction
HALT instruction
Status 3
CPU clock: f
XP
f
XP
: Oscillating
f
R
: Oscillating
Status 2
CPU clock: f
R
f
XP
: Oscillating
f
R
: Oscillating
Status 1
CPU clock: f
R
f
XP
: Oscillation stopped
f
R
: Oscillating
Status 5
CPU clock: f
XT
f
XP
: Oscillation stopped
f
R
: Oscillating/
oscillation stopped
Status 4
CPU clock: f
XT
f
XP
: Oscillating
f
R
: Oscillating/
oscillation stopped
Notes 1.
Before shifting from status 2 to status 3 after reset and STOP are released, check the X1 input clock
oscillation stabilization time status using the oscillation stabilization time counter status register
(OSTC).
2.
When shifting from status 2 to status 1, make sure that MCS is 0.
3.
The watchdog timer operates using Ring-OSC even in STOP mode if "Ring-OSC cannot be stopped"
is selected by a mask option. Ring-OSC division can be selected as the count source of 8-bit timer
H1 (TMH1), so clear the watchdog timer using the TMH1 interrupt request before watchdog timer
overflow. If this processing is not performed, an internal reset signal is generated at watchdog timer
overflow after STOP instruction execution.
4.
Shifting to status 4 (subsystem clock operation) can be performed only from status 3 (X1 input clock
operation).
5.
Shifting to status 1 or status 2 from status 4 is not possible.
6.
All reset sources (RESET input, POC, LVI, clock monitor, and WDT)
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
118
Table 5-3. Relationship Between Operation Clocks in Each Operation Status
Ring-OSC Oscillator
Prescaler Clock Supplied
to Peripherals
Note 2
Status
Operation
Mode
X1
Oscillator
Note 1
RSTOP = 0
RSTOP = 1
Subsystem
Clock
Oscillator
CPU Clock
After
Release
MCM0 = 0
MCM0 = 1
Reset
Stopped
Stopped
Ring-OSC
Stopped
STOP
Stopped
Note 3
Stopped
HALT
Oscillating
Oscillating
Oscillating
Stopped
Oscillating
Note 4
Ring-OSC
X1
Caution
The RSTOP setting is valid only when "Can be stopped by software" is set for Ring-OSC by a mask
option.
Notes 1.
When "Cannot be stopped" is selected for Ring-OSC by a mask option.
2.
When "Can be stopped by software" is selected for Ring-OSC by a mask option.
3.
Operates using the CPU clock at STOP instruction execution.
4.
Operates using the CPU clock at HALT instruction execution.
Remark
RSTOP: Bit 0 of the Ring-OSC mode register (RCM)
MCM0:
Bit 0 of the main clock mode register (MCM)
Table 5-4. Oscillation Control Flags and Clock Oscillation Status
X1 Oscillator
Ring-OSC Oscillator
RSTOP = 0
Stopped
Oscillating
MSTOP = 1
Note
RSTOP = 1
Setting prohibited
RSTOP = 0
Oscillating
MSTOP = 0
Note
RSTOP = 1
Oscillating
Stopped
RSTOP = 0
Oscillating
MCC = 1
Note
RSTOP = 1
Stopped
Stopped
RSTOP = 0
Oscillating
MCC = 0
Note
RSTOP = 1
Oscillating
Stopped
Note Setting X1 oscillator oscillating/stopped differs depending on the CPU clock used.
When the Ring-OSC clock is used as the CPU clock: Set using the MSTOP bit
When the subsystem clock is used as the CPU clock: Set using the MCC bit
Caution
The RSTOP setting is valid only when "Can be stopped by software" is set for Ring-OSC
by a mask option.
Remark
MSTOP: Bit 7 of the main OSC control register (MOC)
MCC:
Bit 7 of the processor clock control register (PCC)
RSTOP: Bit 0 of the Ring-OSC mode register (RCM)
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
119
5.6 Time Required to Switch Between Ring-OSC Clock and X1 Input Clock
Bit 0 (MCM0) of the main clock mode register (MCM) is used to switch between the Ring-OSC clock and X1 input
clock.
In the actual switching operation, switching does not occur immediately after MCM0 rewrite; several instructions
are executed using the pre-switch clock after switching MCM0 (see Table 5-5).
Bit 1 (MCS) of MCM is used to judge that operation is performed using either the Ring-OSC clock or X1 input clock.
To stop the clock, wait for the number of clocks shown in Table 5-5 before stopping.
Table 5-5. Time Required to Switch Between Ring-OSC Clock and X1 Input Clock
PCC
Time Required for Switching
PCC2
PCC1
PCC0
X1
Ring-OSC
Ring-OSC
X1
0
0
0
f
XP
/f
R
+ 1 clock
0
0
1
f
XP
/2f
R
+ 1 clock
0
1
0
f
XP
/4f
R
+ 1 clock
0
1
1
f
XP
/8f
R
+ 1 clock
1
0
0
f
XP
/16f
R
+ 1 clock
2 clocks
Caution
To calculate the maximum time, set f
R
= 120 kHz.
Remarks 1. PCC: Processor clock control register
2. f
XP
: X1 input clock oscillation frequency
3. f
R
: Ring-OSC clock oscillation frequency
4. The maximum time is the number of clocks of the CPU clock before switching.
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
120
5.7 Changing System Clock and CPU Clock Settings
5.7.1 Time required for switching between system clock and CPU clock
The system clock and CPU clock can be switched using bits 0 to 2 (PCC0 to PCC2) and bit 4 (CSS) of the
processor clock control register (PCC).
The actual switchover operation is not performed immediately after rewriting to the PCC; operation continues on
the pre-switchover clock for several instructions (see Table 5-6).
Whether the system is operating on the X1 input clock (or Ring-OSC clock) or the subsystem clock can be
ascertained using bit 5 (CLS) of the PCC register.
Table 5-6. Maximum Time Required for CPU Clock Switchover
Set Value Before
Switchover
Set Value After Switchover
CSS PCC2 PCC1 PCC0 CSS PCC2 PCC1 PCC0 CSS PCC2 PCC1 PCC0 CSS PCC2 PCC1 PCC0 CSS PCC2 PCC1 PCC0 CSS PCC2 PCC1 PCC0
CSS PCC2 PCC1 PCC0
0
0
0
0
0
0
0
1
0
0
1
0
0
0
1
1
0
1
0
0
1
0
0
0
16 clocks
16 clocks
16 clocks
16 clocks
f
XP
/f
XT
clocks
(306 clocks)
0
0
1
8 clocks
8 clocks
8 clocks
8 clocks
f
XP
/2f
XT
clocks
(153 clocks)
0
1
0
4 clocks
4 clocks
4 clocks
4 clocks
f
XP
/4f
XT
clocks
(77 clocks)
0
1
1
2 clocks
2 clocks
2 clocks
2 clocks
f
XP
/8f
XT
clocks
(39 clocks)
0
1
0
0
1 clock
1 clock
1 clock
1 clock
f
XP
/16f
XT
clocks
(20 clocks)
1
1 clock
1 clock
1 clock
1 clock
1 clock
Remarks 1. The maximum time is the number of clocks of the pre-switchover CPU clock.
2. Figures in parentheses apply to operation with f
XP
= 10 MHz and f
XT
= 32.768 kHz.
Caution
Selection of the CPU clock cycle division factor (PCC0 to PCC2) and switchover from the X1
input clock to the subsystem clock (changing CSS from 0 to 1) should not be set
simultaneously.
Simultaneous setting is possible, however, for selection of the CPU clock cycle division factor
(PCC0 to PCC2) and switchover from the subsystem clock to the X1 input clock (changing CSS
from 1 to 0).
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
121
5.8 Clock Switching Flowchart and Register Setting
5.8.1 Switching from Ring-OSC clock to X1 input clock
Figure 5-14. Switching from Ring-OSC Clock to X1 Input Clock (Flowchart)
; f
CPU
= f
R
; Ring-OSC oscillation
; Ring-OSC clock operation
; X1 oscillation
; Oscillation stabilization time status register
; Oscillation stabilization time f
XP
/2
16
MCM.1 (MCS) is changed from 0 to 1
; X1 oscillation stabilization time status check
X1 oscillation stabilization time has elapsed
X1 oscillation stabilization
time has not elapsed
PCC = 00H
RCM = 00H
MCM = 00H
MOC = 00H
OSTC = 00H
OSTS = 05H
Note
OSTC check
Note
Each processing
After reset
PCC setting
MCM.0
1
X1 input clock operation
Ring-OSC
clock operation
(dividing set PCC)
Register value
after reset
Ring-OSC clock
operation
X1 input clock
Note Check the oscillation stabilization wait time of the X1 oscillator after reset release using the OSTC register
and then switch to the X1 input clock operation after the oscillation stabilization wait time has elapsed. The
OSTS register setting is valid only after STOP mode is released during X1 input clock operation.
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
122
5.8.2 Switching from X1 input clock to Ring-OSC clock
Figure 5-15. Switching from X1 Input Clock to Ring-OSC Clock (Flowchart)
MCM.1 (MCS) is changed from 1 to 0
; Ring-OSC oscillating
; Ring-OSC oscillating?
Ring-OSC clock operation
; X1 oscillation
; X1 input clock or Ring-OSC clock
; X1 input clock operation
No: RSTOP = 0
Yes: RSTOP = 1
PCC.7 (MCC) = 0
PCC.4 (CSS) = 0
MCM = 03H
RCM.0
Note
(RSTOP) = 1?
RSTOP = 0
MCM0
0
Register setting
in X1 input
clock operation
X1 input
clock operation
Ring-OSC
clock operation
Note Required only when "clock can be stopped by software" is selected for Ring-OSC by a mask option.
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
123
5.8.3 Switching from X1 input clock to subsystem clock
Figure 5-16. Switching from X1 Input Clock to Subsystem Clock (Flowchart)
MCS = 1 not changed.
CLS is changed from 0 to 1.
; Subsystem clock operation
Subsystem clock operation
; X1 oscillation
; X1 input clock or Ring-OSC clock
; X1 input clock operation
PCC.7 (MCC) = 0
PCC.4 (CSS) = 0
MCM = 03H
CSS
1
Register setting
in X1 input
clock operation
X1 input
clock operation
Subsystem
clock
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
124
5.8.4 Switching from subsystem clock to X1 input clock
Figure 5-17. Switching from Subsystem Clock to X1 Input Clock (Flowchart)
; Subsystem clock operation
; X1 oscillating?
; X1 oscillation enabled
; Wait for X1 oscillation stabilization time
; X1 input clock operation
CLS is changed from 1 to 0.
MCS = 1 not changed.
X1 oscillation stabilization time elapsed
X1 oscillation
stabilization time
not elapsed
Yes: X1 oscillation stopped
No: X1 oscillating
MCC
0
PCC.4 (CSS) = 1
MCM = 03H
MCC = 1?
OSTC check
CSS
0
X1 input clock operation
Subsystem
clock operation
X1 input
clock operation
CHAPTER 5 CLOCK GENERATOR
Preliminary User's Manual U16227EJ1V0UD
125
5.8.5 Register settings
Table 5-7. Clock and Register Setting
Setting Flag
Status Flag
PCC Register
MCM
Register
MOC
Register
RCM
Register
PCC
Register
MCM
Register
f
CPU
Mode
MCC
CSS
MCM0
MSTOP RSTOP
Note 1
CLS
MCS
Ring-OSC oscillating
0
0
1
0
0
0
1
X1 input clock
Note 2
Ring-OSC stopped
0
0
1
0
1
0
1
X1 oscillating
0
0
0
0
0
0
0
Ring-OSC clock
X1 stopped
0
Note 3
0
0
1
0
0
0
X1 oscillating, Ring-OSC oscillating
0
1
1
Note 5
0
Note 6
0
1
1
X1 stopped, Ring-OSC oscillating
1
1
1
Note 5
0
Note 6
0
1
1
X1 oscillating, Ring-OSC stopped
0
1
1
Note 5
0
Note 6
1
1
1
Subsystem clock
Note 4
X1 stopped, Ring-OSC stopped
1
1
1
Note 5
0
Note 6
1
1
1
Notes 1.
Valid only when "clock can be stopped by software" is selected for Ring-OSC by a mask option.
2.
Do not set MCC = 1 or MSTOP = 1 during X1 input clock operation (even if MCC = 1 or MSTOP = 1 is set,
the X1 oscillation does not stop).
3.
Do not set MCC = 1 during Ring-OSC operation (even if MCC = 1 is set, the X1 oscillation does not stop).
To stop X1 oscillation during Ring-OSC operation, use MSTOP.
4.
Shifting to subsystem clock operation mode must be performed from the X1 input clock operation mode.
From subsystem clock operation mode, only X1 input clock operation mode can be shifted to.
5.
Do not set MCM0 = 0 (shifting to Ring-OSC) during subsystem clock operation.
6.
Do not set MSTOP = 1 during subsystem clock operation (even if MSTOP = 1 is set, X1 oscillation does
not stop). To stop X1 oscillation during subsystem clock operation, use MCC.
Preliminary User's Manual U16227EJ1V0UD
126
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
6.1 Functions of 16-Bit Timer/Event Counter 00
16-bit timer/event counter 00 has the following functions.
Interval timer
PPG output
Pulse width measurement
External event counter
Square-wave output
One-shot pulse output
(1) Interval timer
16-bit timer/event counter 00 generates an interrupt request at the preset time interval.
(2) PPG output
16-bit timer/event counter 00 can output a rectangular wave whose frequency and output pulse width can be set
freely.
(3) Pulse width measurement
16-bit timer/event counter 00 can measure the pulse width of an externally input signal.
(4) External event counter
16-bit timer/event counter 00 can measure the number of pulses of an externally input signal.
(5) Square-wave output
16-bit timer/event counter 00 can output a square wave with any selected frequency.
(6) One-shot pulse output
16-bit timer event counter 00 can output a one-shot pulse whose output pulse width can be set freely.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
127
6.2 Configuration of 16-Bit Timer/Event Counter 00
16-bit timer/event counter 00 consists of the following hardware.
Table 6-1. Configuration of 16-Bit Timer/Event Counter 00
Item
Configuration
Timer counter
16 bits
1 (TM00)
Register
16-bit timer capture/compare register: 16 bits
2 (CR000, CR010)
Timer output
1 (TO00)
Control registers
16-bit timer mode control register 00 (TMC00)
16-bit timer capture/compare control register 00 (CRC00)
16-bit timer output control register 00 (TOC00)
Prescaler mode register 00 (PRM00)
Port mode register 0 (PM0)
Note
Note See Figure 4-2 Block Diagram of P00 and Figure 4-3 Block Diagram of P01.
Figure 6-1 shows the block diagram.
Figure 6-1. Block Diagram of 16-Bit Timer/Event Counter 00
Internal bus
Capture/compare control
register 00 (CRC00)
TI010/TO00/P01
f
X
f
X
/2
2
f
X
/2
8
f
X
TI000/P00
Prescaler mode
register 00 (PRM00)
2
PRM001 PRM000
CRC002
16-bit timer capture/compare
register 010 (CR010)
Match
Match
16-bit timer counter 00
(TM00)
Clear
Noise
elimi-
nator
CRC002 CRC001 CRC000
INTTM000
TO00/TI010/
P01
INTTM010
16-bit timer output
control register 00
(TOC00)
16-bit timer mode
control register 00
(TMC00)
Internal bus
TMC003 TMC002 TMC001 OVF00
TOC004 LVS00 LVR00 TOC001 TOE00
Selector
16-bit timer capture/compare
register 000 (CR000)
Selector
Selector
Selector
Noise
elimi-
nator
Noise
elimi-
nator
Output
controller
OSPE00
OSPT00
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
128
(1) 16-bit timer counter 00 (TM00)
TM00 is a 16-bit read-only register that counts count pulses.
The counter is incremented in synchronization with the rising edge of the input clock. The count value is reset to
0000H in the following cases.
<1>
At RESET input
<2>
If TMC003 and TMC002 are cleared
<3>
If the valid edge of TI000 is input in the mode in which clear & start occurs when inputting the valid edge of
TI000
<4>
If TM00 and CR000 match in the mode in which clear & start occurs on a match of TM00 and CR000
<5>
OSPT00 is set in one-shot pulse output mode
(2) 16-bit timer capture/compare register 000 (CR000)
CR000 is a 16-bit register that has the functions of both a capture register and a compare register. Whether it is
used as a capture register or as a compare register is set by bit 0 (CRC000) of capture/compare control register
00 (CRC00).



When CR000 is used as a compare register
The value set in CR000 is constantly compared with the 16-bit timer counter 00 (TM00) count value, and an
interrupt request (INTTM000) is generated if they match. It can also be used as the register that holds the
interval time when TM00 is set to interval timer operation.



When CR000 is used as a capture register
It is possible to select the valid edge of the TI000 pin or the TI010 pin as the capture trigger. The TI000 or
TI010 valid edge is set using prescaler mode register 00 (PRM00).
If the capture trigger is specified to be the valid edge of the TI000 pin, the situation is as shown in Table 6-2.
On the other hand, when the capture trigger is specified to be the valid edge of the TI010 pin, the situation is
as shown in Table 6-3.
Table 6-2. TI000 Pin Valid Edge and CR000, CR010 Capture Trigger
ES001
ES000
TI000 Pin Valid Edge
CR000 Capture Trigger
CR010 Capture Trigger
0
0
Falling edge
Rising edge
Falling edge
0
1
Rising edge
Falling edge
Rising edge
1
0
Setting prohibited
Setting prohibited
Setting prohibited
1
1
Both rising and falling edges
No capture operation
Both rising and falling edges
Table 6-3. TI010 Pin Valid Edge and CR000 Capture Trigger
ES101
ES100
TI010 Pin Valid Edge
CR000 Capture Trigger
0
0
Falling edge
Falling edge
0
1
Rising edge
Rising edge
1
0
Setting prohibited
Setting prohibited
1
1
Both rising and falling edges
Both rising and falling edges
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
129
CR000 can be set by a 16-bit memory manipulation instruction.
RESET input clears CR000 to 0000H.
Cautions 1. Set a value other than 0000H in CR000 in the mode in which clear & start occurs on a match
of TM00 and CR000. However, in the free-running mode and in the clear mode using the
valid edge of TI000, if CR000 is set to 0000H, an interrupt request (INTTM000) is generated
following overflow (FFFFH).
2. If the changed value of CR000 is smaller than the value of 16-bit timer counter 00 (TM00),
TM00 continues counting and starts counting again from 0 after overflow. Therefore, if the
value of CR000 after the change is smaller than before the change, the timer should be
restarted after CR000 is changed.
3. When P01 is used as the valid edge of TI010, it cannot be used as the timer output (TO00).
Moreover, when P01 is used as TO00, it cannot be used as the valid edge of TI010.
4. When CR000 is used as a capture register, read data is undefined if the register read time
and capture trigger input conflict (the capture data itself is the correct value).
If count stop input and capture trigger input conflict, the captured data is undefined.
5. Do not rewrite the compare register during TM00 operation.
(3) 16-bit timer capture/compare register 010 (CR010)
CR010 is a 16-bit register that has the functions of both a capture register and a compare register. Whether it is
used as a capture register or a compare register is set by bit 2 (CRC002) of capture/compare control register 00
(CRC00).



When CR010 is used as a compare register
The value set in the CR010 is constantly compared with the 16-bit timer counter 00 (TM00) count value, and
an interrupt request (INTTM010) is generated if they match.



When CR010 is used as a capture register
It is possible to select the valid edge of the TI000 pin as the capture trigger. The TI000 valid edge is set by
prescaler mode register 00 (PRM00).
CR010 can be set by a 16-bit memory manipulation instruction.
RESET input clears CR010 to 0000H.
Cautions 1. Set CR010 to other than 0000H. This means a 1-pulse count operation cannot be performed
when CR010 is used as the event counter.
However, in the free-running mode and in the clear mode using the valid edge of TI000, if
CR010 is set to 0000H, an interrupt request (INTTM010) is generated following overflow
(FFFFH).
2. When CR010 is used as a capture register, read data is undefined if the register read time
and capture trigger input conflict (the capture data itself is the correct value).
If count stop input and capture trigger input conflict, the captured data is undefined.
3. Do not rewrite the compare register during TM00 operation.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
130
6.3 Registers Controlling 16-Bit Timer/Event Counter 00
The following five registers are used to control 16-bit timer/event counter 00.
16-bit timer mode control register 00 (TMC00)
Capture/compare control register 00 (CRC00)
16-bit timer output control register 00 (TOC00)
Prescaler mode register 00 (PRM00)
Port mode register 0 (PM0)
(1) 16-bit timer mode control register 00 (TMC00)
This register sets the 16-bit timer operating mode, the 16-bit timer counter 00 (TM00) clear mode, and output
timing, and detects an overflow.
TMC00 can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears TMC00 to 00H.
Caution
16-bit timer counter 00 (TM00) starts operation at the moment TMC002 and TMC003 are set to
values other than 0, 0 (operation stop mode), respectively. Set TMC002 and TMC003 to 0, 0 to
stop the operation.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
131
Figure 6-2. Format of 16-Bit Timer Mode Control Register 00 (TMC00)
7
0
6
0
5
0
4
0
3
TMC003
2
TMC002
1
TMC001
0
OVF00
Symbol
TMC00
Address FFBAH After reset: 00H R/W
TMC003 TMC002 TMC001
Operating mode and clear
mode selection
TO00 output timing selection
Interrupt request generation
0
0
0
0
0
1
Operation stop
(TM00 cleared to 0)
No change
Not generated
0
1
0
Free-running mode
Match between TM00 and
CR000 or match between
TM00 and CR010
0
1
1
Match between TM00 and
CR000, match between TM00
and CR010 or TI000 valid edge
1
0
0
1
0
1
Clear & start occurs on TI000
valid edge
-
1
1
0
Clear & start occurs on match
between TM00 and CR000
Match between TM00 and
CR000 or match between
TM00 and CR010
1
1
1
Match between TM00 and
CR000, match between TM00
and CR010 or TI000 valid edge
Generated on match between
TM00 and CR000, or match
between TM00 and CR010
OVF00
16-bit timer counter 00 (TM00) overflow detection
0
Overflow not detected
1
Overflow detected
Cautions 1. Timer operation must be stopped before writing to bits other than the OVF00 flag.
2. Set the valid edge of the TI000/P00 pin using prescaler mode register 00 (PRM00).
3. If any the following modes: the mode in which clear & start occurs on match between TM00
and CR000, the mode in which clear & start occurs at the TI00 valid edge, or free-running
mode is selected, when the set value of CR000 is FFFFH and the TM00 value changes from
FFFFH to 0000H, the OVF00 flag is set to 1.
Remarks 1. TO00:
16-bit timer/event counter 00 output pin
2. TI000:
16-bit timer/event counter 00 input pin
3. TM00:
16-bit timer counter 00
4. CR000: 16-bit timer capture/compare register 000
5. CR010: 16-bit timer capture/compare register 010
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
132
(2) Capture/compare control register 00 (CRC00)
This register controls the operation of the 16-bit timer capture/compare registers (CR000, CR010).
CRC00 can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears CRC00 to 00H.
Figure 6-3. Format of Capture/Compare Control Register 00 (CRC00)
Address: FFBCH After reset: 00H R/W
Symbol
7
6
5
4
3
2
1
0
CRC00
0
0
0
0
0
CRC002
CRC001
CRC000
CRC002
CR010 operating mode selection
0
Operates as compare register
1
Operates as capture register
CRC001
CR000 capture trigger selection
0
Captures on valid edge of TI010
1
Captures on valid edge of TI000 by reverse phase
CRC000
CR000 operating mode selection
0
Operates as compare register
1
Operates as capture register
Cautions 1. Timer operation must be stopped before setting CRC00.
2. When the mode in which clear & start occurs on a match between TM00 and CR000 is
selected with 16-bit timer mode control register 00 (TMC00), CR000 should not be specified
as a capture register.
3. To ensure that the capture operation is performed properly, the capture trigger requires a
pulse two times longer than the count clock selected by prescaler mode register 00 (PRM00).
(3) 16-bit timer output control register 00 (TOC00)
This register controls the operation of the 16-bit timer/event counter 00 output controller. It sets/resets the R-S
type flip-flop (LV00), enables/disables output inversion and 16-bit timer/event counter 00 timer output,
enables/disables the one-shot pulse output operation, and sets the one-shot pulse output trigger via software.
TOC00 can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears TOC00 to 00H.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
133
Figure 6-4. Format of 16-Bit Timer Output Control Register 00 (TOC00)
Address: FFBDH After reset: 00H R/W
Symbol
7
6
5
4
3
2
1
0
TOC00
0
OSPT00
OSPE00
TOC004
LVS00
LVR00
TOC001
TOE00
OSPT00
One-shot pulse output trigger control via software
0
No one-shot pulse trigger
1
One-shot pulse trigger
OSPE00
One-shot pulse output operation control
0
Successive pulse output mode
1
One-shot pulse output mode
Note
TOC004
Timer output F/F control using match of CR010 and TM00
0
Disables inversion operation
1
Enables inversion operation
LVS00
LVR00
16-bit timer/event counter 00 timer output F/F status setting
0
0
No change
0
1
Timer output F/F reset (0)
1
0
Timer output F/F set (1)
1
1
Setting prohibited
TOC001
Timer output F/F control using match of CR000 and TM00
0
Disables inversion operation
1
Enables inversion operation
TOE00
16-bit timer/event counter 00 output control
0
Disables output (output fixed to level 0)
1
Enables output
Note The one-shot pulse output mode operates correctly only in the free-running mode and the mode in which
clear & start occurs at the TI000 valid edge. In the mode in which clear & start occurs on a match between
the TM00 register and CR000 register, one-shot pulse output is not possible because an overflow does not
occur.
Cautions 1. Timer operation must be stopped before setting TOC00.
2. If LVS00 and LVR00 are read after data is set, 0 is read.
3. OSPT00 is automatically cleared after data is set, so 0 is read.
4. Do not set OSPT00 to 1 other than in one-shot pulse output mode.
5. A write interval of two cycles or more of the operating clock is required to write to OSPT00
successively.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
134
(4) Prescaler mode register 00 (PRM00)
This register is used to set the 16-bit timer counter 00 (TM00) count clock and TI000 and TI010 input valid edges.
PRM00 can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears PRM00 to 00H.
Figure 6-5. Format of Prescaler Mode Register 00 (PRM00)
Address: FFBBH After reset: 00H R/W
Symbol
7
6
5
4
3
2
1
0
PRM00
ES101
ES100
ES001
ES000
0
0
PRM001
PRM000
ES101
ES100
TI010 valid edge selection
0
0
Falling edge
0
1
Rising edge
1
0
Setting prohibited
1
1
Both falling and rising edges
ES001
ES000
TI000 valid edge selection
0
0
Falling edge
0
1
Rising edge
1
0
Setting prohibited
1
1
Both falling and rising edges
PRM001
PRM000
Count clock selection
0
0
f
X
(10 MHz)
0
1
f
X
/2
2
(2.5 MHz)
1
0
f
X
/2
8
(39.06 kHz)
1
1
TI000 valid edge
Note
Note The external clock requires a pulse two times longer than internal count clock (f
X
).
Cautions 1. If the valid edge of TI000 is to be set for the count clock, do not set the clear & start mode
using the valid edge of TI000 and the capture trigger.
2. Always set data to PRM00 after stopping the timer operation.
3. If the TI000 or TI010 pin is high level immediately after system reset, the rising edge is
immediately detected after the rising edge or both the rising and falling edges are set as the
valid edge(s) of the TI000 pin or TI010 pin to enable the operation of 16-bit timer counter 00
(TM00). Care is therefore required when pulling up the TI000 or TI010 pin. However, when re-
enabling operation after the operation has been stopped once, the rising edge is not
detected.
4. When P01 is used as the TI010 valid edge, it cannot be used as the timer output (TO00), and
when used as TO00, it cannot be used as the TI010 valid edge.
Remarks 1. f
X
: X1 input clock oscillation frequency
2. TI000, TI010: 16-bit timer/event counter 00 input pin
3. Figures in parentheses are for operation with f
X
= 10 MHz.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
135
(5) Port mode register 0 (PM0)
This register sets port 0 input/output in 1-bit units.
When using the P01/TO00/TI010 pin for timer output, set the output latch of PM01 and P01 to 0.
PM0 can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input sets PM0 to FFH.
Figure 6-6. Format of Port Mode Register 0 (PM0)
7
1
6
1
5
1
4
1
3
1
2
1
1
PM01
0
PM00
Symbol
PM0
Address: FF20H After reset: FFH R/W
PM0n
0
1
P0n pin I/O mode selection (n = 0, 1)
Output mode (output buffer on)
Input mode (output buffer off)
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
136
6.4 Operation of 16-Bit Timer/Event Counter 00
6.4.1 Interval timer operation
Setting 16-bit timer mode control register 00 (TMC00) and capture/compare control register 00 (CRC00) as shown
in Figure 6-7 allows operation as an interval timer. Interrupt requests are generated repeatedly using the count value
preset in 16-bit timer capture/compare register 000 (CR000) as the interval.
When the count value of 16-bit timer counter 00 (TM00) matches the value set in CR000, counting continues with
the TM00 value cleared to 0 and the interrupt request signal (INTTM000) is generated.
The count clock of the 16-bit timer/event counter 00 can be selected with bits 0 and 1 (PRM000, PRM001) of
prescaler mode register 00 (PRM00).
See 6.5 Cautions for 16-Bit Timer/Event Counter 00 (2) 16-bit timer capture/compare register setting for
details of the operation when the compare register value is changed during timer count operation.
Figure 6-7. Control Register Settings for Interval Timer Operation
(a) 16-bit timer mode control register 00 (TMC00)
0
0
0
0
TMC003
1
TMC002
1
TMC001
0/1
OVF00
TMC00
Clears and starts on match between TM00 and CR000.
(b) Capture/compare control register 00 (CRC00)
0
0
0
0
0
CRC002
0/1
CRC001
0/1
CRC000
0
CRC00
CR000 used as compare register
Remark
0/1: Setting 0 or 1 allows another function to be used simultaneously with the interval timer. For details,
see Figures 6-2 and 6-3.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
137
Figure 6-8. Interval Timer Configuration Diagram
16-bit timer capture/compare
register 000 (CR000)
16-bit timer counter 00
(TM00)
OVF00
Clear
circuit
INTTM000
f
X
f
X
/2
2
f
X
/2
8
TI000/P00
Selector
Noise
eliminator
f
X
Figure 6-9. Timing of Interval Timer Operation
Count clock
t
TM00 count value
CR000
INTTM000
TO00
0000H
0001H
N
0000H 0001H
N
0000H 0001H
N
N
N
N
N
Count start
Clear
Clear
Interrupt acknowledged
Interrupt acknowledged
Interval time
Interval time
Interval time
Remark
Interval time = (N + 1)
t
N = 0001H to FFFFH
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
138
6.4.2 PPG output operations
Setting 16-bit timer mode control register 00 (TMC00) and capture/compare control register 00 (CRC00) as shown
in Figure 6-10 allows operation as PPG (Programmable Pulse Generator) output.
In the PPG output operation, rectangular waves are output from the TO00 pin with the pulse width and the cycle
that correspond to the count values preset in 16-bit timer capture/compare register 010 (CR010) and in 16-bit timer
capture/compare register 000 (CR000), respectively.
Figure 6-10. Control Register Settings for PPG Output Operation
(a) 16-bit timer mode control register 00 (TMC00)
0
0
0
0
TMC003
1
TMC002
1
TMC001
0
OVF00
TMC00
Clears and starts on match between TM00 and CR000.
(b) Capture/compare control register 00 (CRC00)
0
0
0
0
0
CRC002
0
CRC001
CRC000
0
CRC00
CR000 used as compare register
CR010 used as compare register
(c) 16-bit timer output control register 00 (TOC00)
0
OSPT00
0
OSPE00
0
TOC004
1
LVS00
0/1
LVR00
0/1
TOC001
1
TOE00
1
TOC00
Enables TO00 output
Inverts output on match between TM00 and CR000
Specifies initial value of TO00 output F/F
Inverts output on match between TM00 and CR010
Disables one-shot pulse output
Cautions 1. Values in the following range should be set in CR000 and CR010:
0000H < CR010 < CR000



FFFFH
2. The cycle of the pulse generated through PPG output (CR000 setting value + 1) has a duty of
(CR010 setting value + 1)/(CR000 setting value + 1).
Remark
: Don't care
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
139
Figure 6-11. Configuration of PPG Output
16-bit timer capture/compare
register 000 (CR000)
16-bit timer counter 00
(TM00)
Clear
circuit
Noise
eliminator
f
X
f
X
f
X
/2
2
f
X
/2
8
TI000/P00
16-bit timer capture/compare
register 010 (CR010)
TO00/TI010/P01
Selector
Output controller
Figure 6-12. PPG Output Operation Timing
t
0000H
0000H 0001H
0001H
M 1
Count clock
TM00 count value
TO00
Pulse width: (M + 1)
t
1 cycle: (N + 1)
t
N
CR000 capture value
CR010 capture value
M
M
N 1
N
Clear
Count start
Remark
0000H < M < N
FFFFH
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
140
6.4.3 Pulse width measurement operations
It is possible to measure the pulse width of the signals input to the TI000 pin and TI010 pin using 16-bit timer
counter 00 (TM00).
There are two measurement methods: measuring with TM00 used in free-running mode, and measuring by
restarting the timer in synchronization with the edge of the signal input to the TI000 pin.
(1) Pulse width measurement with free-running counter and one capture register
When 16-bit timer counter 00 (TM00) is operated in free-running mode (see register settings in Figure 6-13), and
the edge specified by prescaler mode register 00 (PRM00) is input to the TI000 pin, the value of TM00 is taken
into 16-bit timer capture/compare register 010 (CR010) and an external interrupt request signal (INTTM010) is
set.
Any of three edges
rising, falling, or both edgescan be selected using bits 4 and 5 (ES000 and ES001) of
PRM00.
For valid edge detection, sampling is performed using the count clock selected by PRM00, and a capture
operation is only performed when a valid level is detected twice, thus eliminating noise with a short pulse width.
Figure 6-13. Control Register Settings for Pulse Width Measurement with Free-Running Counter
and One Capture Register
(a) 16-bit timer mode control register 00 (TMC00)
0
0
0
0
TMC003
0
TMC002
1
TMC001
0/1
OVF00
0
TMC00
Free-running mode
(b) Capture/compare control register 00 (CRC00)
0
0
0
0
0
CRC002
1
CRC001
0/1
CRC000
0
CRC00
CR000 used as compare register
CR010 used as capture register
Remark
0/1: Setting 0 or 1 allows another function to be used simultaneously with pulse width measurement.
For details, see Figures 6-2 and 6-3.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
141
Figure 6-14. Configuration Diagram for Pulse Width Measurement with Free-Running Counter
f
X
f
X
/2
2
f
X
/2
8
TI000
16-bit timer counter 00
(TM00)
OVF00
16-bit timer capture/compare
register 010 (CR010)
Internal bus
INTTM010
Selector
Figure 6-15. Timing of Pulse Width Measurement Operation with Free-Running Counter
and One Capture Register (with Both Edges Specified)
t
0000H
0000H
FFFFH
0001H
D0
D0
Count clock
TM00 count value
TI000 pin input
CR010 capture value
INTTM010
OVF00
(D1 D0)
t
(D3 D2)
t
(10000H D1 + D2)
t
D1
D2
D3
D2
D3
D0 + 1
D1
D1 + 1
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
142
(2) Measurement of two pulse widths with free-running counter
When 16-bit timer counter 00 (TM00) is operated in free-running mode (see Figure 6-16), it is possible to
simultaneously measure the pulse widths of the two signals input to the TI000 pin and the TI010 pin.
When the edge specified by bits 4 and 5 (ES000 and ES001) of prescaler mode register 00 (PRM00) is input to
the TI000 pin, the value of TM00 is taken into 16-bit timer capture/compare register 010 (CR010) and an interrupt
request signal (INTTM010) is set.
Also, when the edge specified by bits 6 and 7 (ES100 and ES101) of PRM00 is input to the TI010 pin, the value
of TM00 is taken into 16-bit timer capture/compare register 000 (CR000) and an interrupt request signal
(INTTM000) is set.
Any of three edges
rising, falling, or both edgescan be selected as the valid edge of the TI000 pin and the
TI010 pin, specified using bits 4 and 5 (ES000 and ES001) and bits 6 and 7 (ES100 and ES101) of PRM00,
respectively.
For valid edge detection of the TI000 and TI010 pins, sampling is performed at the interval selected by prescaler
mode register 00 (PRM00), and a capture operation is only performed when a valid level is detected twice, thus
eliminating noise with a short pulse width.
Figure 6-16. Control Register Settings for Measurement of Two Pulse Widths with Free-Running Counter
(a) 16-bit timer mode control register 00 (TMC00)
0
0
0
0
TMC003
0
TMC002
1
TMC001
0/1
OVF00
TMC00
Free-running mode
(b) Capture/compare control register 00 (CRC00)
0
0
0
0
0
CRC002
1
CRC001
0
CRC000
1
CRC00
CR000 used as capture register
Captures valid edge of TI010 pin to CR000
CR010 used as capture register
Remark
0/1: Setting 0 or 1 allows another function to be used simultaneously with pulse width measurement.
For details, see Figure 6-2.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
143



Capture operation (free-running mode)
The capture register operation when capture trigger is input is shown below.
Figure 6-17. CR010 Capture Operation with Rising Edge Specified
Count clock
TM00
TI000
Rising edge detection
CR010
INTTM010
N 3
N 2
N 1
N
N + 1
N
Figure 6-18. Timing of Pulse Width Measurement Operation with Free-Running Counter
(with Both Edges Specified)
t
0000H
0000H
FFFFH
0001H
D0
D0
TI010 pin input
CR000 capture value
INTTM010
INTTM000
OVF00
(D1 D0)
t
(D3 D2)
t
(10000H D1 + D2)
t
(10000H D1 + (D2 + 1))
t
D1
D2 + 1
D1
D2
D2
D3
D0 + 1
D1
D1 + 1
D2 + 1 D2 + 2
Count clock
TM00 count value
TI000 pin input
CR010 capture value
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
144
(3) Pulse width measurement with free-running counter and two capture registers
When 16-bit timer counter 00 (TM00) is operated in free-running mode (see Figure 6-19), it is possible to
measure the pulse width of the signal input to the TI000 pin.
When the edge specified by bits 4 and 5 (ES000 and ES001) of prescaler mode register 00 (PRM00) is input to
the TI000 pin, the value of TM00 is taken into 16-bit timer capture/compare register 010 (CR010) and an interrupt
request signal (INTTM010) is set.
Also, when the inverse edge to that of the capture operation is input into CR010, the value of TM00 is taken into
16-bit timer capture/compare register 000 (CR000).
Either of two edges
rising or fallingcan be selected as the valid edge of the TI000 pin specified using bits 4
and 5 (ES000 and ES001) of prescaler mode register 00 (PRM00).
For TI000 pin valid edge detection, sampling is performed at the interval selected by prescaler mode register 00
(PRM00), and a capture operation is only performed when a valid level is detected twice, thus eliminating noise
with a short pulse width.
Figure 6-19. Control Register Settings for Pulse Width Measurement with Free-Running Counter and
Two Capture Registers
(a) 16-bit timer mode control register 00 (TMC00)
0
0
0
0
TMC003
0
TMC002
1
TMC001
0/1
OVF00
TMC00
Free-running mode
(b) Capture/compare control register 00 (CRC00)
0
0
0
0
0
CRC002
1
CRC001
1
CRC000
1
CRC00
CR000 used as capture register
Captures to CR000 at inverse edge
to valid edge of TI000.
CR010 used as capture register
Remark
0/1: Setting 0 or 1 allows another function to be used simultaneously with pulse width measurement.
See the description of the respective control registers for details.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
145
Figure 6-20. Timing of Pulse Width Measurement Operation with Free-Running Counter
and Two Capture Registers (with Rising Edge Specified)
t
0000H
0000H
FFFFH
0001H
D0
D0
INTTM010
OVF00
D2
D1
D3
D2
D3
D0 + 1
D2 + 1
D1
D1 + 1
CR000 capture value
Count clock
TM00 count value
TI000 pin input
CR010 capture value
(D1 D0)
t
(D3 D2)
t
(10000H D1 + D2)
t
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
146
(4) Pulse width measurement by means of restart
When input of a valid edge to the TI000 pin is detected, the count value of 16-bit timer counter 00 (TM00) is taken
into 16-bit timer capture/compare register 010 (CR010), and then the pulse width of the signal input to the TI000
pin is measured by clearing TM00 and restarting the count operation (see Figure 6-21).
Either of two edges
rising or fallingcan be selected using bits 4 and 5 (ES000 and ES001) of prescaler mode
register 00 (PRM00).
In valid edge detection, sampling is performed using the count clock cycle selected by prescaler mode register 00
(PRM00) and a capture operation is only performed when a valid level is detected twice, thus eliminating noise
with a short pulse width.
Figure 6-21. Control Register Settings for Pulse Width Measurement by Means of Restart
(a) 16-bit timer mode control register 00 (TMC00)
0
0
0
0
TMC003
1
TMC002
0
TMC001
0/1
OVF00
0
TMC00
Clears and starts at valid edge of TI000 pin.
(b) Capture/compare control register 00 (CRC00)
0
0
0
0
0
CRC002
1
CRC001
1
CRC000
1
CRC00
CR000 used as capture register
Captures to CR000 at inverse edge to valid edge of TI000.
CR010 used as capture register
Remark
0/1: Setting 0 or 1 allows another function to be used simultaneously with pulse width measurement.
For details, see Figure 6-2.
Figure 6-22. Timing of Pulse Width Measurement Operation by Means of Restart
(with Rising Edge Specified)
t
0000H
0001H
0000H
0001H
0000H 0001H
D0
D0
INTTM010
D1
t
D2
t
D2
D1
D2
D1
CR000 capture value
Count clock
TM00 count value
TI000 pin input
CR010 capture value
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
147
6.4.4 External event counter operation
The external event counter counts the number of external clock pulses input to the TI000 pin using 16-bit timer
counter 00 (TM00).
TM00 is incremented each time the valid edge specified by prescaler mode register 00 (PRM00) is input.
When the TM00 count value matches the 16-bit timer capture/compare register 000 (CR000) value, TM00 is
cleared to 0 and the interrupt request signal (INTTM000) is generated.
Input a value other than 0000H to CR000 (a count operation with 1-bit pulse cannot be carried out).
Any of three edges
rising, falling, or both edgescan be selected using bits 4 and 5 (ES000 and ES001) of
prescaler mode register 00 (PRM00).
Because operation is carried out only after the valid edge is detected twice by sampling using the internal clock (f
X
),
noise with short pulse widths can be eliminated.
Figure 6-23. Control Register Settings in External Event Counter Mode
(a) 16-bit timer mode control register 00 (TMC00)
0
0
0
0
TMC003
1
TMC002
1
TMC001
0/1
OVF00
0
TMC00
Clears and starts on match between TM00 and CR000.
(b) Capture/compare control register 00 (CRC00)
0
0
0
0
0
CRC002
0/1
CRC001
0/1
CRC000
0
CRC00
CR000 used as compare register
Remark
0/1: Setting 0 or 1 allows another function to be used simultaneously with the external event counter.
For details, see Figures 6-2 and 6-3.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
148
Figure 6-24. Configuration Diagram of External Event Counter
16-bit timer capture/compare
register 000 (CR000)
Internal bus
Match
Clear
OVF00
INTTM000
f
X
/2
2
f
X
/2
8
f
X
Noise eliminator
f
X
Valid edge of TI000
16-bit timer/counter 00 (TM00)
16-bit timer capture/compare
register 010 (CR010)
Selector
Noise eliminator
Figure 6-25. External Event Counter Operation Timing (with Rising Edge Specified)
TI000 pin input
TM00 count value
CR000
INTTM000
0000H 0001H 0002H 0003H 0004H 0005H
N
- 1
N
0000H 0001H 0002H 0003H
N
Caution
When reading the external event counter count value, TM00 should be read.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
149
6.4.5 Square-wave output operation
A square wave with any selected frequency can be output at intervals of the count value preset to 16-bit timer
capture/compare register 000 (CR000).
The TO00 pin output status is reversed at intervals of the count value preset to CR000 by setting bit 0 (TOE00) and
bit 1 (TOC001) of 16-bit timer output control register 00 (TOC00) to 1. This enables a square wave with any selected
frequency to be output.
Figure 6-26. Control Register Settings in Square-Wave Output Mode
(a) 16-bit timer mode control register 00 (TMC00)
0
0
0
0
TMC003
1
TMC002
1
TMC001
0
OVF00
0
TMC00
Clears and starts on match between TM00 and CR000.
(b) Capture/compare control register 00 (CRC00)
0
0
0
0
0
CRC002
0/1
CRC001
0/1
CRC000
0
CRC00
CR000 used as compare register
(c) 16-bit timer output control register 00 (TOC00)
0
OSPT00
0
OSPE00
0
TOC004
0
LVS00
0/1
LVR00
0/1
TOC001
1
TOE00
1
TOC00
Enables TO00 output.
Inverts output on match between TM00 and CR000.
Specifies initial value of TO00 output F/F.
Does not invert output on match between TM00 and CR010.
Disables one-shot pulse output.
Remark
0/1: Setting 0 or 1 allows another function to be used simultaneously with square-wave output. For
details, see Figures 6-3 and 6-4.
Figure 6-27. Square-Wave Output Operation Timing
Count clock
TM00 count value
CR000
INTTM000
TO00 pin output
0000H 0001H 0002H
N
- 1
N
0000H 0001H 0002H
N
- 1
N
0000H
N
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
150
6.4.6 One-shot pulse output operation
16-bit timer/event counter 00 can output a one-shot pulse in synchronization with a software trigger or an external
trigger (TI000 pin input).
(1) One-shot pulse output with software trigger
A one-shot pulse can be output from the TO00 pin by setting 16-bit timer mode control register 00 (TMC00),
capture/compare control register 00 (CRC00), and 16-bit timer output control register 00 (TOC00) as shown in
Figure 6-27, and by setting bit 6 (OSPT00) of the TOC00 register to 1 by software.
By setting the OSPT00 bit to 1, 16-bit timer/event counter 00 is cleared and started, and its output becomes
active at the count value (N) set in advance to 16-bit timer capture/compare register 010 (CR010). After that, the
output becomes inactive at the count value (M) set in advance to 16-bit timer capture/compare register 000
(CR000)
Note
.
Even after the one-shot pulse has been output, the TM00 register continues its operation. To stop the TM00
register, the TMC003 and TMC002 bits of the TMC00 register must be set to 00.
Note The case where N < M is described here. When N > M, the output becomes active with the CR000
register and inactive with the CR010 register.
Cautions 1. Do not set the OSPT00 bit while the one-shot pulse is being output. To output the one-shot
pulse again, wait until the current one-shot pulse output is completed.
2. When using the one-shot pulse output of 16-bit timer/event counter 00 with a software
trigger, do not change the level of the TI000 pin or its alternate-function port pin.
Because the external trigger is valid even in this case, the timer is cleared and started even
at the level of the TI000 pin or its alternate-function port pin, resulting in the output of a
pulse at an undesired timing.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
151
Figure 6-28. Control Register Settings for One-Shot Pulse Output with Software Trigger
(a) 16-bit timer mode control register 00 (TMC00)
0
0
0
0
0
TMC003
TMC00
TMC002
TMC001
OVF00
Free-running mode
1
0
0
(b) Capture/compare control register 00 (CRC00)
0
0
0
0
0
CRC00
CRC002
CRC001
CRC000
CR000 as compare register
CR010 as compare register
0
0/1
0
(c) 16-bit timer output control register 00 (TOC00)
0
0
1
1
0/1
TOC00
LVR00
LVS00
TOC004
OSPE00
OSPT00
TOC001
TOE00
Enables TO00 output
Inverts output upon match
between TM00 and CR000
Specifies initial value of
TO00 output F/F
Inverts output upon match
between TM00 and CR010
Sets one-shot pulse output mode
Set to 1 for output
0/1
1
1
Caution
Do not set 0000H to the CR000 and CR010 registers.
Remark
0/1: Setting 0 or 1 allows another function to be used simultaneously with pulse width measurement.
For details, see Figures 6-3 and 6-4.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
152
Figure 6-29. Timing of One-Shot Pulse Output Operation with Software Trigger
0000H
N
N
N
N
N
M
M
M
M
N
M
N + 1
N 1
M 1
0001H
M + 1 M + 2
0000H
Count clock
TM00 count
CR010 set value
CR000 set value
OSPT00
INTTM010
INTTM000
TO00 pin output
Set TMC00 to 0CH
(TM00 count starts)
Caution
16-bit timer counter 00 starts operating as soon as a value other than 00 (operation stop mode) is
set to the TMC003 and TMC002 bits.
Remark
N < M
(2) One-shot pulse output with external trigger
A one-shot pulse can be output from the TO00 pin by setting 16-bit timer mode control register 00 (TMC00),
capture/compare control register 00 (CRC00), and 16-bit timer output control register 00 (TOC00) as shown in
Figure 6-30, and by using the valid edge of the TI000 pin as an external trigger.
The valid edge of the TI000 pin is specified by bits 4 and 5 (ES000, ES001) of prescaler mode register 00
(PRM00). The rising, falling, or both the rising and falling edges can be specified.
When the valid edge of the TI000 pin is detected, the 16-bit timer/event counter is cleared and started, and the
output becomes active at the count value set in advance to 16-bit timer capture/compare register 010 (CR010).
After that, the output becomes inactive at the count value set in advance to 16-bit timer capture/compare register
000 (CR000)
Note
.
Note The case where N < M is described here. When N > M, the output becomes active with the CR000
register and inactive with the CR010 register.
Caution
Even if the external trigger is generated again while the one-shot pulse is output, it is ignored.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
153
Figure 6-30. Control Register Settings for One-Shot Pulse Output with External Trigger
(a) 16-bit timer mode control register 00 (TMC00)
0
0
0
0
1
TMC003
TMC00
TMC002 TMC001
OVF00
Clears and starts at
valid edge of TI000 pin
0
0
0
(b) Capture/compare control register 00 (CRC00)
0
0
0
0
0
CRC00
CRC002
CRC001
CRC000
CR000 used as compare register
CR010 used as compare register
0
0/1
0
(c) 16-bit timer output control register 00 (TOC00)
0
0
1
1
0/1
TOC00
LVR00
TOC001
TOE00
OSPE00
OSPT00
TOC004
LVS00
Enables TO00 output
Inverts output upon match
between TM00 and CR000
Specifies initial value of
TO00 output F/F
Inverts output upon match
between TM00 and CR010
Sets one-shot pulse output mode
0/1
1
1
Caution
Do not set the CR000 and CR010 registers to 0000H.
Remark
0/1: Setting 0 or 1 allows another function to be used simultaneously with pulse width measurement.
For details, see Figures 6-3 and 6-4.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
154
Figure 6-31. Timing of One-Shot Pulse Output Operation with External Trigger (with Rising Edge Specified)
0000H
N
N
N
N
N
M
M
M
M
M
N + 1 N + 2
M + 1 M + 2
M
- 2 M - 1
0001H
0000H
Count clock
TM00 count value
CR010 set value
CR000 set value
TI000 pin input
INTTM010
INTTM000
TO00 pin output
Set TMC00 to 08H
(TM00 count starts)
Caution
16-bit timer counter 00 starts operating as soon as a value other than 00 (operation stop mode) is
set to the TMC002 and TMC003 bits.
Remark
N < M
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
155
6.5 Cautions for 16-Bit Timer/Event Counter 00
(1) Timer start errors
An error of up to one clock may occur in the time required for a match signal to be generated after timer start.
This is because 16-bit timer counter 00 (TM00) is started asynchronously to the count clock.
Figure 6-32. Start Timing of 16-Bit Timer Counter 00 (TM00)
TM00 count value
0000H
0001H
0002H
0004H
Count clock
Timer start
0003H
(2) 16-bit timer capture/compare register setting (in the mode in which clear & start occurs on match
between TM00 and CR000)
Set 16-bit timer capture/compare registers 000, 010 (CR000, CR010) to other than 0000H. This means a 1-pulse
count operation cannot be performed when 16-bit timer/event counter 00 is used as an event counter.
(3) Operation after compare register change during timer count operation
If the value after 16-bit timer capture/compare register 000 (CR000) is changed is smaller than that of 16-bit timer
counter 00 (TM00), TM00 continues counting, overflows and then restarts counting from 0. Thus, if the value (M)
after CR000 changes is smaller than that (N) before the change, it is necessary to restart the timer after changing
CR000.
Figure 6-33. Timings After Change of Compare Register During Timer Count Operation
CR000
N
M
Count clock
TM00 count value
X
- 1
X
FFFFH
0000H
0001H
0002H
Remark
N > X > M
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
156
(4) Capture register data retention timing
If the valid edge of the TI000 pin is input during 16-bit timer capture/compare register 010 (CR010) read, CR010
performs a capture operation. However, the value read at this time is not guaranteed.
The interrupt request flag (TMIF010) is set upon detection of the valid edge.
Figure 6-34. Capture Register Data Retention Timing
Count clock
TM00 count value
Edge input
Interrupt request flag
Capture read signal
CR010 interrupt value
N
N + 1
N + 2
M
M + 1
M + 2
X
N + 2
Capture, but
read value is
not guaranteed
Capture
M + 1
(5) Valid edge setting
Set the valid edge of the TI000 pin after setting bits 2 and 3 (TMC002 and TMC003) of 16-bit timer mode control
register 00 (TMC00) to 0, 0, respectively, and then stopping timer operation. The valid edge is set using bits 4
and 5 (ES000 and ES001) of prescaler mode register 00 (PRM00).
(6) Re-triggering one-shot pulse
(a) One-shot pulse output by software
When a one-shot pulse is output, do not set the OSPT00 bit to 1. Do not output the one-shot pulse again
until INTTM000, which occurs upon a match with the CR000 register, or INTTM010, which occurs upon a
match with the CR010 register, occurs.
(b) One-shot pulse output with external trigger
If the external trigger occurs again while a one-shot pulse is output, it is ignored.
(c) One-shot pulse output function
When using the one-shot pulse output of 16-bit timer/event counter 00 with a software trigger, do not change
the level of the TI000 pin or its alternate function port pin.
Because the external trigger is valid even in this case, the timer is cleared and started even at the level of the
TI000 pin or its alternate function port pin, resulting in the output of a pulse at an undesired timing.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
157
(7) Operation of OVF00 flag
<1>
The OVF00 flag is set to 1 in the following case.
When of the following modes: the mode in which clear & start occurs on a match between TM00 and
CR000, the mode in which clear & start occurs on a TI00 valid edge, or the free-running mode, is selected
CR000 is set to FFFFH
TM00 is counted up from FFFFH to 0000H.
Figure 6-35. Operation Timing of OVF00 Flag
Count clock
CR000
TM00
OVF00
INTTM000
FFFFH
FFFEH
FFFFH
0000H
0001H
<2>
Even if the OVF00 flag is cleared before the next count clock (before TM00 becomes 0001H) after the
occurrence of TM00 overflow, the OVF00 flag is re-set newly and clear is disabled.
(8) Conflicting operations
<1>
Conflict between the read period of the 16-bit timer capture/compare register (CR000/CR010) and capture
trigger input (CR000/CR010 used as capture register)
Capture trigger input has priority. The data read from CR000/CR010 is undefined.
<2>
Conflict between the write period of the 16-bit timer capture/compare register (CR000/CR010) and the
match timing of 16-bit timer counter 00 (TM00) (CR000/CR010 used as a compare register)
Match determination is not performed normally. Do not write any data to CR000/CR010 near the match
timing.
(9) Timer operation
<1>
Even if 16-bit timer counter 00 (TM00) is read, the value is not captured by 16-bit timer capture/compare
register 010 (CR010).
<2>
Regardless of the CPU's operation mode, when the timer stops, the input signals to the TI000/TI010 pins
are not acknowledged.
<3>
The one-shot pulse output mode operates correctly only in the free-running mode and the mode in which
clear & start occurs at the TI000 valid edge. In the mode in which clear & start occurs on a match between
the TM00 register and CR000 register, one-shot pulse output is not possible because an overflow does not
occur.
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User's Manual U16227EJ1V0UD
158
(10) Capture operation
<1>
If TI000 valid edge is specified as the count clock, a capture operation by the capture register specified as
the trigger for TI000 is not possible.
<2>
To ensure the reliability of the capture operation, the capture trigger requires a pulse two times longer than
the count clock selected by prescaler mode register 00 (PRM00).
<3>
The capture operation is performed at the falling edge of the count clock. An interrupt request input
(INTTM000/INTTM010), however, is generated at the rise of the next count clock.
(11) Compare operation
<1>
When the 16-bit timer capture/compare register (CR000/CR010) is overwritten during timer operation, a
match interrupt may be generated or a clear operation may not be performed normally if that value is close
to or larger than the timer value.
<2>
A capture operation may not be performed for CR000/CR010 set in compare mode even if a capture trigger
has been input.
(12) Edge detection
<1>
If the TI000 or TI010 pin is high level immediately after system reset and the rising edge or both the rising
and falling edges are specified as the valid edge of the TI000 or TI010 pin to enable the 16-bit timer counter
00 (TM00) operation, a rising edge is detected immediately after the operation is enabled. Be careful
therefore when pulling up the TI000 or TI010 pin. However, the rising edge is not detected at restart after
the operation has been stopped once.
<2>
The sampling clock used to remove noise differs when the TI000 valid edge is used as the count clock and
when it is used as a capture trigger. In the former case, the count clock is f
X
, and in the latter case the
count clock is selected by prescaler mode register 00 (PRM00). The capture operation is started only after
a valid edge is detected twice by sampling, thus eliminating noise with a short pulse width.
Preliminary User's Manual U16227EJ1V0UD
159
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51
7.1 Functions of 8-Bit Timer/Event Counters 50 and 51
8-bit timer/event counters 50 and 51 have the following functions.
Interval timer
External event counter
Square-wave output
PWM output
Figures 7-1 and 7-2 show the block diagrams of 8-bit timer/event counters 50 and 51.
Figure 7-1. Block Diagram of 8-Bit Timer/Event Counter 50
Internal bus
8-bit timer compare
register 50 (CR50)
TI50/TO50/P17
f
X
/2
2
f
X
/2
6
f
X
/2
8
f
X
/2
13
f
X
f
X
/2
Match
Mask circuit
OVF
Clear
3
Selector
TCL502 TCL501 TCL500
Timer clock selection
register 50 (TCL50)
Internal bus
TCE50 TMC506 LVS50 LVR50 TMC501 TOE50
Invert
level
8-bit timer mode control
register 50 (TMC50)
S
R
S
Q
R
INV
Selector
INTTM50
TO50/TI50/P17
Selector
8-bit timer
counter 50 (TM50)
Selector
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51
Preliminary User's Manual U16227EJ1V0UD
160
Figure 7-2. Block Diagram of 8-Bit Timer/Event Counter 51
Internal bus
8-bit timer compare
register 51 (CR51)
TI51/TO51/P33/INTP4
f
X
/2
4
f
X
/2
6
f
X
/2
8
f
X
/2
12
f
X
f
X
/2
Match
Mask circuit
OVF
Clear
3
Selector
TCL512 TCL511 TCL510
Timer clock selection
register 51 (TCL51)
Internal bus
TCE51 TMC516 LVS51 LVR51 TMC511 TOE51
Invert
level
8-bit timer mode control
register 51 (TMC51)
S
R
S
Q
R
INV
Selector
INTTM51
TO51/TI51/P33/INTP4
Selector
8-bit timer
counter 51 (TM51)
Selector
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51
Preliminary User's Manual U16227EJ1V0UD
161
7.2 Configuration of 8-Bit Timer/Event Counters 50 and 51
8-bit timer/event counters 50 and 51 consist of the following hardware.
Table 7-1. Configuration of 8-Bit Timer/Event Counters 50 and 51
Item
Configuration
Timer register
8-bit timer counter 5n (TM5n)
Register
8-bit timer compare register 5n (CR5n)
Timer output
1 (TO5n)
Control registers
Timer clock selection register 5n (TCL5n)
8-bit timer mode control register 5n (TMC5n)
Port mode register 1 (PM1)
Note
or port mode register 3 (PM3)
Note
Note See Figure 4-9 Block Diagram of P16 and P17 and Figure 4-12 Block Diagram of P33.
(1) 8-bit timer counter 5n (TM5n)
TM5n is an 8-bit register that counts the count pulses and is read-only.
The counter is incremented in synchronization with the rising edge of the count clock.
When the count value is read during operation, count clock input is temporary stopped, and then the count value
is read. In the following situations, the count value is cleared to 00H.
<1>
RESET input
<2>
When TCE5n is cleared
<3>
When TM5n and CR5n match in the mode in which clear & start occurs upon a match of the TM5n and
CR5n.
(2) 8-bit timer compare register 5n (CR5n)
CR5n can be read and written by an 8-bit memory manipulation instruction.
Except in PWM mode, the value set in CR5n is constantly compared with the 8-bit timer counter 5n (TM5n) count
value, and an interrupt request (INTTM5n) is generated if they match.
In PWM mode, when the TO5n pin becomes active due to a TM5n overflow and the values of TM5n and CR5n
match, the TO5n pin becomes inactive.
The value of CR5n can be set within 00H to FFH.
Cautions 1. In the mode in which clear & start occurs on a match of TM5n and CR5n (TMC5n6 = 0), do
not write other values to CR5n during operation.
2. In PWM mode, make the CR5n rewrite period 3 count clocks of the count clock (clock
selected by TCL5n) or more.
Remark
n = 0, 1
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51
Preliminary User's Manual U16227EJ1V0UD
162
7.3 Registers Controlling 8-Bit Timer/Event Counters 50 and 51
The following three registers are used to control 8-bit timer/event counters 50 and 51.
Timer clock selection register 5n (TCL5n)
8-bit timer mode control register 5n (TMC5n)
Port mode register 1 (PM1) or port mode register 3 (PM3)
(1) Timer clock selection register 5n (TCL5n)
This register sets the count clock of 8-bit timer/event counter 5n and the valid edge of TI5n input.
TCL5n can be set by an 8-bit memory manipulation instruction.
RESET input clears TCL5n to 00H.
Remark
n = 0, 1
Figure 7-3. Format of Timer Clock Selection Register 50 (TCL50)
Address: FF6AH After reset: 00H R/W
Symbol
7
6
5
4
3
2
1
0
TCL50
0
0
0
0
0
TCL502
TCL501
TCL500
TCL502
TCL501
TCL500
Count clock selection
0
0
0
TI50 falling edge
0
0
1
TI50 rising edge
0
1
0
f
X
(10 MHz)
0
1
1
f
X
/2 (5 MHz)
1
0
0
f
X
/2
2
(2.5 MHz)
1
0
1
f
X
/2
6
(156.25 kHz)
1
1
0
f
X
/2
8
(39.06 kHz)
1
1
1
f
X
/2
13
(1.22 kHz)
Cautions 1. When rewriting TCL50 to other data, stop the timer operation beforehand.
2. Be sure to set bits 3 to 7 to 0.
Remarks 1. f
X
: X1 input clock oscillation frequency
2. Figures in parentheses apply to operation at f
X
= 10 MHz.
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51
Preliminary User's Manual U16227EJ1V0UD
163
Figure 7-4. Format of Timer Clock Selection Register 51 (TCL51)
Address: FF8CH After reset: 00H R/W
Symbol
7
6
5
4
3
2
1
0
TCL51
0
0
0
0
0
TCL512
TCL511
TCL510
TCL512
TCL511
TCL510
Count clock selection
0
0
0
TI51 falling edge
0
0
1
TI51 rising edge
0
1
0
f
X
(10 MHz)
0
1
1
f
X
/2 (5 MHz)
1
0
0
f
X
/2
4
(625 kHz)
1
0
1
f
X
/2
6
(156.25 kHz)
1
1
0
f
X
/2
8
(39.06 kHz)
1
1
1
f
X
/2
12
(2.44 kHz)
Cautions 1. When rewriting TCL51 to other data, stop the timer operation beforehand.
2. Be sure to set bits 3 to 7 to 0.
Remarks 1. f
X
: X1 input clock oscillation frequency
2. Figures in parentheses apply to operation at f
X
= 10 MHz.
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51
Preliminary User's Manual U16227EJ1V0UD
164
(2) 8-bit timer mode control register 5n (TMC5n)
TMC5n is a register that performs the following five types of settings.
<1>
8-bit timer counter 5n (TM5n) count operation control
<2>
8-bit timer counter 5n (TM5n) operating mode selection
<3>
Timer output F/F (flip flop) status setting
<4>
Active level selection in timer F/F control or PWM (free-running) mode.
<5>
Timer output control
TMC5n can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Remark
n = 0, 1
Figure 7-5. Format of 8-Bit Timer Mode Control Register 50 (TMC50)
Address: FF6BH After reset: 00H R/W
Note
Symbol
7
6
5
4
3
2
1
0
TMC50
TCE50
TMC506
0
0
LVS50
LVR50
TMC501
TOE50
TCE50
TM50 count operation control
0
After clearing to 0, count operation disabled (counter stopped)
1
Count operation start
TMC506
TM50 operating mode selection
0
Mode in which clear & start occurs on a match between TM50 and CR50
1
PWM (free-running) mode
LVS50
LVR50
Timer output F/F status setting
0
0
No change
0
1
Timer output F/F reset (0)
1
0
Timer output F/F set (1)
1
1
Setting prohibited
In other modes (TMC506 = 0)
In PWM mode (TMC506 = 1)
TMC501
Timer F/F control
Active level selection
0
Inversion operation disabled
Active-high
1
Inversion operation enabled
Active-low
TOE50
Timer output control
0
Output disabled (TO50 pin outputs the low level)
1
Output enabled
Note Bits 2 and 3 are write-only.
(Refer to Caution and Remark on the page after the next.)
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51
Preliminary User's Manual U16227EJ1V0UD
165
Figure 7-6. Format of 8-Bit Timer Mode Control Register 51 (TMC51)
Address: FF43H After reset: 00H R/W
Note
Symbol
7
6
5
4
3
2
1
0
TMC51
TCE51
TMC516
0
0
LVS51
LVR51
TMC511
TOE51
TCE51
TM51 count operation control
0
After clearing to 0, count operation disabled (counter stopped)
1
Count operation start
TMC516
TM51 operating mode selection
0
Mode in which clear & start occurs on a match between TM51 and CR51
1
PWM (free-running) mode
LVS51
LVR51
Timer output F/F status setting
0
0
No change
0
1
Timer output F/F reset (0)
1
0
Timer output F/F set (1)
1
1
Setting prohibited
In other modes (TMC516 = 0)
In PWM mode (TMC516 = 1)
TMC511
Timer F/F control
Active level selection
0
Inversion operation disabled
Active-high
1
Inversion operation enabled
Active-low
TOE51
Timer output control
0
Output disabled (TO51 pin outputs the low level)
1
Output enabled
Note Bits 2 and 3 are write-only.
(Refer to Caution and Remark on the next page.)
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51
Preliminary User's Manual U16227EJ1V0UD
166
Cautions 1. To clear TCE5n to 0, set the interrupt mask flag (TMMK5n) to 1 beforehand. Otherwise, an
interrupt may occur when TCE5n is cleared.
TCE5n is cleared to 0 as follows.
TMMK5n = 1;
Mask set
TCE5n = 0;
Timer clear
TMIF5n = 0;
Interrupt request flag clear
TMMK5n = 0;
Mask clear
TCE5n = 1;
Timer start
2. The settings of LVS5n and LVR5n are valid in other than PWM mode.
3. Do not rewrite TMC5n1 and TOE5n simultaneously.
4. When switching to the PWM mode, do not rewrite TM5n6 and LVS5n or LVR5n
simultaneously.
5. To rewrite TMC5n6, stop operation beforehand.
Remarks 1. In PWM mode, PWM output is made inactive by setting TCE5n to 0.
2. If LVS5n and LVR5n are read after data is set, 0 is read.
3. The values of the TMC5n6, LVS5n, LVR5n, TMC5n1, and TOE5n bits are reflected at the TO5n pin
regardless of the value of TCE5n.
4. n = 0, 1
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51
Preliminary User's Manual U16227EJ1V0UD
167
(3) Port mode register 1 (PM1) and 3 (PM3)
These registers set port 1 and 3 input/output in 1-bit units.
When using the P17/TO50/TI50 and P33/TO51/TI51 pins for timer output, set PM17 and PM33 and the output
latches of P17 and P33 to 0.
PM1 and PM3 can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input sets these registers to FFH.
Figure 7-7. Format of Port Mode Register 1 (PM1)
Address: FF21H After reset: FFH R/W
Symbol
7
6
5
4
3
2
1
0
PM1
PM17
PM16
PM15
PM14
PM13
PM12
PM11
PM10
PM1n
P1n pin I/O mode selection (n = 0 to 7)
0
Output mode (output buffer on)
1
Input mode (output buffer off)
Figure 7-8. Format of Port Mode Register 3 (PM3)
Address: FF23H After reset: FFH R/W
Symbol
7
6
5
4
3
2
1
0
PM3
0
0
0
0
PM33
PM32
PM31
PM30
PM3n
P3n pin I/O mode selection (n = 0 to 3)
0
Output mode (output buffer on)
1
Input mode (output buffer off)
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51
Preliminary User's Manual U16227EJ1V0UD
168
7.4 Operations of 8-Bit Timer/Event Counters 50 and 51
7.4.1 Operation as interval timer
8-bit timer/event counter 5n operates as an interval timer that generates interrupt requests repeatedly at intervals
of the count value preset to 8-bit timer compare register 5n (CR5n).
When the count value of 8-bit timer counter 5n (TM5n) matches the value set to CR5n, counting continues with the
TM5n value cleared to 0 and an interrupt request signal (INTTM5n) is generated.
The count clock of TM5n can be selected with bits 0 to 2 (TCL5n0 to TCL5n2) of timer clock selection register 5n
(TCL5n).
[Setting]
<1>
Set the registers.
TCL5n:
Select the count clock.
CR5n:
Compare value
TMC5n: Stop the count operation, select the mode in which clear & start occurs on a match of TM5n
and CR5n.
(TMC5n = 0000
0B = Don't care)
<2>
After TCE5n = 1 is set, the count operation starts.
<3>
If the values of TM5n and CR5n match, INTTM5n is generated (TM5n is cleared to 00H).
<4>
INTTM5n is generated repeatedly at the same interval.
Set TCE5n to 0 to stop the count operation.
Caution
Do not write other values to CR5n during operation.
Figure 7-9. Interval Timer Operation Timing (1/2)
(a) Basic operation
t
Count clock
TM5n count value
CR5n
TCE5n
INTTM5n
TO5n
Count start
Clear
Clear
00H
01H
N
00H
01H
N
00H
01H
N
N
N
N
N
Interrupt acknowledged
Interrupt acknowledged
Interval time
Interval time
Interval time
Remark
Interval time = (N + 1)
t
N = 00H to FFH
n = 0, 1
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51
Preliminary User's Manual U16227EJ1V0UD
169
Figure 7-9. Interval Timer Operation Timing (2/2)
(b) When CR5n = 00H
t
Count clock
TM5n
CR5n
TCE5n
INTTM5n
TO5n
Interval time
00H
00H
00H
00H
00H
(c) When CR5n = FFH
t
Count clock
TM5n
CR5n
TCE5n
INTTM5n
TO5n
01
FE
FF
00
FE
FF
00
FF
FF
FF
Interval time
Interrupt
acknowledged
Interrupt acknowledged
Remark
n = 0, 1
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51
Preliminary User's Manual U16227EJ1V0UD
170
7.4.2 Operation as external event counter
The external event counter counts the number of external clock pulses to be input to TI5n by 8-bit timer counter 5n
(TM5n).
TM5n is incremented each time the valid edge specified by timer clock selection register 5n (TCL5n) is input.
Either the rising or falling edge can be selected.
When the TM5n count value matches the value of 8-bit timer compare register 5n (CR5n), TM5n is cleared to 0
and an interrupt request signal (INTTM5n) is generated.
Whenever the TM5n value matches the value of CR5n, INTTM5n is generated.
[Setting]
<1>
Set each register.
TCL5n: Select TI5n input edge.
TI5n falling edge
TCL5n = 00H
TI5n rising edge
TCL5n = 01H
CR5n: Compare value
TMC5n: Stop the count operation, select the mode in which clear & start occurs on match of TM5n and
CR5n, disable the timer F/F inversion operation, disable timer output.
(TMC5n = 0000
00B = Don't care)
<2>
When TCE5n = 1 is set, the number of pulses input from TI5n is counted.
<3>
When the values of TM5n and CR5n match, INTTM5n is generated (TM5n is cleared to 00H).
<4>
After these settings, INTTM5n is generated each time the values of TM5n and CR5n match.
Figure 7-10. External Event Counter Operation Timing (with Rising Edge Specified)
TI5n
TM5n count value
CR5n
INTTM5n
00
01
02
03
04
05
N 1
N
00
01
02
03
N
Count start
Remark
N = 00H to FFH
n = 0, 1
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51
Preliminary User's Manual U16227EJ1V0UD
171
7.4.3 Square-wave output operation
A square wave with any selected frequency is output at intervals of the value preset to 8-bit timer compare register
5n (CR5n).
The TO5n pin output status is inverted at intervals of the count value preset to CR5n by setting bit 0 (TOE5n) of 8-
bit timer mode control register 5n (TMC5n) to 1. This enables a square wave with any selected frequency to be output
(duty = 50%).
[Setting]
<1>
Set each register.
Set the port latches (P17 and P33)
Note
and port mode registers (PM17 and PM33)
Note
to 0.
TCL5n: Select the count clock.
CR5n: Compare value
TMC5n: Stop the count operation, select the mode in which clear & start occurs on a match of TM5n and
CR5n.
LVS5n
LVR5n
Timer Output F/F Status Setting
1
0
High-level output
0
1
Low-level output
Timer output F/F inversion enabled
Timer output enabled
(TMC5n = 00001011B or 00000111B)
<2>
After TCE5n = 1 is set, the count operation starts.
<3>
The timer output F/F is inverted by a match of TM5n and CR5n. After INTTM5n is generated, TM5n is
cleared to 00H.
<4>
After these settings, the timer output F/F is inverted at the same interval and a square wave is output from
TO5n.
The frequency is as follows.
Frequency = f
CNT
/2 (N + 1)
(N: 00H to FFH, f
CNT
: Count clock)
Note 8-bit timer/event counter 50: P17, PM17
8-bit timer/event counter 51: P33, PM33
Caution
Do not write other values to CR5n during operation.
Remark
n = 0, 1
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51
Preliminary User's Manual U16227EJ1V0UD
172
Figure 7-11. Square-Wave Output Operation Timing
Count clock
TMn count value
CR5n
TO5n
Note
Count start
00H
01H
02H
N 1
N
00H
01H
02H
N 1
N
00H
N
Note The initial value of TO5n output can be set by bits 2 and 3 (LVR5n, LVS5n) of 8-bit timer mode control
register 5n (TMC5n).
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51
Preliminary User's Manual U16227EJ1V0UD
173
7.4.4 PWM output operation
8-bit timer/event counter 5n operates as a PWM output when bit 6 (TMC5n6) of 8-bit timer mode control register 5n
(TMC5n) is set to 1.
The duty ratio pulse determined by the value set to 8-bit timer compare register 5n (CR5n) is output from TO5n.
Set the active level width of the PWM pulse to CR5n; the active level can be selected with bit 1 (TMC5n1) of
TMC5n.
The count clock can be selected with bits 0 to 2 (TCL5n0 to TCL5n2) of timer clock selection register 5n (TCL5n).
PWM output can be enabled/disabled with bit 0 (TOE5n) of TMC5n.
Caution
In PWM mode, make the CR5n rewrite period 3 count clocks of the count clock (clock selected by
TCL5n) or more.
(1) PWM output basic operation
[Setting]
<1>
Set each register.
Set the port latches (P17, P33)
Note
and port mode registers (PM17, PM33)
Note
to 0.
TCL5n: Select the count clock.
CR5n: Compare value
TMC5n: Stop the count operation, select PWM mode.
The timer output F/F is not changed.
TMC5n1
Active Level Selection
0
Active-high
1
Active-low
Timer output enabled
(TMC5n = 01000001B or 01000011B)
<2>
The count operation starts when TCE5n = 1.
Set TCE5n to 0 to stop the count operation.
Note 8-bit timer/event counter 50: P17, PM17
8-bit timer/event counter 51: P33, PM33
[PWM output operation]
<1>
PWM output (output from TO5n) outputs an inactive level after the count operation starts until an overflow
occurs.
<2>
When an overflow occurs, the active level set in <1> above is output.
The active level is output until CR5n matches the count value of 8-bit timer counter 5n (TM5n).
<3>
After the CR5n matches the count value, the inactive level is output until an overflow occurs again.
<4>
Operations <2> and <3> are repeated until the count operation stops.
<5>
When the count operation is stopped with TCE5n = 0, PWM output becomes inactive.
Remark
n = 0, 1
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51
Preliminary User's Manual U16227EJ1V0UD
174
Figure 7-12. PWM Output Operation Timing
(a) Basic operation (active level = H)
Count clock
TM5n
CR5n
TCE5n
INTTM5n
TO5n
00H 01H
FFH 00H 01H 02H
N N + 1
FFH 00H 01H 02H
M
00H
N
Active level
Active level
Inactive level
(b) CR5n = 00H
Count clock
TM5n
CR5n
TCE5n
INTTM5n
TO5n L
Inactive level
Inactive level
01H
00H
FFH 00H 01H 02H
N N + 1
FFH 00H 01H 02H
M 00H
00H
N + 2
(c) CR5n = FFH
TM5n
CR5n
TCE5n
INTTM5n
TO5n
01H
00H
FFH 00H 01H 02H
N N + 1
FFH 00H 01H 02H
M 00H
FFH
N + 2
Inactive level
Active level
Inactive level
Active level
Inactive level
Remark
n = 0, 1
CHAPTER 7 8-BIT TIMER/EVENT COUNTERS 50 AND 51
Preliminary User's Manual U16227EJ1V0UD
175
(2) Operation with CR5n changed
Figure 7-13. Timing of Operation with CR5n Changed
(a) CR5n value is changed from N to M before clock rising edge of FFH
Value is reloaded to CR5n at overflow immediately after change.
Count clock
TM5n
CR5n
TCE5n
INTTM5n
TO5n
<1> CR5n change (N
M)
N N + 1 N + 2
FFH 00H 01H
M M + 1 M + 2
FFH 00H 01H 02H
M M + 1 M + 2
N
02H
M
H
<2>
(b) CR5n value is changed from N to M after clock rising edge of FFH
Value is reloaded to CR5n at second overflow.
Count clock
TM5n
CR5n
TCE5n
INTTM5n
TO5n
N
N + 1 N + 2
FFH 00H 01H
N
N + 1 N + 2
FFH 00H 01H 02H
N
02H
N
H
M
M M + 1 M + 2
<1> CR5n change (N
M)
<2>
Caution
When reloading from CR5n between <1> and <2> in Figure 7-13, the value read differs from the
actual value (read value: M, actual value of CR5n: N).
7.5 Cautions for 8-Bit Timer/Event Counters 50 and 51
(1) Timer start error
An error of up to one clock may occur in the time required for a match signal to be generated after timer start.
This is because 8-bit timer counters 50 and 51 (TM50, TM51) are started asynchronously to the count clock.
Figure 7-14. 8-Bit Timer Counter 5n Start Timing
Count clock
TM5n count value
00H
01H
02H
03H
04H
Timer start
Remark
n = 0, 1
Preliminary User's Manual U16227EJ1V0UD
176
CHAPTER 8 8-BIT TIMERS H0 AND H1
8.1 Functions of 8-Bit Timers H0 and H1
8-bit timers H0 and H1 have the following functions.
8-bit-accuracy interval timer
8-bit-accuracy PWM pulse generator mode
8-bit-accuracy carrier generator mode (8-bit timer H1 only)
8.2 Configuration of 8-Bit Timers H0 and H1
8-bit timers H0 and H1 consist of the following hardware.
Table 8-1. Configuration of 8-Bit Timers H0 and H1
Item
Configuration
Timer register
8-bit timer counter Hn (TMHn)
Registers
8-bit timer H compare register 0n (CMP0n)
8-bit timer H compare register 1n (CMP1n)
Timer output
Two outputs (TOHn)
Control registers
8-bit timer H mode register n (TMHMDn)
8-bit timer H carrier control register 1 (TMCYC1)
Note
Note 8-bit timer H1 only
Remark
n = 0, 1
Figures 8-1 and 8-2 show the block diagrams.
Figure 8-1. Block Diagram of 8-Bit Timer H0
Match
Internal bus
TMHE0 CKS02 CKS01 CKS00 TMMD01TMMD00 TOLEV0 TOEN0
8-bit timer H mode control
register 0 (TMHMD0)
8-bit timer H
compare register
10 (CMP10)
Decoder
TOH0/P15
INTTMH0
Selector
f
X
f
X
/2
f
X
/2
2
f
X
/2
6
f
X
/2
10
TO50/TI50/P17
Interrupt
generator
Output
controller
Level
inversion
1
0
F/F
R
8-bit timer
counter H0
(TMH0)
PWM mode signal
Timer H enable signal
Clear
3
2
8-bit timer H
compare register
00 (CMP00)
Selector
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
177
Figure 8-2. Block Diagram of 8-Bit Timer H1
TMHE1 CKS12 CKS11 CKS10 TMMD11TMMD10 TOLEV1 TOEN1
TOH1/
INTP5/
P16
8-bit timer H carrier
control register 1
(TMCYC1)
INTTMH1
INTTM51
f
X
f
X
/2
2
f
X
/2
4
f
X
/2
6
f
X
/2
12
f
R
/2
7
1
0
F/F
R
3
2
RMC1 NRZB1 NRZ1
Match
8-bit timer H mode control
register 1 (TMHMD1)
8-bit timer H
compare register
11 (CMP11)
Decoder
Selector
Interrupt
generator
Output
controller
Level
inversion
PWM mode signal
Timer H enable signal
8-bit timer H
compare register
01 (CMP01)
8-bit timer
counter H1
(TMH1)
Clear
Selector
Internal bus
Reload/
interrupt
control
Carrier generator mode signal
(1) 8-bit timer H compare register 0n (CMP0n)
This register can be read/written by an 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
CMP0n
After reset: 00H R/W Address: FF18H, FF1AH
7
6
5
4
3
2
1
0
Caution
This register cannot be rewritten during timer count operation.
(2) 8-bit timer H compare register 1n (CMP1n)
This register can be read/written by an 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
CMP1n
After reset: 00H R/W Address: FF19H, FF1BH
7
6
5
4
3
2
1
0
The CMP1n register can be rewritten during timer count operation.
In the carrier generator mode, an interrupt request signal (INTTMHn) is generated if the values of the timer counter
and CMP1n register match after setting the CMP1n register. The timer counter value is cleared at the same time. If
the CMP1n register value is rewritten during timer operation, reloading is performed at the timing at which the counter
value and CMP1n register value match. If the transfer timing and writing from CPU to CMP1n register conflict,
transfer is not performed.
Remark
n = 0, 1
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
178
8.3 Registers Controlling 8-Bit Timers H0 and H1
8-bit timers H0 and H1 are controlled by 8-bit timer H mode registers 0 and 1 (TMHMD0, TMHMD1) and 8-bit timer
H carrier control register 1 (TMCYC1)
Note
.
Note 8-bit timer H1 only
(1) 8-bit timer H mode registers 0 and 1 (TMHMD0, TMHMD1)
These registers control the mode of timer H.
These registers can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears these registers to 00H.
Figure 8-3. Format of 8-Bit Timer H Mode Register 0 (TMHMD0)
TMHE0
Stops timer count operation
Enables timer count operation (count operation started by inputting clock)
TMHE0
0
1
Timer operation enable
TMHMD0
CKS02
CKS01
CKS00
TMMD01 TMMD00 TOLEV0
TOEN0
Address: FF69H After reset: 00H R/W
f
X
f
X
/2
f
X
/2
2
f
X
/2
6
f
X
/2
10
TO50
CKS02
0
0
0
0
1
1
CKS01
0
0
1
1
0
0
CKS00
0
1
0
1
0
1
(10 MHz)
(5 MHz)
(2.5 MHz)
(156.25 kHz)
(9.77 kHz)
Count clock (f
CNT
) selection
Setting prohibited
Other than above
Interval timer mode
PWM pulse generator mode
Setting prohibited
TMMD01
0
1
TMMD00
0
0
Timer operation mode
Low level
High level
TOLEV0
0
1
Timer output level control (in default mode)
Disables output
Enables output
TOEN0
0
1
Timer output control
Other than above
7
6
5
4
3
2
1
0
Caution
When TMHE0 = 1, setting the other bits of the TMHMD0 register is prohibited.
Remarks 1. f
X
: X1 input clock oscillation frequency
2. Figures in parentheses apply to operation at f
X
= 10 MHz
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
179
Figure 8-4. Format of 8-Bit Timer H Mode Register 1 (TMHMD1)
TMHE1
Stops timer count operation
Enables timer count operation (count operation started by inputting clock)
TMHE1
0
1
Timer operation enable
TMHMD1
CKS12
CKS11
CKS10
TMMD11 TMMD10 TOLEV1
TOEN1
Address: FF6CH After reset: 00H R/W
f
X
f
X
/2
2
f
X
/2
4
f
X
/2
6
f
X
/2
12
f
R
/2
7
CKS12
0
0
0
0
1
1
CKS11
0
0
1
1
0
0
CKS10
0
1
0
1
0
1
(10 MHz)
(2.5 MHz)
(625 kHz)
(156.25 kHz)
(2.44 kHz)
(1.88 kHz (TYP.))
Count clock (f
CNT
) selection
Setting prohibited
Other than above
Interval timer mode
Carrier generator mode
PWM pulse generator mode
Setting prohibited
TMMD11
0
0
1
TMMD10
0
1
0
Timer operation mode
Low level
High level
TOLEV1
0
1
Timer output level control (in default mode)
Disables output
Enables output
TOEN1
0
1
Timer output control
Other than above
7
6
5
4
3
2
1
0
Caution
When TMHE1 = 1, setting the other bits of the TMHMD1 register is prohibited.
Remarks 1. f
X
: X1 input clock oscillation frequency
2. f
R
: Ring-OSC clock oscillation frequency
3. Figures in parentheses apply to operation at f
X
= 10 MHz, f
R
= 240 kHz (TYP.).
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
180
(2) 8-bit timer H carrier control register 1 (TMCYC1)
This register controls the remote control output and carrier pulse output status of 8-bit timer H1.
This register can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Figure 8-5. Format of 8-Bit Timer H Carrier Control Register 1 (TMCYC1)
0
TMCYC1
0
0
0
0
RMC1
NRZB1
NRZ1
Address: FF6DH After reset: 00H R/W
Note
Low-level output
High-level output
Low-level output
Carrier pulse output
RMC1
0
0
1
1
NRZB1
0
1
0
1
Remote control output
Carrier output disabled status (low-level status)
Carrier output enabled status
(RMC1 = 1: Carrier pulse output, RMC1 = 0: High-level status)
NRZ1
0
1
Carrier pulse output status flag
Note Bit 0 is read-only.
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
181
8.4 Operation of 8-Bit Timers H0 and H1
8.4.1 Operation as interval timer
When 8-bit timer counter Hn and compare register 0n (CMP0n) match, an interrupt request signal (INTTMHn) is
generated and 8-bit timer counter Hn is cleared to 00H.
Compare register 1n (CMP1n) is not used in interval timer mode. Since a match of 8-bit timer counter Hn and the
CMP1n register is not detected even if the CMP1n register is set, timer output is not affected.
(1) Usage
Generates the INTTMHn signal repeatedly at the same interval.
<1>
Set each register.
Figure 8-6. Register Setting in Interval Timer Mode
(i)
Setting timer H mode register n (TMHMDn)
0
0/1
0/1
0/1
0
0
0/1
0/1
TMMDn0 TOLEVn
TOENn
CKSn1
CKSn2
TMHEn
TMHMDn
CKSn0
TMMDn1
Timer output setting
Timer output level inversion setting
Interval timer mode setting
Count clock (f
CNT
) selection
Count operation stopped
(ii) CMP0n register setting
Compare value (N)
<2>
Count operation starts when TMHEn = 1.
<3>
When the values of 8-bit timer counter Hn and the CMP0n register match, the INTTMHn signal is generated
and 8-bit timer counter Hn is cleared to 00H.
Interval timer = (N +1)/f
CNT
<4>
Subsequently, the INTTMHn signal is generated at the same interval. To stop the count operation, set
TMHEn to 0.
Remark
n = 0, 1
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
182
(2) Timing chart
The timing in interval timer mode is shown below.
Figure 8-7. Timing of Interval Timer Operation (1/2)
(a) Basic operation
00H
Count clock
Count start
8-bit timer counter Hn
CMP0n
TMHEn
INTTMHn
TOHn
01H
N
Clear
Interval time
Clear
N
00H
01H
N
00H
01H 00H
<2>
Level inversion,
match interrupt occurrence,
8-bit timer counter Hn clear
<2>
Level inversion,
match interrupt occurrence,
8-bit timer counter Hn clear
<3>
<1>
<1>
The count operation is enabled by setting the TMHEn bit to 1. The count clock starts counting no more than
1 clock after the operation is enabled.
<2>
When the values of 8-bit timer counter Hn and the CMP0n register match, the value of 8-bit timer counter Hn
is cleared, the TOHn output level is inverted, and the INTTMHn signal is output.
<3>
The INTTMHn signal and TOHn output become inactive by setting the TMHEn bit to 0 during timer Hn
operation. If these are inactive from the first, the level is retained.
Remark
n = 0, 1
N = 00H to FFH
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
183
Figure 8-7. Timing of Interval Timer Operation (2/2)
(b) Operation when CMP0n = FFH
00H
Count clock
Count start
8-bit timer counter Hn
CMP0n
TMHEn
INTTMHn
TOHn
01H
FEH
Clear
Clear
FFH
00H
FEH
FFH
00H
FFH
Interval time
(c) Operation when CMP0n = 00H
Count clock
Count start
8-bit timer counter Hn
CMP0n
TMHEn
INTTMHn
TOHn
00H
00H
Interval time
Remark
n = 0, 1
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
184
8.4.2 Operation as PWM pulse generator
In PWM mode, a pulse with an arbitrary duty and arbitrary cycle can be output.
8-bit timer compare register 0n (CMP0n) controls the cycle of timer output (TOHn). Rewriting the CMP0n register
during timer operation is prohibited.
8-bit timer compare register 1n (CMP1n) controls the duty of timer output (TOHn). Rewriting the CMP1n register
during timer operation is possible.
The operation in PWM mode is as follows.
TOHn output becomes active and 8-bit timer counter Hn is cleared to 0 when 8-bit timer counter Hn and the
CMP0n register match after the timer count is started. TOHn output becomes inactive when 8-bit timer counter Hn
and the CMP1n register match.
(1) Usage
In PWM mode, a pulse for which an arbitrary duty and arbitrary cycle can be set is output.
<1>
Set each register.
Figure 8-8. Register Setting in PWM Pulse Generator Mode
(i)
Setting timer H mode register n (TMHMDn)
0
0/1
0/1
0/1
1
0
0/1
1
TMMDn0 TOLEVn
TOENn
CKSn1
CKSn2
TMHEn
TMHMDn
CKSn0
TMMDn1
Timer output enabled
Timer output level inversion setting
PWM mode selection
Count clock (f
CNT
) selection
Count operation stopped
(ii) Setting CMP0n register
Compare value (N): Cycle setting
(iii) Setting CMP1n register
Compare value (M): Duty setting
Remarks 1. n = 0, 1
2. 00H
CMP1n (M) < CMP0n (N) < FFH
<2>
The count operation starts when TMHEn = 1.
<3>
The CMP0n register is the compare register that is to be compared first after counter operation is enabled.
When the values of 8-bit timer counter Hn and the CMP0n register match, 8-bit timer counter Hn is cleared,
an interrupt request signal (INTTMHn) is generated, and TOHn output becomes active. At the same time,
the compare register to be compared with 8-bit timer counter Hn is changed from the CMP0n register to the
CMP1n register.
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
185
<4>
When 8-bit timer counter Hn and the CMP1n register match, TOHn output becomes inactive and the
compare register to be compared with 8-bit timer counter Hn is changed from the CMP1n register to the
CMP0n register. At this time, 8-bit timer counter Hn is not cleared and the INTTMHn signal is not
generated.
<5>
By performing procedures <3> and <4> repeatedly, a pulse with an arbitrary duty ratio can be obtained.
<6>
To stop the count operation, set TMHEn = 0.
If the setting value of the CMP0n register is N, the setting value of the CMP1n register is M, and the count clock
frequency is f
CNT
, the PWM pulse output cycle and duty ratio are as follows.
PWM pulse output cycle = (N+1)/f
CNT
Duty ratio = Inactive width : Active width = (M + 1) : (N M)
Caution
In PWM mode, three operation clocks (signal selected using the CKSn2 to CKSn0 bits of the
TMHMDn register) are required to transfer the CMP1n register value after rewriting the register.
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
186
(2) Timing chart
The operation timing in PWM mode is shown below.
Caution
Make sure that the CMP1n register setting value (M) and CMP0n register setting value (N) are
within the following range.
00H



CMP1n (M) < CMPn0 (N) < FFH
Remark
n = 0, 1
Figure 8-9. Operation Timing in PWM Pulse Generator Mode (1/4)
(a) Basic operation
Count clock
8-bit timer counter Hn
CMP0n
TMHEn
INTTMHn
TOHn
(TOLEVn = 0)
TOHn
(TOLEVn = 1)
00H 01H
A5H 00H 01H 02H
A5H 00H
A5H 00H
01H 02H
CMP1n
A5H
01H
<1>
<2>
<3>
<4>
<1>
The count operation is enabled by setting the TMHEn bit to 1. Start 8-bit timer counter Hn by masking one
count clock to count up. At this time, TOHn output remains inactive (when TOLEVn = 0).
<2>
When the values of 8-bit timer counter Hn and the CMP0n register match, the TOHn output level is inverted,
the value of 8-bit timer counter Hn is cleared, and the INTTMHn signal is output.
<3>
When the values of 8-bit timer counter Hn and the CMP1n register match, the level of the TOHn output is
returned. At this time, the 8-bit timer counter value is not cleared and the INTTMHn signal is not output.
<4>
Setting the TMHEn bit to 0 during timer Hn operation makes the INTTMHn signal and TOHn output inactive.
Remark
n = 0, 1
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
187
Figure 8-9. Operation Timing in PWM Pulse Generator Mode (2/4)
(b) Operation when CMP0n = FFH, CMP1n = 00H
Count clock
8-bit timer counter Hn
CMP0n
TMHEn
INTTMHn
TOHn
(TOLEVn = 0)
00H 01H
FFH 00H 01H 02H
FFH 00H
FFH 00H
01H 02H
CMP1n
FFH
00H
(c) Operation when CMP0n = FFH, CMP1n = FEH
Count clock
8-bit timer counter Hn
CMP0n
TMHEn
INTTMHn
TOHn
(TOLEVn = 0)
00H 01H
FEH FFH 00H 01H
FEH FFH 00H 01H
FEH FFH 00H
CMP1n
FFH
FEH
Remark
n = 0, 1
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
188
Figure 8-9. Operation Timing in PWM Pulse Generator Mode (3/4)
(d) Operation when CMP0n = 01H, CMP1n = 00H
Count clock
8-bit timer counter Hn
CMP0n
TMHEn
INTTMHn
TOHn
(TOLEVn = 0)
01H
00H
01H 00H 01H 00H
00H 01H 00H 01H
CMP1n
00H
Remark
n = 0, 1
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
189
Figure 8-9. Operation Timing in PWM Pulse Generator Mode (4/4)
(e) Operation by changing CMP1n (CMP1n = 01H
03H, CMP0n = A5H)
Count clock
8-bit timer counter Hn
CMP0n
TMHEn
INTTMHn
TOHn
(TOLEVn = 0)
00H 01H 02H
A5H 00H 01H 02H 03H
A5H 00H 01H 02H 03H
A5H 00H
CMP1n
01H
A5H
03H
01H (03H)
<1>
<3>
<4>
<2>
<2>'
<5>
<6>
<1>
The count operation is enabled by setting TMHEn = 1. Start 8-bit timer counter Hn by masking one count
clock to count up. At this time, the TOHn output remains inactive (when TOLEVn = 0).
<2>
The CMP1n register value can be changed during timer counter operation. This operation is asynchronous
to the count clock.
<3>
When the values of 8-bit timer counter Hn and the CMP0n register match, the value of 8-bit timer counter Hn
is cleared, the TOHn output becomes active, and the INTTMHn signal is output.
<4>
If the CMP1n register value is changed, the value is latched and not transferred to the register. When the
values of 8-bit timer counter Hn and the CMP1n register before the change match, the value is transferred to
the CMP1n register and the CMP1n register value is changed (<2>').
However, three count clocks or more are required from when the CMP1n register value is changed to when
the value is transferred to the register. If a match signal is generated within three count clocks, the changed
value cannot be transferred to the register.
<5>
When the values of 8-bit timer counter Hn and the CMP1n register after the change match, the TOHn output
becomes inactive. 8-bit timer counter Hn is not cleared and the INTTMHn signal is not generated.
<6>
Setting the TMHEn bit to 0 during timer Hn operation makes the INTTMHn signal and TOHn output inactive.
Remark
n = 0, 1
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
190
8.4.3 Carrier generator mode operation (8-bit timer H1 only)
The carrier clock generated by 8-bit timer H1 is output in the cycle set by 8-bit timer/event counter 51.
In carrier generator mode, the output of the 8-bit timer H1 carrier pulse is controlled by 8-bit timer/event counter 51,
and the carrier pulse is output from the TOH1 output.
In carrier generator mode, the connection between 8-bit timer H1 and 8-bit timer/event counter 51 is as shown
below.
Figure 8-10. Example of Connection Between 8-Bit Timer H1 and 8-Bit Timer/Event Counter 51
8-bit timer/event counter 51
Prescaler
CPU
INTC
INTTM51
INTTM51
INTTM5H1
INTTMH1
8-bit timer H1
TO51
TOH1
Selector
TMMD01,
TMMD11
(1) Carrier generation
In carrier generator mode, 8-bit timer H compare register 01 (CMP01) generates a low-level width carrier pulse
waveform and 8-bit timer H compare register 11 (CMP11) generates a high-level width carrier pulse waveform.
Rewriting the CMP11 register during 8-bit timer H1 operation is possible but rewriting the CMP01 register is
prohibited.
(2) Carrier output control
Carrier output is controlled by the interrupt request signal (INTTM51) of 8-bit timer/event counter 51 and the
NRZ1 and RMC1 bits of the 8-bit timer H carrier control register (TMCYC1). The relationship between the
outputs is shown below.
RMC1 Bit
NRZ1 Bit
Output
0
0
Low-level output
0
1
High-level output
1
0
Low-level output
1
1
Carrier pulse output
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
191
To control the carrier pulse output during a count operation, the NRZ1 and NRZB1 bits of the TMCYC1 register
have a master and slave bit configuration. The NRZ1 bit is read-only but the NRZB1 bit can be read and written.
The INTTM51 signal is synchronized with the 8-bit timer H1 clock and output as the INTTM5H1 signal. The
INTTM5H1 signal becomes the data transfer signal of the NRZ1 bit, and the NRZB1 bit value is transferred to the
NRZ1 bit. The timing for transfer from the NRZB1 bit to the NRZ1 bit is as shown below.
Figure 8-11. Transfer Timing
8-bit timer H1
count clock
TMHE1
INTTM51
INTTM5H1
NRZ1
NRZB1
RMC1
1
1
1
0
0
0
<1>
<2>
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
192
(3) Usage
Outputs an arbitrary carrier clock from the TOH1 pin.
<1>
Set each register.
Figure 8-12. Register Setting in Carrier Generator Mode
(i)
Setting 8-bit timer H mode register 1 (TMHMD1)
0
0/1
0/1
0/1
0
Timer output enabled
Timer output level inversion setting
Carrier generator mode selection
Count clock (f
CNT
) selection
Count operation stopped
1
0/1
0/1
TMMD10 TOLEV1
TOEN1
CKS11
CKS12
TMHE1
TMHMD1
CKS10
TMMD11
(ii) CMP01 register setting
Compare value
(iii) CMP11 register setting
Compare value
(iv) TMCYC1 register setting
RMC1 = 1 ... Remote control output enable bit
NRZB1 = 0/1 ... carrier output enable bit
(v) TCL51 and TMC51 register setting
Refer to 7.3 Registers Controlling 8-Bit Timer/Event Counters 50 and 51.
<2>
When TMHE1 = 1, 8-bit timer H1 starts counting.
<3>
When TCE51 of 8-bit timer mode control register 51 (TMC51) is set to 1, 8-bit timer/event counter 51 starts
counting.
<4>
After the count operation is enabled, the first compare register to be compared is the CMP01 register.
When the count value of 8-bit timer counter H1 and the CMP01 register value match, the INTTMH1 signal
is generated, 8-bit timer counter H1 is cleared, and at the same time, the compare register to be compared
with 8-bit timer counter H1 is switched from the CMP01 register to the CMP11 register.
<5>
When the count value of 8-bit timer counter H1 and the CMP11 register value match, the INTTMH1 signal
is generated, 8-bit timer counter H1 is cleared, and at the same time, the compare register to be compared
with 8-bit timer counter H1 is switched from the CMP11 register to the CMP01 register.
<6>
By performing procedures <4> and <5> repeatedly, a carrier clock is generated.
<7>
The INTTM51 signal is synchronized with 8-bit timer H1 and output as the INTTM5H1 signal. The
INTTM5H1 signal becomes the data transfer signal for the NRZB1 bit, and the NRZB1 bit value is
transferred to the NRZ1 bit.
<8>
When the NRZ1 bit is high level, a carrier clock is output from the TOH1 pin.
<9>
By performing the procedures above, an arbitrary carrier clock is obtained. To stop the count operation, set
TMHE1 to 0.
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
193
If the setting value of the CMP01 register is 1, the setting value of the CMP11 register is M, and the count clock
frequency is f
CNT
, the carrier clock output cycle and duty ratio are as follows.
Carrier clock output cycle = (1 + M + 2)/f
CNT
Duty ratio = High-level width : Low-level width = ( M + 1) : (1 + 1)
(4) Timing chart
The carrier output control timing is shown below.
Cautions 1. Set the values of the CMP01 and CMP11 registers in a range of 01H to FFH.
2. In the carrier generator mode, three operating clocks (signal selected by CKS12 to CKS10
bits of TMHMD1 register) or more are required from when the CMP11 register value is
changed to when the value is transferred to the register.
3. Be sure to set the RMC1 bit before the count operation is started.
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
194
Figure 8-13. Carrier Generator Mode Operation Timing (1/3)
(a) Operation when CMP01 = 1, CMP11 = 1
CMP01
CMP11
TMHE1
INTTMH1
Carrier clock
00H
N
00H
N
00H
N
00H
N
00H
N
00H
N
N
N
8-bit timer 51
count clock
TM51 count value
CR51
TCE51
TOH1
0
0
1
1
0
0
1
1
0
0
INTTM51
NRZB1
NRZ1
Carrier clock
00H 01H
L
00H 01H
L
00H 01H
L
00H 01H
00H 01H
L
L
<1> <2>
<3>
<4>
<5>
<6>
<7>
8-bit timer H1
count clock
8-bit timer counter
H1 count value
<1>
When TMHE1 = 0 and TCE51 = 0, 8-bit timer H1 operation is stopped.
<2>
When TMHE1 = 1 is set, 8-bit timer H1 starts a count operation. At that time, the carrier clock is held at the
inactive level.
<3>
When the count value of 8-bit timer counter H1 matches the CMP01 register value, the first INTTMH1 signal
is generated, the carrier clock signal is inverted, and the compare register to be compared with 8-bit timer
counter H1 is switched from the CMP01 register to the CMP11 register. 8-bit timer counter H1 is cleared to
00H.
<4>
When the count value of 8-bit timer counter H1 matches the CMP11 register value, the INTTMH1 signal is
generated, the carrier clock signal is inverted, and the compare register to be compared with 8-bit timer
counter H1 is switched from the CMP11 register to the CMP01 register. 8-bit timer counter H1 is cleared to
00H. By performing procedures <3> and <4> repeatedly, a carrier clock with duty ratio fixed to 50% is
generated.
<5>
When the INTTM51 signal is generated, it is synchronized with 8-bit timer H1 and output as the INTTM5H1
signal.
<6>
The INTTM5H1 signal becomes the data transfer signal for the NRZB1 bit, and the NRZB1 bit value is
transferred to the NRZ1 bit.
<7>
When NRZ1 = 0 is set, the TOH1 output becomes low level.
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
195
Figure 8-13. Carrier Generator Mode Operation Timing (2/3)
(b) Operation when CMP01 = 1, CMP11 = M (operation when carrier clock phase is asynchronous to NRZ1 phase)
N
L
CMP01
CMP11
TMHE1
INTTMH1
Carrier clock
TM51 count value
00H
N
00H 01H
M
00H
N
00H 01H
M
00H
00H
N
M
CR51
TCE51
TOH1
0
0
1
1
0
0
1
1
0
0
INTTM51
NRZB1
NRZ1
Carrier clock
00H 01H
L
00H 01H
L
00H 01H
L
00H 01H
00H 01H
L
<1> <2>
<3>
<4>
<5>
<6>
<7>
8-bit timer 51
count clock
8-bit timer H1
count clock
8-bit timer counter
H1 count value
<1>
When TMHE1 = 0 and TCE51 = 0, 8-bit timer H1 operation is stopped.
<2>
When TMHE1 = 1 is set, 8-bit timer H1 starts a count operation. At that time, the carrier clock is held at the
inactive level.
<3>
When the count value of 8-bit timer counter H1 matches the CMP01 register value, the first INTTMH1 signal
is generated, the carrier clock signal is inverted, and the compare register to be compared with 8-bit timer
counter H1 is switched from the CMP01 register to the CMP11 register. 8-bit timer counter H1 is cleared to
00H.
<4>
When the count value of 8-bit timer counter H1 matches the CMP11 register value, the INTTMH1 signal is
generated, the carrier clock signal is inverted, and the compare register to be compared with 8-bit timer
counter H1 is switched from the CMP11 register to the CMP01 register. 8-bit timer counter H1 is cleared to
00H. By performing procedures <3> and <4> repeatedly, a carrier clock with duty ratio fixed to other than
50% is generated.
<5>
When the INTTM51 signal is generated, it is synchronized with 8-bit timer H1 and output as the INTTM5H1
signal.
<6>
When the carrier clock phase becomes asynchronous to the NRZ1 bit phase, a carrier signal is output at the
first rising edge of the carrier clock if NRZ1 is set to 1.
<7>
When NRZ1 = 0, the TOH1 output is held at the high level and is not changed to low level while the carrier
clock is high level (from <6> and <7>, the high-level width of the carrier clock waveform is guaranteed).
CHAPTER 8 8-BIT TIMERS H0 AND H1
Preliminary User's Manual U16227EJ1V0UD
196
Figure 8-13. Carrier Generator Mode Operation Timing (3/3)
(c) Operation when CMP11 is changed
8-bit timer H1
count clock
CMP01
TMHE1
INTTMH1
Carrier clock
00H 01H
N
00H 01H
01H
M
00H
N
00H
L
00H
<1>
<3>'
<4>
<3>
<2>
CMP11
<5>
M
N
L
M (L)
8-bit timer counter
H1 count value
<1>
When TMHE1 = 1 is set, 8-bit timer H1 starts a count operation. At that time, the carrier clock is held at the
inactive level.
<2>
When the count value of 8-bit timer counter H1 matches the CMP01 register value, 8-bit timer counter H1 is
cleared and the INTTMH1 signal is output.
<3>
The CMP11 register can be rewritten during 8-bit timer H1 operation, however, the changed value (L) is
latched. The CMP11 register is changed when the count value of 8-bit timer counter H1 and the CMP11
register value before the change (M) match (<3>').
<4>
When the count value of 8-bit timer counter H1 and the CMP11 register value before the change (M) match,
the INTTMH1 signal is output, the carrier signal is inverted, and 8-bit timer counter H1 is cleared to 00H.
<5>
The timing at which the count value of 8-bit timer counter H1 and the CMP11 register value match again is
indicated by the value after the change (L).
Preliminary User's Manual U16227EJ1V0UD
197
CHAPTER 9 WATCH TIMER
9.1 Functions of Watch Timer
The watch timer has the following functions.
Watch timer
Interval timer
The watch timer and the interval timer can be used simultaneously.
Figure 9-1 shows the watch timer block diagram.
Figure 9-1. Watch Timer Block Diagram
f
X
/2
7
f
W
/2
4
f
W
/2
5
f
W
/2
6
f
W
/2
7
f
W
/2
8
f
W
/2
10
f
W
/2
11
f
W
/2
9
f
XT
INTWT
INTWTI
WTM0
WTM1
WTM2
WTM3
WTM4
WTM5
WTM6
WTM7
f
W
Clear
11-bit prescaler
Clear
5-bit counter
Watch timer operation
mode register (WTM)
Internal bus
Selector
Selector
Selector
Selector
Remark
f
X
: X1 input clock oscillation frequency
f
XT
: Subsystem clock oscillation frequency
f
W
: Watch timer clock frequency
CHAPTER 9 WATCH TIMER
Preliminary User's Manual U16227EJ1V0UD
198
(1) Watch timer
When the X1 input clock or subsystem clock is used, interrupt requests (INTWT) are generated at preset
intervals.
Table 9-1. Watch Timer Interrupt Time
Interrupt Time
When Operated at f
XT
= 32.768 kHz
When Operated at f
X
= 10 MHz
2
4
/f
W
488
s
205
s
2
5
/f
W
977
s
410
s
2
13
/f
W
0.25 s
0.105 s
2
14
/f
W
0.5 s
0.210 s
Remark
f
X
: X1 input clock oscillation frequency
f
XT
: Subsystem clock oscillation frequency
f
W
: Watch timer clock frequency
(2) Interval timer
Interrupt requests (INTWTI) are generated at preset time intervals.
Table 9-2. Interval Timer Interval Time
Interval Time
When Operated at f
XT
= 32.768 kHz
When Operated at f
X
= 10 MHz
2
4
/f
W
488
s
205
s
2
5
/f
W
977
s
410
s
2
6
/f
W
1.95 ms
820
s
2
7
/f
W
3.91 ms
1.64 ms
2
8
/f
W
7.81 ms
3.28 ms
2
9
/f
W
15.6 ms
6.55 ms
2
10
/f
W
31.2 ms
13.1 ms
2
11
/f
W
62.4 ms
26.2 ms
Remark
f
X
: X1 input clock oscillation frequency
f
XT
: Subsystem clock oscillation frequency
f
W
: Watch timer clock frequency
CHAPTER 9 WATCH TIMER
Preliminary User's Manual U16227EJ1V0UD
199
9.2 Configuration of Watch Timer
The watch timer consists of the following hardware.
Table 9-3. Watch Timer Configuration
Item
Configuration
Counter
5 bits
1
Prescaler
11 bits
1
Control register
Watch timer operation mode register (WTM)
9.3 Register Controlling Watch Timer
The watch timer is controlled by the watch timer operation mode register (WTM).



Watch timer operation mode register (WTM)
This register sets the watch timer count clock, enables/disables operation, prescaler interval time, and 5-bit
counter operation control.
WTM is set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears WTM to 00H.
CHAPTER 9 WATCH TIMER
Preliminary User's Manual U16227EJ1V0UD
200
Figure 9-2. Format of Watch Timer Operation Mode Register (WTM)
Address: FF6FH After reset: 00H R/W
Symbol
7
6
5
4
3
2
<1>
<0>
WTM
WTM7
WTM6
WTM5
WTM4
WTM3
WTM2
WTM1
WTM0
WTM7
Watch timer count clock selection
0
f
X
/2
7
(78.125 kHz)
1
f
XT
(32.768 kHz)
WTM6
WTM5
WTM4
Prescaler interval time selection
0
0
0
2
4
/f
W
0
0
1
2
5
/f
W
0
1
0
2
6
/f
W
0
1
1
2
7
/f
W
1
0
0
2
8
/f
W
1
0
1
2
9
/f
W
1
1
0
2
10
/f
W
1
1
1
2
11
/f
W
WTM3
WTM2
Interrupt time selection
0
0
2
14
/f
W
0
1
2
13
/f
W
1
0
2
5
/f
W
1
1
2
4
/f
W
WTM1
5-bit counter operation control
0
Clear after operation stop
1
Start
WTM0
Watch timer operation enable
0
Operation stop (clear both prescaler and timer)
1
Operation enable
Caution
Do not change the count clock and interval time (by setting bits 4 to 7 (WTM4 to WTM7) of WTM)
during watch timer operation.
Remarks 1. f
W
: Watch timer clock frequency (f
X
/2
7
or f
XT
)
2. f
X
: X1 input clock oscillation frequency
3. f
XT
: Subsystem clock oscillation frequency
4. Figures in parentheses apply to operation with f
X
= 10 MHz, f
XT
= 32.768 kHz.
CHAPTER 9 WATCH TIMER
Preliminary User's Manual U16227EJ1V0UD
201
9.4 Watch Timer Operations
9.4.1 Watch timer operation
The watch timer generates an interrupt request (INTWT) at a specific time interval by using the X1 input clock or
subsystem clock.
When bit 0 (WTM0) and bit 1 (WTM1) of the watch timer operation mode register (WTM) are set to 1, the count
operation starts. When these bits are set to 0, the 5-bit counter is cleared and the count operation stops.
When the interval timer is simultaneously operated, zero-second start can be achieved only for the watch timer by
setting WTM1 to 0. In this case, however, the 11-bit prescaler is not cleared. Therefore, an error up to 2
11
1/f
W
seconds occurs in the first overflow (INTWT) after zero-second start.
The interrupt request is generated at the following time intervals.
Table 9-4. Watch Timer Interrupt Time
WTM3
WTM2
Interrupt Time Selection
When Operated at f
XT
= 32.768 kHz
(WTM7 = 1)
When Operated at f
X
= 10 MHz
(WTM7 = 0)
0
0
2
14
/f
W
0.5 s
0.210 s
0
1
2
13
/f
W
0.25 s
0.105 s
1
0
2
5
/f
W
977
s
410
s
1
1
2
4
/f
W
488
s
205
s
Remark
f
X
:
X1 input clock oscillation frequency
f
XT
: Subsystem clock oscillation frequency
f
W
: Watch timer clock frequency
CHAPTER 9 WATCH TIMER
Preliminary User's Manual U16227EJ1V0UD
202
9.4.2 Interval timer operation
The watch timer operates as interval timer which generates interrupt requests (INTWTI) repeatedly at an interval of
the preset count value.
The interval time can be selected with bits 4 to 6 (WTM4 to WTM6) of the watch timer operation mode register
(WTM).
When bit 0 (WTM0) of the WTM is set to 1, the count operation starts. When this bit is set to 0, the count operation
stops.
Table 9-5. Interval Timer Interval Time
WTM6
WTM5
WTM4
Interval Time
When Operated at
f
XT
= 32.768 kHz (WTM7 = 1)
When Operated at
f
X
= 10 MHz (WTM7 = 0)
0
0
0
2
4
/f
W
488
s
205
s
0
0
1
2
5
/f
W
977
s
410
s
0
1
0
2
6
/f
W
1.95 ms
820
s
0
1
1
2
7
/f
W
3.91 ms
1.64 ms
1
0
0
2
8
/f
W
7.81 ms
3.28 ms
1
0
1
2
9
/f
W
15.6 ms
6.55 ms
1
1
0
2
10
/f
W
31.2 ms
13.1 ms
1
1
1
2
11
/f
W
62.4 ms
26.2 ms
Remark
f
X
:
X1 input clock oscillation frequency
f
XT
: Subsystem clock oscillation frequency
f
W
: Watch timer clock frequency
CHAPTER 9 WATCH TIMER
Preliminary User's Manual U16227EJ1V0UD
203
Figure 9-3. Operation Timing of Watch Timer/Interval Timer
0H
Start
Overflow
Overflow
5-bit counter
Count clock
f
W
/2
11
Watch timer
interrupt INTWT
Interval timer
interrupt INTWTI
Interrupt time of watch timer (0.5 s)
Interval time
(T)
T
Interrupt time of watch timer (0.5 s)
n
T
n
T
Caution
When operation of the watch timer and 5-bit counter is enabled by the watch timer mode control
register (WTM) (by setting bits 0 (WTM0) and 1 (WTM1) of WTM to 1), the interval until the first
interrupt request (INTWT) is generated after the register is set does not exactly match the
specification made with bit 3 (WTM3) of WTM. This is because there is a delay of one 11-bit
prescaler output cycle until the 5-bit counter starts counting. Subsequently, however, the INTWT
signal is generated at the specified intervals.
Remark
f
W
: Watch timer clock frequency
n:
The number of times of interval timer operations
Figures in parentheses are for operation with f
W
= 32.768 kHz (WTM7 = 1, WTM3, WTM2 = 0, 0)
Preliminary User's Manual U16227EJ1V0UD
204
CHAPTER 10 WATCHDOG TIMER
10.1 Functions of Watchdog Timer
The watchdog timer detects an inadvertent program loop. If a program loop is detected, an internal reset signal
(WDTRES) is generated.
When a reset occurs due to the watchdog timer, bit 4 (WDTRF) of the reset control flag register (RESF) is set to 1.
For details of RESF, refer to CHAPTER 18 RESET FUNCTION.
Table 10-1. Loop Detection Time of Watchdog Timer
Loop Detection Time
During Ring-OSC Clock Operation
During X1 Input Clock Operation
f
R
/2
11
(8.53 ms)
f
XP
/2
13
(819.2
s)
f
R
/2
12
(17.07 ms)
f
XP
/2
14
(1.64 ms)
f
R
/2
13
(34.13 ms)
f
XP
/2
15
(3.28 ms)
f
R
/2
14
(68.27 ms)
f
XP
/2
16
(6.55 ms)
f
R
/2
15
(136.53 ms)
f
XP
/2
17
(13.11 ms)
f
R
/2
16
(273.07 ms)
f
XP
/2
18
(26.21 ms)
f
R
/2
17
(546.13 ms)
f
XP
/2
19
(52.43 ms)
f
R
/2
18
(1.09 s)
f
XP
/2
20
(104.86 ms)
Remarks 1. f
R
: Ring-OSC clock oscillation frequency
2. f
XP
: X1 input clock oscillation frequency
3. Figures in parentheses apply to operation at f
R
= 240 kHz (TYP.), f
XP
= 10 MHz
The operation mode of the watchdog timer (WDT) is switched according to the mask option setting of the on-chip
Ring-OSC as shown in Table 10-2.
CHAPTER 10 WATCHDOG TIMER
Preliminary User's Manual U16227EJ1V0UD
205
Table 10-2. Mask Option Setting and Watchdog Timer Operation Mode
Mask Option
Ring-OSC Cannot Be Stopped
Ring-OSC Can Be Stopped by Software
Watchdog timer clock
source
Fixed to f
R
Note 1
.
Selectable by software (f
XP
, f
R
or
stopped)
When reset is released: f
R
Operation after reset
Operation starts with the maximum
interval (f
R
/2
18
).
Operation starts with maximum
interval (f
R
/2
18
).
Operation mode selection
The interval can be changed only
once.
The clock selection/interval can be
changed only once.
Features
The watchdog timer cannot be
stopped.
Current in STOP mode 10
A
The watchdog timer can be stopped in
standby mode
Note 2
.
Notes 1.
As long as power is being supplied, Ring-OSC oscillation cannot be stopped (except in the reset
period).
2.
Clock supply to the watchdog timer is stopped in accordance with the watchdog timer clock
source as follows:
<1> When the clock source is f
XP
Clock supply to the watchdog timer is stopped while f
XP
is stopped, during HALT/STOP
instruction execution, and during the oscillation stabilization time.
<2> When the clock source is f
R
Clock supply to the watchdog timer is stopped if f
R
is stopped by software before STOP
instruction execution when the CPU clock is f
XP
and during HALT/STOP instruction
execution.
Remarks 1. f
R
: Ring-OSC clock oscillation frequency
2. f
XP
: X1 input clock oscillation frequency
CHAPTER 10 WATCHDOG TIMER
Preliminary User's Manual U16227EJ1V0UD
206
10.2 Configuration of Watchdog Timer
The watchdog timer consists of following hardware.
Table 10-3. Configuration of Watchdog Timer
Item
Configuration
Control registers
Watchdog timer mode register (WDTM)
Watchdog timer enable register (WDTE)
Figure 10-1. Block Diagram of Watchdog Timer
f
R
/2
2
Clock
input
controller
Output
controller
WDTRES
(internal reset signal)
WDCS2
Internal bus
WDCS1 WDCS0
f
XP
/2
4
WDCS3
WDCS4
0
1
1
Selector
16-bit
counter
f
XP
/2
13
to
f
XP
/2
20
or
f
R
/2
11
to
f
R
/2
18
Watchdog timer enable
register (WDTE)
Watchdog timer mode
register (WDTM)
3
3
2
Clear
Mask option
(to set "Ring-OSC
cannot be stopped" or
"Ring-OSC can be
stopped by software")
CHAPTER 10 WATCHDOG TIMER
Preliminary User's Manual U16227EJ1V0UD
207
10.3 Registers Controlling Watchdog Timer
The watchdog timer is controlled by the following two registers.
Watchdog timer mode register (WDTM)
Watchdog timer enable register (WDTE)
(1) Watchdog timer mode register (WDTM)
This register sets the overflow time and operation clock of the watchdog timer.
This register can be set by an 8-bit memory manipulation instruction and can be read many times, but can be
written only once after reset is released.
RESET input sets this register to 67H.
Figure 10-2. Format of Watchdog Timer Mode Register (WDTM)
0
WDCS0
1
WDCS1
2
WDCS2
3
WDCS3
4
WDCS4
5
1
6
1
7
0
Symbol
WDTM
Address: FF98H After reset: 67H R/W
WDCS4
Note 1
WDCS3
Note 1
Operation clock selection
0
0
Ring-OSC clock (f
R
)
0
1
X1 input clock (f
XP
)
1
Watchdog timer operation stopped
Overflow time setting
WDCS2
Note 2
WDCS1
Note 2
WDCS0
Note 2
During Ring-OSC clock
operation
Note 3
During X1 input clock operation
0
0
0
f
R
/2
11
(8.53 ms)
f
XP
/2
13
(819.2
s)
0
0
1
f
R
/2
12
(17.07 ms)
f
XP
/2
14
(1.64 ms)
0
1
0
f
R
/2
13
(34.13 ms)
f
XP
/2
15
(3.28 ms)
0
1
1
f
R
/2
14
(68.27 ms)
f
XP
/2
16
(6.55 ms)
1
0
0
f
R
/2
15
(136.53 ms)
f
XP
/2
17
(13.11 ms)
1
0
1
f
R
/2
16
(273.07 ms)
f
XP
/2
18
(26.21 ms)
1
1
0
f
R
/2
17
(546.13 ms)
f
XP
/2
19
(52.43 ms)
1
1
1
f
R
/2
18
(1.09 s)
f
XP
/2
20
(104.86 ms)
Notes 1.
If "Ring-OSC cannot be stopped" is specified by a mask option, this cannot be set. The Ring-
OSC clock will be selected no matter what value is written.
2.
Reset is released at the maximum cycle (WDCS2, 1, 0 = 1, 1, 1).
3.
Ring-OSC clock oscillation frequency: 120 kHz (MIN.), 240 kHz (TYP.), or 480 kHz (MAX.)
Caution
If data is written to WDTM, a wait cycle is generated. For details, refer to CHAPTER 27
CAUTIONS FOR WAIT.
CHAPTER 10 WATCHDOG TIMER
Preliminary User's Manual U16227EJ1V0UD
208
Cautions 1. Set bits 7, 6, and 5 to 0, 1, and 1, respectively (when "Ring-OSC cannot be stopped"
is selected by a mask option, other values are ignored).
2. After reset is released, WDTM can be written only once by an 8-bit memory
manipulation instruction. If writing attempted a second time, an internal reset signal
is generated.
3. WDTM cannot be set by a 1-bit memory manipulation instruction.
Remarks 1. f
R
: Ring-OSC clock oscillation frequency
2. f
XP
: X1 input clock oscillation frequency
3.
: Don't care
4. Figures in parentheses apply to operation at f
R
= 240 kHz (TYP.), f
XP
= 10 MHz
(2) Watchdog timer enable register (WDTE)
Writing ACH to WDTE clears the watchdog timer counter and starts counting again.
This register can be set by an 8-bit memory manipulation instruction.
RESET input sets this register to 9AH.
Figure 10-3. Format of Watchdog Timer Enable Register (WDTE)
0
1
2
3
4
5
6
7
Symbol
WDTE
Address: FF99H After reset: 9AH R/W
Cautions 1. If a value other than ACH is written to WDTE, an internal reset signal is generated.
2. If a 1-bit memory manipulation instruction is executed for WDTE, an internal reset
signal is generated (an error occurs in the assembler).
3. The value read from WDTE is 9AH (this differs from the written value (ACH)).
CHAPTER 10 WATCHDOG TIMER
Preliminary User's Manual U16227EJ1V0UD
209
10.4 Operation of Watchdog Timer
10.4.1 Watchdog timer operation when "Ring-OSC cannot be stopped" is selected by a mask option
The operation clock of watchdog timer is fixed to the Ring-OSC.
After reset is released, operation is started at the maximum cycle (bits 2, 1, and 0 (WDCS2, WDCS1, WDCS0) of
the watchdog timer mode register (WDTM) = 1, 1, 1). The watchdog timer operation cannot be stopped.
The following shows the watchdog timer operation after reset release.
1.
The status after reset release is as follows.
Operation clock: Ring-OSC clock
Cycle: f
R
/2
18
(1.09 seconds: At operation with f
R
= 240 kHz (TYP.))
Counting starts
2.
The following should be set in the watchdog timer mode register (WDTM) by an 8-bit memory manipulation
instruction
Notes 1, 2
.
Cycle: Set using bits 2 to 0 (WDCS2 to WDCS0)
3.
After the above procedures are executed, writing ACH to WDTE clears the count to 0, enabling recounting.
Notes 1.
The operation clock (Ring-OSC clock) cannot be changed. If any value is written to bits 3 and 4
(WDCS3, WDCS4) of WDTM, it is ignored.
2.
As soon as WDTM is written, the counter of the watchdog timer is cleared.
Caution
In this mode, operation of the watchdog timer absolutely cannot be stopped even during STOP
instruction execution. For 8-bit timer H1 (TMH1), a division of the Ring-OSC can be selected as
the count source, so clear the watchdog timer using the interrupt request of TMH1 before the
watchdog timer overflows. If this processing is not performed, an internal reset signal is
generated when the watchdog timer overflows after STOP instruction execution.
CHAPTER 10 WATCHDOG TIMER
Preliminary User's Manual U16227EJ1V0UD
210
10.4.2 Watchdog timer operation when "Ring-OSC can be stopped by software" is selected by mask option
The operation clock of the watchdog timer can be selected as either the Ring-OSC clock or the X1 input clock.
After reset is released, operation is started at the maximum cycle (bits 2, 1, and 0 (WDCS2, WDCS1, WDCS0) of
the watchdog timer mode register (WDTM) = 1, 1, 1).
The following shows the watchdog timer operation after reset release.
1.
The status after reset release is as follows.
Operation clock: Ring-OSC clock oscillation frequency (f
R
)
Cycle: f
R
/2
18
(1.09 seconds: At operation with f
R
= 240 kHz (TYP.))
Counting starts
2.
The following should be set in the watchdog timer mode register (WDTM) by an 8-bit memory manipulation
instruction
Notes 1, 2, 3
.
Operation clock: Any of the following can be selected using bits 3 and 4 (WDCS3 and WDCS4).
Ring-OSC clock (f
R
)
X1 input clock (f
XP
)
Watchdog timer operation stopped
Cycle: Set using bits 2 to 0 (WDCS2 to WDCS0)
3.
After the above procedures are executed, writing ACH to WDTE clears the count to 0, enabling recounting.
Notes 1.
As soon as WDTM is written, the counter of the watchdog timer is cleared.
2.
Set bits 7, 6, and 5 to 0, 1, 1, respectively. If other values are set, the watchdog timer cannot be
operated (an error occurs in the assembler).
3.
If the watchdog timer is stopped by setting WDCS4 and WDCS3 to 1 and
, respectively, an internal
reset signal is not generated even if the following processing is performed.
WDTM is written a second time.
A 1-bit memory manipulation instruction is executed to WDTE.
A value other than ACH is written to WDTE.
Caution
In this mode, watchdog timer operation is stopped during HALT/STOP instruction execution.
After HALT/STOP mode is released, counting is started again using the operation clock of the
watchdog timer set before HALT/STOP instruction execution by WDTM. At this time, the counter
is not cleared to 0.
For the watchdog timer operation during STOP mode and HALT mode in each status, refer to 10.4.3 Watchdog
timer operation in STOP mode and 10.4.4 Watchdog timer operation in HALT mode.
CHAPTER 10 WATCHDOG TIMER
Preliminary User's Manual U16227EJ1V0UD
211
10.4.3 Watchdog timer operation in STOP mode (when "Ring-OSC can be stopped by software" is selected
by mask option)
The watchdog timer stops counting during STOP instruction execution regardless of whether the X1 input clock or
Ring-OSC clock is being used.
(1) When the CPU clock and the watchdog timer operation clock are the X1 input clock (f
XP
) when the STOP
instruction is executed
When STOP instruction is executed, operation of the watchdog timer is stopped. After STOP mode is released,
counting stops for the oscillation stabilization time set by the oscillation stabilization time select register (OSTS)
and then counting is started again using the operation clock before the operation was stopped. At this time, the
counter is not cleared to 0.
Figure 10-4. Operation in STOP Mode (CPU Clock and WDT Operation Clock: X1 Input Clock)
Watchdog timer
Operating
Operation stopped
Operating
f
R
f
XP
CPU operation
Normal
operation
STOP
Oscillation stabilization time
Normal operation
Oscillation
stopped
Oscillation stabilization time
(set by OSTS register)
(2) When the CPU clock is the X1 input clock (f
XP
) and the watchdog timer operation clock is the Ring-OSC
clock (f
R
) when the STOP instruction is executed
When the STOP instruction is executed, operation of the watchdog timer is stopped. After STOP mode is
released, counting is started again using the operation clock before the operation was stopped. At this time, the
counter is not cleared to 0.
Figure 10-5. Operation in STOP Mode
(CPU Clock: X1 Input Clock, WDT Operation Clock: Ring-OSC Clock)
Watchdog timer
Operating
f
R
f
XP
CPU operation
Normal
operation
STOP
Oscillation stabilization time
Normal operation
Oscillation
stopped
Oscillation stabilization time
(set by OSTS register)
Operating Operation stopped
CHAPTER 10 WATCHDOG TIMER
Preliminary User's Manual U16227EJ1V0UD
212
(3) When the CPU clock is the Ring-OSC clock (f
R
) and the watchdog timer operation clock is the X1 input
clock (f
XP
) when the STOP instruction is executed
When the STOP instruction is executed, operation of the watchdog timer is stopped. After STOP mode is
released, counting is stopped until the timing of <1> or <2>, whichever is earlier, and then counting is started
using the operation clock before the operation was stopped. At this time, the counter is not cleared to 0
<1>
The oscillation stabilization time set by the oscillation stabilization time select register (OSTS) elapses.
<2>
The CPU clock is switched to the X1 input clock (f
XP
).
Figure 10-6. Operation in STOP Mode
(CPU Clock: Ring-OSC Clock, WDT Operation Clock: X1 Input Clock)
<1>
Timing when counting is started after the oscillation stabilization time set by the oscillation stabilization time
select register (OSTS) has elapsed
Watchdog timer
Operating
Operation stopped
Operating
f
R
f
XP
CPU operation
17 clocks
Normal operation
(Ring-OSC clock)
Clock supply stopped
Normal operation (Ring-OSC clock)
Oscillation
stopped
STOP
Oscillation stabilization time
(set by OSTS register)
<2>
Timing when counting is started after the CPU clock is switched to the X1 input clock (f
XP
)
Operating
Operation stopped
Operating
f
R
f
XP
f
R
f
XP
Note
CPU operation
17 clocks
Normal operation
(Ring-OSC clock)
Clock supply
stopped
Normal operation (Ring-OSC clock)
Normal operation (X1 input clock)
CPU clock
Oscillation
stopped
STOP
Oscillation stabilization time
(set by OSTS register)
Watchdog timer
Note Confirm the oscillation stabilization time of f
XP
using the oscillation stabilization time counter status register
(OSTC).
CHAPTER 10 WATCHDOG TIMER
Preliminary User's Manual U16227EJ1V0UD
213
(4) When CPU clock and watchdog timer operation clock are the Ring-OSC clocks (f
R
) during STOP
instruction execution
When the STOP instruction is executed, operation of the watchdog timer is stopped. After STOP mode is
released, counting is started again using the operation clock before the operation was stopped. At this time, the
counter is not cleared to 0.
Figure 10-7. Operation in STOP Mode (CPU Clock and WDT Operation Clock: Ring-OSC Clock)
Watchdog timer
Operating
f
R
f
XP
CPU operation
17 clocks
Normal operation
(Ring-OSC clock)
Clock supply stopped
Normal operation (Ring-OSC clock)
Oscillation
stopped
STOP
Oscillation stabilization time
(set by OSTS register)
Operating Operation stopped
10.4.4 Watchdog timer operation in HALT mode (when "Ring-OSC can be stopped by software" is selected by
mask option)
The watchdog timer stops counting during HALT instruction execution regardless of whether the CPU clock is the
X1 input clock (f
XP
), Ring-OSC clock (f
R
), or subsystem clock (f
XT
), or whether the operation clock of the watchdog
timer is the X1 input clock (f
XP
) or Ring-OSC clock (f
R
). After HALT mode is released, counting is started again using
the operation clock before the operation was stopped. At this time, the counter is not cleared to 0.
Figure 10-8. Operation in HALT Mode
Watchdog timer
Operating
f
R
f
XP
CPU operation
Normal operation
Operating
HALT
Operation stopped
f
XT
Normal operation
Preliminary User's Manual U16227EJ1V0UD
214
CHAPTER 11 A/D CONVERTER
11.1 Functions of A/D Converter
The A/D converter converts an analog input signal into a digital value, and consists of up to eight channels (ANI0 to
ANI7) with a resolution of 10 bits.
The A/D converter has the following two functions.
(1) 10-bit resolution A/D conversion
10-bit resolution A/D conversion is carried out repeatedly for one channel selected from analog inputs ANI0 to
ANI7. Each time an A/D conversion operation ends, an interrupt request (INTAD) is generated.
(2) Power-fail detection function
This function is used to detect a voltage drop in a battery. The A/D conversion result (ADCR register value) and
power-fail comparison threshold register (PFT) value are compared. INTAD is generated only when a
comparative condition has been matched.
Figure 11-1. Block Diagram of A/D Converter
Sample & hold circuit
Series resistor string
Successive
approximation
register (SAR)
ADCS
FR2
FR1
ADCE
Controller
Voltage comparator
A/D conversion result
register (ADCR)
AV
REF
(Can be used as
analog power supply)
AV
SS
INTAD
Internal bus
A/D converter mode
register (ADM)
Tap selector
Selector
ANI0/P20
ANI1/P21
ANI2/P22
ANI3/P23
FR0
ADS1
ADS0
Analog input channel
specification register
(ADS)
3
ADS2
ANI4/P24
ANI5/P25
ANI6/P26
ANI7/P27
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
215
Figure 11-2. Block Diagram of Power-Fail Detection Function
Selector
PFEN PFCM
Internal bus
A/D converter
PFCM
PFEN
Comparator
Power-fail comparison
mode register (PFM)
Power-fail comparison
threshold register (PFT)
INTAD
Selector
ANI0/P20
ANI1/P21
ANI2/P22
ANI3/P23
ADS1
ADS0
Analog input channel
specification register
(ADS)
ADS2
ANI4/P24
ANI5/P25
ANI6/P26
ANI7/P27
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
216
11.2 Configuration of A/D Converter
The A/D converter consists of the following hardware.
Table 11-1. Configuration of A/D Converter
Item
Configuration
Analog input
8 channels (ANI0 to ANI7)
Registers
Successive approximation register (SAR)
A/D conversion result register (ADCR)
Control registers
A/D converter mode register (ADM)
Analog input channel specification register (ADS)
Power-fail comparison mode register (PFM)
Power-fail comparison threshold register (PFT)
(1) Successive approximation register (SAR)
This register compares the analog input voltage value with the voltage tap (compare voltage) value applied from
the series resistor string, and holds the result starting from the most significant bit (MSB).
When the result up to the least significant bit (LSB) is held (end of A/D conversion), the SAR contents are
transferred to the A/D conversion result register.
(2) A/D conversion result register (ADCR)
The ADCR is 16-bit register that stores the A/D conversion result. The lower six bits are fixed to 0. Each time
A/D conversion ends, the conversion result is loaded from the successive approximation register, and is stored in
ADCR in order starting from the most significant bit (MSB).
ADCR can be read by a 16-bit memory manipulation instruction.
RESET input makes ADCR undefined.
Figure 11-3. Format of A/D Conversion Register (ADCR)
Symbol
Address: FF08H, FF09H After reset: Undefined R
FF09H
FF08H
0
0
0
0
0
0
ADCR
Cautions 1. When writing to the A/D converter mode register (ADM) and analog input channel
specification register (ADS), the contents of ADCR may become undefined. Read the
conversion result following conversion completion before writing to ADM and ADS. Using
timing other than the above may cause an incorrect conversion result to be read.
2. If data is read from ADCR, a wait cycle is generated. For details, refer to CHAPTER 27
CAUTIONS FOR WAIT.
(3) Sample & hold circuit
The sample & hold circuit samples each analog input signal sequentially applied from the input circuit, and sends
it to the voltage comparator. This circuit holds the sampled analog input voltage value during A/D conversion.
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
217
(4) Voltage comparator
The voltage comparator compares the analog input with the series resistor string output voltage.
(5) Series resistor string
The series resistor string is connected between AV
REF
and AV
SS
, and generates a voltage to be compared with
the analog input.
(6) ANI0 to ANI7 pins
These eight-channel analog input pins input analog signals to undergo A/D conversion to the A/D converter.
ANI0 to ANI7 are alternate-function pins that can also be used for digital input.
Cautions 1. Observe the rated range of the ANI0 to ANI7 input voltage. If a voltage of AV
REF
or higher or
a voltage of AV
SS
or lower (even if within the range of absolute maximum ratings) is input to
an analog input channel, the converted value of that channel becomes undefined. In
addition, the converted values of the other channels may also be affected.
2. The analog input pins (ANI0 to ANI7) are also used as input port pins (P20 to P27). When
A/D conversion is performed with any of ANI0 to ANI7 selected, do not execute the input
instruction to port 2 while conversion is in progress; otherwise the conversion resolution
may be degraded. If a digital pulse is applied to the pins adjacent to the pins currently used
for A/D conversion, the expected value of the A/D conversion may not be obtained due to
coupling noise. Therefore, do not apply a pulse to the pins adjacent to the pin undergoing
A/D conversion.
(7) AV
REF
pin
The AV
REF
pin inputs the A/D converter reference voltage.
It converts signals input to ANI0 to ANI7 into digital signals based on a voltage between AV
REF
and AV
SS
.
In a standby mode, the current flowing into series resistor strings can be reduced by changing the input voltage of
the AV
REF
pin to AV
SS
level.
It can also be used as the analog power supply. When the A/D converter is used, be sure to use the AV
REF
pin
for the power supply.
Caution
A series resistor string of several tens of k
is connected between the AV
REF
and AV
SS
pins.
Therefore, if the output impedance of the reference voltage source is high, this will result in
series connection to the series resistor string between the AV
REF
and AV
SS
pins, resulting in a
large reference voltage error.
(8) AV
SS
pin
The AV
SS
pin is the GND potential pin for the A/D converter. Always use the AV
SS
pin at the same potential as
the EV
SS
or V
SS
pin, even when the A/D converter is not used.
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
218
11.3 Registers Controlling A/D Converter
The following four registers are used to control the A/D converter.
A/D converter mode register (ADM)
Analog input channel specification register (ADS)
Power-fail comparison mode register (PFM)
Power-fail comparison threshold register (PFT)
(1) A/D converter mode register (ADM)
This register sets the conversion time for analog input to be A/D converted, and starts/stops conversion.
ADM can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Figure 11-4. Format of A/D Converter Mode Register (ADM)
144 s
Note 1
120 s
Note 1
96 s
72 s
60 s
48 s
ADCE
0
0
FR0
FR1
FR2
0
ADCS
A/D conversion operation control
Stops conversion operation
Enables conversion operation
ADCS
0
1
Conversion time selection
Note 1
288/f
X
240/f
X
192/f
X
144/f
X
120/f
X
96/f
X
Setting prohibited
FR2
0
0
0
1
1
1
Other than above
FR1
0
0
1
0
0
1
FR0
0
1
0
0
1
0
0
1
2
3
4
5
6
7
ADM
Address: FF28H After reset: 00H R/W
Symbol


34.3 s
28.6 s
22.9 s
17.2 s
14.3 s
11.5 s
Note 1
28.8 s
24.0 s
19.2 s
14.4 s
12.0 s
Note 1
9.6 s
Note 1



f
X
= 8.38 MHz f
X
= 10 MHz
Boost reference voltage generator operation control
Note 2
Stops operation of reference voltage generator
Enables operation of reference voltage generator
ADCE
0
1


f
X
= 2 MHz
Notes 1.
Set so that the A/D conversion time is 14
s or longer but less than 100 s.
2.
A booster circuit is incorporated to realize low-voltage operation. The operation of the circuit that
generates the reference voltage for boosting is controlled by ADCE, and it takes 14
s from operation
start to operation stabilization. Therefore, when ADCS is set to 1 after 14
s or more has elapsed
from the time ADCE is set to 1, the conversion result at that time has priority over the first conversion
result.
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
219
Table 11-2. Settings of ADCS and ADCE
ADCS
ADCE
A/D Conversion Operation
0
0
Stop status (DC power consumption path does not exist)
0
1
Conversion waiting mode (only reference voltage generator consumes power)
1
0
Conversion mode (reference voltage generator operation stopped
Note
)
1
1
Conversion mode (reference voltage generator operates)
Note Data of first conversion cannot be used.
Figure 11-5. Timing Chart When Boost Reference Voltage Generator Is Used
ADCE
Boost reference voltage
ADCS
Conversion
operation
Conversion
operation
Conversion stopped
Conversion
waiting
Boost reference voltage generator: operating
Note
Note 14
s or more is required for reference voltage stabilization.
Cautions 1. A/D conversion must be stopped before rewriting bits FR0 to FR2 to values other than the
identical data.
2. For the sampling time of the A/D converter and the A/D conversion start delay time, refer to
(11) in 11.6 Cautions for A/D Converter.
3. If data is written to ADM, a wait cycle is generated. For details, refer to CHAPTER 27
CAUTIONS FOR WAIT.
Remark
f
X
: X1 input clock oscillation frequency
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
220
(2) Analog input channel specification register (ADS)
This register specifies the input port of the analog voltage to be A/D converted.
ADS can be set by a 1-bit or 8-bit memory manipulation.
RESET input clears this register to 00H.
Figure 11-6. Format of Analog Input Channel Specification Register (ADS)
ADS0
ADS1
ADS2
0
0
0
0
0
Analog input channel specification
ANI0
ANI1
ANI2
ANI3
ANI4
ANI5
ANI6
ANI7
ADS0
0
1
0
1
0
1
0
1
ADS1
0
0
1
1
0
0
1
1
ADS2
0
0
0
0
1
1
1
1
0
1
2
3
4
5
6
7
ADS
Address: FF29H After reset: 00H R/W
Symbol
Cautions 1. Be sure to set bits 3 to 7 of ADS to 0.
2. If data is written to ADS, a wait cycle is generated. For details, refer to CHAPTER 27
CAUTIONS FOR WAIT.
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
221
(3) Power-fail comparison mode register (PFM)
The power-fail comparison mode register (PFM) is a register that controls the comparison operation.
PFM can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Figure 11-7. Format of Power-Fail Comparison Mode Register (PFM)
0
0
0
0
0
0
PFCM
PFEN
Power-fail comparison enable
Stops power-fail comparison (used as a normal A/D converter)
Enables power-fail comparison (used for power-fail detection)
PFEN
0
1
Power-fail comparison mode selection
Interrupt request signal (INTAD) generation
No INTAD generation
No INTAD generation
INTAD generation
ADCR3
PFT3
ADCR3 < PFT3
ADCR3
PFT3
ADCR3 < PFT3
PFCM
0
1
0
1
2
3
4
5
6
7
PFM
Address: FF2AH After reset: 00H R/W
Symbol
Caution
If data is written to PFM, a wait cycle is generated. For details, refer to CHAPTER 27
CAUTIONS FOR WAIT.
(4) Power-fail comparison threshold register (PFT)
The power-fail comparison threshold register (PFT) is a register that sets the threshold value when comparing the
values with the A/D conversion result.
8-bit data in PFT is compared to the higher 8 bits (FF09H) of the 10-bit A/D conversion result.
PFT can be set by an 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Figure 11-8. Format of Power-Fail Comparison Threshold Register (PFT)
PFT0
PFT1
PFT2
PFT3
PFT4
PFT5
PFT6
PFT7
0
1
2
3
4
5
6
7
PFT
Address: FF2BH After reset: 00H R/W
Symbol
Caution
If data is written to PFT, a wait cycle is generated. For details, refer to CHAPTER 27 CAUTIONS
FOR WAIT.
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
222
11.4 A/D Converter Operations
11.4.1 Basic operations of A/D converter
<1>
Select one channel for A/D conversion with analog input channel specification register (ADS).
<2>
The voltage input to the selected analog input channel is sampled by the sample & hold circuit.
<3>
When sampling has been done for a certain time, the sample & hold circuit is placed in the hold state and the
input analog voltage is held until the A/D conversion operation is ended.
<4>
Bit 9 of the successive approximation register (SAR) is set. The series resistor string voltage tap is set to
(1/2) AV
REF
by the tap selector.
<5>
The voltage difference between the series resistor string voltage tap and analog input is compared by the
voltage comparator. If the analog input is greater than (1/2) AV
REF
, the MSB of SAR remains set to 1. If the
analog input is smaller than (1/2) AV
REF0
, the MSB is reset to 0.
<6>
Next, bit 8 of SAR is automatically set to 1, and the operation proceeds to the next comparison. The series
resistor string voltage tap is selected according to the preset value of bit 9, as described below.
Bit 9 = 1: (3/4) V
DD
Bit 9 = 0: (1/4) V
DD
The voltage tap and analog input voltage are compared and bit 8 of SAR is manipulated as follows.
Analog input voltage Voltage tap: Bit 8 = 1
Analog input voltage < Voltage tap: Bit 8 = 0
<7>
Comparison is continued in this way up to bit 0 of SAR.
<8>
Upon completion of the comparison of 10 bits, an effective digital result value remains in SAR, and the result
value is transferred to the A/D conversion result register (ADCR) and then latched.
At the same time, the A/D conversion end interrupt request (INTAD) can also be generated.
Caution
The first A/D conversion value immediately after A/D conversion operations start may not fall
within the rating.
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
223
Figure 11-9. Basic Operation of A/D Converter
Conversion time
Sampling time
Sampling
A/D conversion
Undefined
Conversion
result
A/D converter
operation
SAR
ADCR
INTAD
Conversion
result
A/D conversion operations are performed continuously until bit 7 (ADCS) of the A/D converter mode register (ADM)
is reset (0) by software.
If a write operation is performed to one of the ADM, analog input channel specification register (ADS), power-fail
comparison mode register (PFM), or power-fail comparison threshold register (PFT) during an A/D conversion
operation, the conversion operation is initialized, and if the ADCS bit is set (1), conversion starts again from the
beginning.
RESET input makes the A/D conversion result register (ADCR) undefined.
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
224
11.4.2 Input voltage and conversion results
The relationship between the analog input voltage input to the analog input pins (ANI0 to ANI7) and the A/D
conversion result (stored in the A/D conversion result register (ADCR)) is shown by the following expression.
ADCR = INT (
1024 + 0.5)
or
(ADCR
- 0.5) - V
IN
< (ADCR + 0.5)
where, INT( ):
Function which returns integer part of value in parentheses
V
IN
:
Analog input voltage
AV
REF
:
AV
REF
pin voltage
ADCR: A/D conversion result register (ADCR) value
Figure 11-10 shows the relationship between the analog input voltage and the A/D conversion result.
Figure 11-10. Relationship Between Analog Input Voltage and A/D Conversion Result
1023
1022
1021
3
2
1
0
A/D conversion result
(ADCR)
1
2048
1
1024
3
2048
2
1024
5
2048
3
1024
2043
2048
1022
1024
2045
2048
1023
1024
2047
2048
1
Input voltage/AV
REF
V
IN
AV
REF
AV
REF
1024
AV
REF
1024
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
225
11.4.3 A/D converter operation mode
The operation mode of the A/D converter is the select mode. One channel of analog input is selected from ANI0 to
ANI7 by the analog input channel specification register (ADS) and A/D conversion is executed.
In addition, the following two functions can be selected by setting of bit 7 (PFEN) of the power-fail comparison
mode register (PFM).
Normal 10-bit A/D converter (PFEN = 0)
Power-fail detection function (PFEN = 1)
(1) A/D conversion operation (when PFEN = 0)
By setting bit 7 (ADCS) of the A/D converter mode register (ADM) to 1 and bit 7 (PFEN) of the power-fail
comparison mode register (PFM) to 0, the A/D conversion operation of the voltage, which is applied to the analog
input pin specified by the analog input channel specification register (ADS), is started.
When A/D conversion has been completed, the result of the A/D conversion is stored in the A/D conversion result
register (ADCR), and an interrupt request signal (INTAD) is generated. Once the A/D conversion has started and
when one A/D conversion has been completed, the next A/D conversion operation is immediately started. The
A/D conversion operations are repeated until new data is written to ADS.
If ADS is rewritten during A/D conversion, the A/D conversion under execution is suspended, and the A/D
conversion of the newly selected analog input channel is started.
If 0 is written to ADCS of ADM during A/D conversion, the conversion operation is immediately stopped.
Figure 11-11. A/D Conversion Operation
ANIn
Rewriting ADM
ADCS = 1
Rewriting ADS
ADCS = 0
ANIn
ANIn
ANIn
ANIm
ANIn
ANIm
ANIm
Stopped
A/D conversion
ADCR
INTAD
(PFEN = 0)
Conversion is stopped
Conversion result is not retained
Remarks 1. n = 0 to 7
2. m = 0 to 7
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
226
(2) Power-fail detection function (when PFEN = 1)
By setting bit 7 (ADCS) of the A/D converter mode register (ADM) to 1 and bit 7 (PFEN) of the power-fail
comparison mode register (PFM) to 1, the A/D conversion operation of the voltage applied to the analog input pin
specified by the analog input channel specification register (ADS) is started.
When the A/D conversion has been completed, the result of the A/D conversion is stored in the A/D conversion
result register (ADCR), the values are compared with power-fail comparison threshold register (PFT), and an
interrupt request signal (INTAD) is generated under the condition specified by bit 6 (PFCM) of PFM.
<1>
When PFEN = 0
INTAD is generated at the end of each A/D conversion.
<2>
When PFEN = 1 and PFCM = 0
The ADCR and PFT values are compared when A/D conversion ends and INTAD is only generated when
ADCR
PFT.
<3>
When PFEN = 1 and PFCM = 1
The ADCR and PFT values are compared when A/D conversion ends and INTAD is only generated when
ADCR < PFT.
Figure 11-12. Power-Fail Detection (When PFEN = 1 and PFCM = 0)
A/D conversion
ADCR
PFT
INTAD
(PFEN = 1)
ANIn
ANIn
80H
80H
Condition match
First conversion
Note
7FH
80H
ANIn
ANIn
Note If the conversion result is not read before the end of the next conversion after INTAD is output, the result is
replaced by the next conversion result.
Remark
n = 0 to 7
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
227
The setting methods are described below.
When used as A/D conversion operation
<1>
Set bit 0 (ADCE) of the A/D converter mode register (ADM) to 1.
<2>
Select the channel and conversion time using bits 2 to 0 (ADS2 to ADS0) of the analog input channel
specification register (ADS) and bits 5 to 3 (FR2 to FR0) of ADM.
<3>
Set bit 7 (ADCS) of ADM to 1.
<4>
An interrupt request signal (INTAD) is generated.
<5>
Transfer the A/D conversion data to the A/D conversion result register (ADCR).
<Change the channel>
<6>
Change the channel using bits 2 to 0 (ADS2 to ADS0) of ADS.
<7>
An interrupt request signal (INTAD) is generated.
<8>
Transfer the A/D conversion data to the A/D conversion result register (ADCR).
<Complete A/D conversion>
<9>
Clear ADCS to 0.
<10> Clear ADCE to 0.
Cautions 1. Make sure the period of <1> to <3> is 14



s or more.
2. It is no problem if the order of <1> and <2> is reversed.
3. <1> can be omitted. However, do not use the first conversion result after <3> in this
case.
4. The period from <4> to <7> differs from the conversion time set using bits 5 to 3 (FR2 to
FR0) of ADM. The period from <6> to <7> is the conversion time set using FR2 to FR0.
When used as power-fail function
<1>
Set bit 7 (PFEN) of the power-fail comparison mode register (PFM).
<2>
Set power-fail comparison condition using bit 6 (PFCM) of PFM.
<3>
Set bit 0 (ADCE) of the A/D converter mode register (ADM) to 1.
<4>
Select the channel and conversion time using bits 2 to 0 (ADS2 to ADS0) of the analog input channel
specification register (ADS) and bits 5 to 3 (FR2 to FR0) of ADM.
<5>
Set a threshold value to the power-fail comparison threshold register (PFT).
<6>
Set bit 7 (ADCS) of ADM to 1.
<7>
Transfer the A/D conversion data to the A/D conversion result register (ADCR).
<8>
ADCR and PFT are compared and an interrupt request signal (INTAD) is generated if the conditions
match.
<Change the channel>
<9>
Change the channel using bits 2 to 0 (ADS2 to ADS0) of ADS.
<10> Transfer the A/D conversion data to the A/D conversion result register (ADCR).
<11> ADCR and the power-fail comparison threshold register (PFT) are compared and an interrupt request
signal (INTAD) is generated if the conditions match.
<Complete A/D conversion>
<12> Clear ADCS to 0.
<13> Clear ADCE to 0.
Cautions 1. Make sure the period of <3> to <6> is 14



s or more.
2. It is no problem if order of <3>, <4>, and <5> is changed.
3. <3> can be omitted. However, do not use the first conversion result after <6> in this
case.
4. The period from <7> to <11> differs from the conversion time set using bits 5 to 3 (FR2 to
FR0) of ADM. The period from <9> to <11> is the conversion time set using FR2 to FR0.
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
228
11.5 How to Read A/D Converter Characteristics Table
Here, special terms unique to the A/D converter are explained.
(1) Resolution
This is the minimum analog input voltage that can be identified. That is, the percentage of the analog input
voltage per bit of digital output is called 1LSB (Least Significant Bit). The percentage of 1LSB with respect to the
full scale is expressed by %FSR (Full Scale Range).
1LSB is as follows when the resolution is 10 bits.
1LSB = 1/2
10
= 1/1024
= 0.098%FSR
Accuracy has no relation to resolution, but is determined by overall error.
(2) Overall error
This shows the maximum error value between the actual measured value and the theoretical value.
Zero-scale error, full-scale error, integral linearity error, and differential linearity errors that are combinations of
these express the overall error.
Note that the quantization error is not included in the overall error in the characteristics table.
(3) Quantization error
When analog values are converted to digital values, a
1/2LSB error naturally occurs. In an A/D converter, an
analog input voltage in a range of
1/2LSB is converted to the same digital code, so a quantization error cannot
be avoided.
Note that the quantization error is not included in the overall error, zero-scale error, full-scale error, integral
linearity error, and differential linearity error in the characteristics table.
Figure 11-13. Overall Error
Figure 11-14. Quantization Error
Ideal line
0......0
1......1
Digital output
Overall
error
Analog input
AV
REF
0
0......0
1......1
Digital output
Quantization error
1/2LSB
1/2LSB
Analog input
0
AV
REF
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
229
(4) Zero-scale error
This shows the difference between the actual measurement value of the analog input voltage and the theoretical
value (1/2LSB) when the digital output changes from 0......000 to 0......001.
If the actual measurement value is greater than the theoretical value, it shows the difference between the actual
measurement value of the analog input voltage and the theoretical value (3/2LSB) when the digital output
changes from 0......000 to 0......010.
(5) Full-scale error
This shows the difference between the actual measurement value of the analog input voltage and the theoretical
value (Full-scale
- 3/2LSB) when the digital output changes from 1......110 to 1......111.
(6) Integral linearity error
This shows the degree to which the conversion characteristics deviate from the ideal linear relationship. It
expresses the maximum value of the difference between the actual measurement value and the ideal straight line
when the zero-scale error and full-scale error are 0.
(7) Differential linearity error
While the ideal width of code output is 1LSB, this indicates the difference between the actual measurement value
and the ideal value.
Figure 11-15. Zero-Scale Error
Figure 11-16. Full-Scale Error
111
011
010
001
Zero-scale error
Ideal line
000
0
1
2
3
AV
REF
Digital output (Lo
w
er 3 bits)
Analog input (LSB)
111
110
101
000
0
AV
REF
AV
REF
1
AV
REF
2
AV
REF
3
Digital output (Lo
w
er 3 bits)
Analog input (LSB)
Ideal line
Full-scale error
Figure 11-17. Integral Linearity Error
Figure 11-18. Differential Linearity Error
0
AV
REF
Digital output
Analog input
Integral linearity
error
Ideal line
1......1
0......0
0
AV
REF
Digital output
Analog input
Differential
linearity error
1......1
0......0
Ideal 1LSB width
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
230
(8) Conversion time
This expresses the time since sampling has been started until digital output is obtained.
The sampling time is included in the conversion time in the characteristics table.
(9) Sampling time
This is the time the analog switch is turned on for the analog voltage to be sampled by the sample & hold circuit.
Sampling
time
Conversion time
11.6 Cautions for A/D Converter
(1) Power consumption in standby mode
The A/D converter stops operating in the standby mode. At this time, the power consumption can be reduced by
stopping the conversion operation (by setting bit 7 (ADCS) of the A/D converter mode register (ADM) to 0).
Figure 11-19 shows the circuit configuration of series resistor string.
Figure 11-19. Circuit Configuration of Series Resistor String
AV
REF
AV
SS
P-ch
Series resistor string
ADCS
(2) Input range of ANI0 to ANI7
Observe the rated range of the ANI0 to ANI7 input voltage. If a voltage of AV
REF
or higher and AV
SS
or lower
(even in the range of absolute maximum ratings) is input to an analog input channel, the converted value of that
channel becomes undefined. In addition, the converted values of the other channels may also be affected.
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
231
(3) Conflicting operations
<1>
Conflict between A/D conversion result register (ADCR) write and ADCR read by instruction upon the end
of conversion
ADCR read has priority. After the read operation, the new conversion result is written to ADCR.
Old data can be read from ADCR at the timing of (1) and new data can be read from ADCR at the timing of
(2) as shown in Figure 11-20. A master-slave configuration is employed for transferring the A/D conversion
result to ADCR.
Figure 11-20. Storing Conversion Result in ADCR and Timing of Data Read from ADCR
(1) Timing to read old data
Internal clock
INTAD
Master write signal
A/D conversion (master)
Slave write signal
ADCR (slave)
Read data
Conversion
end
Conversion
result N
Conversion result N
Conversion result N
Conversion result N + 1
(2) Timing to read new data
Internal clock
INTAD
Master write signal
A/D conversion (master)
Slave write signal
ADCR (slave)
Read data
Conversion
end
Conversion
result N
Conversion result N + 1
Conversion result N + 1
Conversion result N + 1
<2>
Conflict between ADCR write and A/D converter mode register (ADM) write or analog input channel
specification register (ADS) write
ADM or ADS write has priority. ADCR write is not performed, nor is the conversion end interrupt signal
(INTAD) generated.
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
232
(4) Noise countermeasures
To maintain the 10-bit resolution, attention must be paid to noise input to the AV
REF
pin and pins ANI0 to ANI7.
Because the effect increases in proportion to the output impedance of the analog input source, it is recommended
that a capacitor be connected externally, as shown in Figure 11-21, to reduce noise.
Figure 11-21. Analog Input Pin Connection
Reference
voltage
input
C = 100 to 1,000 pF
If there is a possibility that noise equal to or higher than AV
REF
or
equal to or lower than AV
SS
may enter, clamp with a diode with a
small V
F
value (0.3 V or lower).
AV
REF
AV
SS
V
SS
ANI0 to ANI7
(5) ANI0/P20 to ANI7/P27
The analog input pins (ANI0 to ANI7) are also used as input port pins (P20 to P27).
When A/D conversion is performed with any of ANI0 to ANI7 selected, do not execute the input instruction to port
2 while conversion is in progress; otherwise the conversion resolution may be degraded.
If a digital pulse is applied to the pins adjacent to the pins currently used for A/D conversion, the expected value
of the A/D conversion may not be obtained due to coupling noise. Therefore, do not apply a pulse to the pins
adjacent to the pin undergoing A/D conversion.
(6) Input impedance of ANI0 to ANI7 pins
In this A/D converter, the internal sampling capacitor is charged and sampling is performed for approx. one tenth
of the conversion time.
Since only the leakage current flows other than during sampling and the current for charging the capacitor also
flows during sampling, the input impedance fluctuates and has no meaning.
To perform sufficient sampling, however, it is recommended to make the output impedance of the analog input
source 10 k
or lower, or attach a capacitor of around 100 pF to the ANI0 to ANI7 pins (see Figure 11-21).
(7) AV
REF
pin input impedance
A series resistor string of several tens of 10 k
is connected between the AV
REF
and AV
SS
pins.
Therefore, if the output impedance of the reference voltage source is high, this will result in a series connection to
the series resistor string between the AV
REF
and AV
SS
pins, resulting in a large reference voltage error.
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
233
(8) Interrupt request flag (ADIF)
The interrupt request flag (ADIF) is not cleared even if the analog input channel specification register (ADS) is
changed.
Therefore, if an analog input pin is changed during A/D conversion, the A/D conversion result and ADIF for the
pre-change analog input may be set just before the ADS rewrite. Caution is therefore required since, at this time,
when ADIF is read immediately after the ADS rewrite, ADIF is set despite the fact A/D conversion for the post-
change analog input has not ended.
When A/D conversion is stopped and then resumed, clear ADIF before the A/D conversion operation is resumed.
Figure 11-22. Timing of A/D Conversion End Interrupt Request Generation
ADS rewrite
(start of ANIn conversion)
A/D conversion
ADCR
INTAD
ANIn
ANIn
ANIm
ANIm
ANIn
ANIn
ANIm
ANIm
ADS rewrite
(start of ANIm conversion)
ADIF is set but ANIm conversion
has not ended.
Remarks 1. n = 0 to 7
2. m = 0 to 7
(9) Conversion results just after A/D conversion start
The first A/D conversion value immediately after A/D conversion starts may not fall within the rating. Take
measures such as polling the A/D conversion end interrupt request (INTAD) and removing the first conversion
result.
(10) A/D conversion result register (ADCR) read operation
When a write operation is performed to the A/D converter mode register (ADM) and analog input channel
specification register (ADS), the contents of ADCR may become undefined. Read the conversion result following
conversion completion before writing to ADM and ADS. Using timing other than the above may cause an
incorrect conversion result to be read.
Do not read ADCR when the CPU is operating on the subsystem clock and oscillation of the X1 input clock is
stopped.
CHAPTER 11 A/D CONVERTER
Preliminary User's Manual U16227EJ1V0UD
234
(11) A/D converter sampling time and A/D conversion start delay time
The A/D converter sampling time differs depending on the set value of the A/D converter mode register (ADM).
The delay time exists until actual sampling is started after A/D converter operation is enabled.
When using a set in which the A/D conversion time must be strictly observed, care is required for the contents
shown in Figure 11-23 and Table 11-3.
Figure 11-23. Timing of A/D Converter Sampling and A/D Conversion Start Delay
ADCS
Wait
period
Conversion time
A/D
conversion
start delay
time
Sampling
time
Sampling timing
INTAD
ADCS
1 or ADS rewrite
Table 11-3. A/D Converter Sampling Time and A/D Conversion Start Delay Time (ADM Set Value)
A/D Conversion Start Delay Time
Note
FR2
FR1
FR0
Conversion Time
Sampling Time
MIN.
MAX.
0
0
0
288/f
X
40/f
X
32/f
X
36/f
X
0
0
1
240/f
X
32/f
X
28/f
X
32/f
X
0
1
0
192/f
X
24/f
X
24/f
X
28/f
X
1
0
0
144/f
X
20/f
X
16/f
X
18/f
X
1
0
1
120/f
X
16/f
X
14/f
X
16/f
X
1
1
0
96/f
X
12/f
X
12/f
X
14/f
X
Other than above
Setting prohibited
-
-
-
Note The A/D conversion start delay time is the time after wait period. For the wait function, refer to CHAPTER 27
CAUTIONS FOR WAIT.
Remark
f
X
: X1 clock oscillation frequency
Preliminary User's Manual U16227EJ1V0UD
235
CHAPTER 12 SERIAL INTERFACE UART0
12.1 Functions of Serial Interface UART0
Serial interface UART0 has the following two modes.
(1) Operation stop mode
This mode is used when serial transfer is not executed and can enable a reduction in the power consumption.
For details, refer to 12.4.1 Operation stop mode.
(2) Asynchronous serial interface (UART) mode
The functions of this mode are outlined below.
Two-pin configuration T
X
D0: Transmit data output pin
R
X
B0: Receive data input pin
Length of transfer data can be selected from 7 or 8 bits.
Dedicated on-chip 5-bit baud rate generator allowing any baud rate to be set
Transmission and reception can be performed independently.
Four operating clock inputs selectable
Fixed to LSB-first transfer
Cautions 1. The default value of the T
X
D0 pin is high level. Exercise care when using the T
X
D0 pin as a
port pin.
2. If clock supply to serial interface UART0 is not stopped (e.g., in the HALT mode), normal
operation continues. If clock supply to serial interface UART0 is stopped (e.g., in the STOP
mode), each register stops operating, and holds the value immediately before clock supply
was stopped. The T
X
D0 pin also holds the value immediately before clock supply was
stopped and outputs it. However, the operation is not guaranteed after clock supply is
resumed. Therefore, reset the circuit so that POWER0 = 0, RXE0 = 0, and TXE0 = 0.
3. Set POWER0 = 1 and then set TXE0 = 1 (transmission) or RXE0 = 1 (reception) to start
communication.
4. TXE0 and RXE0 are synchronized with the base clock (f
XCLK
) set by BRGC0. Therefore, the
transmission unit may not be initialized if TXE0 = 1 is not set again 2 clocks after TXE0 = 0
is set. Similarly, the reception unit may not be initialized if RXE0 = 1 is not set again 2
clocks after RXE0 = 0 is set.
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
236
12.2 Configuration of Serial Interface UART0
Serial interface UART0 consists of the following hardware.
Table 12-1. Configuration of Serial Interface UART0
Item
Configuration
Registers
Receive buffer register 0 (RXB0)
Receive shift register 0 (RXS0)
Transmit shift register 0 (TXS0)
Control registers
Asynchronous serial interface operation mode register 0 (ASIM0)
Asynchronous serial interface reception error status register 0 (ASIS0)
Baud rate generator control register 0 (BRGC0)
CHAP
T
E
R
12
S
E
R
I
A
L

I
N
T
E
RF
ACE
UART
0
P
r
el
i
m
i
n
a
r
y U
s
er'
s

Ma
nu
al
U
1
6
227E
J
1
V
0
U
D
237
Figure 12-1. Block Diagram of Serial Interface UART0
T
x
D0/SCK10/P10
INTST0
R
x
D0/SI10/P11
INTSR0
f
X
/2
5
f
X
/2
3
f
X
/2
Transmit shift register 0
(TXS0)
Receive shift register 0
(RXS0)
Receive buffer register 0
(RXB0)
Asynchronous serial
interface reception error
status register 0 (ASIS0)
Asynchronous serial
interface operation mode
register 0 (ASIM0)
Baud rate generator
control register 0
(BRGC0)
TO50/TI50/P17
(TM50 output)
Registers
Selector
Baud rate
generator
Baud rate
generator
Reception unit
Reception control
Filter
Internal bus
Transmission control
Transmission unit
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
238
(1) Receive buffer register 0 (RXB0)
This 8-bit register stores parallel data converted by receive shift register 0 (RXS0).
Each time 1 byte of data has been received, new receive data is transferred to this register from receive shift
register 0 (RXS0).
If the data length is set to 7 bits the receive data is transferred to bits 0 to 6 of RXB0 and the MSB of RXB0 is
always 0.
If an overrun error (OVE0) occurs, the receive data is not transferred to RXB0.
RESET input or POWER0 = 0 sets this register to FFH.
RXB0 can be read by an 8-bit memory manipulation instruction. No data can be written to this register.
(2) Receive shift register 0 (RXS0)
This register converts the serial data input to the R
X
D0 pin into parallel data.
RXS0 cannot be directly manipulated by a program.
(3) Transmit shift register 0 (TXS0)
This register is used to set transmit data. Transmission is started when data is written to TXS0, and serial data is
transmitted from the T
X
D0 pins.
RESET input, POWR0 = 0, or TXE0 = 0 sets this register to FFH.
TXS0 can be written by an 8-bit memory manipulation instruction. This register cannot be read.
Caution
Do not write the next transmit data to TXS0 before the transmission completion interrupt signal
(INTST0) is generated.
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
239
12.3 Registers Controlling Serial Interface UART0
Serial interface UART0 is controlled by the following three registers.
Asynchronous serial interface operation mode register 0 (ASIM0)
Asynchronous serial interface reception error status register 0 (ASIS0)
Baud rate generator control register 0 (BRGC0)
(1) Asynchronous serial interface operation mode register 0 (ASIM0)
This 8-bit register controls the serial transfer operations of serial interface UART0.
This register can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input sets this register to 01H.
Figure 12-2. Format of Asynchronous Serial Interface Operation Mode Register 0 (ASIM0) (1/2)
Address: FF70H After reset: 01H R/W
Symbol
7
6
5
4
3
2
1
0
ASIM0
POWER0
TXE0
RXE0
PS01
PS00
CL0
SL0
1
POWER0
Enables/disables operation of internal operation clock
0
Note
Disables operation of the internal operation clock (fixes the clock to low level) and asynchronously
resets the internal circuit.
1
Enables operation of the internal operation clock.
TXE0
Enables/disables transmission
0
Disables transmission (synchronously resets the transmission circuit).
1
Enables transmission.
RXE0
Enables/disables reception
0
Disables reception (synchronously resets the reception circuit).
1
Enables reception.
Note The input from the R
X
D0 pin is fixed to high level when POWER0 = 0.
Cautions 1. At startup, set POWER0 to 1 and then set TXE0 to 1. Clear TXE0 to 0 first, and then clear
POWER0 to 0.
2. At startup, set POWER0 to 1 and then set RXE0 to 1. Clear RXE0 to 0 first, and then clear
POWER0 to 0.
3. TXE0 and RXE0 are synchronized with the base clock (f
XCLK
) set by BRGC0. Therefore, the
transmission unit may not be initialized if TXE0 = 1 is not set again 2 clocks after TXE0 = 0 is
set. Similarly, the reception unit may not be initialized if RXE0 = 1 is not set again 2 clocks
after RXE0 = 0 is set.
4. Be sure to set bit 0 to 1.
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
240
Figure 12-2. Format of Asynchronous Serial Interface Operation Mode Register 0 (ASIM0) (2/2)
PS01
PS00
Transmission operation
Reception operation
0
0
Does not output parity bit.
Reception without parity
0
1
Outputs 0 parity.
Reception as 0 parity
Note
1
0
Outputs odd parity.
Judges as odd parity.
1
1
Outputs even parity.
Judges as even parity.
CL0
Specifies character length of transmit/receive data
0
Character length of data = 7 bits
1
Character length of data = 8 bits
SL0
Specifies number of stop bits of transmit data
0
Number of stop bits = 1
1
Number of stop bits = 2
Note If "reception as 0 parity" is selected, the parity is not judged. Therefore, bit 2 (PE0) of asynchronous serial
interface reception error status register 0 (ASIS0) is not set and the error interrupt does not occur.
Cautions 1. Clear the TXE0 and RXE0 bits to 0 before rewriting the PS01, PS00, and CL0 bits.
2. Make sure that TXE0 = 0 when rewriting the SL0 bit. Reception is always performed with
"number of stop bits = 1", and therefore, is not affected by the set value of the SL0 bit.
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
241
(2) Asynchronous serial interface reception error status register 0 (ASIS0)
This register indicates an error status on completion of reception by serial interface UART0. It includes three
error flag bits (PE0, FE0, OVE0).
This register can be set by an 8-bit memory manipulation instruction and is read-only.
RESET input clears this register to 00H if bit 7 (POWER0) and bit 5 (RXE0) of ASIM0 = 0. 00H is read when this
register is read.
Figure 12-3. Format of Asynchronous Serial Interface Reception Error Status Register 0 (ASIS0)
Address: FF73H After reset: 00H R
Symbol
7
6
5
4
3
2
1
0
ASIS0
0
0
0
0
0
PE0
FE0
OVE0
PE0
Status flag indicating parity error
0
If POWER0 = 0 and RXE0 = 0, or if ASIS0 register is read.
1
If the parity of transmit data does not match the parity bit on completion of reception.
FE0
Status flag indicating framing error
0
If POWER0 = 0 and RXE0 = 0, or if ASIS0 register is read.
1
If the stop bit is not detected on completion of reception.
OVE0
Status flag indicating overrun error
0
If POWER0 = 0 and RXE0 = 0, or if ASIS0 register is read.
1
If receive data is set to the RXB register and the next reception operation is completed before the
data is read.
Cautions 1. The operation of the PE0 bit differs depending on the set values of the PS01 and PS00 bits of
asynchronous serial interface operation mode register 0 (ASIM0).
2. Only the first bit of the receive data is checked as the stop bit, regardless of the number of
stop bits.
3. If an overrun error occurs, the next receive data is not written to receive buffer register 0
(RXB0) but discarded.
4. If data is read from ASIS0, a wait cycle is generated. For details, refer to CHAPTER 27
CAUTIONS FOR WAIT.
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
242
(3) Baud rate generator control register 0 (BRGC0)
This register selects the base clock of serial interface UART0 and controls the baud rate.
BRGC0 can be set by an 8-bit memory manipulation instruction.
RESET input sets this register to 1FH.
Figure 12-4. Format of Baud Rate Generator Control Register 0 (BRGC0)
Address: FF71H After reset: 1FH R/W
Symbol
7
6
5
4
3
2
1
0
BRGC0
TPS01
TPS00
0
MDL04
MDL03
MDL02
MDL01
MDL00
TPS01
TPS00
Base clock (f
XCLK
) selection
0
0
TM50 output (TO50)
0
1
f
X
/2 (5 MHz)
1
0
f
X
/2
3
(1.25 MHz)
1
1
f
X
/2
5
(312.5 kHz)
MDL04
MDL03
MDL02
MDL01
MDL00
k
Selection of 5-bit counter
output clock
0
0
Setting prohibited
0
1
0
0
0
8
f
XCLK
/8
0
1
0
0
1
9
f
XCLK
/9
0
1
0
1
0
10
f
XCLK
/10




























1
1
0
1
0
26
f
XCLK
/26
1
1
0
1
1
27
f
XCLK
/27
1
1
1
0
0
28
f
XCLK
/28
1
1
1
1
0
30
f
XCLK
/30
1
1
1
1
1
31
f
XCLK
/31
Cautions 1. Make sure that bit 6 (TXE0) and bit 5 (RXE0) of the ASIM0 register = 0 when rewriting the
MDL04 to MDL00 bits.
2. The baud rate is the output clock of the 5-bit counter divided by 2.
Remarks 1. f
XCLK
: Frequency of base clock (Clock) selected by the TPS01 and TPS00 bits
2. f
X
:
X1 input clock oscillation frequency
3. k:
Value set by the MDL04 to MDL00 bits (k = 8, 9, 10, ..., 31)
4.
:
Don't care
5. Figures in parentheses apply to operation at f
X
= 10 MHz
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
243
12.4 Operation of Serial Interface UART0
This section explains the two modes of serial interface UART0.
12.4.1 Operation stop mode
In this mode, serial transfer cannot be executed, thus reducing the power consumption. In addition, the pins can
be used as ordinary port pins in this mode.
(1) Register setting
The operation stop mode is set by asynchronous serial interface operation mode register 0 (ASIM0).
ASIM0 can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input sets this register to 01H.
Address: FF70H After reset: 01H R/W
Symbol
7
6
5
4
3
2
1
0
ASIM0
POWER0
TXE0
RXE0
PS01
PS00
CL0
SL0
1
POWER0
Enables/disables operation of internal operation clock
0
Note
Disables operation of the internal operation clock (fixes the clock to low level) and asynchronously
resets the internal circuit.
1
Enables operation of the internal operation clock.
TXE0
Enables/disables transmission
0
Disables transmission (synchronously resets the transmission circuit).
1
Enables transmission.
RXE0
Enables/disables reception
0
Disables reception (synchronously resets the reception circuit).
1
Enables reception.
Note The input from the R
X
D0 pin is fixed to high level when POWER0 = 0.
Cautions 1. At startup, set POWER0 to 1 and then set TXE0 to 1. Clear TXE0 to 0 first, and then clear
POWER0 to 0.
2. At startup, set POWER0 to 1 and then set RXE0 to 1. Clear RXE0 to 0 first, and then clear
POWER0 to 0.
3. TXE0 and RXE0 are synchronized with the base clock (f
XCLK
) set by BRGC0. Therefore, the
transmission unit may not be initialized if TXE0 = 1 is not set again 2 clocks after TXE0 = 0 is
set. Similarly, the reception unit may not be initialized if RXE0 = 1 is not set again 2 clocks
after RXE0 = 0 is set.
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
244
12.4.2 Asynchronous serial interface (UART) mode
In this mode, 1-byte data is transmitted/received following a start bit, and a full-duplex operation can be performed.
A dedicated UART baud rate generator is incorporated, so that communication can be executed at a wide range of
baud rates.
(1) Register setting
The UART mode is set by asynchronous serial interface operation mode register 0 (ASIM0) and asynchronous
serial interface reception error status register 0 (ASIS0).
(a) Asynchronous serial interface operation mode register 0 (ASIM0)
This 8-bit register controls the serial transfer operations of serial interface UART0.
ASIM0 can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input sets this register to 01H.
Address: FF70H After reset: 01H R/W
Symbol
7
6
5
4
3
2
1
0
ASIM0
POWER0
TXE0
RXE0
PS01
PS00
CL0
SL0
1
POWER0
Enables/disables operation of internal operation clock
0
Note
Disables operation of the internal operation clock (fixes the clock to low level) and asynchronously
resets the internal circuit.
1
Enables operation of the internal operation clock.
TXE0
Enables/disables transmission
0
Disables transmission (synchronously resets the transmission circuit).
1
Enables transmission.
RXE0
Enables/disables reception
0
Disables reception (synchronously resets the reception circuit).
1
Enables reception
Note The input from the R
X
D0 pin is fixed to high level when POWER0 = 0.
Cautions 1. At startup, set POWER0 to 1 and then set TXE0 to 1. Clear TXE0 to 0 first, and then clear
POWER0 to 0.
2. At startup, set POWER0 to 1 and then set RXE0 to 1. Clear RXE0 to 0 first, and then clear
POWER0 to 0.
3. TXE0 and RXE0 are synchronized with the base clock (f
XCLK
) set by BRGC0. Therefore, the
transmission unit may not be initialized if TXE0 = 1 is not set again 2 clocks after TXE0 = 0 is
set. Similarly, the reception unit may not be initialized if RXE0 = 1 is not set again 2 clocks
after RXE0 = 0 is set.
4. Be sure to set bit 0 to 1.
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
245
PS01
PS00
Transmission operation
Reception operation
0
0
Does not output parity bit.
Reception without parity
0
1
Outputs 0 parity.
Reception as 0 parity
Note
1
0
Outputs odd parity.
Judges as odd parity.
1
1
Outputs even parity.
Judges as even parity.
CL0
Specifies character length of transmit/receive data
0
Character length of data = 7 bits
1
Character length of data = 8 bits
SL0
Specifies number of stop bits of transmit data
0
Number of stop bits = 1
1
Number of stop bits = 2
Note If "reception as 0 parity" is selected, the parity is not judged. Therefore, bit 2 (PE0) of asynchronous serial
interface reception error status register 0 (ASIS0) is not set and the error interrupt does not occur.
Cautions 1. Clear the TXE0 and RXE0 bits to 0 before rewriting the PS01, PS00, and CL0 bits.
2. Make sure that TXE0 = 0 when rewriting the SL0 bit. Reception is always performed with
"number of stop bits = 1", and therefore, is not affected by the set value of the SL0 bit.
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
246
(b) Asynchronous serial interface reception error status register 0 (ASIS0)
This register indicates an error status on completion of reception by serial interface UART0. It includes three
error flag bits (PE0, FE0, OVE0).
This register can be set by an 8-bit memory manipulation instruction and is read-only.
RESET input clears this register to 00H if bit 7 (POWER0) and bit 5 (RXE0) of ASIM0 = 0. 00H is read when
this register is read.
Address: FF73H After reset: 00H R
Symbol
7
6
5
4
3
2
1
0
ASIS0
0
0
0
0
0
PE0
FE0
OVE0
PE0
Status flag indicating parity error
0
If POWER0 = 0 and RXE0 = 0, or if ASIS0 register is read.
1
If the parity of transmit data does not match the parity bit on completion of reception.
FE0
Status flag indicating framing error
0
If POWER0 = 0 and RXE0 = 0, or if ASIS0 register is read.
1
If the stop bit is not detected on completion of reception.
OVE0
Status flag indicating overrun error
0
If POWER0 = 0 and RXE0 = 0, or if ASIS0 register is read.
1
If receive data is set to the RXB register and the next reception operation is completed before the
data is read.
Cautions 1. The operation of the PE0 bit differs depending on the set values of the PS01 and PS00 bits of
asynchronous serial interface operation mode register 0 (ASIM0).
2. Only the first bit of the receive data is checked as the stop bit, regardless of the number of
stop bits.
3. If an overrun error occurs, the next receive data is not written to receive buffer register 0
(RXB0) but discarded.
4. If data is read from ASIS0, a wait cycle is generated. For details, refer to CHAPTER 27
CAUTIONS FOR WAIT.
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
247
(2) Communication operation
(a) Normal transmit/receive data format
Figure 12-5 shows the format of the transmit/receive data.
Figure 12-5. Format of Normal UART Transmit/Receive Data
Start
bit
Parity
bit
D0
D1
D2
D3
D4
1 data frame
Character bits
D5
D6
D7
Stop bit
One data frame consists of the following bits.
Start bit ... 1 bit
Character bits ... 7 or 8 bits (LSB first)
Parity bit ... Even parity, odd parity, 0 parity, or no parity
Stop bit ... 1 or 2 bits
The character bit length, parity, and stop bit length in one data frame are specified by asynchronous serial
interface mode register 0 (ASIM0).
Figure 12-6. Example of Normal UART Transmit/Receive Data Format
1. Data length: 8 bits, Parity: Even parity, Stop bit: 1 bit, Transfer data: 55H
1 data frame
Start
D0
D1
D2
D3
D4
D5
D6
D7
Parity
Stop
2. Data length: 7 bits, Parity: Odd parity, Stop bit: 2 bits, Transfer data: 36H
1 data frame
Start
D0
D1
D2
D3
D4
D5
D6
Parity
Stop
Stop
3. Data length: 8 bits, Parity: None, Stop bit: 1 bit, Transfer data: 87H
1 data frame
Start
D0
D1
D2
D3
D4
D5
D6
D7
Stop
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
248
(b) Parity types and operation
The parity bit is used to detect a bit error in communication data. Usually, the same type of parity bit is used
on both the transmission and reception sides. With even parity and odd parity, a 1-bit (odd number) error
can be detected. With zero parity and no parity, an error cannot be detected.
(i)
Even parity
Transmission
Transmit data, including the parity bit, is controlled so that the number of bits that are "1" is even.
The value of the parity bit is as follows.
If transmit data has an odd number of bits that are "1": 1
If transmit data has an even number of bits that are "1": 0
Reception
The number of bits that are "1" in the receive data, including the parity bit, is counted. If it is odd, a
parity error occurs.
(ii) Odd parity
Transmission
Unlike even parity, transmit data, including the parity bit, is controlled so that the number of bits that
are "1" is odd.
If transmit data has an odd number of bits that are "1": 0
If transmit data has an even number of bits that are "1": 1
Reception
The number of bits that are "1" in the receive data, including the parity bit, is counted. If it is even, a
parity error occurs.
(iii) 0 parity
The parity bit is cleared to 0 when data is transmitted, regardless of the transmit data.
The parity bit is not detected when the data is received. Therefore, a parity error does not occur
regardless of whether the parity bit is "0" or "1".
(iv) No parity
No parity bit is appended to the transmit data.
Reception is performed assuming that there is no parity bit when data is received. Because there is no
parity bit, a parity error does not occur.
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
249
(c) Transmission
The T
X
D0 pin outputs a high level when bit 7 (POWER0) of asynchronous serial interface mode register 0
(ASIM0) is set to 1. If bit 6 (TXE0) of ASIM0 is then set to 1, transmission is enabled. Transmission can be
started by writing transmit data to transmit shift register 0 (TXS0). The start bit, parity bit, and stop bit are
automatically appended to the data.
When transmission is started, the start bit is output from the T
X
D0 pin, followed by the rest of the data in
order starting from the LSB. When transmission is completed, the parity and stop bits set by ASIM0 are
appended and a transmission completion interrupt request (INTST0) is generated.
Transmission is stopped until the data to be transmitted next is written to TXS0.
Figure 12-7 shows the timing of the transmission completion interrupt request (INTST0). This interrupt
occurs as soon as the last stop bit has been output.
Caution
After transmit data is written to TXS0, do not write the next transmit data before the
transmission completion interrupt signal (INTST0) is generated.
Figure 12-7. Normal Transmission Completion Interrupt Request Timing
1. Stop bit length: 1
INTST0
D0
START
D1
D2
D6
D7
STOP
T
X
D0 (output)
Parity
2. Stop bit length: 2
T
X
D0 (output)
INTST0
D0
START
D1
D2
D6
D7
Parity
STOP
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
250
(d) Reception
Reception is enabled and the R
X
D0 pin input is sampled when bit 7 (POWER0) of asynchronous serial
interface operation mode register 0 (ASIM0) is set to 1 and then bit 5 (RXE0) of ASIM0 is set to 1.
The 5-bit counter of the baud rate generator starts counting when the falling edge of the R
X
D0 pin input is
detected. When the set value of baud rate generator control register 0 (BRGC0) has been counted, the
R
X
D0 pin input is sampled again ( in Figure 12-8). If the R
X
D0 pin is low level at this time, it is recognized
as a start bit.
When the start bit is detected, reception is started, and serial data is sequentially stored in receive shift
register 0 (RXS0) at the set baud rate. When the stop bit has been received, the reception completion
interrupt (INTSR0) is generated and the data of RXS0 is written to receive buffer register 0 (RXB0). If an
overrun error (OVE0) occurs, however, the receive data is not written to RXB0.
Even if a parity error (PE0) or a framing error (FE0) occurs while reception is in progress, reception continues
to the reception position of the stop bit, and an error interrupt (INTSR0) is generated after completion of
reception.
Figure 12-8. Reception Completion Interrupt Request Timing
R
X
D0 (input)
INTSR0
Start
D0
D1
D2
D3
D4
D5
D6
D7
Parity
Stop
RXB0
Cautions 1. Be sure to read receive buffer register 0 (RXB0) even if a reception error occurs.
Otherwise, an overrun error will occur when the next data is received, and the reception
error status will persist.
2. Reception is always performed with the "number of stop bits = 1". The second stop bit
is ignored.
3. Be sure to read asynchronous serial interface reception error status register 0 (ASIS0)
before reading RXB0.
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
251
(e) Reception error
Three types of errors may occur during reception: a parity error, framing error, or overrun error. If the error
flag of asynchronous serial interface reception error status register 0 (ASIS0) is set as a result of data
reception, a reception error interrupt request (INTSR0) is generated.
Which error has occurred during reception can be identified by reading the contents of ASIS0 in the reception
error interrupt servicing (INTSR0) (refer to Table 12-2).
The contents of ASIS0 are reset to 0 when ASIS0 is read.
Table 12-2. Cause of Reception Error
Reception Error
Cause
Value of ASIS0
Parity error
The parity specified for transmission does not match the parity of the
receive data.
04H
Framing error
Stop bit is not detected.
02H
Overrun error
Reception of the next data is completed before data is read from
receive buffer register 0 (RXB0).
01H
(f)
Noise filter of receive data
The R
X
D0 signal is sampled using the base clock output by the prescaler block.
If two sampled values are the same, the output of the match detector changes, and the data is sampled as
input data.
Because the circuit is configured as shown in Figure 12-9, the internal processing of the reception operation
is delayed by two clocks from the external signal status.
Figure 12-9. Noise Filter Circuit
Internal signal B
Internal signal A
Match detector
In
Base clock
R
X
D0/SI10/P11
Q
In
LD_EN
Q
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
252
12.4.3 Dedicated baud rate generator
The dedicated baud rate generator consists of a source clock selector and an 5-bit programmable counter, and
generates a serial clock for transmission/reception of UART0.
Separate 5-bit counters are provided for transmission and reception.
(1) Configuration of baud rate generator
Base clock (Clock)
The clock selected by bits 7 and 6 (TPS01 and TPS00) of baud rate generator control register 0 (BRGC0) is
supplied to each module when bit 7 (POWER0) of asynchronous serial interface operation mode register 0
(ASIM0) is 1. This clock is called the base clock "Clock" and its frequency is called f
XCLK
. "Clock" is fixed to
low level when POWER0 = 0.
Transmission counter
This counter stops, cleared to 0, when bit 7 (POWER0) or bit 6 (TXE0) of asynchronous serial interface
operation mode register 0 (ASIM0) is 0.
It starts counting when POWER0 = 1 and TXE0 = 1.
The counter is cleared to 0 when the first data transmitted is written to transmit shift register 0 (TXS0).
Reception counter
This counter stops operation, cleared to 0, when bit 7 (POWER0) or bit 5 (RXE0) of asynchronous serial
interface operation mode register 0 (ASIM0) is 0.
It starts counting when the start bit has been detected.
The counter stops operation after one frame has been received, until the next start bit is detected.
Figure 12-10. Configuration of Baud Rate Generator
Clock
(f
XCLK
)
Selector
POWER0
5-bit counter
Match detector
Baud rate
BRGC0: MDL04 to MDL00
1/2
POWER0, TXE0 (or RXE0)
BRGC0: TPS01, TPS00
TO50/TI50/P17
(TM50 output)
f
X
/2
5
f
X
/2
f
X
/2
3
Remark
POWER0: Bit 7 of asynchronous serial interface operation mode register 0 (ASIM0)
TXE0:
Bit 6 of ASIM0
RXE0:
Bit 5 of ASIM0
BRGC0:
Baud rate generator control register 0
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
253
(2) Generation of serial clock
A serial clock can be generated by using baud rate generator control register 0 (BRGC0).
Select the clock to be input to the 5-bit counter by using bits 7 and 6 (TPS01 and TPS00) of BRGC0.
Bits 4 to 0 (MDL04 to MDL00) of BRGC0 can be used to select the division value of the 5-bit counter.
(a) Baud rate generator control register 0 (BRGC0)
This register selects the base clock of serial interface UART0 and controls the baud rate.
BRGC0 can be set by an 8-bit memory manipulation instruction.
RESET input sets this register to 1FH.
Address: FF71H After reset: 1FH R/W
Symbol
7
6
5
4
3
2
1
0
BRGC0
TPS01
TPS00
0
MDL04
MDL03
MDL02
MDL01
MDL00
TPS01
TPS00
Base clock (f
XCLK
) selection
0
0
TM50 output (TO50)
0
1
f
X
/2 (5 MHz)
1
0
f
X
/2
3
(1.25 MHz)
1
1
f
X
/2
5
(312.5 kHz)
MDL04
MDL03
MDL02
MDL01
MDL00
k
Selection of 5-bit counter
output clock
0
0
Setting prohibited
0
1
0
0
0
8
f
XCLK
/8
0
1
0
0
1
9
f
XCLK
/9
0
1
0
1
0
10
f
XCLK
/10




























1
1
0
1
0
26
f
XCLK
/26
1
1
0
1
1
27
f
XCLK
/27
1
1
1
0
0
28
f
XCLK
/28
1
1
1
1
0
30
f
XCLK
/30
1
1
1
1
1
31
f
XCLK
/31
Cautions 1. Make sure that bit 6 (TXE0) and bit 5 (RXE0) of the ASIM0 register = 0 when rewriting the
MDL04 to MDL00 bits.
2. The baud rate value is the output clock of the 5-bit counter divided by 2.
Remarks 1. f
XCLK
: Frequency of base clock (Clock) selected by the TPS01 and TPS00 bits
2. f
X
:
X1 input clock oscillation frequency
3. k:
Value set by the MDL04 to MDL00 bits (k = 8, 9, 10, ..., 31)
4.
:
Don't care
5. Figures in parentheses apply to operation with f
X
= 10 MHz
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
254
(b) Baud rate
The baud rate can be calculated by the following expression.
Baud rate = [bps]
f
XCLK
: Frequency of base clock (Clock) selected by the TPS01 and TPS00 bits of the BRGC0 register
k:
Value set by the MDL04 to MDL00 bits of the BRGC0 register (k = 8, 9, 10, ..., 31)
(c) Error of baud rate
The baud rate error can be calculated by the following expression.
Error (%) = - 1 100 [%]
Cautions 1. Keep the baud rate error during transmission to within the permissible error range at
the reception destination.
2. Make sure that the baud rate error during reception satisfies the range shown in (4)
Permissible baud rate range during reception.
Example: Frequency of base clock (Clock) = 2.5 MHz = 2,500,000 Hz
Set value of MDL04 to MDL00 bits of BRGC0 register = 10000B (k = 16)
Target baud rate = 76,800 bps
Baud rate = 2.5 M/(2
16)
= 2,500,000/(2
16) = 78,125 [bps]
Error = (78,125/76,800
- 1) 100
= 1.725 [%]
f
XCLK
2
k
Actual baud rate (baud rate with error)
Desired baud rate (correct baud rate)
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
255
(3) Example of setting baud rate
Table 12-3. Set Data of Baud Rate Generator
f
X
= 10.0 MHz
f
X
= 8.38 MHz
f
X
= 4.19 MHz
Baud Rate
[bps]
TPS01,
TPS00
k
Calculated
value
ERR[%]
TPS01,
TPS00
k
Calculated
Value
ERR[%]
TPS01,
TPS00
k
Calculated
Value
ERR[%]
2400
-
-
-
-
-
-
-
-
3
27
2425
1.03
4800
-
-
-
-
3
27
4850
1.03
3
14
4676
-2.58
9600
3
16
9766
1.73
3
14
9353
-2.58
2
27
9699
1.03
10400
3
15
10417
0.16
3
13
10072
-3.15
2
25
10475
0.72
19200
3
8
19531
1.73
2
27
19398
1.03
2
14
18705
-2.58
31250
2
20
31250
0
2
17
30809
-1.41
-
-
-
-
38400
2
16
39063
1.73
2
14
38796
-2.58
2
27
38796
1.03
76800
2
8
78125
1.73
1
27
77593
1.03
1
14
74821
-2.58
115200
1
22
113636
-1.36
1
18
116389
1.03
1
9
116389
1.03
153600
1
16
156250
1.73
1
14
149643
-2.58
-
-
-
-
230400
1
11
227273
-1.36
1
9
232778
1.03
-
-
-
-
Remark
TPS01, TPS00:
Bits 7 and 6 of baud rate generator control register 0 (BRGC0) (setting of base clock
(f
XCLK
))
k:
Value set by the MDL04 to MDL00 bits of BRGC0 (k = 8, 9, 10, ..., 31)
f
X
:
X1 input clock oscillation frequency
ERR:
Baud rate error
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
256
(4) Permissible baud rate range during reception
The permissible error from the baud rate at the transmission destination during reception is shown below.
Caution
Make sure that the baud rate error during reception is within the permissible error range, by
using the calculation expression shown below.
Figure 12-11. Permissible Baud Rate Range During Reception
FL
1 data frame (11
FL)
FLmin
FLmax
Transfer rate
of UART0
Start bit
Bit 0
Bit 1
Bit 7
Parity bit
Minimum permissible
transfer rate
Maximum permissible
transfer rate
Stop bit
Start bit
Bit 0
Bit 1
Bit 7
Parity bit
Latch timing
Stop bit
Start bit
Bit 0
Bit 1
Bit 7
Parity bit
Stop bit
As shown in Figure 12-11, the latch timing of the receive data is determined by the counter set by baud rate
generator control register 0 (BRGC0) after the start bit has been detected. If the last data (stop bit) meets this
latch timing, the data can be correctly received.
Assuming that 14-bit data is received, the theoretical values can be calculated as follows.
FL = (Brate)
-
1
Brate: Baud rate of UART0
k:
Set value of BRGC0
FL:
1-bit data length
Margin of latch timing: 2 clocks
CHAPTER 12 SERIAL INTERFACE UART0
Preliminary User's Manual U16227EJ1V0UD
257
Minimum permissible transfer rate: FLmin = 11
FL - FL = FL
Therefore, the maximum receivable baud rate at the transmission destination is as follows.
BRmax = (FLmin/11)
-
1
= Brate
Similarly, the maximum permissible transfer rate can be calculated as follows.
10
k + 2
21k
- 2
11
2
k
2
k
FLmax = FL
11
Therefore, the minimum receivable baud rate at the transmission destination is as follows.
BRmin = (FLmax/11)
-
1
= Brate
The permissible baud rate error between UART0 and the transmission destination can be calculated from the
above minimum and maximum baud rate expressions, as follows.
Table 12-4. Maximum/Minimum Permissible Baud Rate Error
Division Ratio (k)
Maximum Permissible Baud Rate Error
Minimum Permissible Baud Rate Error
8
+3.53%
-3.61%
16
+4.14%
-4.19%
24
+4.34%
-4.38%
31
+4.44%
-4.47%
Remarks 1. The accuracy of reception depends on the number of bits in one frame, input clock frequency,
and division ratio (k). The higher the input clock frequency and the higher the division ratio (k),
the higher the accuracy.
2. k: Set value of BRGC0
k
- 2
2k
21k + 2
2k
22k
21k + 2
FLmax = 11 FL - FL = FL
21k
2
20k
20k
21k
- 2
Preliminary User's Manual U16227EJ1V0UD
258
CHAPTER 13 SERIAL INTERFACE UART6
13.1 Functions of Serial Interface UART6
Serial interface UART6 has the following two modes.
(1) Operation stop mode
This mode is used when serial transfer is not executed and can enable a reduction in the power consumption.
For details, refer to 13.4.1 Operation stop mode.
(2) Asynchronous serial interface (UART) mode
This mode supports the LIN (Local Interconnect Network) bus. The functions of this mode are outlined below.
Two-pin configuration T
X
D6: Transmit data output pin
R
X
B6: Receive data input pin
Data length of transfer data can be selected from 7 or 8 bits.
Dedicated internal 8-bit baud rate generator allowing any baud rate to be set
Transmission and reception can be performed independently.
Twelve operating clock inputs selectable
MSB- or LSB-first transfer selectable
Inverted transmission operation
Tuning break field transmission from 13 to 20 bits
More than 11 bits can be identified for tuning break field reception (SBF reception flag provided).
Cautions 1. The default value of the T
X
D6 pin is the high level. Exercise care when using the T
X
D6 pin
as a port pin.
2. The T
X
D6 output inversion function inverts only the transmission side and not the reception
side. To use this function, the reception side must be ready for reception of inverted data (it
must be able to recognize a low-level start bit).
3. If clock supply to serial interface UART6 is not stopped (e.g., in the HALT mode), normal
operation continues. If clock supply to serial interface UART6 is stopped (e.g., in the STOP
mode), each register stops operating, and holds the value immediately before clock supply
was stopped. The T
X
D6 pin also holds the value immediately before clock supply was
stopped and outputs it. However, the operation is not guaranteed after clock supply is
resumed. Therefore, reset the circuit so that POWER6 = 0, RXE6 = 0, and TXE6 = 0.
4. If data is continuously transmitted, the transfer rate from the stop bit to the next start bit is
extended two clocks. However, this does not affect the result of transfer because the
reception side initializes the timing when it has detected a start bit. Do not use the
continuous transmission function if the interface is incorporated in LIN.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
259
Remark
LIN stands for Local Interconnect Network and is a low-speed (1 to 20 kbps) serial communication
protocol intended to aid the cost reduction of an automotive network.
LIN communication is single-master communication, and up to 15 slaves can be connected to one
master.
The LIN slaves are used to control the switches, actuators, and sensors, and these are connected to the
LIN master via the LIN network.
Normally, the LIN master is connected to a network such as CAN (Controller Area Network).
In addition, the LIN bus uses a single-wire method and is connected to the nodes via a transceiver that
complies with ISO9141.
In the LIN protocol, the master transmits a frame with baud rate information and the slave receives it and
corrects the baud rate error. Therefore, communication is possible when the baud rate error in the slave
is
15% or less.
Figures 13-1 and 13-2 outline the transmission and reception operations of LIN.
Figure 13-1. LIN Transmission Operation
Sleep
bus
TX6
INTST6
Note 4
Wakeup
signal frame
Tuning
break field
Tuning field
Match field
Data field
Checksum
field
Data field
8 bits
Note 3
Note 1
13-bit
Note 2
SBF
transmission
55H
transmission
Data
transmission
Data
transmission
Data
transmission
Data
transmission
Notes 1.
The interval between each field is controlled by software.
2.
The tuning break field is output by hardware. The output width is equal to the bit length set by bits 4 to
2 (SBL62 to SBL60) of asynchronous serial interface control register 6 (ASICL6). If the output width
needs to be adjusted more accurately, use baud rate generator control register 6 (BRGC6).
3.
The wakeup signal frame is substituted by 80H transfer in the 8-bit mode.
4.
INTST6 is output on completion of each transmission. It is also output when SBF is transmitted.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
260
Figure 13-2. LIN Reception Operation
Sleep
bus
RX6
Reception interrupt
(INTSR6)
Edge detection
(INTP0)
Capture timer
Data
reception
Wakeup
signal frame
Tuning
break field
Tuning field
Match field
Data filed
Data filed
Checksum
field
Disable
Enable
Disable
Enable
Note 1
Note 3
Note 4
13 bits
Note 2
SBF
reception
ID reception
SF
reception
Data
reception
Data
reception
Note 5
Notes 1.
The wakeup signal is detected at the edge of the pin, and enables UART6 and sets the SBF reception
mode.
2.
Reception continues until the STOP bit is detected. When 11 bits or more of SBF have been detected,
it is assumed that SBF reception has been completed correctly, and an interrupt signal is output. If
less than 11 bits of SBF have been detected, it is assumed that an SBF reception error has occurred.
The interrupt signal is not output and the SBF reception mode is restored.
3.
If SBF reception has been completed correctly, an interrupt signal is output. This SBF reception
completion interrupt enables the capture timer. Detection of errors OVE6, PE6, and FE6 is
suppressed, and error detection processing of UART communication and data transfer of the shift
register and RXB6 is not performed. The shift register holds the reset value FFH.
4.
Calculate the baud rate error from the value obtained from the capture timer, disable UART6 after SF
reception, and then re-set baud rate generator control register 6 (BRGC6).
5.
Distinguish the checksum field by software. Also perform processing by software to initialize UART6
after reception of the checksum field and to set the SBF reception mode again.
To perform a LIN receive operation, use a configuration like the one shown in Figure 13-3.
The wakeup signal transmitted from the LIN master is received by detecting the edge of the external interrupt
(INTP0). The length of the tuning break field transmitted from the LIN master can be measured using the external
event capture operation of 16-bit timer/event counter 00, and the baud rate error can be calculated using the time and
number of bits of the tuning break field.
The input signal of the reception port input (RxD6) can be input to the external interrupt (INTP0) and 16-bit
timer/event counter 00 by port input switching control (ISC0/ISC1), without connecting RxD6 and INTP0/TI000
externally.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
261
Figure 13-3. Port Configuration for LIN Reception Operation
MPX
RXD6 input
INTP0 input
TI000 input
P14/R
X
D6
P120/INTP0
P00/TI000
Port input
switch control
(ISC0)
<ISC0>
0: A output
1: B output
A
B
Q
MPX
Port mode
(PM14)
A
B
Q
Port latch
(P14)
MPX
Port mode
(PM120)
A
B
Q
Port latch
(P120)
MPX
Port input
switch control
(ISC1)
<ISC1>
0: A output
1: B output
A
B
Q
MPX
Port mode
(PM00)
A
B
Q
Port latch
(P00)
Remark
ISC0, ISC1: Bits 0 and 1 of the input switching control register (ISC) (see Figure 4-19.)
The resources used in the LIN communication operation are shown below.
<Resources used>
External interrupt (INTP0); wakeup signal detection
Use: Detects the wakeup signal edges and detects start of communication.
16-bit timer/event counter 00 (TI000); baud rate error detection
Use: Detects the baud rate error (measures the TI000 input edge interval in the capture mode) by detecting the
tuning break field (SBF) length and divides it by the number of bits.
Serial interface UART6
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
262
13.2 Configuration of Serial Interface UART6
Serial interface UART6 consists of the following hardware.
Table 13-1. Configuration of Serial Interface UART6
Item
Configuration
Registers
Receive buffer register 6 (RXB6)
Receive shift register 6 (RXS6)
Transmit buffer register 6 (TXB6)
Transmit shift register 6 (TXS6)
Control registers
Asynchronous serial interface operation mode register 6 (ASIM6)
Asynchronous serial interface reception error status register 6 (ASIS6)
Asynchronous serial interface transmission status register 6 (ASIF6)
Clock selection register 6 (CKSR6)
Baud rate generator control register 6 (BRGC6)
Asynchronous serial interface control register 6 (ASICL6)
CHAP
T
E
R
13
S
E
R
I
A
L

I
N
T
E
RF
ACE
UART
6
Pr
e
lim
i
n
a
r
y Us
e
r
'
s
Ma
nu
al
U
1
6
227E
J
1
V
0
U
D
263
Figure 13-4. Block Diagram of Serial Interface UART6
Asynchronous serial interface
control register 6 (ASICL6)
Transmit buffer register 6
(TXB6)
Transmit shift register 6
(TXS6)
T
X
D6/P13
INTST6
Asynchronous serial interface
control register 6 (ASICL6)
Receive shift register 6
(RXS6)
Receive buffer register 6
(RXB6)
R
X
D6/P14
INTSR6
INTSRE6
Asynchronous serial
interface reception error
status register 6 (ASIS6)
Asynchronous serial
interface operation mode
register 6 (ASIM6)
Asynchronous serial
interface transmission
status register 6 (ASIF6)
f
X
-f
X
/2
10
Clock selection
register 6 (CKSR6)
Baud rate generator
control register 6
(BRGC6)
TO50/TI50/P17
(TM50 output)
Registers
Selector
Baud rate
generator
Baud rate
generator
Reception unit
Reception control
Filter
Internal bus
Transmission control
Transmission unit
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
264
(1) Receive buffer register 6 (RXB6)
This 8-bit register stores parallel data converted by the receive shift register.
Each time 1 byte of data has been received, new receive data is transferred to this register from receive shift
register 6 (RXS6). If the data length is set to 7 bits, data is transferred as follows.
In LSB-first reception, the receive data is transferred to bits 0 to 6 of RXB6 and the MSB of RXB6 is always 0.
In MSB-first reception, the receive data is transferred to bits 1 to 7 of RXB6 and the LSB of RXB6 is always 0.
If an overrun error (OVE6) occurs, the receive data is not transferred to RXB6.
RXB6 can be read by an 8-bit memory manipulation instruction. No data can be written to this register.
RESET input sets this register to FFH.
(2) Receive shift register 6 (RXS6)
This register converts the serial data input to the R
X
D6 pin into parallel data.
RXS6 cannot be directly manipulated by a program.
(3) Transmit buffer register 6 (TXB6)
This buffer register is used to set transmit data. Transmission is started when data is written to TXB6.
This register can be read or written by an 8-bit memory manipulation instruction.
RESET input sets this register to FFH.
Cautions 1. Do not write data to TXB6 when bit 1 (TXBF6) of asynchronous serial interface transmission
status register 6 (ASIF6) is 1.
2. Do not refresh (write the same value to) TXB6 by software during a communication
operation (when bit 7 (POWER6) and bit 6 (TXE6) of asynchronous serial interface operation
mode register 6 (ASIM6) are 1 or when bit 7 (POWER6) and bit 5 (RXE6) of ASIM6 are 1).
However, if the same value is continuously transmitted in the transmission mode (POWER6
= 1 and TXE6 = 1), the same value can be written.
(4) Transmit shift register 6 (TXS6)
This register transmits the data transferred from TXB6 from the T
X
D6 pin as serial data. Data is transferred from
TXB6 immediately after TXB6 is written for the first transmission, or immediately before INTST6 occurs after one
frame was transmitted for continuous transmission. Data is transferred from TXB6 and transmitted from the T
X
D6
pin at the falling edge of the internal clock.
TXS6 cannot be directly manipulated by a program.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
265
13.3 Registers Controlling Serial Interface UART6
Serial interface UART6 is controlled by the following six registers.
Asynchronous serial interface operation mode register 6 (ASIM6)
Asynchronous serial interface reception error status register 6 (ASIS6)
Asynchronous serial interface transmission status register 6 (ASIF6)
Clock selection register 6 (CKSR6)
Baud rate generator control register 6 (BRGC6)
Asynchronous serial interface control register 6 (ASICL6)
(1) Asynchronous serial interface operation mode register 6 (ASIM6)
This 8-bit register controls the serial transfer operations of serial interface UART6.
This register can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input sets this register to 01H.
Remark
ASIM6 can be refreshed (the same value is written) by software during a communication operation
(when bit 7 (POWER6) and bit 6 (TXE6) of ASIM6 = 1 or bit 7 (POWER6) and bit 5 (RXE6) of ASIM6
= 1).
Figure 13-5. Format of Asynchronous Serial Interface Operation Mode Register 6 (ASIM6) (1/2)
Address: FF50H After reset: 01H R/W
Symbol
7
6
5
4
3
2
1
0
ASIM6
POWER6
TXE6
RXE6
PS61
PS60
CL6
SL6
ISRM6
POWER6
Enables/disables operation of internal operation clock
0
Note 1
Disables operation of the internal operation clock (fixes the clock to low level) and asynchronously
resets the internal circuit.
1
Note 2
Enables operation of the internal operation clock
TXE6
Enables/disables transmission
0
Disables transmission (synchronously resets the transmission circuit).
1
Enables transmission
Notes 1.
The output of the T
X
D6 pin goes high and the input from the R
X
D6 pin is fixed to the high level when
POWER6 = 0.
2.
Operation of the internal operation clock is enabled at the second input clock after 1 is written to the
POWER6 bit.
Caution
At startup, set POWER6 to 1 and then set TXE6 to 1. Clear TXE6 to 0 first, and then clear
POWER6 to 0.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
266
Figure 13-5. Format of Asynchronous Serial Interface Operation Mode Register 6 (ASIM6) (2/2)
RXE6
Enables/disables reception
0
Disables reception (synchronously resets the reception circuit).
1
Enables reception
PS61
PS60
Transmission operation
Reception operation
0
0
Does not output parity bit.
Reception without parity
0
1
Outputs 0 parity.
Reception as 0 parity
Note
1
0
Outputs odd parity.
Judges as odd parity.
1
1
Outputs even parity.
Judges as even parity.
CL6
Specifies character length of transmit/receive data
0
Character length of data = 7 bits
1
Character length of data = 8 bits
SL6
Specifies number of stop bits of transmit data
0
Number of stop bits = 1
1
Number of stop bits = 2
ISRM6
Enables/disables occurrence of reception completion interrupt in case of error
0
"INTSRE6" occurs in case of error (at this time, INTSR6 does not occur).
1
"INTSR6" occurs in case of error (at this time, INTSRE6 does not occur).
Note If "reception as 0 parity" is selected, the parity is not judged. Therefore, bit 2 (PE6) of asynchronous serial
interface reception error status register 6 (ASIS6) is not set and the error interrupt does not occur.
Cautions 1. At startup, set POWER6 to 1 and then set RXE6 to 1. Clear RXE6 to 0 first, and then clear
POWER6 to 0.
2. Clear the TXE6 and RXE6 bits to 0 before rewriting the PS61, PS60, and CL6 bits.
3. Fix the PS61 and PS60 bits to 0 when mounting the device on LIN.
4. Make sure that TXE6 = 0 when rewriting the SL6 bit. Reception is always performed with "the
number of stop bits = 1", and therefore, is not affected by the set value of the SL6 bit.
5. Make sure that RXE6 = 0 when rewriting the ISRM6 bit.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
267
(2) Asynchronous serial interface reception error status register 6 (ASIS6)
This register indicates an error status on completion of reception by serial interface UART6. It includes three
error flag bits (PE6, FE6, OVE6).
This register can be set by an 8-bit memory manipulation instruction and is read-only.
RESET input clears this register to 00H if bit 7 (POWER6) and bit 5 (RXE6) of ASIM6 = 0. 00H is read when this
register is read.
Figure 13-6. Format of Asynchronous Serial Interface Reception Error Status Register 6 (ASIS6)
Address: FF53H After reset: 00H R
Symbol
7
6
5
4
3
2
1
0
ASIS6
0
0
0
0
0
PE6
FE6
OVE6
PE6
Status flag indicating parity error
0
If POWER6 = 0 and RXE6 = 0, or if ASIS6 register is read
1
If the parity of transmit data does not match the parity bit on completion of reception
FE6
Status flag indicating framing error
0
If POWER6 = 0 and RXE6 = 0, or if ASIS6 register is read
1
If the stop bit is not detected on completion of reception
OVE6
Status flag indicating overrun error
0
If POWER6 = 0 and RXE6 = 0, or if ASIS6 register is read
1
If receive data is set to the RXB register and the next reception operation is completed before the
data is read.
Cautions 1. The operation of the PE6 bit differs depending on the set values of the PS61 and PS60 bits of
asynchronous serial interface operation mode register 6 (ASIM6).
2. The first bit of the receive data is checked as the stop bit, regardless of the number of stop
bits.
3. If an overrun error occurs, the next receive data is not written to receive buffer register 6
(RXB6) but discarded.
4. If data is read from ASIS6, a wait cycle is generated. For details, refer to CHAPTER 27
CAUTIONS FOR WAIT.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
268
(3) Asynchronous serial interface transmission status register 6 (ASIF6)
This register indicates the status of transmission by serial interface UART6. It includes two status flag bits
(TXBF6 and TXSF6).
Transmission can be continued without disruption even during an interrupt period, by writing the next data to the
TXB6 register after data has been transferred from the TXB6 register to the TXS6 register.
This register can be set by an 8-bit memory manipulation instruction, and is read-only.
RESET input clears this register to 00H if bit 7 (POWER6) and bit 6 (TXE6) of ASIM6 = 0.
Figure 13-7. Format of Asynchronous Serial Interface Transmission Status Register 6 (ASIF6)
Address: FF55H After reset: 00H R
Symbol
7
6
5
4
3
2
1
0
ASIF6
0
0
0
0
0
0
TXBF6
TXSF6
TXBF6
Transmit buffer data flag
0
If POWER6 = 0 or TXE6 = 0, or if data is transferred to transmit shift register 6 (TXS6)
1
If data is written to transmit buffer register 6 (TXB6) (if data exists in TXB6)
TXSF6
Transmit shift register data flag
0
If POWER6 = 0 or TXE6 = 0, or if the next data is not transferred from transmit buffer register 6
(TXB6) after completion of transfer
1
If data is transferred from transmit buffer register 6 (TXB6) (if data transmission is in progress)
Cautions 1. To continuously transmit data, write the data of the first byte to TXB6, check that the value of
the TXBF6 flag is 0, and then write the data of the second byte to TXB6. The operation is not
guaranteed if data is written to TXB6 while the TXBF6 flag is 1.
2. While continuous transmission is being executed, check the value of the TXSF6 flag after the
transmission completion interrupt to determine the subsequent write processing to TXB6.



If TXSF6 is 1: Continuous transmission is in progress. Data of 1 byte can be written.



If TXSF6 is 0: Continuous transmission is complete. Data of 2 bytes can be written. When
doing so, observe Caution 1 above.
3. While continuous transmission is in progress, check that TXSF6 is 0 after the transmission
completion interrupt, and then execute clearing (POWER6 = 0 or TXE6 = 0). If clearing is
executed while the TXSF6 flag is 1, the transmit data cannot be guaranteed.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
269
(4) Clock selection register 6 (CKSR6)
This register selects the base clock of serial interface UART6.
CKSR6 can be set by an 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Remark
CKSR6 can be refreshed (the same value is written) by software during a communication operation
(when bit 7 (POWER6) and bit 6 (TXE6) of ASIM6 = 1 or bit 7 (POWER6) and bit 5 (RXE6) of ASIM6
= 1).
Figure 13-8. Format of Clock Selection Register 6 (CKSR6)
Address: FF56H After reset: 00H R/W
Symbol
7
6
5
4
3
2
1
0
CKSR6
0
0
0
0
TPS63
TPS62
TPS61
TPS60
TPS63
TPS62
TPS61
TPS60
Base clock (f
XCLK
)
0
0
0
0
f
X
(10 MHz)
0
0
0
1
f
X
/2 (5 MHz)
0
0
1
0
f
X
/2
2
(2.5 MHz)
0
0
1
1
f
X
/2
3
(1.25 MHz)
0
1
0
0
f
X
/2
4
(625 kHz)
0
1
0
1
f
X
/2
5
(312.5 kHz)
0
1
1
0
f
X
/2
6
(156.25 kHz)
0
1
1
1
f
X
/2
7
(78.13 kHz)
1
0
0
0
f
X
/2
8
(39.06 kHz)
1
0
0
1
f
X
/2
9
(19.53 kHz)
1
0
1
0
f
X
/2
10
(9.77 kHz)
1
0
1
1
TM50 output (TO50)
Other
Setting prohibited
Caution
Make sure POWER6 = 0 when rewriting TPS63 to TPS60.
Remarks 1. Figures in parentheses are for operation with f
X
= 10 MHz
2. f
X
: X1 input clock oscillation frequency
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
270
(5) Baud rate generator control register 6 (BRGC6)
This register selects the base clock of serial interface UART6.
BRGC6 can be set by an 8-bit memory manipulation instruction.
RESET input sets this register to FFH.
Remark
BRGC6 can be refreshed (the same value is written) by software during a communication operation
(when bit 7 (POWER6) and bit 6 (TXE6) of ASIM6 = 1 or bit 7 (POWER6) and bit 5 (RXE6) of ASIM6
= 1).
Figure 13-9. Format of Baud Rate Generator Control Register 6 (BRGC6)
Address: FF57H After reset: FFH R/W
Symbol
7
6
5
4
3
2
1
0
BRGC6
MDL67
MDL66
MDL65
MDL64
MDL63
MDL62
MDL61
MDL60
MDL67
MDL66
MDL65
MDL64
MDL63
MDL62
MDL61
MDL60
k
Output clock selection of
8-bit counter
0
0
0
0
0
Setting prohibited
0
0
0
0
1
0
0
0
8
f
XCLK
/8
0
0
0
0
1
0
0
1
9
f
XCLK
/9
0
0
0
0
1
0
1
0
10
f
XCLK
/10








































1
1
1
1
1
1
0
0
252
f
XCLK
/252
1
1
1
1
1
1
0
1
253
f
XCLK
/253
1
1
1
1
1
1
1
0
254
f
XCLK
/254
1
1
1
1
1
1
1
1
255
f
XCLK
/255
Cautions 1. Make sure that bit 6 (TXE6) and bit 5 (RXE6) of the ASIM6 register = 0 when rewriting the
MDL67 to MDL60 bits.
2. The baud rate is the output clock of the 8-bit counter divided by 2.
Remarks 1. f
XCLK
: Frequency of base clock (Clock) selected by the TPS63 to TPS60 bits of CKSR6 register
2. k:
Value set by MDL67 to MDL60 bits (k = 8, 9, 10, ..., 255)
3.
:
Don't care
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
271
(6) Asynchronous serial interface control register 6 (ASICL6)
This register controls the serial transfer operations of serial interface UART6.
ASICL6 can be set by a 1-bit transfer instruction or an 8-bit memory manipulation instruction.
RESET input sets this register to 16H.
Remark
ASICL6 can be refreshed (the same value is written) by software during a communication operation
(when bit 7 (POWER6) and bit 6 (TXE6) of ASIM6 = 1 or bit 7 (POWER6) and bit 5 (RXE6) of ASIM6 =
1). However, transfer is started by refresh because bit 6 (SBRT6) and bit 5 (SBTT6) of ASICL6 are
cleared to 0 when communication is complete (when an interrupt signal is generated).
Figure 13-10. Format of Asynchronous Serial Interface Control Register 6 (ASICL6) (1/2)
Address: FF58H After reset: 16H R/W
Note
Symbol
7
6
5
4
3
2
1
0
ASICL6
SBRF6
SBRT6
SBTT6
SBL62
SBL61
SBL60
DIR6
TXDLV6
SBRF6
SBF reception status flag
0
If POWER6 = 0 and RXE6 = 0 or if SBF reception has been completed correctly
1
SBF reception in progress
SBRT6
SBF reception trigger
0
-
1
SBF reception trigger
SBTT6
SBF transmission trigger
0
-
1
SBF transmission trigger
Note Bit 7 is read-only.
Cautions 1. In the case of an SBF reception error, return the mode to the SBF reception mode and hold
the status of the SBRF6 flag.
2. Before setting the SBRT6 bit, make sure that bit 7 (POWER6) and bit 5 (RXE6) of ASIM6 = 1.
3. The read value of the SBRT6 bit is always 0. SBRT6 is automatically cleared to 0 after SBF
reception has been correctly completed.
4. Before setting the SBTT6 bit to 1, make sure that bit 7 (POWER6) and bit 6 (TXE6) of ASIM6 =
1.
5. The read value of the SBTT6 bit is always 0. SBTT6 is automatically cleared to 0 at the end of
SBF transmission.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
272
Figure 13-10. Format of Asynchronous Serial Interface Control Register 6 (ASICL6) (2/2)
SBL62
SBL61
SBL60
SBF transmission output width control
1
0
1
SBF is output with 13-bits length.
1
1
0
SBF is output with 14-bits length.
1
1
1
SBF is output with 15-bits length.
0
0
0
SBF is output with 16-bits length.
0
0
1
SBF is output with 17-bits length.
0
1
0
SBF is output with 18-bits length.
0
1
1
SBF is output with 19-bits length.
1
0
0
SBF is output with 20-bits length.
DIR6
MSB/LSB-first transfer
0
MSB-first transfer
1
LSB-first transfer
TXDLV6
Enables/disables inverting T
X
D6 output
0
Normal output of T
X
D6
1
Inverted output of T
X
D6
Caution
Before rewriting the DIR6 and TXDLV6 bits, clear the TXE6 and RXE6 bits to 0.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
273
13.4 Operation of Serial Interface UART6
This section explains the two modes of serial interface UART6.
13.4.1 Operation stop mode
In this mode, serial transfer cannot be executed; therefore, the power consumption can be reduced. In addition,
the pins can be used as ordinary port pins in this mode.
(1) Register setting
The operation stop mode is set by asynchronous serial interface operation mode register 6 (ASIM6).
ASIM6 can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input sets this register to 01H.
Remark
ASIM6 can be refreshed (the same value is written) by software during a communication operation
(when bit 7 (POWER6) and bit 6 (TXE6) of ASIM6 = 1 or bit 7 (POWER6) and bit 5 (RXE6) of ASIM6
= 1).
Address: FF50H After reset: 01H R/W
Symbol
7
6
5
4
3
2
1
0
ASIM6
POWER6
TXE6
RXE6
PS61
PS60
CL
SL6
ISRM6
POWER6
Enables/disables operation of internal operation clock
0
Note 1
Disables operation of the internal operation clock (fixes the clock to low level) and asynchronously
resets the internal circuit.
1
Note 2
Enables operation of the internal operation clock.
TXE6
Enables/disables transmission
0
Disables transmission operation (synchronously resets the transmission circuit).
1
Enables transmission
RXE6
Enables/disables reception
0
Disables reception (synchronously resets the reception circuit).
1
Enables reception
Notes 1.
The output of the T
X
D6 pin goes high and the input from the R
X
D6 pin is fixed to the high level when
POWER6 = 0.
2.
Operation of the internal operation clock is enabled at the second input clock after 1 is written to the
POWER6 bit.
Cautions 1. At startup, set POWER6 to 1 and then set TXE6 to 1. Clear TXE6 to 0 first, and then clear
POWER6 to 0.
2. At startup, set POWER6 to 1 and then set RXE6 to 1. Clear RXE6 to 0 first, and then clear
POWER6 to 0.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
274
13.4.2 Asynchronous serial interface (UART) mode
In this mode, data of 1 byte is transmitted/received following a start bit, and a full-duplex operation can be
performed.
A dedicated UART baud rate generator is incorporated, so that communication can be executed at a wide range of
baud rates.
(1) Register setting
The UART mode is set by asynchronous serial interface operation mode register 6 (ASIM6), asynchronous serial
interface reception error status register 6 (ASIS6), asynchronous serial interface transmission status register 6
(ASIF6), and asynchronous serial interface control register 6 (ASICL6).
(a) Asynchronous serial interface operation mode register 6 (ASIM6)
This 8-bit register controls the serial transfer operations of serial interface UART6.
ASIM6 can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input sets this register to 01H.
Remark
ASIM6 can be refreshed (the same value is written) by software during a communication operation
(when bit 7 (POWER6) and bit 6 (TXE6) of ASIM6 = 1 or bit 7 (POWER6) and bit 5 (RXE6) of
ASIM6 = 1).
Address: FF50H After reset: 01H R/W
Symbol
7
6
5
4
3
2
1
0
ASIM6
POWER6
TXE6
RXE6
PS61
PS60
CL6
SL6
ISRM6
POWER6
Enables/disables operation of internal operation clock
0
Note 1
Disables operation of the internal operation clock (fixes the clock to low level) and asynchronously
resets the internal circuit.
1
Note 2
Enables operation of the internal operation clock.
TXE6
Enables/disables transmission
0
Disables transmission (synchronously resets the transmission circuit).
1
Enables transmission
Notes 1.
The output of the T
X
D6 pin goes high and the input from the R
X
D6 pin is fixed to the high level when
POWER6 = 0.
2.
Operation of the internal operation clock is enabled at the second input clock after 1 is written to the
POWER6 bit.
Caution
At startup, set POWER6 to 1 and then set TXE6 to 1. Clear TXE6 to 0 first, and then clear
POWER6 to 0.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
275
RXE6
Enables/disables reception
0
Disables reception (synchronously resets the reception circuit).
1
Enables reception
PS61
PS60
Transmission operation
Reception operation
0
0
Does not output parity bit.
Reception without parity
0
1
Outputs 0 parity.
Reception as 0 parity
Note
1
0
Outputs odd parity.
Judges as odd parity.
1
1
Outputs even parity.
Judges as even parity.
CL6
Specifies character length of transmit/receive data
0
Character length of data = 7 bits
1
Character length of data = 8 bits
SL6
Specifies number of stop bits of transmit data
0
Number of stop bits = 1
1
Number of stop bits = 2
ISRM6
Enables/disables occurrence of reception completion interrupt in case of error
0
"INTSRE6" occurs in case of error (at this time, INTSR6 does not occur).
1
"INTSR6" occurs in case of error (at this time, INTSRE6 does not occur).
Note If "reception as 0 parity" is selected, the parity is not judged. Therefore, bit 2 (PE6) of asynchronous serial
interface reception error status register 6 (ASIS6) is not set and the error interrupt does not occur.
Cautions 1. At startup, set POWER6 to 1 and then set RXE6 to 1. Clear RXE6 to 0 first, and then clear
POWER6 to 0.
2. Clear the TXE6 and RXE6 bits to 0 before rewriting the PS61, PS60, and CL6 bits.
3. Fix the PS61 and PS60 bits to 0 when mounting the device on LIN.
4. Make sure that TXE6 = 0 when rewriting the SL6 bit. Reception is always performed with "the
number of stop bits = 1", and therefore, is not affected by the set value of the SL6 bit.
5. Make sure that RXE6 = 0 when rewriting the ISRM6 bit.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
276
(b) Asynchronous serial interface reception error status register 6 (ASIS6)
This register indicates an error status on completion of reception by serial interface UART6. It includes three
error flag bits (PE6, FE6, OVE6).
This register can be set by an 8-bit memory manipulation instruction and is read-only.
RESET input clears this register to 00H if bit 7 (POWER6) and bit 5 (RXE6) of ASIM6 = 0. 00H is read when
this register is read.
Address: FF53H After reset: 00H R
Symbol
7
6
5
4
3
2
1
0
ASIS6
0
0
0
0
0
PE6
FE6
OVE6
PE6
Status flag indicating parity error
0
If POWER6 = 0 and RXE6 = 0, or if ASIS6 register is read
1
If the parity of transmit data does not match the parity bit on completion of reception
FE6
Status flag indicating framing error
0
If POWER6 = 0 and RXE6 = 0, or if ASIS6 register is read
1
If the stop bit is not detected on completion of reception
OVE6
Status flag indicating overrun error
0
If POWER6 = 0 and RXE6 = 0, or if ASIS6 register is read
1
If receive data is set to the RXB register and the next reception operation is completed before the
data is read.
Cautions 1. The operation of the PE6 bit differs depending on the set values of the PS61 and PS60 bits of
asynchronous serial interface operation mode register 6 (ASIM6).
2. The first bit of the receive data is checked as the stop bit, regardless of the number of stop
bits.
3. If an overrun error occurs, the next receive data is not written to receive buffer register 6
(RXB6) but discarded.
4. If data is read from ASIS6, a wait cycle is generated. For details, refer to CHAPTER 27
CAUTIONS FOR WAIT.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
277
(c) Asynchronous serial interface transmission status register 6 (ASIF6)
This register indicates the status of transmission by serial interface UART6. It includes two status flag bits
(TXBF6 and TXSF6).
Transmission can be continued without disruption even during an interrupt period, by writing the next data to
the TXB6 register after data has been transferred from the TXB6 register to the TXS6 register.
This register can be set by an 8-bit memory manipulation instruction, and is read-only.
RESET input clears this register to 00H if bit 7 (POWER6) and bit 6 (TXE6) of ASIM6 = 0.
Address: FF55H After reset: 00H R
Symbol
7
6
5
4
3
2
1
0
ASIF6
0
0
0
0
0
0
TXBF6
TXSF6
TXBF6
Transmit buffer data flag
0
If POWER6 = 0 or TXE6 = 0, or if data is transferred to transmit shift register 6 (TXS6)
1
If data is written to transmit buffer register 6 (TXB6) (if data exists in TXB6)
TXSF6
Transmit shift register data flag
0
If POWER6 = 0 or TXE6 = 0, or if the next data is not transferred from transmit buffer register 6
(TXB6) after completion of transfer
1
If data is transferred from transmit buffer register 6 (TXB6) (if data transmission is in progress)
Cautions 1. To continuously transmit data, write the data of the first byte to TXB6, check that the value of
the TXBF6 flag is 0, and then write the data of the second byte to TXB6. The operation is not
guaranteed if data is written to TXB6 while the TXBF6 flag is 1.
2. While continuous transmission is being executed, check the value of the TXSF6 flag after the
transmission completion interrupt to determine the subsequent write processing to TXB6.



If TXSF6 is 1: Continuous transmission is in progress. Data of 1 byte can be written.



If TXSF6 is 0: Continuous transmission is complete. Data of 2 bytes can be written. When
doing so, observe Caution 1 above.
3. While continuous transmission is in progress, check that TXSF6 is 0 after the transmission
completion interrupt, and then execute clearing (POWER6 = 0 or TXE6 = 0). If clearing is
executed while the TXSF6 flag is 1, the transmit data cannot be guaranteed.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
278
(d) Asynchronous serial interface control register 6 (ASICL6)
This register controls the serial transfer operations of serial interface UART6.
ASICL6 can be set by a 1-bit transfer instruction or an 8-bit memory manipulation instruction.
RESET input sets this register to 16H.
Remark
ASICL6 can be refreshed (the same value is written) by software during a communication
operation (when bit 7 (POWER6) and bit 6 (TXE6) of ASIM6 = 1 or bit 7 (POWER6) and bit 5
(RXE6) of ASIM6 = 1). However, transfer is started by refresh because bit 6 (SBRT6) and bit 5
(SBTT6) of ASICL6 are cleared to 0 when communication is complete (when an interrupt signal is
generated).
Address: FF58H After reset: 16H R/W
Note
Symbol
7
6
5
4
3
2
1
0
ASICL6
SBRF6
SBRT6
SBTT6
SBL62
SBL61
SBL60
DIR6
TXDLV6
SBRF6
SBF reception status flag
0
If POWER6 = 0 and RXE6 = 0 or if SBF reception has been completed correctly
1
SBF reception in progress
SBRT6
SBF reception trigger
0
-
1
SBF reception trigger
SBTT6
SBF transmission trigger
0
-
1
SBF transmission trigger
Note Bit 7 is read-only.
Cautions 1. In the case of an SBF reception error, return the mode to the SBF reception mode and hold
the status of the SBRF6 flag.
2. Before setting the SBRT6 bit, make sure that bit 7 (POWER6) and bit 5 (RXE6) of ASIM6 = 1.
3. The read value of the SBRT6 bit is always 0. SBRT6 is automatically cleared to 0 after SBF
reception has been correctly completed.
4. Before setting the SBTT6 bit to 1, make sure that bit 7 (POWER6) and bit 6 (TXE6) of ASIM6
= 1.
5. The read value of the SBTT6 bit is always 0. SBTT6 is automatically cleared to 0 at the end of
SBF transmission.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
279
SBL62
SBL61
SBL60
SBF transmission output width control
1
0
1
SBF is output with 13-bit length.
1
1
0
SBF is output with 14-bit length.
1
1
1
SBF is output with 15-bit length.
0
0
0
SBF is output with 16-bit length.
0
0
1
SBF is output with 17-bit length.
0
1
0
SBF is output with 18-bit length.
0
1
1
SBF is output with 19-bit length.
1
0
0
SBF is output with 20-bit length.
DIR6
MSB/LSB-first transfer
0
MSB-first transfer
1
LSB-first transfer
TXDLV6
Enables/disables inverting T
X
D6 output
0
Normal output of T
X
D6
1
Inverted output of T
X
D6
Caution
Before rewriting the DIR6 and TXDLV6 bits, clear the TXE6 and RXE6 bits to 0.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
280
(2) Communication operation
(a) Normal transmit/receive data format
Figure 13-11 shows the format of the transmit/receive data.
Figure 13-11. Format of Normal UART Transmit/Receive Data
1. LSB-first transmission/reception
Start
bit
Parity
bit
D0
D1
D2
D3
D4
1 data frame
Character bits
D5
D6
D7
Stop bit
2. MSB-first transmission/reception
Start
bit
Parity
bit
D7
D6
D5
D4
D3
1 data frame
Character bits
D2
D1
D0
Stop bit
One data frame consists of the following bits.
Start bit ... 1 bit
Character bits ... 7 or 8 bits
Parity bit ... Even parity, odd parity, 0 parity, or no parity
Stop bit ... 1 or 2 bits
The character bit length, parity, and stop bit length in one data frame are specified by asynchronous serial
interface mode register 6 (ASIM6).
Whether data is transferred with the LSB or MSB first is specified by bit 1 (DIR6) of asynchronous serial
interface control register 6 (ASICL6).
Whether the T
X
D6 pin outputs normal or inverted data is specified by bit 0 (TXDLV6) of ASICL6.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
281
Figure 13-12. Example of Normal UART Transmit/Receive Data Format
1. Data length: 8 bits, LSB first, Parity: Even parity, Stop bit: 1 bit, Transfer data: 55H
1 data frame
Start
D0
D1
D2
D3
D4
D5
D6
D7
Parity
Stop
2. Data length: 8 bits, MSB first, Parity: Even parity, Stop bit: 1 bit, Transfer data: 55H
1 data frame
Start
D7
D6
D5
D4
D3
D2
D1
D0
Parity
Stop
3. Data length: 8 bits, MSB first, Parity: Even parity, Stop bit: 1 bit, Transfer data: 55H, T
X
D6 pin inverted
output
1 data frame
Start
D7
D6
D5
D4
D3
D2
D1
D0
Parity
Stop
4. Data length: 7 bits, LSB first, Parity: Odd parity, Stop bit: 2 bits, Transfer data: 36H
1 data frame
Start
D0
D1
D2
D3
D4
D5
D6
Parity
Stop
Stop
5. Data length: 8 bits, LSB first, Parity: None, Stop bit: 1 bit, Transfer data: 87H
1 data frame
Start
D0
D1
D2
D3
D4
D5
D6
D7
Stop
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
282
(b) Parity types and operation
The parity bit is used to detect a bit error in communication data. Usually, the same type of parity bit is used
on both the transmission and reception sides. With even parity and odd parity, a 1-bit (odd number) error
can be detected. With zero parity and no parity, an error cannot be detected.
Caution
Fix the PS61 and PS60 bits to 0 when the device is incorporated in LIN.
(i)
Even parity
Transmission
Transmit data, including the parity bit, is controlled so that the number of bits that are "1" is even.
The value of the parity bit is as follows.
If transmit data has an odd number of bits that are "1": 1
If transmit data has an even number of bits that are "1": 0
Reception
The number of bits that are "1" in the receive data, including the parity bit, is counted. If it is odd, a
parity error occurs.
(ii) Odd parity
Transmission
Unlike even parity, transmit data, including the parity bit, is controlled so that the number of bits that
are "1" is odd.
If transmit data has an odd number of bits that are "1": 0
If transmit data has an even number of bits that are "1": 1
Reception
The number of bits that are "1" in the receive data, including the parity bit, is counted. If it is even, a
parity error occurs.
(iii) 0 parity
The parity bit is cleared to 0 when data is transmitted, regardless of the transmit data.
The parity bit is not detected when the data is received. Therefore, a parity error does not occur
regardless of whether the parity bit is "0" or "1".
(iv) No parity
No parity bit is appended to the transmit data.
Reception is performed assuming that there is no parity bit when data is received. Because there is no
parity bit, a parity error does not occur.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
283
(c) Normal transmission
The T
X
D6 pin outputs a high level when bit 7 (POWER6) of asynchronous serial interface operation mode
register 6 (ASIM6) is set to 1. If bit 6 (TXE6) of ASIM6 is then set to 1, transmission is enabled.
Transmission can be started by writing transmit data to transmit buffer register 6 (TXB6). The start bit, parity
bit, and stop bit are automatically appended to the data.
When transmission is started, the data in TXB6 is transferred to transmit shift register 6 (TXS6). After that,
the data is sequentially output from TXS6 to the T
X
D6 pin, starting from the LSB. When transmission is
completed, a transmission completion interrupt request (INTST6) is generated.
Transmission is stopped until the data to be transmitted next is written to TXB6.
Figure 13-13 shows the timing of the transmission completion interrupt request (INTST6). This interrupt
occurs as soon as the last stop bit has been output.
Figure 13-13. Normal Transmission Completion Interrupt Request Timing
1. Stop bit length: 1
T
X
D6 (output)
INTST6
D0
START
D1
D2
D6
D7
Parity
STOP
2. Stop bit length: 2
INTST6
D0
START
D1
D2
D6
D7
STOP
T
X
D6 (output)
Parity
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
284
(d) Continuous transmission
When transmit shift register 6 (TXS6) has started the shift operation, the next transmit data can be written to
transmit buffer register 6 (TXB6). As a result, data can be transmitted without intermission even while an
interrupt that has occurred after transmission of one data frame is being serviced, thus realizing an efficient
communication rate. To transmit data continuously, however, transmission processing must be executed
while referencing bits 1 (TXBF6) and 0 (TXSF6) of asynchronous serial interface transmission status register
6 (ASIF6).
Caution
When the device is incorporated in LIN, the continuous transmission function cannot be
used. Make sure that asynchronous serial interface transmission status register 6 (ASIF6)
is 00H before writing transmit data to transmit buffer register 6 (TXB6).
Table 13-2. Write Processing and Writing to TXB6 During Execution of Continuous Transmission
TXBF6
TXSF6
Write Processing During Execution of
Continuous Transmission
Writing to TXB6 During Execution of
Continuous Transmission
0
0
Enables writing 2 bytes or
transmission completion processing
Enables writing
0
1
Enables writing 1 byte
Enables writing
1
0
Enables writing 2 bytes or
transmission completion processing
Disables writing
1
1
Enables writing 1 byte
Disables writing
Cautions 1. To continuously transmit data, write the data of the first byte to TXB6, check that the
value of the TXBF6 flag is 0, and then write the data of the second byte to TXB6. The
operation is not guaranteed if data is written to TXB6 while the TXBF6 flag is 1.
2. While continuous transmission is being executed, check the value of the TXSF6 flag
after the transmission completion interrupt to determine the subsequent write
processing to TXB6.



If TXSF6 is 1: Continuous transmission is in progress. Data of 1 byte can be written.



If TXSF6 is 0: Continuous transmission is completed. Data of 2 bytes can be written.
To do so, observe Caution 1 above.
3. While continuous transmission is in progress, check that TXSF6 is 0 after the
transmission completion interrupt, and then execute clearing (POWER6 = 0 or TXE6 =
0). If clearing is executed while the TXSF6 flag is 1, the transmit data cannot be
guaranteed.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
285
Figure 13-14 shows the processing flow of continuous transmission.
Figure 13-14. Processing Flow of Continuous Transmission
Set registers.
Interrupt occurs.
Wait for interrupt.
Transfer executed
necessary number
of times?
Write transmit data to
TXB6 register.
Write transmit data to
TXB6 register.
Read ASIF6
register.
TXBF6 = 0?
Read ASIF6
register.
TXSF6 = 1?
Read ASIF6
register.
TXSF6 = 0?
No
No
No
No
Yes
Yes
Yes
Yes
Completion of
transmission processing
Remark
TXB6:
Transmit buffer register 6
ASIF6:
Asynchronous serial interface transmission status register 6
TXBF6: Bit 1 of ASIF6 (transmit buffer data flag)
TXSF6: Bit 0 of ASIF6 (transmit shift register data flag)
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
286
Figure 13-15 shows the timing of starting continuous transmission, and Figure 13-16 shows the timing of
ending continuous transmission.
Figure 13-15. Timing of Starting Continuous Transmission
T
X
D6
Start
INTST6
Data (1)
Data (1)
Data (2)
Data (3)
Data (2)
Data (1)
Data (3)
FF
FF
Parity
Stop
Data (2)
Parity
Stop
TXB6
TXS6
TXBF6
TXSF6
Start
Start
Note
Note When ASIF6 is read, there is a period in which TXBF6 and TXSF6 = 1, 1. Therefore, judge whether
writing is enabled using only the TXBF6 bit.
Remark
T
X
D6:
T
X
D6 pin (output)
INTST6: Interrupt request signal
TXB6:
Transmit buffer register 6
TXS6:
Transmit shift register 6
ASIF6:
Asynchronous serial interface transmission status register 6
TXBF6:
Bit 1 of ASIF6
TXSF6:
Bit 0 of ASIF6
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
287
Figure 13-16. Timing of Ending Continuous Transmission
T
X
D6
Start
INTST6
Data (n1)
Data (n1)
Data (n)
Data (n)
Data (n1)
FF
Parity
Stop
Stop
Data (n)
Parity
Stop
TXB6
TXS6
TXBF6
TXSF6
POWER6 or TXE6
Start
Remark
T
X
D6:
T
X
D6 pin (output)
INTST6:
Interrupt request signal
TXB6:
Transmit buffer register 6
TXS6:
Transmit shift register 6
ASIF6:
Asynchronous serial interface transmission status register 6
TXBF6:
Bit 1 of ASIF6
TXSF6:
Bit 0 of ASIF6
POWER6: Bit 7 of asynchronous serial interface operation mode register (ASIM6)
TXE6:
Bit 6 of asynchronous serial interface operation mode register (ASIM6)
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
288
(e) Normal reception
Reception is enabled and the RXD6 pin input is sampled when bit 7 (POWER6) of asynchronous serial
interface operation mode register 6 (ASIM6) is set to 1 and then bit 5 (RXE6) of ASIM6 is set to 1.
The 8-bit counter of the baud rate generator starts counting when the falling edge of the R
X
D6 pin input is
detected. When the set value of baud rate generator control register 6 (BRGC6) has been counted, the
R
X
D6 pin input is sampled again ( in Figure 13-17). If the R
X
D6 pin is low level at this time, it is recognized
as a start bit.
When the start bit is detected, reception is started, and serial data is sequentially stored in the receive shift
register (RXS6) at the set baud rate. When the stop bit has been received, the reception completion interrupt
(INTSR6) is generated and the data of RXS6 is written to receive buffer register 6 (RXB6). If an overrun
error (OVE6) occurs, however, the receive data is not written to RXB6.
Even if a parity error (PE6) or a framing error (FE6) occurs while reception is in progress, reception continues
to the reception position of the stop bit, and an error interrupt (INTSR6/INTSRE6) is generated on completion
of reception.
Figure 13-17. Reception Completion Interrupt Request Timing
R
X
D6 (input)
INTSR6
Start
D0
D1
D2
D3
D4
D5
D6
D7
Parity
Stop
RXB6
Cautions 1. Be sure to read receive buffer register 6 (RXB6) even if a reception error occurs.
Otherwise, an overrun error will occur when the next data is received, and the reception
error status will persist.
2. Reception is always performed with the "number of stop bits = 1". The second stop bit
is ignored.
3. Be sure to read asynchronous serial interface reception error status register 6 (ASIS6)
before reading RXB6.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
289
(f)
Reception error
Three types of errors may occur during reception: a parity error, framing error, or overrun error. If the error
flag of asynchronous serial interface reception error status register 6 (ASIS6) is set as a result of data
reception, a reception error interrupt request (INTSR6/INTSRE6) is generated.
Which error has occurred during reception can be identified by reading the contents of ASIS6 in the reception
error interrupt servicing (INTSR6/INTSRE6) (refer to Table 13-3).
The contents of ASIS6 are reset to 0 when ASIS6 is read.
Table 13-3. Cause of Reception Error
Reception Error
Cause
Value of ASIS6
Parity error
The parity specified for transmission does not match the parity of the
receive data.
04H
Framing error
Stop bit is not detected.
02H
Overrun error
Reception of the next data is completed before data is read from
receive buffer register 6 (RXB6).
01H
The error interrupt can be separated into INTSR6 and INTSRE6 by clearing bit 0 (ISRM6) of asynchronous
serial interface operation mode register 6 (ASIM6) to 0.
Figure 13-18. Reception Error Interrupt
1. If ISRM6 is cleared to 0 (INTSR6 and INTSRE6 are separated)
(a) No error during reception
(b) Error during reception
INTSR6
INTSRE6
INTSR6
INTSRE6
2. If ISRM6 is set to 1 (error interrupt is included in INTSR6)
(a) No error during reception
(b) Error during reception
INTSRE6
INTSR6
INTSRE6
INTSR6
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
290
(g) Noise filter of receive data
The RXD6 signal is sampled with the base clock output by the prescaler block.
If two sampled values are the same, the output of the match detector changes, and the data is sampled as
input data.
Because the circuit is configured as shown in Figure 13-19, the internal processing of the reception operation
is delayed by two clocks from the external signal status.
Figure 13-19. Noise Filter Circuit
Internal signal B
Internal signal A
Match detector
In
Base clock
R
X
D6/P14
Q
In
LD_EN
Q
(h) SBF transmission
When the device is incorporated in LIN, the SBF (Synchronous Break Field) transmission control function is
used for transmission. For the transmission operation of LIN, refer to Figure 13-1 LIN Transmission
Operation.
The T
X
D6 pin outputs a high level when bit 7 (POWER6) of asynchronous serial interface operation mode
register 6 (ASIM6) is set to 1. Transmission is enabled when bit 6 (TXE6) of ASIM6 is set to 1 next time, and
SBF transmission operation is started when bit 5 (SBTT6) of asynchronous serial interface control register 6
(ASICL6) is set to 1.
After transmission has been started, the low levels of bits 13 to 20 (set by bits 4 to 2 (SBL62 to SBL60) of
ASICL6) are output. When SBF transmission has been completed, a transmission completion interrupt
request (INTST6) is generated, and SBTT6 is automatically cleared. After SBF transmission has been
completed, the normal transmission mode is restored.
Transmission is stopped until the data to be transmitted next is written to transmit buffer register 6 (TXB6) or
SBTT6 is set to 1.
Figure 13-20. SBF Transmission
T
X
D6
INTST6
SBTT6
1
2
3
4
5
6
7
8
9
10
11
12
13
Stop
Remark
T
X
D6:
T
X
D6 pin (output)
INTST6: Transmission completion interrupt request
SBTT6: Bit 5 of asynchronous serial interface control register 6 (ASICL6)
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
291
(i)
SBF reception
When the device is incorporated in LIN, the SBF (Synchronous Break Field) reception control function is
used for reception. For the reception operation of LIN, refer to Figure 13-2 LIN Reception Operation.
Reception is enabled when bit 7 (POWER6) of asynchronous serial interface operation mode register 6
(ASIM6) is set to 1 and then bit 5 (RXE6) of ASIM6 is set to 1. SBF reception is enabled when bit 6 (SBRT6)
of asynchronous serial interface control register 6 (ASICL6) is set to 1. In the SBF reception enabled status,
the R
X
D6 pin is sampled and the start bit is detected in the same manner as the normal reception enable
status.
When the start bit has been detected, reception is started, and serial data is sequentially stored in the
receive shift register 6 (RXS6) at the set baud rate. When the stop bit is received and if the width of SBF is
11 bits or more, a reception completion interrupt request (INTSR6) is generated as normal processing. At
this time, the SBRF6 and SBRT6 bits are automatically cleared, and SBF reception ends. Detection of
errors, such as OVE6, PE6, and FE6 (bits 0 to 2 of asynchronous serial interface reception error status
register 6 (ASIS6)) is suppressed, and error detection processing of UART communication is not performed.
In addition, data transfer between receive shift register 6 (RXS6) and receive buffer register 6 (RXB6) is not
performed, and the reset value of FFH is retained. If the width of SBF is 10 bits or less, an interrupt does not
occur as error processing after the stop bit has been received, and the SBF reception mode is restored. In
this case, the SBRF6 and SBRT6 bits are not cleared.
Figure 13-21. SBF Reception
1. Normal SBF reception (stop bit is detected with a width of more than 10.5 bits)
R
X
D6
SBRT6
/SBRF6
INTSR6
1
2
3
4
5
6
7
8
9
10
11
2. SBF reception error (stop bit is detected with a width of 10.5 bits or less)
R
X
D6
SBRT6
/SBRF6
INTSR6
1
2
3
4
5
6
7
8
9
10
"0"
Remark
R
X
D6:
R
X
D6 pin (input)
SBRT6: Bit 6 of asynchronous serial interface control register 6 (ASICL6)
SBRF6: Bit 7 of ASICL6
INTSR6: Reception completion interrupt request
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
292
13.4.3 Dedicated baud rate generator
The dedicated baud rate generator consists of a source clock selector and an 8-bit programmable counter, and
generates a serial clock for transmission/reception of UART6.
Separate 8-bit counters are provided for transmission and reception.
(1) Configuration of baud rate generator
Base clock (Clock)
The clock selected by bits 3 to 0 (TPS63 to TPS60) of clock selection register 6 (CKSR6) is supplied to
each module when bit 7 (POWER6) of asynchronous serial interface operation mode register 6 (ASIM6) is
1. This clock is called the base clock (Clock) and its frequency is called f
XCLK
. Clock is fixed to the low level
when POWER6 = 0.
Transmission counter
This counter stops, cleared to 0, when bit 7 (POWER6) or bit 6 (TXE6) of asynchronous serial interface
operation mode register 6 (ASIM6) is 0.
It starts counting when POWER6 = 1 and TXE6 = 1.
The counter is cleared to 0 when the first data transmitted is written to transmit buffer register 6 (TXB6).
If data are continuously transmitted, the counter is cleared to 0 again when one frame of data has been
completely transmitted. If there is no data to be transmitted next, the counter is not cleared to 0 and continues
counting until POWER6 or TXE6 is cleared to 0.
Reception counter
This counter stops operation, cleared to 0, when bit 7 (POWER6) or bit 5 (RXE6) of asynchronous serial
interface operation mode register 6 (ASIM6) is 0.
It starts counting when the start bit has been detected.
The counter stops operation after one frame has been received, until the next start bit is detected.
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
293
Figure 13-22. Configuration of Baud Rate Generator
Clock
(f
XCLK
)
Selector
POWER6
8-bit counter
Match detector
Baud rate
BRGC6: MDL67 to MDL60
1/2
POWER6, TXE6 (or RXE6)
CKSR6: TPS63 to TPS60
f
X
f
X
/2
f
X
/2
2
f
X
/2
3
f
X
/2
4
f
X
/2
5
f
X
/2
6
f
X
/2
7
f
X
/2
8
f
X
/2
9
f
X
/2
10
TO50/TI50/P17
(TM50 output)
Remark
POWER6: Bit 7 of asynchronous serial interface operation mode register 6 (ASIM6)
TXE6:
Bit 6 of ASIM6
RXE6:
Bit 5 of ASIM6
CKSR6:
Clock selection register 6
BRGC6:
Baud rate generator control register 6
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
294
(2) Generation of serial clock
A serial clock can be generated by using clock selection register 6 (CKSR6) and baud rate generator control
register 6 (BRGC6).
Select the clock to be input to the 8-bit counter by using bits 3 to 0 (TPS63 to TPS60) of CKSR6.
Bits 7 to 0 (MDL67 to MDL60) of BRGC6 can be used to select the division value of the 8-bit counter.
(a) Clock selection register 6 (CKSR6)
This register selects the base clock of serial interface UART6.
CKSR6 can be set by an 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Remark
CKSR6 can be refreshed (the same value is written) by software during a communication
operation (when bit 7 (POWER6) and bit 6 (TXE6) of ASIM6 = 1 or bit 7 (POWER6) and bit 5
(RXE6) of ASIM6 = 1).
Address: FF56H After reset: 00H R/W
Symbol
7
6
5
4
3
2
1
0
CKSR6
0
0
0
0
TPS63
TPS62
TPS61
TPS60
TPS63
TPS62
TPS61
TPS60
Base clock (f
XCLK
)
0
0
0
0
f
X
(10 MHz)
0
0
0
1
f
X
/2 (5 MHz)
0
0
1
0
f
X
/2
2
(2.5 MHz)
0
0
1
1
f
X
/2
3
(1.25 MHz)
0
1
0
0
f
X
/2
4
(625 kHz)
0
1
0
1
f
X
/2
5
(312.5 kHz)
0
1
1
0
f
X
/2
6
(156.25 kHz)
0
1
1
1
f
X
/2
7
(78.13 kHz)
1
0
0
0
f
X
/2
8
(39.06 kHz)
1
0
0
1
f
X
/2
9
(19.53 kHz)
1
0
1
0
f
X
/2
10
(9.77 kHz)
1
0
1
1
TM50 output
Other
Setting prohibited
Caution
Make sure POWER6 = 0 when rewriting TPS63 to TPS60.
Remarks 1. Figures in parentheses are for operation with f
X
= 10 MHz
2. f
X
: X1 input clock oscillation frequency
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
295
(b) Baud rate generator control register 6 (BRGC6)
This register selects the base clock of serial interface UART6.
BRGC6 can be set by an 8-bit memory manipulation instruction.
RESET input sets this register to FFH.
Remark
BRGC6 can be refreshed (the same value is written) by software during a communication
operation (when bit 7 (POWER6) and bit 6 (TXE6) of ASIM6 = 1 or bit 7 (POWER6) and bit 5
(RXE6) of ASIM6 = 1).
Address: FF57H After reset: FFH R/W
Symbol
7
6
5
4
3
2
1
0
BRGC6
MDL67
MDL66
MDL65
MDL64
MDL63
MDL62
MDL61
MDL60
MDL67
MDL66
MDL65
MDL64
MDL63
MDL62
MDL61
MDL60
k
Output clock selection of
8-bit counter
0
0
0
0
0
Setting prohibited
0
0
0
0
1
0
0
0
8
f
XCLK
/8
0
0
0
0
1
0
0
1
9
f
XCLK
/9
0
0
0
0
1
0
1
0
10
f
XCLK
/10








































1
1
1
1
1
1
0
0
252
f
XCLK
/252
1
1
1
1
1
1
0
1
253
f
XCLK
/253
1
1
1
1
1
1
1
0
254
f
XCLK
/254
1
1
1
1
1
1
1
1
255
f
XCLK
/255
Cautions 1. Make sure that bit 6 (TXE6) and bit 5 (RXE6) of the ASIM6 register = 0 when rewriting the
MDL67 to MDL60 bits.
2. The baud rate is the output clock of the 8-bit counter divided by 2.
Remarks 1. f
XCLK
: Frequency of base clock (Clock) selected by the TPS63 to TPS60 bits of CKSR6 register
2. k: Value set by MDL67 to MDL60 bits (k = 8, 9, 10, ..., 255)
3.
: Don't care
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
296
(c) Baud rate
The baud rate can be calculated by the following expression.
Baud rate = [bps]
f
XCLK
: Frequency of base clock (Clock) selected by TPS63 to TPS60 bits of CKSR6 register
k:
Value set by MDL67 to MDL60 bits of BRGC6 register (k = 8, 9, 10, ..., 255)
(d) Error of baud rate
The baud rate error can be calculated by the following expression.
Error (%) = - 1 100 [%]
Cautions 1. Keep the baud rate error during transmission to within the permissible error range at
the reception destination.
2. Make sure that the baud rate error during reception satisfies the range shown in (4)
Permissible baud rate range during reception.
Example: Frequency of base clock (Clock) = 20 MHz = 20,000,000 Hz
Set value of MDL67 to MDL60 bits of BRGC6 register = 01000001B (k = 65)
Target baud rate = 153,600 bps
Baud rate = 20 M/(2
65)
= 20,000,000/(2
65) = 153,846 [bps]
Error = (153,846/153,600
- 1) 100
= 0.160 [%]
f
XCLK
2
k
Actual baud rate (baud rate with error)
Desired baud rate (correct baud rate)
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
297
(3) Example of setting baud rate
Table 13-4. Set Data of Baud Rate Generator
f
X
= 10.0 MHz
f
X
= 8.38 MHz
f
X
= 4.19 MHz
Baud Rate
[bps]
TPS63 to
TPS60
k
Calculated
value
ERR[%]
TPS63 to
TPS60
k
Calculated
value
ERR[%]
TPS63 to
TPS60
k
Calculated
value
ERR[%]
600
6H
130
601
0.16
6H
109
601
0.11
5H
109
601
0.11
1200
5H
130
1202
0.16
5H
109
1201
0.11
4H
109
1201
0.11
2400
4H
130
2404
0.16
4H
109
2403
0.11
3H
109
2403
0.11
4800
3H
130
4808
0.16
3H
109
4805
0.11
2H
109
4805
0.11
9600
2H
130
9615
0.16
2H
109
9610
0.11
1H
109
9610
0.11
10400
2H
120
10417
0.16
2H
101
10371
0.28
1H
101
10475
-0.28
19200
1H
130
19231
0.16
1H
109
19200
0.11
0H
109
19220
0.11
31250
1H
80
31250
0.00
0H
134
31268
0.06
0H
67
31268
0.06
38400
0H
130
38462
0.16
0H
109
38440
0.11
0H
55
38090
-0.80
76800
0H
65
76923
0.16
0H
55
76182
-0.80
0H
27
77593
1.03
115200
0H
43
116279
0.94
0H
36
116388
1.03
0H
18
116389
1.03
153600
0H
33
151515
-1.36
0H
27
155185
1.03
0H
14
149643
-2.58
230400
0H
22
227272
-1.36
0H
18
232777
1.03
0H
9
232778
1.03
Caution
The maximum permissible frequency (f
XCLK
) of the base clock is 25 MHz.
Remark
TPS63 to TPS60: Bits 3 to 0 of clock selection register 6 (CKSR6) (setting of base clock (f
XCLK
))
k:
Value set by MDL67 to MDL60 bits of baud rate generator control register 6
(BRGC6) (k = 8, 9, 10, ..., 255)
f
X
:
X1 input clock oscillation frequency
ERR:
Baud rate error
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
298
(4) Permissible baud rate range during reception
The permissible error from the baud rate at the transmission destination during reception is shown below.
Caution
Make sure that the baud rate error during reception is within the permissible error range, by
using the calculation expression shown below.
Figure 13-23. Permissible Baud Rate Range During Reception
FL
1 data frame (11
FL)
FLmin
FLmax
Transfer rate
of UART6
Start bit
Bit 0
Bit 1
Bit 7
Parity bit
Minimum permissible
transfer rate
Maximum permissible
transfer rate
Stop bit
Start bit
Bit 0
Bit 1
Bit 7
Parity bit
Latch timing
Stop bit
Start bit
Bit 0
Bit 1
Bit 7
Parity bit
Stop bit
As shown in Figure 13-23, the latch timing of the receive data is determined by the counter set by baud rate
generator control register 6 (BRGC6) after the start bit has been detected. If the last data (stop bit) meets this
latch timing, the data can be correctly received.
Assuming that 11-bit data is received, the theoretical values can be calculated as follows.
FL = (Brate)
-
1
Brate: Baud rate of UART6
k:
Set value of BRGC6
FL:
1-bit data length
Margin of latch timing: 2 clocks
Minimum permissible transfer rate: FLmin = 11
FL - FL = FL
k
- 2
2k
21k + 2
2k
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
299
Therefore, the maximum receivable baud rate at the transmission destination is as follows.
BRmax = (Flmin/11)
-
1
= Brate
Similarly, the maximum permissible transfer rate can be calculated as follows.
10
k + 2
21k
- 2
11
2
k
2
k
FLmax = FL
11
Therefore, the minimum receivable baud rate at the transmission destination is as follows.
BRmin = (FLmax/11)
-
1
= Brate
The permissible baud rate error between UART6 and the transmission destination can be calculated from the
above minimum and maximum baud rate expressions, as follows.
Table 13-5. Maximum/Minimum Permissible Baud Rate Error
Division Ratio (k)
Maximum Permissible Baud Rate Error
Minimum Permissible Baud Rate Error
8
+3.53%
-3.61%
20
+4.26%
-4.31%
50
+4.56%
-4.58%
100
+4.66%
-4.67%
255
+4.72%
-4.73%
Remarks 1. The accuracy of reception depends on the number of bits in one frame, input clock frequency,
and division ratio (k). The higher the input clock frequency and the higher the division ratio (k),
the higher the accuracy.
2. k: Set value of BRGC6
22k
21k + 2
FLmax = 11 FL - FL = FL
21k
2
20k
20k
21k
- 2
CHAPTER 13 SERIAL INTERFACE UART6
Preliminary User's Manual U16227EJ1V0UD
300
(5) Transfer rate during continuous transmission
When data is continuously transmitted, the transfer rate from a stop bit to the next start bit is extended by two
clocks from the normal value. However, the result of transfer is not affected because the timing is initialized on
the reception side when the start bit is detected.
Figure 13-24. Transfer Rate During Continuous Transmission
Start bit
Bit 0
Bit 1
Bit 7
Parity bit
Stop bit
FL
1 data frame
FL
FL
FL
FL
FL
FL
FLstp
Start bit of
second byte
Start bit
Bit 0
Where the 1-bit data length is FL, the stop bit length is FLstp, and base clock frequency is f
XCLK
, the following
expression is satisfied.
FLstp = FL + 2/f
XCLK
Therefore, the transfer rate during continuous transmission is:
Transfer rate = 11
FL + 2/f
XCLK
Preliminary User's Manual U16227EJ1V0UD
301
CHAPTER 14 SERIAL INTERFACE CSI10
14.1 Functions of Serial Interface CSI10
Serial interface CSI10 has the following two modes.
Operation stop mode
3-wire serial I/O mode
(1) Operation stop mode
This mode is used when serial transfer is not performed and can enable a reduction in the power consumption.
(2) 3-wire serial I/O mode (MSB/LSB-first selectable)
This mode is used to transfer 8-bit data using three lines: a serial clock line (SCK10) and two serial data lines
(SI10 and SO10).
The processing time of data transfer can be shortened in the 3-wire serial I/O mode because transmission and
reception can be simultaneously executed.
In addition, whether 8-bit data is transferred with the MSB or LSB first can be specified, so this interface can be
connected to any device.
The 3-wire serial I/O mode is useful for connecting peripheral ICs and display controllers with a clocked serial
interface.
14.2 Configuration of Serial Interface CSI10
Serial interface CSI10 consists of the following hardware.
Table 14-1. Configuration of Serial Interface CSI10
Item
Configuration
Registers
Transmit buffer register 10 (SOTB10)
Serial I/O shift register 10 (SIO10)
Control registers
Serial operation mode register 10 (CSIM10)
Serial clock selection register 10 (CSIC10)
CHAPTER 14 SERIAL INTERFACE CSI10
Preliminary User's Manual U16227EJ1V0UD
302
Figure 14-1. Block Diagram of Serial Interface CSI10
8
8
SO10/P12
INTCSI10
SI10/P11/R
X
D0
Output
selector
f
X
/2 to f
X
/2
7
SCK10/P10/T
X
D0
Internal bus
Serial I/O shift
register 10 (SIO10)
Transmit buffer
register 10 (SOTB10)
Output latch
Transmit controller
Clock start/stop controller &
clock phase controller
Selector
Transmit data
controller
(1) Transmit buffer register 10 (SOTB10)
This register sets the transmit data.
Transmission/reception is started by writing data to SOTB10 when bit 6 (TRMD10) of serial operation mode
register 10 (CSIM10) is 1.
The data written to SOTB10 is converted from parallel data into serial data by serial I/O shift register 10, and
output to the serial output pin (SO10).
SOTB10 can be written or read by an 8-bit memory manipulation instruction.
RESET input makes this register undefined.
Caution
Do not access SOTB10 when CSOT10 = 1 (during serial communication).
(2) Serial I/O shift register 10 (SIO10)
This is an 8-bit register that converts data from parallel data into serial data and vice versa.
This register can be read by an 8-bit memory manipulation instruction.
Reception is started by reading data from SIO10 if bit 6 (TRMD10) of serial operation mode register 10 (CSIM10)
is 0.
During reception, the data is read from the serial input pin (SI10) to SIO10.
RESET input clears this register to 00H.
Caution
Do not access SIO10 when CSOT10 = 1 (during serial communication).
CHAPTER 14 SERIAL INTERFACE CSI10
Preliminary User's Manual U16227EJ1V0UD
303
14.3 Registers Controlling Serial Interface CSI10
Serial interface CSI10 is controlled by the following two registers.
Serial operation mode register 10 (CSIM10)
Serial clock selection register 10 (CSIC10)
(1) Serial operation mode register 10 (CSIM10)
CSIM10 is used to select the operation mode and enable or disable operation.
CSIM10 can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Figure 14-2. Format of Serial Operation Mode Register 10 (CSIM10)
Address: FF80H After reset: 00H R/W
Note 1
Symbol
7
6
5
4
3
2
1
0
CSIM10
CSIE10
TRMD10
0
DIR10
0
0
0
CSOT10
CSIE10
Operation control in 3-wire serial I/O mode
0
Stops operation (SI10/P11/R
X
D0, SO10/P12, and SCK10/P10/T
X
D0 pins can be used as general-
purpose port pins).
1
Enables operation (SI10/P11/R
X
D0, SO10/P12, and SCK10/P10/T
X
D0 pins are at active level).
TRMD10
Note 2
Transmit/receive mode control
0
Note 3
Receive mode (transmission disabled).
1
Transmit/receive mode
DIR10
Note 4
First bit specification
0
MSB
1
LSB
CSOT10
Note 5
Operation mode flag
0
Communication is stopped.
1
Communication is in progress.
Notes 1.
Bit 0 is read-only.
2.
Do not rewrite TRMD10 when CSOT10 = 1 (during serial communication).
3.
The SO10 pin is fixed to the low level when TRMD10 is 0. Reception is started when data is read from
SIO10.
4.
Do not rewrite DIR10 when CSOT10 = 1 (during serial communication).
5.
CSOT10 is cleared if CSIE10 is set to 0 (operation stopped).
Caution
Be sure to set bit 5 to 0.
CHAPTER 14 SERIAL INTERFACE CSI10
Preliminary User's Manual U16227EJ1V0UD
304
(2) Serial clock selection register 10 (CSIC10)
CSIC10 is used to select the phase of the data clock and set the count clock.
CSIC10 can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Figure 14-3. Format of Serial Clock Selection Register 10 (CSIC10)
Address: FF81H After reset: 00H R/W
Symbol
7
6
5
4
3
2
1
0
CSIC10
0
0
0
CKP10
DAP10
CKS102
CKS101
CKS100
CKP10
DAP10
Data clock phase selection
Type
0
0
D7
D6
D5
D4
D3
D2
D1
D0
SCK10
SO10
SI10 input timing
1
0
1
D7
D6
D5
D4
D3
D2
D1
D0
SCK10
SO10
SI10 input timing
2
1
0
D7
D6
D5
D4
D3
D2
D1
D0
SCK10
SO10
SI10 input timing
3
1
1
D7
D6
D5
D4
D3
D2
D1
D0
SCK10
SO10
SI10 input timing
4
CKS102
CKS101
CKS100
CSI10 count clock selection
0
0
0
f
X
/2 (5 MHz)
0
0
1
f
X
/2
2
(2.5 MHz)
0
1
0
f
X
/2
3
(1.25 MHz)
0
1
1
f
X
/2
4
(625 kHz)
1
0
0
f
X
/2
5
(312.5 kHz)
1
0
1
f
X
/2
6
(156.25 kHz)
1
1
0
f
X
/2
7
(78.13 kHz)
1
1
1
External clock input to SCK10
Cautions 1. Do not write CSIC10 during a communication operation or when using P10/SCK10/T
X
D0,
P11/SI10/R
X
D0, and P12/SO10 as general-purpose port pins.
2. The phase type of the data clock is type 1 after reset.
Remarks 1. Figures in parentheses are for operation with f
X
= 10 MHz
2. f
X
: X1 input clock oscillation frequency
CHAPTER 14 SERIAL INTERFACE CSI10
Preliminary User's Manual U16227EJ1V0UD
305
14.4 Operation of Serial Interface CSI10
Serial interface CSI10 can be used in the following two modes.
Operation stop mode
3-wire serial I/O mode
14.4.1 Operation stop mode
Serial transfer is not executed in this mode. Therefore, the power consumption can be reduced. In addition, the
P10/SCK10/T
X
D0, P11/SI10/R
X
D0, and P12/SO10 pins can be used as ordinary I/O port pins in this mode.
(1) Register setting
The operation stop mode is set by serial operation mode register 10 (CSIM10).
(a) Serial operation mode register 10 (CSIM10)
CSIM10 can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears CSIM10 to 00H.
Address: FF80H After reset: 00H R/W
Symbol
7
6
5
4
3
2
1
0
CSIM10
CSIE10
TRMD10
0
DIR10
0
0
0
CSOT10
CSIE10
Operation control in 3-wire serial I/O mode
0
Stops operation (SI10/P11/R
X
D0, SO10/P12, and SCK10/P10/T
X
D0 pins can be used as general-
purpose port pins).
1
Enables operation (SI10/P11/R
X
D0, SO10/P12, and SCK10/P10/T
X
D0 pins are at active level).
CHAPTER 14 SERIAL INTERFACE CSI10
Preliminary User's Manual U16227EJ1V0UD
306
14.4.2 3-wire serial I/O mode
The 3-wire serial I/O mode is useful for connecting peripheral ICs and display controllers that have a clocked serial
interface.
In this mode, communication is executed by using three lines: the serial clock (SCK10), serial output (SO10), and
serial input (SI10) lines.
(1) Register setting
The 3-wire serial I/O mode is set by serial operation mode register 10 (CSIM10) and serial clock selection register
10 (CSIC10).
(a) Serial operation mode register 10 (CSIM10)
This register can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Address: FF80H After reset: 00H R/W
Note 1
Symbol
7
6
5
4
3
2
1
0
CSIM10
CSIE10
TRMD10
0
DIR10
0
0
0
CSOT10
CSIE10
Operation control in 3-wire serial I/O mode
0
Stops operation (SI10/P11/R
X
D0, SO10/P12, and SCK10/P10/T
X
D0 pins can be used as general-
purpose port pins).
1
Enables operation (SI10/P11/R
X
D0, SO10/P12, and SCK10/P10/T
X
D0 pins are at active level).
TRMD10
Note 2
Transmit/receive mode control
0
Note 3
Receive mode (transmission disabled).
1
Transmit/receive mode
DIR10
Note 4
First bit specification
0
MSB
1
LSB
CSOT10
Note 5
Operation mode flag
0
Communication is stopped.
1
Communication is in progress.
Notes 1.
Bit 0 is read-only.
2.
Do not rewrite TRMD10 when CSOT10 = 1 (during serial communication).
3.
The SO10 pin is fixed to the low level when TRMD10 is 0. Reception is started when data is read from
SIO10.
4.
Do not rewrite DIR10 when CSOT10 = 1 (during serial communication).
5.
CSOT10 is cleared if CSIE10 is set to 0 (operation stopped).
Caution
Be sure to set bit 5 to 0.
CHAPTER 14 SERIAL INTERFACE CSI10
Preliminary User's Manual U16227EJ1V0UD
307
(b) Serial clock selection register 10 (CSIC10)
CSIC10 can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Address: FF81H After reset: 00H R/W
Symbol
7
6
5
4
3
2
1
0
CSIC10
0
0
0
CKP10
DAP10
CKS102
CKS101
CKS100
CKP10
DAP10
Data clock phase selection
Type
0
0
D7
D6
D5
D4
D3
D2
D1
D0
SCK10
SO10
SI10 input timing
1
0
1
D7
D6
D5
D4
D3
D2
D1
D0
SCK10
SO10
SI10 input timing
2
1
0
D7
D6
D5
D4
D3
D2
D1
D0
SCK10
SO10
SI10 input timing
3
1
1
D7
D6
D5
D4
D3
D2
D1
D0
SCK10
SO10
SI10 input timing
4
CKS102
CKS101
CKS100
CSI10 count clock selection
0
0
0
f
X
/2 (5 MHz)
0
0
1
f
X
/2
2
(2.5 MHz)
0
1
0
f
X
/2
3
(1.25 MHz)
0
1
1
f
X
/2
4
(625 kHz)
1
0
0
f
X
/2
5
(312.5 kHz)
1
0
1
f
X
/2
6
(156.25 kHz)
1
1
0
f
X
/2
7
(78.13 kHz)
1
1
1
External clock input to SCK10
Cautions 1. Do not write CSIC10 during a communication operation or when using P10/SCK10/T
X
D0,
P11/SI10/R
X
D0, and P12/SO10 as general-purpose port pins.
2. The phase type of the data clock is type 1 after reset.
Remarks 1. Figures in parentheses are for operation with f
X
= 10 MHz
2. f
X
: X1 input clock oscillation frequency
CHAPTER 14 SERIAL INTERFACE CSI10
Preliminary User's Manual U16227EJ1V0UD
308
(2) Setting of ports
<1>
Transmit/receive mode
(a) To use externally input clock as system clock (SCK10)
Bit 1 (PM11) of port mode register 1: Set to 1
Bit 2 (PM12) of port mode register 1: Cleared to 0
Bit 0 (PM10) of port mode register 1: Set to 1
Bit 2 (P12) of port 1: Cleared to 0
(b) To use internal clock as system clock (SCK10)
Bit 1 (PM11) of port mode register 1: Set to 1
Bit 2 (PM12) of port mode register 1: Cleared to 0
Bit 0 (PM10) of port mode register 1: Cleared to 0
Bit 2 (P12) of port 1: Cleared to 0
Bit 0 (P10) of port 1: Set to 1
<2>
Receive mode (with transmission disabled)
(a) To use externally input clock as system clock (SCK10)
Bit 1 (PM11) of port mode register 1: Set to 1
Bit 0 (PM10) of port mode register 1: Set to 1
(b) To use internal clock as system clock (SCK10)
Bit 1 (PM11) of port mode register 1: Set to 1
Bit 0 (PM10) of port mode register 1: Cleared to 0
Bit 0 (P10) of port 1: Set to 1
Remark
The transmit/receive mode or receive mode is selected by using bit 6 (TRMD10) of serial operation
mode register 10 (CSIM10).
CHAPTER 14 SERIAL INTERFACE CSI10
Preliminary User's Manual U16227EJ1V0UD
309
(3) Communication operation
In the 3-wire serial I/O mode, data is transmitted or received in 8-bit units. Each bit of the data is transmitted or
received in synchronization with the serial clock.
Data can be transmitted or received if bit 6 (TRMD10) of serial operation mode register 10 (CSIM10) is 1.
Transmission/reception is started when a value is written to transmit buffer register 10 (SOTB10). In addition,
data can be received when bit 6 (TRMD10) of serial operation mode register 10 (CSIM10) is 0.
Reception is started when data is read from serial I/O shift register 10 (SIO10).
After communication has been started, bit 0 (CSOT10) of CSIM10 is set to 1. When communication of 8-bit data
has been completed, a communication completion interrupt request flag (CSIIF10) is set, and CSOT10 is cleared
to 0. Then the next communication is enabled.
Caution
Do not access the control register and data register when CSOT10 = 1 (during serial
communication).
Figure 14-4. Timing in 3-Wire Serial I/O Mode (1/2)
(1) Transmission/reception timing (Type 1; TRMD10 = 1, DIR10 = 0, CKP10 = 0, DAP10 = 0)
AAH
ABH
56H
ADH
5AH
B5H
6AH
D5H
55H (communication data)
55H is written to SOTB10.
SCK10
SOTB10
SIO10
CSOT10
CSIIF10
SO10
SI10 (receive AAH)
Read/write trigger
INTCSI10
CHAPTER 14 SERIAL INTERFACE CSI10
Preliminary User's Manual U16227EJ1V0UD
310
Figure 14-4. Timing in 3-Wire Serial I/O Mode (2/2)
(2) Transmission/reception timing (Type 2; TRMD10 = 1, DIR10 = 0, CKP10 = 0, DAP10 = 1)
ABH
56H
ADH
5AH
B5H
6AH
D5H
SCK10
SOTB10
SIO10
CSOT10
CSIIF10
SO10
SI10 (receives AAH)
AAH
55H (communication data)
55H is written to SOTB10.
Read/write trigger
INTCSI10
CHAPTER 14 SERIAL INTERFACE CSI10
Preliminary User's Manual U16227EJ1V0UD
311
Figure 14-5. Timing of Clock/Data Phase
(a) Type 1; CKP10 = 0, DAP10 = 0
D7
D6
D5
D4
D3
D2
D1
D0
SCK10
SO10
Writing to SOTB10 or
reading from SIO10
SI10 capture
CSIIF10
CSOT10
(b) Type 2; CKP10 = 0, DAP10 = 1
D7
D6
D5
D4
D3
D2
D1
D0
SCK10
SO10
Writing to SOTB10 or
reading from SIO10
SI10 capture
CSIIF10
CSOT10
(c) Type 3; CKP10 = 1, DAP10 = 0
D7
D6
D5
D4
D3
D2
D1
D0
SCK10
SO10
Writing to SOTB10 or
reading from SIO10
SI10 capture
CSIIF10
CSOT10
(d) Type 4; CKP10 = 1, DAP10 = 1
D7
D6
D5
D4
D3
D2
D1
D0
SCK10
SO10
Writing to SOTB10 or
reading from SIO10
SI10 capture
CSIIF10
CSOT10
CHAPTER 14 SERIAL INTERFACE CSI10
Preliminary User's Manual U16227EJ1V0UD
312
(4) Timing of output to SO10 pin (first bit)
When communication is started, the value of transmit buffer register 10 (SOTB10) is output from the SO10 pin.
The output operation of the first bit at this time is described below.
Figure 14-6. Output Operation of First Bit
(1) When CKP10 = 0, DAP10 = 0 (or CKP10 = 1, DAP10 = 0)
SCK10
SOTB10
SIO10
SO10
Writing to SOTB10 or
reading from SIO10
First bit
2nd bit
Output latch
The first bit is directly latched by the SOTB10 register to the output latch at the falling (or rising) edge of SCK10,
and output from the SO10 pin via an output selector. Then, the value of the SOTB10 register is transferred to the
SIO10 register at the next rising (or falling) edge of SCK10, and shifted one bit. At the same time, the first bit of
the receive data is stored in the SIO10 register via the SI10 pin.
The second and subsequent bits are latched by the SIO10 register to the output latch at the next falling (or rising)
edge of SCK10, and the data is output from the SO10 pin.
(2) When CKP10 = 0, DAP10 = 1 (or CKP10 = 1, DAP10 = 1)
SCK10
SOTB10
SIO10
SO10
Writing to SOTB10 or
reading from SIO10
First bit
2nd bit
3rd bit
Output latch
The first bit is directly latched by the SOTB10 register at the falling edge of the write signal of the SOTB10
register or the read signal of the SIO10 register, and output from the SO10 pin via an output selector. Then, the
value of the SOTB10 register is transferred to the SIO10 register at the next rising (or falling) edge of SCK10, and
shifted one bit. At the same time, the first bit of the receive data is stored in the SIO10 register via the SI10 pin.
The second and subsequent bits are latched by the SIO10 register to the output latch at the next falling (or rising)
edge of SCK10, and the data is output from the SO10 pin.
CHAPTER 14 SERIAL INTERFACE CSI10
Preliminary User's Manual U16227EJ1V0UD
313
(5) Output value of SO10 pin (last bit)
After communication has been completed, the SO10 pin holds the output value of the last bit.
Figure 14-7. Output Value of SO10 Pin (Last Bit)
(1) Type 1; when CKP10 = 0 and DAP10 = 0 (or CKP10 = 1, DAP10 = 0)
SCK10
SOTB10
SIO10
SO10
Writing to SOTB10 or
reading from SIO10
(
Next request is issued.)
Last bit
Output latch
(2) Type 2; when CKP10 = 0 and DAP10 = 1 (or CKP10 = 1, DAP10 = 1)
SCK10
SOTB10
SIO10
SO10
Last bit
Writing to SOTB10 or
reading from SIO10
(
Next request is issued.)
Output latch
Preliminary User's Manual U16227EJ1V0UD
314
CHAPTER 15 INTERRUPT FUNCTIONS
15.1 Interrupt Function Types
The following two types of interrupt functions are used.
(1) Maskable interrupts
These interrupts undergo mask control. Maskable interrupts can be divided into a high interrupt priority group
and a low interrupt priority group by setting the priority specification flag registers (PR0L, PR0H, PR1L).
Multiple interrupt servicing can be applied to low-priority interrupts when high-priority interrupts are generated. If
two or more interrupts with the same priority are generated simultaneously, each interrupt is serviced according to
its predetermined priority (see Table 15-1).
A standby release signal is generated.
Seven external interrupt requests and 15 internal interrupt requests are provided as maskable interrupts.
(2) Software interrupt
This is a vectored interrupt generated by executing the BRK instruction. It is acknowledged even when interrupts
are disabled. The software interrupt does not undergo interrupt priority control.
15.2 Interrupt Sources and Configuration
A total of 23 interrupt sources exist for maskable and software interrupts (see Table 15-1).
CHAPTER 15 INTERRUPT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
315
Table 15-1. Interrupt Source List
Interrupt Source
Interrupt
Type
Default
Priority
Note 1
Name
Trigger
Internal/
External
Vector
Table
Address
Basic
Configuration
Type
Note 2
0
INTLVI
Low-voltage detection
Internal
0004H
(A)
1
INTP0
0006H
2
INTP1
0008H
3
INTP2
000AH
4
INTP3
000CH
5
INTP4
000EH
6
INTP5
Pin input edge detection
External
0010H
(B)
7
INTSRE6
UART6 reception error generation
0012H
8
INTSR6
End of UART6 reception
0014H
9
INTST6
End of UART6 transmission
0016H
10
INTCSI10/
INTST0
End of CSI10 transfer/end of UART0
transmission
0018H
11
INTTMH1
Match between TMH1 and CRH1
(when compare register is specified)
001AH
12
INTTMH0
Match between TMH0 and CRH0
(when compare register is specified)
001CH
13
INTTM50
Match between TM50 and CR50
(when compare register is specified)
001EH
14
INTTM000
Match between TM00 and CR000
(when compare register is specified),
TI010 pin valid edge detection
(when capture register is specified)
0020H
15
INTTM010
Match between TM00 and CR010
(when compare register is specified),
TI000 pin valid edge detection
(when capture register is specified)
0022H
16
INTAD
End of A/D conversion
0024H
17
INTSR0
End of UART0 reception or reception error
generation
0026H
18
INTWTI
Watch timer reference time interval signal
0028H
19
INTTM51
Match between TM51 and CR51
(when compare register is specified)
Internal
002AH
(A)
20
INTKR
Key interrupt detection
External
002CH
(C)
Maskable
21
INTWT
Watch timer overflow
Internal
002EH
(A)
Software
-
BRK
BRK instruction execution
-
003EH
(D)
RESET
Reset input
POC
Power-on reset
LVI
Low-voltage detection
Clock monitor X1 oscillation stop detection
Reset
-
WDT
WDT overflow
-
0000H
-
Notes 1.
The default priority is the priority applicable when two or more maskable interrupt are generated
simultaneously. 0 is the highest priority, and 21 is the lowest.
2.
Basic configuration types (A) to (D) correspond to (A) to (D) in Figure 15-1.
CHAPTER 15 INTERRUPT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
316
Figure 15-1. Basic Configuration of Interrupt Function (1/2)
(A) Internal maskable interrupt
Internal bus
Interrupt
request
IF
MK
IE
PR
ISP
Priority controller
Vector table
address generator
Standby release signal
(B) External maskable interrupt (INTP0 to INTP5)
Internal bus
Interrupt
request
IF
MK
IE
PR
ISP
Priority controller
Vector table
address generator
Standby release signal
External interrupt edge
enable register
(EGP, EGN)
Edge
detector
IF:
Interrupt request flag
IE:
Interrupt enable flag
ISP:
In-service priority flag
MK:
Interrupt mask flag
PR:
Priority specification flag
CHAPTER 15 INTERRUPT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
317
Figure 15-1. Basic Configuration of Interrupt Function (2/2)
(C) External maskable interrupt (INTKR)
IF
MK
IE
PR
ISP
Internal bus
Interrupt
request
Priority controller
Vector table
address generator
Standby release signal
Key
interrupt
detector
1 when KRMn = 1 (n = 0 to 7)
(D) Software interrupt
Internal bus
Interrupt
request
Vector table
address generator
IF:
Interrupt request flag
IE:
Interrupt enable flag
ISP:
In-service priority flag
MK:
Interrupt mask flag
PR:
Priority specification flag
KRM: Key return mode register
15.3 Registers Controlling Interrupt Functions
The following 6 types of registers are used to control the interrupt functions.
Interrupt request flag register (IF0L, IF0H, IF1L)
Interrupt mask flag register (MK0L, MK0H, MK1L)
Priority specification flag register (PR0L, PR0H, PR1L)
External interrupt rising edge enable register (EGP)
External interrupt falling edge enable register (EGN)
Program status word (PSW)
Table 15-2 shows a list of interrupt request flags, interrupt mask flags, and priority specification flags corresponding
to interrupt request sources.
CHAPTER 15 INTERRUPT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
318
Table 15-2. Flags Corresponding to Interrupt Request Sources
Interrupt Request Flag
Interrupt Mask Flag
Priority Specification Flag
Interrupt
Request
Register
Register
Register
INTLVI
LVIIF
IF0L
LVIMK
MK0L
LVIPR
PR0L
INTP0
PIF0
PMK0
PPR0
INTP1
PIF1
PMK1
PPR1
INTP2
PIF2
PMK2
PPR2
INTP3
PIF3
PMK3
PPR3
INTP4
PIF4
PMK4
PPR4
INTP5
PIF5
PMK5
PPR5
INTSRE6
SREIF6
SREMK6
SREPR6
INTSR6
SRIF6
IF0H
SRMK6
MK0H
SRPR6
PR0H
INTST6
STIF6
STMK6
STPR6
INTCSI10
DUALIF0
Note
DUALMK0
DUALPR0
INTST0
INTTMH1
TMIFH1
TMMKH1
TMPRH1
INTTMH0
TMIFH0
TMMKH0
TMPRH0
INTTM50
TMIF50
TMMK50
TMPR50
INTTM000
TMIF000
TMMK000
TMPR000
INTTM010
TMIF010
TMMK010
TMPR010
INTAD
ADIF
IF1L
ADMK
MK1L
ADPR
PR1L
INTSR0
SRIF0
SRMK0
SRPR0
INTWTI
WTIIF
WTIMK
WTIPR
INTTM51
TMIF51
TMMK51
TMPR51
INTKR
KRIF
KRMK
KRPR
INTWT
WTIF
WTMK
WTPR
Note If either of the two types of interrupt sources is generated, these flags are set (1).
CHAPTER 15 INTERRUPT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
319
(1) Interrupt request flag registers (IF0L, IF0H, IF1L)
The interrupt request flags are set to 1 when the corresponding interrupt request is generated or an instruction is
executed. They are cleared to 0 when an instruction is executed upon acknowledgment of an interrupt request or
upon RESET input.
IF0L, IF0H, and IF1L are set by a 1-bit or 8-bit memory manipulation instruction. When IF0L and IF0H are
combined to form 16-bit register IF0, they are read with a 16-bit memory manipulation instruction.
RESET input clears these registers to 00H.
Figure 15-2. Format of Interrupt Request Flag Registers (IF0L, IF0H, IF1L)
Address: FFE0H After reset: 00H R/W
Symbol
7
6
5
4
3
2
1
0
IF0L
SREIF6
PIF5
PIF4
PIF3
PIF2
PIF1
PIF0
LVIIF
Address: FFE1H After reset: 00H R/W
Symbol
7
6
5
4
3
2
1
0
IF0H
TMIF010
TMIF000
TMIF50
TMIFH0
TMIFH1
DUALIF0
STIF6
SRIF6
Address: FFE2H After reset: 00H R/W
Symbol
7
6
5
4
3
2
1
0
IF1L
0
Note
0
Note
WTIF
KRIF
TMIF51
WTIIF
SRIF0
ADIF
XXIFX
Interrupt request flag
0
No interrupt request signal is generated
1
Interrupt request is generated, interrupt request status
Note Be sure to set bits 6 and 7 of IF1L to 0.
Cautions 1. When operating a timer, serial interface, or A/D converter after standby release, operate it
once after clearing the interrupt request flag. An interrupt request flag may be set by noise.
2. When an interrupt is acknowledged, the interrupt request flag is automatically cleared and
then the interrupt routine is entered.
CHAPTER 15 INTERRUPT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
320
(2) Interrupt mask flag registers (MK0L, MK0H, MK1L)
The interrupt mask flags are used to enable/disable the corresponding maskable interrupt servicing.
MK0L, MK0H, and MK1L are set by a 1-bit or 8-bit memory manipulation instruction. When MK0L and MK0H are
combined to form 16-bit register MK0, they are set with a 16-bit memory manipulation instruction.
RESET input sets these registers to FFH.
Figure 15-3. Format of Interrupt Mask Flag Registers (MK0L, MK0H, MK1L)
Address: FFE4H After reset: FFH R/W
Symbol
7
6
5
4
3
2
1
0
MK0L
SREMK6
PMK5
PMK4
PMK3
PMK2
PMK1
PMK0
LVIMK
Address: FFE5H After reset: FFH R/W
Symbol
7
6
5
4
3
2
1
0
MK0H
TMMK010
TMMK000
TMMK50
TMMKH0
TMMKH1
DUALMK0
STMK6
SRMK6
Address: FFE6H After reset: FFH R/W
Symbol
7
6
5
4
3
2
1
0
MK1L
1
Note
1
Note
WTMK
KRMK
TMMK51
WTIMK
SRMK0
ADMK
XXMKX
Interrupt servicing control
0
Interrupt servicing enabled
1
Interrupt servicing disabled
Note Be sure to set bits 6 and 7 of MK1L to 1.
CHAPTER 15 INTERRUPT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
321
(3) Priority specification flag registers (PR0L, PR0H, PR1L)
The priority specification flag registers are used to set the corresponding maskable interrupt priority order.
PR0L, PR0H, and PR1L are set by a 1-bit or 8-bit memory manipulation instruction. If PR0L and PR0H are
combined to form 16-bit register PR0, they are set with a 16-bit memory manipulation instruction.
RESET input sets these registers to FFH.
Figure 15-4. Format of Priority Specification Flag Registers (PR0L, PR0H, PR1L)
Address: FFE8H After reset: FFH R/W
Symbol
7
6
5
4
3
2
1
0
PR0L
SREPR6
PPR5
PPR4
PPR3
PPR2
PPR1
PPR0
LVIPR
Address: FFE9H After reset: FFH R/W
Symbol
7
6
5
4
3
2
1
0
PR0H
TMPR010
TMPR000
TMPR50
TMPRH0
TMPRH1
DUALPRO
STPR6
SRPR6
Address: FFEAH After reset: FFH R/W
Symbol
7
6
5
4
3
2
1
0
PR1L
1
Note
1
Note
WTPR
KRPR
TMPR51
WTIPR
SRPR0
ADPR
XXPRX
Priority level selection
0
High priority level
1
Low priority level
Note Be sure to set bits 6 and 7 of PR1L to 1.
CHAPTER 15 INTERRUPT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
322
(4) External interrupt rising edge enable register (EGP), external interrupt falling edge enable register (EGN)
These registers specify the valid edge for INTP0 to INTP5.
EGP and EGN are set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears these registers to 00H.
Figure 15-5. Format of External Interrupt Rising Edge Enable Register (EGP)
and External Interrupt Falling Edge Enable Register (EGN)
Address: FF48H After reset: 00H R/W
Symbol
7
6
5
4
3
2
1
0
EGP
0
0
EGP5
EGP4
EGP3
EGP2
EGP1
EGP0
Address: FF49H After reset: 00H R/W
Symbol
7
6
5
4
3
2
1
0
EGN
0
0
EGN5
EGN4
EGN3
EGN2
EGN1
EGN0
EGPn
EGNn
INTPn pin valid edge selection (n = 0 to 5)
0
0
Interrupt disabled
0
1
Falling edge
1
0
Rising edge
1
1
Both rising and falling edges
Table 15-3 shows the ports corresponding to EGPn and EGNn.
Table 15-3. Ports Corresponding to EGPn and EGNn
Detection Enable Register
Edge Detection Port
External Request Signal
EGP0
EGN0
P120
INTP0
EGP1
EGN1
P30
INTP1
EGP2
EGN2
P31
INTP2
EGP3
EGN3
P32
INTP3
EGP4
EGN4
P33
INTP4
EGP5
EGN5
P16
INTP5
CHAPTER 15 INTERRUPT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
323
(5) Program status word (PSW)
The program status word is a register used to hold the instruction execution result and the current status for an
interrupt request. The IE flag that sets maskable interrupt enable/disable and the ISP flag that controls multiple
interrupt servicing are mapped to the PSW.
Besides 8-bit read/write, this register can carry out operations using bit manipulation instructions and dedicated
instructions (EI and DI). When a vectored interrupt request is acknowledged, if the BRK instruction is executed,
the contents of the PSW are automatically saved into a stack and the IE flag is reset to 0. If a maskable interrupt
request is acknowledged, the contents of the priority specification flag of the acknowledged interrupt are
transferred to the ISP flag. The PSW contents are also saved into the stack with the PUSH PSW instruction.
They are restored from the stack with the RETI, RETB, and POP PSW instructions.
RESET input sets PSW to 02H.
Figure 15-6. Format of Program Status Word
7
IE
6
Z
5
RBS1
4
AC
3
RBS0
2
0
1
ISP
0
CY
PSW
After reset
02H
ISP
High-priority interrupt servicing (low-priority
interrupt disabled)
IE
0
1
Disabled
Priority of interrupt currently being serviced
Interrupt request acknowledgement enable/disable
Used when normal instruction is executed
Enabled
Interrupt request not acknowledged, or low-
priority interrupt servicing (all maskable
interrupts enabled)
0
1
CHAPTER 15 INTERRUPT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
324
15.4 Interrupt Servicing Operations
15.4.1 Maskable interrupt acknowledgement
A maskable interrupt becomes acknowledgeable when the interrupt request flag is set to 1 and the mask (MK) flag
corresponding to that interrupt request is cleared to 0. A vectored interrupt request is acknowledged if interrupts are
in the interrupt enabled state (when the IE flag is set to 1). However, a low-priority interrupt request is not
acknowledged during servicing of a higher priority interrupt request (when the ISP flag is reset to 0). The times from
generation of a maskable interrupt request until interrupt servicing is performed are listed in Table 15-4 below.
For the interrupt request acknowledgement timing, see Figures 15-8 and 15-9.
Table 15-4. Time from Generation of Maskable Interrupt Until Servicing
Minimum Time
Maximum Time
Note
When
PR = 0
7 clocks
32 clocks
When
PR = 1
8 clocks
33 clocks
Note If an interrupt request is generated just before a divide instruction, the wait time becomes longer.
Remark
1 clock: 1/f
CPU
(f
CPU
: CPU clock)
If two or more maskable interrupt requests are generated simultaneously, the request with a higher priority level
specified in the priority specification flag is acknowledged first. If two or more interrupts requests have the same
priority level, the request with the highest default priority is acknowledged first.
An interrupt request that is held pending is acknowledged when it becomes acknowledgeable.
Figure 15-7 shows the interrupt request acknowledgement algorithm.
If a maskable interrupt request is acknowledged, the contents are saved into the stacks in the order of PSW, then
PC, the IE flag is reset (0), and the contents of the priority specification flag corresponding to the acknowledged
interrupt are transferred to the ISP flag. The vector table data determined for each interrupt request is the loaded into
the PC and branched.
Restoring from an interrupt is possible by using the RETI instruction.
CHAPTER 15 INTERRUPT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
325
Figure 15-7. Interrupt Request Acknowledgement Processing Algorithm
Start
IF = 1?
MK = 0?
PR = 0?
IE = 1?
ISP = 1?
Interrupt request held pending
Yes
Yes
No
No
Yes (interrupt request generation)
Yes
No (Low priority)
No
No
Yes
Yes
No
IE = 1?
No
Any high-priority
interrupt request among those
simultaneously generated
with
PR = 0?
Yes (High priority)
No
Yes
Yes
No
Vectored interrupt servicing
Interrupt request held pending
Interrupt request held pending
Interrupt request held pending
Interrupt request held pending
Interrupt request held pending
Interrupt request held pending
Vectored interrupt servicing
Any high-priority
interrupt request among
those simultaneously
generated?
Any high-priority
interrupt request among
those simultaneously generated
with
PR = 0?
IF: Interrupt request flag
MK: Interrupt mask flag
PR: Priority specification flag
IE:
Flag that controls acknowledgement of maskable interrupt request (1 = Enable, 0 = Disable)
ISP:
Flag that indicates the priority level of the interrupt currently being serviced (0 = high-priority interrupt
servicing, 1 = No interrupt request acknowledged, or low-priority interrupt servicing)
CHAPTER 15 INTERRUPT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
326
Figure 15-8. Interrupt Request Acknowledgement Timing (Minimum Time)
8 clocks
7 clocks
Instruction
Instruction
PSW and PC saved,
jump to interrupt
servicing
Interrupt servicing
program
CPU processing
IF
(
PR = 1)
IF
(
PR = 0)
6 clocks
Remark
1 clock: 1/f
CPU
(f
CPU
: CPU clock)
Figure 15-9. Interrupt Request Acknowledgement Timing (Maximum Time)
33 clocks
32 clocks
Instruction
Divide instruction
PSW and PC saved,
jump to interrupt
servicing
Interrupt servicing
program
CPU processing
IF
(
PR = 1)
IF
(
PR = 0)
6 clocks
25 clocks
Remark
1 clock: 1/f
CPU
(f
CPU
: CPU clock)
15.4.2 Software interrupt request acknowledgement
A software interrupt acknowledge is acknowledged by BRK instruction execution. Software interrupts cannot be
disabled.
If a software interrupt request is acknowledged, the contents are saved into the stacks in the order of the program
status word (PSW), then program counter (PC), the IE flag is reset (0), and the contents of the vector table (003EH,
003FH) are loaded into the PC and branched.
Restoring from a software interrupt is possible by using the RETB instruction.
Caution
Do not use the RETI instruction for restoring from the software interrupt.
CHAPTER 15 INTERRUPT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
327
15.4.3 Multiple interrupt servicing
Multiple interrupt servicing occurs when another interrupt request is acknowledged during execution of an interrupt.
Multiple interrupt servicing does not occur unless the interrupt request acknowledgement enabled state is selected
(IE = 1). Also, when an interrupt request is acknowledged, interrupt request acknowledgement becomes disabled (IE
= 0). Therefore, to enable multiple interrupt servicing, it is necessary to set (1) the IE flag with the EI instruction during
interrupt servicing to enable interrupt acknowledgement.
Moreover, even if interrupts are enabled, multiple interrupt servicing may not be enabled, this being subject to
interrupt priority control. Two types of priority control are available: default priority control and programmable priority
control. Programmable priority control is used for multiple interrupt servicing.
In the interrupt enabled state, if an interrupt request with a priority equal to or higher than that of the interrupt
currently being serviced is generated, it is acknowledged for multiple interrupt servicing. If an interrupt with a priority
lower than that of the interrupt currently being serviced is generated during interrupt servicing, it is not acknowledged
for multiple interrupt servicing. Interrupt requests that are not enabled because interrupts are in the interrupt disabled
state or because they have a lower priority are held pending. When servicing of the current interrupt ends, the
pending interrupt request is acknowledged following execution of at least one main processing instruction execution.
Table 15-5 shows interrupt requests enabled for multiple interrupt servicing and Figure 15-10 shows multiple
interrupt servicing examples.
Table 15-5. Interrupt Request Enabled for Multiple Interrupt Servicing During Interrupt Servicing
Multiple Interrupt Request
Maskable Interrupt Request
PR = 0
PR = 1
Interrupt Being Serviced
IE = 1
IE = 0
IE = 1
IE = 0
ISP = 0
Maskable interrupt
ISP = 1
Software interrupt
Remarks 1. : Multiple interrupt servicing enabled
2.
: Multiple interrupt servicing disabled
3. ISP and IE are flags contained in the PSW.
ISP = 0: An interrupt with higher priority is being serviced.
ISP = 1: No interrupt request has been acknowledged, or an interrupt with a lower
priority is being serviced.
IE = 0:
Interrupt request acknowledgement is disabled.
IE = 1:
Interrupt request acknowledgement is enabled.
4. PR is a flag contained in PR0L, PR0H, and PR1L.
PR = 0: Higher priority level
PR = 1: Lower priority level
CHAPTER 15 INTERRUPT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
328
Figure 15-10. Examples of Multiple Interrupt Servicing (1/2)
Example 1. Multiple interrupt servicing occurs twice
Main processing
INTxx servicing
INTyy servicing
INTzz servicing
EI
EI
EI
RETI
RETI
RETI
INTxx
(PR = 1)
INTyy
(PR = 0)
INTzz
(PR = 0)
IE = 0
IE = 0
IE = 0
IE = 1
IE = 1
IE = 1
During servicing of interrupt INTxx, two interrupt requests, INTyy and INTzz, are acknowledged, and multiple
interrupt servicing takes place. Before each interrupt request is acknowledged, the EI instruction must always be
issued to enable interrupt request acknowledgement.
Example 2. Multiple interrupt servicing does not occur due to priority control
Main processing
INTxx servicing
INTyy servicing
INTxx
(PR = 0)
INTyy
(PR = 1)
EI
RETI
IE = 0
IE = 0
EI
1 instruction execution
RETI
IE = 1
IE = 1
Interrupt request INTyy issued during servicing of interrupt INTxx is not acknowledged because its priority is lower
than that of INTxx, and multiple interrupt servicing does not take place. The INTyy interrupt request is held pending,
and is acknowledged following execution of one main processing instruction.
PR = 0: Higher priority level
PR = 1: Lower priority level
IE = 0:
Interrupt request acknowledgement disabled
CHAPTER 15 INTERRUPT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
329
Figure 15-10. Examples of Multiple Interrupt Servicing (2/2)
Example 3. Multiple interrupt servicing does not occur because interrupts are not enabled
Main processing
INTxx servicing INTyy servicing
EI
1 instruction execution
RETI
RETI
INTxx
(PR = 0)
INTyy
(PR = 0)
IE = 0
IE = 0
IE = 1
IE = 1
Interrupts are not enabled during servicing of interrupt INTxx (EI instruction is not issued), therefore, interrupt
request INTyy is not acknowledged and multiple interrupt servicing does not take place. The INTyy interrupt request
is held pending, and is acknowledged following execution of one main processing instruction.
PR = 0: Higher priority level
IE = 0:
Interrupt request acknowledgement disabled
CHAPTER 15 INTERRUPT FUNCTIONS
Preliminary User's Manual U16227EJ1V0UD
330
15.4.4 Interrupt request hold
There are instructions where, even if an interrupt request is issued for them while another instruction is being
executed, request acknowledgement is held pending until the end of execution of the next instruction. These
instructions (interrupt request hold instructions) are listed below.
MOV PSW, #byte
MOV A, PSW
MOV PSW, A
MOV1 PSW. bit, CY
MOV1 CY, PSW. bit
AND1 CY, PSW. bit
OR1 CY, PSW. bit
XOR1 CY, PSW. bit
SET1 PSW. bit
CLR1 PSW. bit
RETB
RETI
PUSH PSW
POP PSW
BT PSW. bit, $addr16
BF PSW. bit, $addr16
BTCLR PSW. bit, $addr16
EI
DI
Manipulation instructions for the IF0L, IF0H, IF1L, MK0L, MK0H, MK1L, PR0L, PR0H, and PR1L registers.
Caution
The BRK instruction is not one of the above-listed interrupt request hold instructions. However,
the software interrupt activated by executing the BRK instruction causes the IE flag to be
cleared. Therefore, even if a maskable interrupt request is generated during execution of the
BRK instruction, the interrupt request is not acknowledged.
Figure 15-11 shows the timing at which interrupt requests are held pending.
Figure 15-11. Interrupt Request Hold
Instruction N
Instruction M
PSW and PC saved, jump
to interrupt servicing
Interrupt servicing
program
CPU processing
IF
Remarks 1. Instruction N: Interrupt request hold instruction
2. Instruction M: Instruction other than interrupt request hold instruction
3. The
PR (priority level) values do not affect the operation of IF (instruction request).
Preliminary User's Manual U16227EJ1V0UD
331
CHAPTER 16 KEY INTERRUPT FUNCTION
16.1 Functions of Key Interrupt
A key interrupt (INTKR) can be generated by setting the key return mode register (KRM) and inputting a rising
edge to the key interrupt input pins (KR0 to KR3).
Table 16-1. Assignment of Key Interrupt Detection Pins
Flag
Description
KRM0
Controls KR0 signal in 1-bit units.
KRM1
Controls KR1 signal in 1-bit units.
KRM2
Controls KR2 signal in 1-bit units.
KRM3
Controls KR3 signal in 1-bit units.
16.2 Configuration of Key Interrupt
The key interrupt consists of the following hardware.
Table 16-2. Configuration of Key Interrupt
Item
Configuration
Control register
Key return mode register (KRM)
Figure 16-1. Block Diagram of Key Interrupt
INTKR
Key return mode register (KRM)
0
0
0
0
KRM3 KRM2 KRM1 KRM0
KR3
KR2
KR1
KR0
CHAPTER 16 KEY INTERRUPT FUNCTION
Preliminary User's Manual U16227EJ1V0UD
332
16.3 Register Controlling Key Interrupt
(1) Key return mode register (KRM)
This register controls the KRM0 to KRM3 bits using the KR0 to KR3 signals, respectively.
This register is set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Figure 16-2. Format of Key Return Mode Register (KRM)
0
Does not detect key interrupt signal
Detects key interrupt signal
KRMn
0
1
Key interrupt mode control
KRM
0
0
0
KRM3
KRM2
KRM1
KRM0
Address: FF6EH After reset: 00H R/W
Symbol
7
6
5
4
3
2
0
Cautions 1. If any of the KRM0 to KRM3 bits used is set to 1, set bits 0 to 3 (PU70 to PU73) of the
corresponding pull-up resistor register 7 (PU7) to 1.
2. If KRM is changed, the interrupt request flag may be set. Therefore, disable interrupts and
then change the KRM register. Clear the interrupt request flag and enable interrupts.
3. The bits not used in the key interrupt mode can be used as normal ports.
Preliminary User's Manual U16227EJ1V0UD
333
CHAPTER 17 STANDBY FUNCTION
17.1 Standby Function and Configuration
17.1.1 Standby function
Table 17-1. Relationship Between HALT Mode, STOP Mode, and Clock
X1 Input Clock
Ring-OSC Clock
Subsystem Clock
CPU Clock
HALT mode
Oscillation continues
Oscillation continues
Oscillation continues
Operation stopped
STOP mode
Oscillation stopped
Oscillation continues
Oscillation continues
Operation stopped
The standby function is designed to reduce the power consumption of the system. The following two modes are
available.
(1) HALT mode
HALT instruction execution sets the HALT mode. In the HALT mode, the CPU operation clock is stopped, but the
system clock oscillator continues oscillating. In this mode, power consumption is not decreased as much as in
the STOP mode, but the HALT mode is effective for restarting operation immediately upon interrupt request
generation and carrying out intermittent operations.
(2) STOP mode
STOP instruction execution sets the STOP mode. In the STOP mode, the X1 input clock oscillator stops,
stopping the whole system, thereby considerably reducing the CPU power consumption.
Because this mode can be cleared by an interrupt request, it enables intermittent operations to be carried out.
However, because a wait time is required to secure the oscillation stabilization time after the STOP mode is
released, select the HALT mode if it is necessary to start processing immediately upon interrupt request
generation.
In either of these two modes, all the contents of registers, flags and data memory just before the standby mode is
set are held. The I/O port output latches and output buffer statuses are also held.
Cautions 1. STOP mode can be used only when operating on the X1 input clock or Ring-OSC clock.
HALT mode can be used when operating on the X1 input clock, Ring-OSC clock, or
subsystem clock. However, when the STOP instruction is executed during Ring-OSC clock
operation, the X1 oscillator stops, but Ring-OSC oscillator does not stop.
2. When shifting to the STOP mode, be sure to stop the peripheral hardware operation before
executing STOP instruction.
3. The following sequence is recommended for power consumption reduction of the A/D
converter when the standby function is used: First clear bit 7 (ADCS) of the A/D converter
mode register (ADM) to 0 to stop the A/D conversion operation, and then execute the HALT or
STOP instruction.
4. Ring-OSC clock oscillation cannot be stopped in the STOP mode. However, when the Ring-
OSC clock is used as the CPU clock, the CPU operation is stopped for 17/f
R
(s) after STOP
mode is released.
CHAPTER 17 STANDBY FUNCTION
Preliminary User's Manual U16227EJ1V0UD
334
Figure 17-1. Operation Timing When STOP Mode Is Released
Ring-OSC clock is
selected as CPU clock
when STOP instruction
is executed
Ring-OSC clock
X1 input clock
X1 input clock is
selected as CPU clock
when STOP instruction
is executed
STOP mode release
STOP mode
Operation stopped
(17/f
R
)
Clock switched
by software
Ring-OSC clock
X1 input clock
HALT status
(oscillation stabilization time set by OSTS)
X1 input clock
CHAPTER 17 STANDBY FUNCTION
Preliminary User's Manual U16227EJ1V0UD
335
17.1.2 Registers controlling standby function
The standby function is controlled by the following two registers.
Oscillation stabilization time counter status register (OSTC)
Oscillation stabilization time select register (OSTS)
(1) Oscillation stabilization time counter status register (OSTC)
This is the status register of the X1 input clock oscillation stabilization time counter. If the Ring-OSC 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.
RESET input, STOP instruction, MSTOP = 1, and MCC = 1 clear OSTC to 00H.
Figure 17-2. 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
MOST11
MOST13
MOST14
MOST15
MOST16
Oscillation stabilization time status
1
0
0
0
0
2
11
/f
X
min. (204.8
s min.)
1
1
0
0
0
2
13
/f
X
min. (819.2
s min.)
1
1
1
0
0
2
14
/f
X
min. (1.64 ms min.)
1
1
1
1
0
2
15
/f
X
min. (3.27 ms min.)
1
1
1
1
1
2
16
/f
X
min. (6.55 ms min.)
Caution
After the above time has elapsed, the bits are set to 1 in order from MOST11 and
remain 1.
Remarks 1. Values in parentheses are for operation with f
X
= 10 MHz.
2. f
X
: X1 input clock oscillation frequency
CHAPTER 17 STANDBY FUNCTION
Preliminary User's Manual U16227EJ1V0UD
336
(2) 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 when the X1 input clock is selected as the CPU
clock. After STOP mode is released when the Ring-OSC clock is selected, check the oscillation stabilization time
using OSTC.
OSTS can be set by an 8-bit memory manipulation instruction.
RESET input sets OSTS to 05H.
Figure 17-3. 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
OSTS2
OSTS1
OSTS0
Oscillation stabilization time selection
0
0
1
2
11
/f
X
(204.8
s)
0
1
0
2
13
/f
X
(819.2
s)
0
1
1
2
14
/f
X
(1.64 ms)
1
0
0
2
15
/f
X
(3.27 ms)
1
0
1
2
16
/f
X
(6.55 ms)
Other than above
Setting prohibited
Cautions 1. If the STOP mode is entered and then released while the Ring-OSC 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 only during the oscillation
stabilization time set by OSTS. Therefore, note that only the statuses during the
oscillation stabilization time set by OSTS are set to OSTC after STOP mode has
been 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
V
SS
a
Remarks 1. Values in parentheses are for operation with f
X
= 10 MHz.
2. f
X
: X1 input clock oscillation frequency
CHAPTER 17 STANDBY FUNCTION
Preliminary User's Manual U16227EJ1V0UD
337
17.2 Standby Function Operation
17.2.1 HALT mode
(1) HALT mode
The HALT mode is set by executing the HALT instruction. HALT mode can be set regardless of whether the CPU
clock before the setting was the X1 input clock, Ring-OSC clock, or subsystem clock.
The operating statuses in the HALT mode are shown below.
Table 17-2. Operating Statuses in HALT Mode (1/2)
When HALT Instruction Is Executed While CPU Is
Operating on X1 Input Clock
When HALT Instruction Is Executed While CPU Is
Operating on Ring-OSC Clock
When Ring-OSC
Oscillation Continues
When Ring-OSC
Oscillation Stopped
Note 1
When X1 Input Clock
Oscillation Continues
When X1 Input Clock
Oscillation Stopped
HALT Mode Setting
Item
When
Subsystem
Clock Used
When
Subsystem
Clock Not
Used
When
Subsystem
Clock Used
When
Subsystem
Clock Not
Used
When
Subsystem
Clock Used
When
Subsystem
Clock Not
Used
When
Subsystem
Clock Used
When
Subsystem
Clock Not
Used
System clock
The X1 oscillator, Ring-OSC oscillator, and subsystem clock oscillator are able to oscillate. Clock supply to the
CPU is stopped.
CPU
Operation stopped
Port (latch)
Status before HALT mode was set is retained
16-bit timer/event counter 00
Operable
Operation stopped
8-bit timer/event counter 50
Operable
Operable only when TI50 is selected as the count clock
8-bit timer/event counter 51
Operable
Operable only when TI51 is selected as the count clock
8-bit timer H0
Operable
Operable only when TO50 is selected as the count
clock during 8-bit timer/event counter 50 operation
8-bit timer H1
Operable
Operable only when f
R
/2
7
is selected as the count clock
Watch timer
Operable
Operable
Note 2
Operable
Operable
Note 2
Operable
Note 3
Not operable Operable
Note 3
Not operable
Ring-OSC cannot
be stopped
Note 4
Operable
-
Operable
Watchdog
timer
Ring-OSC can be
stopped
Note 4
Operation stopped
A/D converter
Operable
Not operable
UART0
Operable
UART6
Operable
Operable only when TO50 is selected as the serial
clock during TM50 operation
Serial
interface
CSI10
Operable
Operable only when external SCK10 is selected as the
serial clock
Clock monitor
Operable
Operation stopped
Operable
Operation stopped
Power-on-clear function
Note 5
Operable
Low-voltage detection function
Operable
External interrupt
Operable
Notes 1.
When "Stopped by software" is selected for Ring-OSC by a mask option and Ring-OSC is stopped by
software (for mask options, see CHAPTER 22 MASK OPTIONS).
2.
Operable when the X1 input clock is selected.
3.
Operable when the subsystem clock is selected.
4.
"Ring-OSC cannot be stopped" or "Ring-OSC can be stopped by software" can be selected by a mask
option.
5.
When "POC used" is selected by a mask option.
CHAPTER 17 STANDBY FUNCTION
Preliminary User's Manual U16227EJ1V0UD
338
Table 17-2. Operating Statuses in HALT Mode (2/2)
When HALT Instruction Is Executed While CPU Is Operating on Subsystem Clock
When X1 Input Clock Oscillation Continues
When X1 Input Clock Oscillation Stopped
HALT Mode Setting
Item
When Ring-OSC
Oscillation Continues
When Ring-OSC
Oscillation Stopped
Note 1
When Ring-OSC
Oscillation Continues
When Ring-OSC
Oscillation Stopped
Note 1
System clock
The X1 oscillator, Ring-OSC oscillator, and subsystem clock oscillator are able to oscillate. Clock supply to the
CPU is stopped.
CPU
Operation stopped
Port (latch)
Status before HALT mode was set is retained
16-bit timer/event counter 00
Operable
Operation stopped
8-bit timer/event counter 50
Operable
Operable only when TI50 is selected as the count clock
8-bit timer/event counter 51
Operable
Operable only when TI51 is selected as the count clock
8-bit timer H0
Operable
Operable only when TO50 is selected as the count
clock during 8-bit timer/event counter 50 operation
8-bit timer H1
Operable
Operable only when the
X1 input clock is selected
as the count clock
Operable only when f
R
/2
7
is selected as the count
clock
Operation stopped
Watch timer
Operable
Operable only when subsystem clock is selected
Ring-OSC cannot
be stopped
Note 2
Operable
-
Operable
-
Watchdog
timer
Ring-OSC can be
stopped
Note 2
Operation stopped
A/D converter
Operable
Not operable
UART0
Operable
UART6
Operable
Operable only when TO50 is selected as the serial
clock during TM50 operation
Serial
interface
CSI10
Operable
Operable only when external clock is selected as the
serial clock
Clock monitor
Operable
Operation stopped
Power-on-clear function
Note 3
Operable
Low-voltage detection function
Operable
External interrupt
Operable
Notes 1.
When "Stopped by software" is selected for Ring-OSC by a mask option and Ring-OSC is stopped by
software (for mask options, see CHAPTER 22 MASK OPTIONS).
2.
"Ring-OSC cannot be stopped" or "Ring-OSC can be stopped by software" can be selected by a mask
option.
3.
When "POC used" is selected by a mask option.
CHAPTER 17 STANDBY FUNCTION
Preliminary User's Manual U16227EJ1V0UD
339
(2) HALT mode release
The HALT mode can be released by the following two sources.
(a) Release by unmasked interrupt request
When an unmasked interrupt request is generated, the HALT mode is released. If interrupt
acknowledgement is enabled, vectored interrupt servicing is carried out. If interrupt acknowledgement is
disabled, the next address instruction is executed.
Figure 17-4. HALT Mode Release by Interrupt Request Generation
HALT
instruction
Wait
Wait
Operating mode
HALT mode
Operating mode
Oscillation
X1 input clock,
Ring-OSC clock,
or subsystem clock
CPU clock
Standby
release signal
Interrupt
request
Remarks 1. The broken lines indicate the case when the interrupt request which has released the standby
mode is acknowledged.
2. The wait time is as follows:
When vectored interrupt servicing is carried out: 8 or 9 clocks
When vectored interrupt servicing is not carried out: 2 or 3 clocks
CHAPTER 17 STANDBY FUNCTION
Preliminary User's Manual U16227EJ1V0UD
340
(b) Release by RESET input
When the RESET signal is input, HALT mode is released, and then, as in the case with a normal reset
operation, the program is executed after branching to the reset vector address.
Figure 17-5. HALT Mode Release by RESET Input
(1) When X1 input clock is used as CPU clock
HALT
instruction
RESET signal
X1 input clock
Operating mode
HALT mode
Reset
period
Operation
stopped
Operating mode
Oscillates
Oscillation
stopped
Oscillates
CPU clock
(X1 input clock)
Oscillation stabilization time
(2
11
/f
X
to 2
16
/f
X
)
(Ring-OSC clock)
(17/f
R
)
(2) When Ring-OSC clock or subsystem clock is used as CPU clock
HALT
instruction
RESET signal
Ring-OSC clock
or
subsystem clock
Operating mode
HALT mode
Reset
period
Operation
stopped
Operating mode
Oscillates
Oscillation
stopped
Oscillates
CPU clock
(Ring-OSC clock)
(17/f
R
)
Ring-OSC clock
or
subsystem clock
Remarks 1. f
X
: X1 input clock oscillation frequency
2. f
R
: Ring-OSC clock oscillation frequency
Table 17-3. Operation After HALT Mode Release
Release Source
MK
PR
IE
ISP
Operation
0
0
0
Next address
instruction execution
0
0
1
Interrupt servicing
execution
0
1
0
1
0
1
0
Next address
instruction execution
0
1
1
1
Interrupt servicing
execution
Maskable interrupt
request
1
HALT mode held
RESET input
-
-
Reset processing
: Don't care
CHAPTER 17 STANDBY FUNCTION
Preliminary User's Manual U16227EJ1V0UD
341
17.2.2 STOP mode
(1) STOP mode setting and operating statuses
The STOP mode is set by executing the STOP instruction, and it can be set only when the CPU clock before the
setting was the X1 input clock or Ring-OSC clock.
Caution
Because the interrupt request signal is used to clear the standby mode, if there is an interrupt
source with the interrupt request flag set and the interrupt mask flag reset, the standby mode is
immediately cleared if set. Thus, the STOP mode is reset to the HALT mode immediately after
execution of the STOP instruction and the system returns to the operating mode as soon as the
wait time set using the oscillation stabilization time select register (OSTS) has elapsed.
The operating statuses in the STOP mode are shown below.
Table 17-4. Operating Statuses in STOP Mode
When STOP Instruction Is Executed While CPU Is Operating on X1 Input Clock
When Ring-OSC Oscillation
Continues
When Ring-OSC Oscillation
Stopped
Note 1
When STOP Instruction Is Executed
While CPU Is Operating on Ring-
OSC Clock
STOP Mode Setting
Item
When Subsystem
Clock Used
When Subsystem
Clock Not Used
When Subsystem
Clock Used
When Subsystem
Clock Not Used
When Subsystem
Clock Used
When Subsystem
Clock Not Used
System clock
Only X1 oscillator oscillation is stopped. Clock supply to the CPU is stopped.
CPU
Operation stopped
Port (latch)
Status before STOP mode was set is retained
16-bit timer/event counter 00
Operation stopped
8-bit timer/event counter 50
Operable only when TI50 is selected as the count clock
8-bit timer/event counter 51
Operable only when TI51 is selected as the count clock
8-bit timer H0
Operable only when TO50 is selected as the count clock during 8-bit timer/event counter 50 operation
8-bit timer H1
Operable
Note 2
Operation stopped
Operable
Note 2
Watch timer
Operable
Note 3
Operation stopped Operable
Note 3
Operation stopped Operable
Note 3
Operation stopped
Ring-OSC cannot
be stopped
Note 4
Operable
-
Operable
Watchdog
timer
Ring-OSC can be
stopped
Note 4
Operation stopped
A/D converter
Operation stopped
UART0
UART6
Operable only when TO50 is selected as the serial clock during TM50 operation
Serial interface
CSI10
Operable only when external SCK10 is selected as the serial clock
Clock monitor
Operation stopped
Power-on-clear function
Note 5
Operable
Low-voltage detection function
Operable
External interrupt
Operable
Notes 1.
When "Stopped by software" is selected for Ring-OSC by a mask option and Ring-OSC is stopped by
software (for mask options, see CHAPTER 22 MASK OPTIONS).
2.
Operation continues only when f
R
/2
7
is selected as the count clock.
3.
Operable when the subsystem clock is selected.
4.
"Ring-OSC cannot be stopped" or "Ring-OSC can be stopped by software" can be selected by a mask
option.
5.
When "POC used" is selected by a mask option.
CHAPTER 17 STANDBY FUNCTION
Preliminary User's Manual U16227EJ1V0UD
342
(2) STOP mode release
The STOP mode can be released by the following two sources.
(a) Release by unmasked interrupt request
When an unmasked interrupt request is generated, the STOP mode is released. After the oscillation
stabilization time has elapsed, if interrupt acknowledgement is enabled, vectored interrupt servicing is carried
out. If interrupt acknowledgement is disabled, the next address instruction is executed.
Figure 17-6. STOP Mode Release by Interrupt Request Generation
(1) When X1 input clock is used as CPU clock
Operating mode
Operating mode
Oscillates
Oscillates
STOP
instruction
STOP mode
Wait
(set by OSTS)
Standby release signal
Oscillation stabilization
wait status
Oscillation stopped
X1 input clock
CPU clock
Oscillation stabilization time (set by OSTS)
(X1 input clock)
(X1 input clock)
(2) When Ring-OSC clock is used as CPU clock
Operating mode
Operating mode
Oscillates
STOP
instruction
STOP mode
Standby release signal
Ring-OSC clock
CPU clock
(Ring-OSC clock)
Operation
stopped
(17/ f
R
)
(Ring-OSC clock)
Remark
The broken lines indicate the case when the interrupt request that has released the standby mode
is acknowledged.
CHAPTER 17 STANDBY FUNCTION
Preliminary User's Manual U16227EJ1V0UD
343
(b) Release by RESET input
When the RESET signal is input, STOP mode is released and a reset operation is performed after the
oscillation stabilization time has elapsed.
Figure 17-7. STOP Mode Release by RESET Input
(1) When X1 input clock is used as CPU clock
STOP
instruction
RESET signal
X1 input clock
Operating mode
STOP mode
Reset
period
Operation
stopped
Operating mode
Oscillates
Oscillation
stopped
Oscillates
CPU clock
(X1 input clock)
Oscillation stabilization time (2
11/
f
X
to 2
16
/f
X
)
(Ring-OSC clock)
(17/f
R
)
Oscillation stopped
(2) When Ring-OSC clock is used as CPU clock
STOP
instruction
RESET signal
Ring-OSC clock
Operating mode
STOP mode
Reset
period
Operation
stopped
Operating mode
Oscillates
Oscillation
stopped
Oscillates
CPU clock
(Ring-OSC clock)
(17/f
R
)
(Ring-OSC clock)
Table 17-5. Operation After STOP Mode Release
Release Source
MK
PR
IE
ISP
Operation
0
0
0
Next address
instruction execution
0
0
1
Interrupt servicing
execution
0
1
0
1
0
1
0
Next address
instruction execution
0
1
1
1
Interrupt servicing
execution
Maskable interrupt
request
1
STOP mode held
RESET input
-
-
Reset processing
: Don't care
Preliminary User's Manual U16227EJ1V0UD
344
CHAPTER 18 RESET FUNCTION
The following five operations are available to generate a reset signal.
(1) External reset input via RESET pin
(2) Internal reset by watchdog timer program loop detection
(3) Internal reset by clock monitor X1 clock oscillation stop detection
(4) Internal reset by comparison of supply voltage and detection voltage of power-on-clear (POC) circuit
(5) Internal reset by comparison of supply voltage and detection voltage of low-power-supply detector (LVI)
External and internal resets have no functional differences. In both cases, program execution starts at the address
at 0000H and 0001H when the reset signal is input.
A reset is applied when a low level is input to the RESET pin, the watchdog timer overflows, X1 clock oscillation
stop is detected by the clock monitor, or by POC and LVI circuit voltage detection, and each item of hardware is set to
the status shown in Table 18-1. Each pin is high impedance during reset input or during the oscillation stabilization
time just after reset release, except for P130, which is low-level output.
When a high level is input to the RESET pin, the reset is released and program execution starts using the Ring-
OSC clock after the CPU clock operation has stopped for 17/f
R
(s). A reset generated by the watchdog timer and
clock monitor sources is automatically released after the reset, and program execution starts using the Ring-OSC
clock after the CPU clock operation has stopped for 17/f
R
(s) (see Figures 18-2 to 18-4). Reset by POC and LVI
circuit power supply detection is automatically released when V
DD
> V
POC
or V
DD
> V
LVI
after the reset, and program
execution starts using the Ring-OSC clock after the CPU clock operation has stopped for 17/f
R
(s) (see CHAPTER 20
POWER-ON-CLEAR CIRCUIT and CHAPTER 21 LOW-VOLTAGE DETECTOR).
Cautions 1. For an external reset, input a low level for 10



s or more to the RESET pin.
2. During reset input, the X1 input clock and Ring-OSC clock stop oscillating.
3. When the STOP mode is released by a reset, the STOP mode contents are held during reset
input. However, the port pins become high-impedance, except for P130, which is set to low-
level output.
CHAPTER 18 RESET FUNCTION
Preliminary User's Manual U16227EJ1V0UD
345
Figure 18-1. Block Diagram of Reset Function
CLMRF
LVIRF
WDTRF
Reset control flag register (RESF)
Internal bus
WDTRES
(Watchdog timer reset signal)
CLMRESB
(Clock monitor reset signal)
RESET
POCRESB
(Power-on-clear circuit reset signal)
LVIRESB
(Low-voltage detector reset signal)
Reset signal
Reset signal
Reset signal to LVIM/LVIS register
Clear
Set
Set
Clear
Clear
Set
Caution
An LVI circuit internal reset does not reset the LVI circuit.
Remarks 1. LVIM: Low-voltage detection register
2. LVIS: Low-voltage detection level selection register
CHAPTER 18 RESET FUNCTION
Preliminary User's Manual U16227EJ1V0UD
346
Figure 18-2. Timing of Reset by RESET Input
Delay
Delay
Hi-Z
Note
Normal operation
Reset period
(Oscillation stop)
Operation stop
(17/f
R
)
Normal operation
(Reset processing,
Ring-OSC clock)
X1
RESET
Internal
reset signal
Port pin
CPU clock
Figure 18-3. Timing of Reset Due to Watchdog Timer Overflow
Hi-Z
Note
Normal operation
Reset period
(Oscillation stop)
X1
Watchdog
timer
overflow
Internal
reset signal
Port pin
Operation stop
(17/f
R
)
Normal operation
(Reset processing,
Ring-OSC clock)
CPU clock
Caution
A watchdog timer internal reset resets the watchdog timer.
Figure 18-4. Timing of Reset in STOP Mode by RESET Input
Delay
Delay
Hi-Z
Note
Normal operation
X1
RESET
Internal
reset signal
Port pin
Stop status
(Oscillation stop)
STOP instruction execution
Reset period
(Oscillation stop)
Operation stop
(17/f
R
)
Normal operation
(Reset processing,
Ring-OSC clock)
CPU clock
Note The port pins become high impedance, except for P130, which is set to low-level output.
Remark
For the reset timing of the power-on-clear circuit and low-voltage detector, see CHAPTER 20 POWER-
ON-CLEAR CIRCUIT and CHAPTER 21 LOW-VOLTAGE DETECTOR.
CHAPTER 18 RESET FUNCTION
Preliminary User's Manual U16227EJ1V0UD
347
Table 18-1. Hardware Statuses After Reset (1/2)
Hardware
Status After Reset
Program counter (PC)
Note 1
The contents of the
reset vector table
(0000H, 0001H) are
set.
Stack pointer (SP)
Undefined
Program status word (PSW)
02H
Data memory
Undefined
Note 2
RAM
General-purpose registers
Undefined
Note 2
Ports (P0 to P3, P6, P7, P12, P13) (output latches)
00H
Port mode registers (PM0, PM1, PM3, PM6, PM7, PM12)
FFH
Pull-up resistor option registers (PU0, PU1, PU3 to PU7, PU12)
00H
Input switch control register (ISC)
00H
Internal memory size switching register (IMS)
CFH
Processor clock control register (PCC)
00H
Ring-OSC mode register (RCM)
00H
Main clock mode register (MCM)
00H
Main OSC control register (MOC)
00H
Oscillation stabilization time select register (OSTS)
05H
Oscillation stabilization time counter status register (OSTC)
00H
Timer counter 00 (TM00)
0000H
Capture/compare registers 000, 010 (CR000, CR010)
0000H
Mode control register 00 (TMC00)
00H
Prescaler mode register 00 (PRM00)
00H
Capture/compare control register 00 (CRC00)
00H
16-bit timer/event
counter 00
Timer output control register 00 (TOC00)
00H
Timer counters 50, 51 (TM50, TM51)
00H
Compare registers 50, 51 (CR50, CR51)
00H
Timer clock selection registers 50, 51 (TCL50, TCL51)
00H
8-bit timer/event
counters 50, 51
Mode control registers 50, 51 (TMC50, TMC51)
00H
Compare registers 00, 10, 01, 11 (CMP00, CMP10, CMP01, CMP11)
00H
Mode registers (TMHMD0, TMHMD1)
00H
8-bit timers H0, H1
Carrier control register 1 (TMCYC1)
Note 3
00H
Watch timer
Operation mode register (WTM)
00H
Mode register (WDTM)
67H
Watchdog timer
Enable register (WDTE)
9AH
Notes 1.
During reset input or oscillation stabilization time wait, only the PC contents among the hardware statuses
become undefined. All other hardware statuses remain unchanged after reset.
2.
When a reset is executed in the standby mode, the pre-reset status is held even after reset.
3.
8-bit timer H1 only.
CHAPTER 18 RESET FUNCTION
Preliminary User's Manual U16227EJ1V0UD
348
Table 18-1. Hardware Statuses After Reset (2/2)
Hardware
Status After Reset
Conversion result register (ADCR)
Undefined
Mode register (ADM)
00H
Analog input channel specification register (ADS)
00H
Power-fail comparison mode register (PFM)
00H
A/D converter
Power-fail comparison threshold register (PFT)
00H
Receive buffer register 0 (RXB0)
FFH
Transmit shift register 0 (TXS0)
FFH
Asynchronous serial interface operation mode register 0 (ASIM0)
01H
Serial interface UART0
Baud rate generator control register 0 (BRGC0)
1FH
Receive buffer register 6 (RXB6)
FFH
Transmit buffer register 6 (TXB6)
FFH
Asynchronous serial interface operation mode register 6 (ASIM6)
01H
Asynchronous serial interface reception error status register 6 (ASIS6)
00H
Asynchronous serial interface transmission status register 6 (ASIF6)
00H
Clock selection register 6 (CKSR6)
00H
Baud rate generator control register 6 (BRGC6)
FFH
Serial interface UART6
Asynchronous serial interface control register 6 (ASICL6)
16H
Transmit buffer register 10 (SOTB10)
Undefined
Serial I/O shift register 10 (SIO10)
00H
Serial operation mode register 10 (CSIM10)
00H
Serial interface CSI10
Serial clock selection register 10 (CSIC10)
00H
Key interrupt
Key return mode register (KRM)
00H
Clock monitor
Mode register (CLM)
00H
Reset function
Reset control flag register (RESF)
00H
Note
Low-voltage detection register (LVIM)
00H
Note
Low-voltage detector
Low-voltage detection level selection register (LVIS)
00H
Note
Request flag registers 0L, 0H, 1L (IF0L, IF0H, IF1L)
00H
Mask flag registers 0L, 0H, 1L (MK0L, MK0H, MK1L)
FFH
Priority specification flag registers 0L, 0H, 1L (PR0L, PR0H, PR1L)
FFH
External interrupt rising edge enable register (EGP)
00H
Interrupt
External interrupt falling edge enable register (EGN)
00H
Note These values vary depending on the reset source.
Reset Source
Register
RESET Input
Reset by POC
Reset by WDT
Reset by CLM
Reset by LVI
RESF
See Table 18-2.
LVIM
LVIS
Cleared (00H)
Cleared (00H)
Cleared (00H)
Cleared (00H)
Held
CHAPTER 18 RESET FUNCTION
Preliminary User's Manual U16227EJ1V0UD
349
18.1 Register for Confirming Reset Source
Many internal reset generation sources exist in the 78K0/KC1 Series. The reset control flag register (RESF) is
used to store which source has generated the reset request.
RESF can be read by an 8-bit memory manipulation instruction.
RESET input, reset input by power-on-clear (POC) circuit, and reading RESF clear RESF to 00H.
Figure 18-5. Format of Reset Control Flag Register (RESF)
Address: FFACH After reset: 00H
Note
R
Symbol
7
6
5
4
3
2
1
0
RESF
0
0
0
WDTRF
0
0
CLMRF
LVIRF
WDTRF
Internal reset request by watchdog timer (WDT)
0
Internal reset request is not generated, or RESF is cleared.
1
Internal reset request is generated.
CLMRF
Internal reset request by clock monitor (CLM)
0
Internal reset request is not generated, or RESF is cleared.
1
Internal reset request is generated.
LVIRF
Internal reset request by low-voltage detector (LVI)
0
Internal reset request is not generated, or RESF is cleared.
1
Internal reset request is generated.
Note The value after reset varies depending on the reset source.
Caution
Do not read data by a 1-bit memory manipulation instruction.
The status of RESF when a reset request is generated is shown in Table 18-2.
Table 18-2. RESF Status When Reset Request Is Generated
Reset Source
Flag
RESET input
Reset by POC
Reset by WDT
Reset by CLM
Reset by LVI
WDTRF
Set (1)
Held
Held
CLMRF
Held
Set (1)
Held
LVIRF
Cleared (0)
Cleared (0)
Held
Held
Set (1)
Preliminary User's Manual U16227EJ1V0UD
350
CHAPTER 19 CLOCK MONITOR
19.1 Functions of Clock Monitor
The clock monitor samples the X1 input clock using the on-chip Ring-OSC, and generates an internal reset signal
when the X1 input clock is stopped.
When a reset signal is generated by the clock monitor, bit 1 (CLMRF) of the reset control flag register (RESF) is set
to 1. For details of RESF, refer to CHAPTER 18 RESET FUNCTION.
The clock monitor automatically stops under the following conditions.
In STOP mode and during the oscillation stabilization time
When the X1 input clock is stopped by software (when MSTOP = 1 or MCC = 1)
During the oscillation stabilization time after reset is released
When the Ring-OSC clock is stopped
Remark
MSTOP: Bit 7 of the main OSC control register (MOC)
19.2 Configuration of Clock Monitor
Clock monitor consists of the following hardware.
Table 19-1. Configuration of Clock Monitor
Item
Configuration
Control register
Clock monitor mode register (CLM)
Figure 19-1. Block Diagram of Clock Monitor
X1 input clock
Ring-OSC clock
Internal reset signal
Enable/disable
CLME
Clock monitor mode register (CLM)
CHAPTER 19 CLOCK MONITOR
Preliminary User's Manual U16227EJ1V0UD
351
19.3 Registers Controlling Clock Monitor
Clock monitor is controlled by the clock monitor mode register (CLM).
(1) Clock monitor mode register (CLM)
This register sets the operation mode of the clock monitor.
This register can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears this register to 00H.
Figure 19-2. Format of Clock Monitor Mode Register (CLM)
7
0
CLME
0
1
Symbol
CLM
Address: FFA9H After reset: 00H R/W
6
0
Disables clock monitor operation
Enables clock monitor operation
5
0
4
0
3
0
Enables/disables clock monitor operation
2
0
1
0
0
CLME
Cautions 1. Once bit 0 (CLME) is set to 1, it cannot be cleared to 0 except by RESET input or the internal
reset signal.
2. If the reset signal is generated by the clock monitor, CLME is cleared to 0 and bit 1 (CLMRF)
of the reset control flag register (RESF) is set to 1. CLMRF is read by software and then
automatically cleared to 0. CLMRF is cleared under the following conditions.



RESET input



Internal reset signal generation by POC



After read by software
CHAPTER 19 CLOCK MONITOR
Preliminary User's Manual U16227EJ1V0UD
352
19.4 Operation of Clock Monitor
This section explains the functions of the clock monitor. The start and stop conditions are as follows.
<Start condition>
When bit 0 (CLME) of the clock monitor mode register (CLM) is set to operation enabled (1).
<Stop condition>
In STOP mode and during the oscillation stabilization time
When the X1 input clock is stopped by software (when MSTOP = 1 or MCC = 1)
During the oscillation stabilization time after reset is released
When the Ring-OSC clock is stopped
Remark
MSTOP: Bit 7 of the main OSC control register (MOC)
Table 19-2. Operation Status of Clock Monitor (When CLME = 1)
CPU Operation Clock
Operation Mode
X1 Input Clock Status
Ring-OSC Clock Status
Clock Monitor Status
Oscillating
STOP mode
Stopped
Stopped
Note
Oscillating
RESET input
Stopped
Note
Stopped
Oscillating
Operating
X1 input clock
HALT mode
Oscillating
Stopped
Note
Stopped
STOP mode
RESET input
Stopped
Oscillating
Stopped
Oscillating
Operating
Ring-OSC clock
HALT mode
Stopped
Stopped
Note The Ring-OSC clock is stopped only when the "Ring-OSC can be stopped by software" is selected by a
mask option. If "Ring-OSC cannot be stopped" is selected, the Ring-OSC clock cannot be stopped.
The clock monitor timing is as shown in Figure 19-3.
CHAPTER 19 CLOCK MONITOR
Preliminary User's Manual U16227EJ1V0UD
353
Figure 19-3. Timing of Clock Monitor (1/3)
(1) When internal reset is executed by oscillation stop of X1 input clock
4 clocks of Ring-OSC clock
X1 input clock
Ring-OSC clock
Internal reset signal
CLME
CLMRF
Note
Note CLMRF is read by software and then automatically cleared to 0. CLMRF is cleared under the following
conditions.
RESET input
Internal reset signal generation by POC
After read by software
(2) Clock monitor status after STOP mode is released
(CLME = 1 is set when CPU clock operates on X1 input clock and before entering STOP mode)
Clock monitor status
Monitoring
Monitoring stopped
Monitoring
CLME
Ring-OSC clock
X1 input clock
CPU operation
Normal
operation
STOP
Oscillation stabilization time
Normal operation
Oscillation
stopped
Oscillation stabilization time
(set by OSTS register)
When bit 0 (CLME) of the clock monitor mode register (CLM) is set to 1 before entering STOP mode, monitoring
automatically starts at the end of the X1 input clock oscillation stabilization time. Monitoring is stopped in STOP mode
and during the oscillation stabilization time.
CHAPTER 19 CLOCK MONITOR
Preliminary User's Manual U16227EJ1V0UD
354
Figure 19-3. Timing of Clock Monitor (2/3)
(3) Clock monitor status after STOP mode is released
(CLME = 1 is set when CPU clock operates on Ring-OSC clock and before entering STOP mode)
Clock monitor status
Monitoring
Monitoring
stopped
Monitoring stopped
Monitoring
CLME
Ring-OSC clock
X1 input clock
CPU operation
Normal
operation
17 clocks
Clock supply
stopped
Normal operation (Ring-OSC clock)
Oscillation
stopped
Oscillation stabilization time
(set by OSTS register)
STOP
When bit 0 (CLME) of the clock monitor mode register (CLM) is set to 1 before entering STOP mode, monitoring
automatically starts at the end of the X1 input clock oscillation stabilization time. Monitoring is stopped in STOP mode
and during the oscillation stabilization time.
(4) Clock monitor status after RESET input
(CLME = 1 is set after RESET input and during X1 input clock oscillation stabilization time)
CPU operation
Clock monitor status
CLME
Ring-OSC clock
X1 input clock
Reset
Oscillation
stopped
Oscillation stabilization time
Normal
operation
Clock supply
stopped
Normal operation (Ring-OSC clock)
Monitoring
Monitoring stopped
Monitoring
Waiting for end
of oscillation
stabilization time
Oscillation
stopped
17 clocks
Set to 1 by software
RESET
RESET input clears bit 0 (CLME) of the clock monitor mode register (CLM) to 0 and stops the clock monitor
operation. Even if CLME is set to 1 by software during the oscillation stabilization time of the X1 input clock,
monitoring is not performed until the oscillation stabilization time of the X1 input clock ends. Monitoring is
automatically started at the end of the oscillation stabilization time.
CHAPTER 19 CLOCK MONITOR
Preliminary User's Manual U16227EJ1V0UD
355
Figure 19-3. Timing of Clock Monitor (3/3)
(5) Clock monitor status after RESET input
(CLME = 1 is set after RESET input and at the end of X1 input clock oscillation stabilization time)
CPU operation
Clock monitor status
CLME
RESET
Ring-OSC clock
X1 input clock
Reset
Oscillation stabilization time
Normal
operation
Clock supply
stopped
Normal operation (Ring-OSC clock)
Monitoring
Monitoring stopped
Monitoring
17 clocks
Set to 1 by software
RESET input clears bit 0 (CLME) of the clock monitor mode register (CLM) to 0 and stops the clock monitor
operation. When CLME is set to 1 by software at the end of the oscillation stabilization time of the X1 input clock,
monitoring is started.
Preliminary User's Manual U16227EJ1V0UD
356
CHAPTER 20 POWER-ON-CLEAR CIRCUIT
20.1 Functions of Power-on-Clear Circuit
The power-on-clear circuit (POC) has the following functions.
Generates internal reset signal at power on.
Compares supply voltage (V
DD
) and detection voltage (V
POC
), and generates internal reset signal when V
DD
<
V
POC
.
The following can be selected by a mask option.
POC disabled
POC used (detection voltage: V
POC
= 2.85 V
0.15 V)
POC used (detection voltage: V
POC
= 3.5 V
0.2 V)
Caution
If an internal reset signal is generated in the POC circuit, the reset control flag register (RESF) is
cleared to 00H.
Remark
This product incorporates multiple hardware functions that generate an internal reset signal. A flag that
indicates the reset cause is located in the reset control flag register (RESF) for when an internal reset
signal is generated by the watchdog timer (WDT), low-voltage-detection (LVI) circuit, or clock monitor.
RESF is not cleared to 00H and the flag is set to 1 when an internal reset signal is generated by WDT,
LVI, or the clock monitor.
For details of the RESF, refer to CHAPTER 18 RESET FUNCTION.
CHAPTER 20 POWER-ON-CLEAR CIRCUIT
Preliminary User's Manual U16227EJ1V0UD
357
20.2 Configuration of Power-on-Clear Circuit
The block diagram of the power-on-clear circuit is shown in Figure 20-1.
Figure 20-1. Block Diagram of Power-on-Clear Circuit
+
Detection
voltage source
(V
POC
)
Internal reset signal
V
DD
V
DD
20.3 Operation of Power-on-Clear Circuit
In the power-on-clear circuit, the supply voltage (V
DD
) and detection voltage (V
POC
) are compared, and when V
DD
<
V
POC
, an internal reset signal is generated.
Figure 20-2. Timing of Internal Reset Signal Generation in Power-on-Clear Circuit
Time
Supply voltage (V
DD
)
POC detection voltage
(V
POC
)
2.7 V
Internal reset signal
CHAPTER 20 POWER-ON-CLEAR CIRCUIT
Preliminary User's Manual U16227EJ1V0UD
358
20.4 Cautions for Power-on-Clear Circuit
In a system where the supply voltage (V
DD
) fluctuates for a certain period in the vicinity of the POC detection
voltage (V
POC
), the system may be repeatedly reset and released from the reset status. In this case, the time from
release of reset to the start of the operation of the microcontroller can be arbitrarily set by taking the following action.
<Action>
After releasing the reset signal, wait for the supply voltage fluctuation period of each system by means of a
software counter that uses a timer, and then initialize the ports.
Figure 20-3. Example of Software Processing After Release of Reset (1/2)
If supply voltage fluctuation is 50 ms or less in vicinity of POC detection voltage
Yes
Power-on-clear
; The Ring-OSC clock is set as the CPU clock when the reset signal is generated
; The cause of reset (power-on-clear, WDT, LVI, or clock monitor)
can be identified by the RESF register.
; Change the CPU clock from the Ring-OSC clock to the X1 input clock.
; Check the stabilization of oscillation of the X1 input clock by using the
OSTC register.
; TMIFH1 = 1: Interrupt request is generated.
; Initialization of ports
; 8-bit timer H1 can operate with the Ring-OSC clock.
Source: f
R
(240 kHz)/2
7
compare 100 = 53 ms
(f
R
: Ring-OSC clock oscillation frequency)
No
Note 1
Reset
Checking cause
of reset
Note 2
Checking stabilization
of oscillation
Change CPU clock
50 ms has passed?
(TMIFH1 = 1?)
Initialization
processing
Start timer
(set to 50 ms)
Notes 1.
If reset is generated again during this period, initialization processing is not started.
2.
A flowchart is shown on the next page.
CHAPTER 20 POWER-ON-CLEAR CIRCUIT
Preliminary User's Manual U16227EJ1V0UD
359
Figure 20-3. Example of Software Processing After Release of Reset (2/2)
Checking cause of reset
Yes
No
Check cause of reset
Power-on-clear/external
reset generated
Reset processing by
watchdog timer
Reset processing by
clock monitor
Reset processing by
low-voltage detector
No
No
WDTRF of RESF
register = 1?
CLMRF of RESF
register = 1?
LVIRF of RESF
register = 1?
Yes
Yes
Preliminary User's Manual U16227EJ1V0UD
360
CHAPTER 21 LOW-VOLTAGE DETECTOR
21.1 Functions of Low-Voltage Detector
The low-voltage detector (LVI) has following functions.
Compares supply voltage (V
DD
) and detection voltage (V
LVI
), and generates an internal interrupt signal or
internal reset signal when V
DD
< V
LVI
.
Detection levels (seven levels) of supply voltage can be changed by software.
Interrupt or reset function can be selected by software.
Operable in STOP mode.
When the low-voltage detector is used to reset, bit 0 (LVIRF) of the reset control flag register (RESF) is set to 1 if
reset occurs. For details of RESF, refer to CHAPTER 18 RESET FUNCTION.
21.2 Configuration of Low-Voltage Detector
The block diagram of the low-voltage detector is shown below.
Figure 21-1. Block Diagram of Low-Voltage Detector
LVIS1 LVIS0
LVION
LVIE
+
Detection
voltage source
(V
LVI
)
V
DD
V
DD
INTLVI
Internal bus
N-ch
Low-voltage detection level
selection register (LVIS)
Low-voltage detection register
(LVIM)
LVIS2
LVIMD
LVIF
Internal reset signal
3
Low-voltage detection level selector
Selector
CHAPTER 21 LOW-VOLTAGE DETECTOR
Preliminary User's Manual U16227EJ1V0UD
361
21.3 Registers Controlling Low-Voltage Detector
The low-voltage detector is controlled by the following registers.
Low-voltage detection register (LVIM)
Low-voltage detection level selection register (LVIS)
CHAPTER 21 LOW-VOLTAGE DETECTOR
Preliminary User's Manual U16227EJ1V0UD
362
(1) Low-voltage detection register (LVIM)
This register sets low-voltage detection and the operation mode.
This register can be set by a 1-bit or 8-bit memory manipulation instruction.
RESET input clears LVIM to 00H.
Figure 21-2. Format of Low-Voltage Detection Register (LVIM)
0
LVIF
1
LVIMD
2
0
3
0
4
LVIE
5
0
6
0
7
LVION
Symbol
LVIM
Address: FFBEH After reset: 00H R/W
Note 1
LVION
Notes 2, 3
Enables low-voltage detection operation
0
Disables operation
1
Enables operation
LVIE
Notes 2, 4, 5
Specifies reference voltage generator
0
Disables operation
1
Enables operation
LVIMD
Note 2
Low-voltage detection operation mode selection
0
Generates interrupt signal when supply voltage (V
DD
) < detection voltage (V
LVI
)
1
Generates internal reset signal when supply voltage (V
DD
) < detection voltage (V
LVI
)
LVIF
Note 6
Low-voltage detection flag
0
Supply voltage (V
DD
) > detection voltage (V
LVI
), or when operation is disabled
1
Supply voltage (V
DD
) < detection voltage (V
LVI
)
Notes 1.
Bit 0 is read-only.
2.
LVION, LVIE, and LVIMD are cleared to 0 at a reset other than an LVI reset. These are not
cleared to 0 at an LVI reset.
3.
When LVION is set to 1, operation of the comparator in the LVI circuit is started. Use
software to instigate a wait of at least 0.2 ms from when LVION is set to 1 until the voltage is
confirmed at LVIF.
4.
When LVIE is set to 1, a reference voltage generator operation in the LVI circuit is started.
Use software to instigate a wait of at least 2 ms from when LVIE is set to 1 until LVION is set
to 1.
5.
If "use POC" is selected by a mask option, leave LVIE as 0. A wait time (2 ms) until LVION is
set to 1 is not necessary.
6.
The value of LVIF is output as the interrupt request signal INTLVI when LVION = 1 and
LVIMD = 0.
Caution
To stop LVI, follow either of the procedures below.



When using 8-bit manipulation instruction: Write 00H to LVIM.



When using 1-bit memory manipulation instruction: Clear LVION to 0 first and then
clear LVIE to 0.
CHAPTER 21 LOW-VOLTAGE DETECTOR
Preliminary User's Manual U16227EJ1V0UD
363
(2) Low-voltage detection level selection register (LVIS)
This register selects the low-voltage detection level.
This register can be set by an 8-bit memory manipulation instruction.
RESET input clears LVIS to 00H.
Figure 21-3. Format of Low-Voltage Detection Level Selection Register (LVIS)
0
LVIS0
1
LVIS1
2
LVIS2
3
0
4
0
5
0
6
0
7
0
Symbol
LVIS
Address: FFBFH After reset: 00H R/W
LVIS2
LVIS1
LVIS0
Detection level
0
0
0
V
LVI0
(4.3 V
0.2 V)
0
0
1
V
LVI1
(4.1 V
0.2 V)
0
1
0
V
LVI2
(3.9 V
0.2 V)
0
1
1
V
LVI3
(3.7 V
0.2 V)
1
0
0
V
LVI4
(3.5 V
0.2 V)
Note
1
0
1
V
LVI5
(3.3 V
0.2 V)
Note
1
1
0
V
LVI6
(3.1 V
0.15 V)
Note
1
1
1
Setting prohibited
Note When the detection voltage of the POC circuit is specified as V
POC
= 3.5 V
0.2 V by a mask
option, do not select V
LVI4
to V
LVI6
as the LVI detection voltage. Even if V
LVI4
to V
LVI6
are selected,
POC circuit has priority.
CHAPTER 21 LOW-VOLTAGE DETECTOR
Preliminary User's Manual U16227EJ1V0UD
364
21.4 Operation of Low-Voltage Detector
The low-voltage detector can be used in the following two modes.
Used as reset
Compares the supply voltage (V
DD
) and detection voltage (V
LVI
), and generates an internal reset signal when
V
DD
< V
LVI
.
Used as interrupt
Compares the supply voltage (V
DD
) and detection voltage (V
LVI
), and generates an interrupt signal (INTLVI)
when V
DD
< V
LVI
.
The operation is set as follows.
(1) When used as reset
When starting operation
<1>
Mask the LVI interrupt (LVIMK = 1).
<2>
Set the detection voltage using bits 2 to 0 (LVIS2 to LVIS0) of the low-voltage detection level selection
register (LVIS).
<3>
Set bit 4 (LVIE) of the low-voltage detection register (LVIM) to 1 (enables reference voltage generator
operation).
<4>
Use software to instigate a wait of at least 2 ms.
<5>
Set bit 7 (LVION) of LVIM to 1 (enables LVI operation).
<6>
Use software to instigate a wait of at least 0.2 ms.
<7>
Confirm that "supply voltage (V
DD
) > detection voltage (V
LVI
)" at bit 0 (LVIF) of LVIM.
<8>
Set bit 1 (LVIMD) of LVIM to 1 (generates internal reset signal when supply voltage (V
DD
) < detection
voltage (V
LVI
)).
Cautions 1. <1> must always be executed. When LVIMK = 0, an interrupt may occur immediately
after the processing in <5>.
2. If "use POC" is selected by a mask option, procedures <3> and <4> are not required.
3. If supply voltage (V
DD
) > detection voltage (V
LVI
) when LVIM is set to 1, an internal reset
signal is not generated.
When stopping operation
Either of the following procedures must be executed.
When using 8-bit memory manipulation instruction:
Write 00H to LVIM.
When using 1-bit memory manipulation instruction:
Clear LVIMD to 0, LVION to 0, and LVIE to 0 in that order.
CHAPTER 21 LOW-VOLTAGE DETECTOR
Preliminary User's Manual U16227EJ1V0UD
365
Figure 21-4. Timing of Low-Voltage Detector Internal Reset Signal Generation
Supply voltage (V
DD
)
LVI detection voltage
(V
LVI
)
POC detection voltage
(V
POC
)
2.7 V
LVIF flag
LVIRF flag
Note
LVI reset signal
POC reset signal
Internal reset signal
Cleared by
software
Not cleared
Not cleared
Not cleared
Not cleared
Not cleared
Not cleared
Cleared by
software
<2>
<1>
<5>
<7>
<8>
Time
Clear
Clear
Clear
Clear
<3>
<4> 2 ms or longer
<6> 0.2 ms or longer
LVIMK flag
(set by software)
LVIE flag
(set by software)
LVION flag
(set by software)
LVIMD flag
(set by software)
Note LVIRF is bit 0 of the reset control flag register (RESF). For details of RESF, refer to CHAPTER 18 RESET
FUCNTION.
Remark
<1> to <8> in Figure 21-4 above correspond to <1> to <8> in the description of "when starting operation"
in 21.4 (1) When used as reset.
CHAPTER 21 LOW-VOLTAGE DETECTOR
Preliminary User's Manual U16227EJ1V0UD
366
(2) When used as interrupt
When starting operation
<1>
Mask the LVI interrupt (LVIMK = 1).
<2>
Set the detection voltage using bits 2 to 0 (LVIS2 to LVIS0) of the low-voltage detection level selection
register (LVIS).
<3>
Set bit 4 (LVIE) of the low-voltage detection register (LVIM) to 1 (enables reference voltage generator
operation).
<4>
Use software to instigate a wait of at least 2 ms.
<5>
Set bit 7 (LVION) of LVIM to 1 (enables LVI operation).
<6>
Use software to instigate a wait of at least 0.2 ms.
<7>
Confirm that "supply voltage (V
DD
) > detection voltage (V
LVI
)" at bit 0 (LVIF) of LVIM.
<8>
Clear the interrupt request flag of LVI (LVIIF) to 0.
<9>
Release the interrupt mask flag of LVI (LVIMK).
<10> Execute the EI instruction (when vector interrupts are used).
Caution
If "use POC" is selected by a mask option, procedures <3> and <4> are not required.
When stopping operation
Either of the following procedures must be executed.
When using 8-bit memory manipulation instruction:
Write 00H to LVIM.
When using 1-bit memory manipulation instruction:
Clear LVION to 0 first, and then clear LVIE to 0.
CHAPTER 21 LOW-VOLTAGE DETECTOR
Preliminary User's Manual U16227EJ1V0UD
367
Figure 21-5. Timing of Low-Voltage Detector Interrupt Signal Generation
Supply voltage (V
DD
)
LVI detection voltage
(V
LVI
)
POC detection voltage
(V
POC
)
2.7 V
Time
LVIF flag
INTLVI
LVIIF flag
Internal reset signal
<2>
<1>
<5>
<7>
<8>
Cleared by software
<3>
<4> 2 ms or longer
<9> Cleared by software
<6> 0.2 ms or longer
LVIMK flag
(set by software)
LVIE flag
(set by software)
LVION flag
(set by software)
Remark
<1> to <9> in Figure 21-5 above correspond to <1> to <9> in the description of "when starting operation"
in 21.4 (2) When used as interrupt.
CHAPTER 21 LOW-VOLTAGE DETECTOR
Preliminary User's Manual U16227EJ1V0UD
368
21.5 Cautions for Low-Voltage Detector
In a system where the supply voltage (V
DD
) fluctuates for a certain period in the vicinity of the LVI detection voltage
(V
LVI
), the operation is as follows depending on how the low-voltage detector is used.
(1) When used as reset
The system may be repeatedly reset and released from the reset status.
In this case, the time from release of reset to the start of the operation of the microcontroller can be arbitrarily set
by taking action (1) below.
(2) When used as interrupt
Interrupt requests may be frequently generated. Take action (2) below.
In this system, take the following actions.
<Action>
(1) When used as reset
After releasing the reset signal, wait for the supply voltage fluctuation period of each system by means of a
software counter that uses a timer, and then initialize the ports.
CHAPTER 21 LOW-VOLTAGE DETECTOR
Preliminary User's Manual U16227EJ1V0UD
369
Figure 21-6. Example of Software Processing After Release of Reset (1/2)
If supply voltage fluctuation is 50 ms or less in vicinity of LVI detection voltage
Yes
LVI
; The Ring-OSC clock is set as the CPU clock when the reset signal is generated
; The cause of reset (power-on-clear, WDT, LVI, or clock monitor)
can be identified by the RESF register.
; Change the CPU clock from the Ring-OSC clock to the X1 input clock.
; Check the stabilization of oscillation of the X1 input clock by using the
OSTC register.
; TMIFH1 = 1: Interrupt request is generated.
; Initialization of ports
; 8-bit timer H1 can operate with the Ring-OSC clock.
Source: f
R
(240 kHz)/2
7
compare 100 = 53 ms
(f
R
: Ring-OSC clock oscillation frequency)
No
Note 1
Reset
Checking cause
of reset
Note 2
Checking stabilization
of oscillation
Change CPU clock
50 ms has passed?
(TMIFH1 = 1?)
Initialization
processing
Start timer
(set to 50 ms)
Notes 1.
If reset is generated again during this period, initialization processing is not started.
2.
A flowchart is shown on the next page.
CHAPTER 21 LOW-VOLTAGE DETECTOR
Preliminary User's Manual U16227EJ1V0UD
370
Figure 21-6. Example of Software Processing After Release of Reset (2/2)
Checking cause of reset
Yes
No
Check cause of reset
Power-on-clear/external
reset generated
Reset processing by
watchdog timer
Reset processing by
clock monitor
Reset processing by
low-voltage detector
No
Yes
WDTRF of RESF
register = 1?
CLMRF of RESF
register = 1?
LVIRF of RESF
register = 1?
Yes
No
CHAPTER 21 LOW-VOLTAGE DETECTOR
Preliminary User's Manual U16227EJ1V0UD
371
(2) When used as interrupt
Disable interrupts (DI) in the servicing routine of the LVI interrupt, and check to see if "supply voltage (V
DD
) >
detection voltage (V
LVI
)", by using bit 0 (LVIF) of the low-voltage detection register (LVIM). Then enable interrupts
(EI).
In a system where the supply voltage fluctuation period is long in the vicinity of the LVI detection voltage, disable
interrupts (DI), wait for the supply voltage fluctuation period, check that "supply voltage (V
DD
) > detection voltage
(V
LVI
)" with the LVIF flag, and then enable interrupts (EI).
Figure 21-7. Example of Software Processing of LVI Interrupt
If supply voltage fluctuation is 50 ms or less in vicinity of LVI detection voltage
; Check that supply voltage (V
DD
) > detection voltage (V
LVI
).
; TMIFH1 = 1: Interrupt request is generated
; Enable interrupts.
; Disable interrupts.
Yes
No
LVIF1 of LVIM
register = 0?
Yes
No
50 ms has passed?
(TMIFH1 = 1?)
LVI
LVI interrupt
Start timer
(set to 50 ms)
EI
DI
LVI interrupt servicing
Preliminary User's Manual U16227EJ1V0UD
372
CHAPTER 22 MASK OPTIONS
Mask ROM versions are provided with the following mask options.
1.
Power-on-clear (POC) circuit
POC cannot be used
POC used (detection voltage: V
POC
= 2.85 V
0.15 V)
POC used (detection voltage: V
POC
= 3.5 V
0.2 V)
2.
Ring-OSC
Cannot be stopped
Can be stopped by software
3.
Pull-up resistor of P60 to P63 pins
Pull-up resistor can be incorporated in 1-bit units
(Pull-up resistors are not available for the flash memory versions.)
Flash memory versions that support the mask options of the mask ROM versions are as follows.
Table 22-1. Flash Memory Versions Supporting Mask Options of Mask ROM Versions
Mask Option
POC Circuit
Ring-OSC
Flash Memory Version
Cannot be stopped
PD78F0114M1
POC cannot be used
Can be stopped by software
PD78F0114M2
Cannot be stopped
PD78F0114M3
POC used (V
POC
= 2.85 V
0.15 V)
Can be stopped by software
PD78F0114M4
Cannot be stopped
PD78F0114M5
POC used (V
POC
= 3.5 V
0.2 V)
Can be stopped by software
PD78F0114M6
Preliminary User's Manual U16227EJ1V0UD
373
CHAPTER 23



PD78F0114
The
PD78F0114 is provided as the flash memory version of the 78K0/KC1 Series.
The
PD78F0114 replaces the internal mask ROM of the PD780114 with flash memory to which a program can
be written, erased, and overwritten while mounted on the board. Table 23-1 lists the differences between the
PD78F0114 and the mask ROM versions.
Table 23-1. Differences Between



PD78F0114 and Mask ROM Versions
Item
PD78F0114
Mask ROM Versions
Internal ROM configuration
Flash memory
Mask ROM
Internal ROM capacity
32 KB
Note
PD780111: 8 KB
PD780112: 16 KB
PD780113: 24 KB
PD780114: 32 KB
Internal high-speed RAM capacity
1024 bytes
Note
PD780111: 512 bytes
PD780112: 512 bytes
PD780113: 1024 bytes
PD780114: 1024 bytes
IC pin
None
Available
V
PP
pin
Available
None
Electrical specifications
Refer to CHAPTER 25 ELECTRICAL SPECIFICATIONS (TARGET VALUES).
Note The same capacity as the mask ROM versions can be specified by means of the internal memory size
switching register (IMS).
Caution
There are differences in noise immunity and noise radiation between the flash memory and
mask ROM versions. When pre-producing an application set with the flash memory version
and then mass-producing it with the mask ROM version, be sure to conduct sufficient
evaluations for the commercial samples (not engineering samples) of the mask ROM versions.
CHAPTER 23



PD78F0114
Preliminary User's Manual U16227EJ1V0UD
374
23.1 Internal Memory Size Switching Register
The
PD78F0114 allows users to select the internal memory capacity using the internal memory size switching
register (IMS) so that the same memory map as that of the mask ROM versions with a different internal memory
capacity can be achieved.
IMS is set by an 8-bit memory manipulation instruction.
RESET input sets IMS to CFH.
Caution
Be sure to set the value of the relevant mask ROM version at initialization.
Figure 23-1. Format of Internal Memory Size Switching Register (IMS)
Address: FFF0H After reset: CFH R/W
Symbol
7
6
5
4
3
2
1
0
IMS
RAM2
RAM1
RAM0
0
ROM3
ROM2
ROM1
ROM0
RAM2
RAM1
RAM0
Internal high-speed RAM capacity selection
0
1
0
512 bytes
1
1
0
1024 bytes
Other than above
Setting prohibited
ROM3
ROM2
ROM1
ROM0
Internal ROM capacity selection
0
0
1
0
8 KB
0
1
0
0
16 KB
0
1
1
0
24 KB
1
0
0
0
32 KB
Other than above
Setting prohibited
The IMS settings required to obtain the same memory map as mask ROM versions are shown in Table 23-2.
Table 23-2. Internal Memory Size Switching Register Settings
Target Mask ROM Versions
IMS Setting
PD780111
42H
PD780112
44H
PD780113
C6H
PD780114
C8H
Caution
When using a mask ROM version, be sure to set the value indicated in Table 23-2 to IMS.
CHAPTER 23



PD78F0114
Preliminary User's Manual U16227EJ1V0UD
375
23.2 Flash Memory Programming
On-board writing of flash memory (with device mounted on target system) is supported.
On-board writing is performed after connecting a dedicated flash programmer (Flashpro III (FL-PR3, PG-
FP3)/Flashpro IV (FL-PR4, PG-FP4)) to the host machine and target system.
Moreover, writing to flash memory can also be performed using a flash memory writing adapter connected to
Flashpro III/Flashpro IV.
Remarks 1. FL-PR3 and FL-PR4 are products of Naito Densei Machida Mfg. Co., Ltd.
2. USB is supported only by Flashpro IV.
23.2.1 Selection of communication mode
Writing to flash memory is performed using Flashpro III/Flashpro IV and serial communication. Select the
communication mode for writing from Table 23-3. For the selection of the communication mode, a format like the one
shown in Figure 23-2 is used. The communication mode are selected according to the number of V
PP
pulses shown in
Table 23-3.
Table 23-3. Communication Mode List
Communication Mode
Number of Channels
Pin Used
Note
Number of V
PP
Pulses
SCK10/TxD0/P10
SI10/RxD0/P11
SO10/P12
0
3-wire serial I/O
1
SCK10/TxD0/P10
SI10/RxD0/P11
SO10/P12
HS/P15/TOH0
3
TxD0/SCK10/P10
RxD0/SI10/P11
8
UART (UART0)
1
TxD0/SCK10/P10
RxD0/SI10/P11
HS/P15/TOH0
11
UART (UART6)
1
TxD6/P13
RxD6/P14
9
Note After shifting to flash memory programming mode, all pins not used for flash memory programming are set
to the same state as after reset. Therefore, since all ports become output high-impedance, pin processing,
such as connecting to V
DD
or V
SS
via a resistor is required if the output high-impedance state is not
acknowledged by external devices.
Cautions 1. Be sure to select the number of V
PP
pulses shown in Table 23-3 for the communication mode.
2. When writing to flash memory using the UART communication mode, set the X1 input clock
oscillation frequency to 3 MHz or higher.
CHAPTER 23



PD78F0114
Preliminary User's Manual U16227EJ1V0UD
376
Figure 23-2. Communication Mode Selection Format
10 V
V
PP
RESET
V
DD
V
SS
V
DD
V
SS
V
PP
pulses
Flash memory write mode
23.2.2 Flash memory programming function
Flash memory writing is performed via command and data transmit/receive operations using the selected
communication mode. The main functions are listed in Table 23-4.
Table 23-4. Main Functions of Flash Memory Programming
Function
Description
Reset
Used to detect write stop and transmission synchronization.
Batch verify
Compares entire memory contents and input data.
Batch erase
Erases the entire memory contents.
Batch blank check
Checks the erase status of the entire memory.
High-speed write
Performs writing to flash memory according to write start address and number of write data
(bytes).
Continuous write
Performs successive write operations using the data input with high-speed write operation.
Status
Checks the current operation mode and operation end.
Oscillation frequency setting
Inputs the resonator oscillation frequency information.
Delete time setting
Inputs the memory delete time.
Baud rate setting
Sets the communication rate when the UART method is used.
Silicon signature read
Outputs the device name, memory capacity, and device block information.
CHAPTER 23



PD78F0114
Preliminary User's Manual U16227EJ1V0UD
377
23.2.3 Connecting Flashpro III/Flashpro IV
The connection between Flashpro III/Flashpro IV and the
PD78F0114 differs depending on the communication
mode (3-wire serial I/O or UART). Figures 23-3 to 23-7 show the connection diagrams of each case.
Figure 23-3. Connection of Flashpro III/Flashpro IV in 3-Wire Serial I/O Mode
VPP
VDD
RESET
SCK
SO
SI
GND
V
PP
V
DD
/EV
DD
/AV
REF
RESET
SCK10
SI10
SO10
V
SS
/EV
SS
/AV
SS
Flashpro III/Flashpro IV
PD78F0114
Figure 23-4. Connection of Flashpro III/Flashpro IV in 3-Wire Serial I/O Mode (Using Handshake)
VPP
VDD
RESET
SCK
SO
SI
GND
V
PP
V
DD
/EV
DD
/AV
REF
RESET
SCK10
SI10
SO10
HS
HS (P15)
V
SS
/EV
SS
/AV
SS
Flashpro III/Flashpro IV
PD78F0114
CHAPTER 23



PD78F0114
Preliminary User's Manual U16227EJ1V0UD
378
Figure 23-5. Connection of Flashpro III/Flashpro IV in UART (UART0) Mode
VPP
VDD
RESET
SO
SI
GND
V
PP
V
DD
/EV
DD
/AV
REF
RESET
RxD0
TxD0
V
SS
/EV
SS
/AV
SS
Flashpro III/Flashpro IV
PD78F0114
Figure 23-6. Connection of Flashpro III/Flashpro IV in UART (UART0) Mode (Using Handshake)
VPP
VDD
RESET
SO
SI
GND
V
PP
V
DD
/EV
DD
/AV
REF
RESET
RxD0
TxD0
HS
HS (P15)
V
SS
/EV
SS
/AV
SS
Flashpro III/Flashpro IV
PD78F0114
Figure 23-7. Connection of Flashpro III/Flashpro IV in UART (UART6) Mode
VPP
VDD
RESET
SO
SI
GND
V
PP
V
DD
/EV
DD
/AV
REF
RESET
RxD6
TxD6
V
SS
/EV
SS
/AV
SS
Flashpro III/Flashpro IV
PD78F0114
CHAPTER 23



PD78F0114
Preliminary User's Manual U16227EJ1V0UD
379
23.2.4 Connection on adapter for flash memory writing
Examples of the recommended connection when using the adapter for flash memory writing are shown below.
Figure 23-8. Example of Wiring Adapter for Flash Memory Writing in 3-Wire Serial I/O Mode
44 43 42 41 40 39 38
13
12
14 15 16 17 18 19 20 21 22
23
1
2
3
4
5
6
7
8
9
10
11
36 35 34
33
32
31
30
29
28
27
26
25
37
24
PD78F0114
GND
VDD
VDD2 (LVDD)
SI SO SCK CLKOUT RESET VPP RESERVE/HS
WRITER INTERFACE
VDD (2.7 to 5.5 V)
GND
CHAPTER 23



PD78F0114
Preliminary User's Manual U16227EJ1V0UD
380
Figure 23-9. Example of Wiring Adapter for Flash Memory Writing in 3-Wire Serial I/O Mode
(Using Handshake)
44 43 42 41 40 39 38
13
12
14 15 16 17 18 19 20 21 22
23
1
2
3
4
5
6
7
8
9
10
11
36 35 34
33
32
31
30
29
28
27
26
25
37
24
PD78F0114
GND
VDD
SI SO SCK CLKOUT RESET VPP RESERVE/HS
WRITER INTERFACE
VDD (2.7 to 5.5 V)
GND
VDD2 (LVDD)
CHAPTER 23



PD78F0114
Preliminary User's Manual U16227EJ1V0UD
381
Figure 23-10. Example of Wiring Adapter for Flash Memory Writing in UART (UART0) Mode
44 43 42 41 40 39 38
13
12
14 15 16 17 18 19 20 21 22
23
1
2
3
4
5
6
7
8
9
10
11
36 35 34
33
32
31
30
29
28
27
26
25
37
24
PD78F0114
GND
VDD
SI SO SCK CLKOUT RESET VPP RESERVE/HS
WRITER INTERFACE
VDD (2.7 to 5.5 V)
GND
VDD2 (LVDD)
CHAPTER 23



PD78F0114
Preliminary User's Manual U16227EJ1V0UD
382
Figure 23-11. Example of Wiring Adapter for Flash Memory Writing in UART (UART0) Mode
(Using Handshake)
44 43 42 41 40 39 38
13
12
14 15 16 17 18 19 20 21 22
23
1
2
3
4
5
6
7
8
9
10
11
36 35 34
33
32
31
30
29
28
27
26
25
37
24
PD78F0114
GND
VDD
SI SO SCK CLKOUT RESET VPP RESERVE/HS
WRITER INTERFACE
VDD (2.7 to 5.5 V)
GND
VDD2 (LVDD)
CHAPTER 23



PD78F0114
Preliminary User's Manual U16227EJ1V0UD
383
Figure 23-12. Example of Wiring Adapter for Flash Memory Writing in UART (UART6) Mode
44 43 42 41 40 39 38
13
12
14 15 16 17 18 19 20 21 22
23
1
2
3
4
5
6
7
8
9
10
11
36 35 34
33
32
31
30
29
28
27
26
25
37
24
PD78F0114
GND
VDD
VDD2 (LVDD)
SI SO SCK CLKOUT RESET VPP RESERVE/HS
WRITER INTERFACE
VDD (2.7 to 5.5 V)
GND
Preliminary User's Manual U16227EJ1V0UD
384
CHAPTER 24 INSTRUCTION SET
This chapter lists each instruction set of the 78K0/KC1 Series in table form. For details of each operation and
operation code, refer to the separate document 78K/0 Series Instruction User's Manual (U12326E).
24.1 Conventions Used in Operation List
24.1.1 Operand identifiers and specification methods
Operands are written in the "Operand" column of each instruction in accordance with the specification method of
the instruction operand identifier (refer to the assembler specifications for details). When there are two or more
methods, select one of them. Upper case letters and the symbols #, !, $ and [ ] are keywords and must be written as
they are. Each symbol has the following meaning.
#: Immediate data specification
!: Absolute address specification
$: Relative address specification
[ ]: Indirect address specification
In the case of immediate data, describe an appropriate numeric value or a label. When using a label, be sure to
write the #, !, $, and [ ] symbols.
For operand register identifiers r and rp, either function names (X, A, C, etc.) or absolute names (names in
parentheses in the table below, R0, R1, R2, etc.) can be used for specification.
Table 24-1. Operand Identifiers and Specification Methods
Identifier
Specification Method
r
rp
sfr
sfrp
X (R0), A (R1), C (R2), B (R3), E (R4), D (R5), L (R6), H (R7),
AX (RP0), BC (RP1), DE (RP2), HL (RP3)
Special function register symbol
Note
Special function register symbol (16-bit manipulatable register even addresses only)
Note
saddr
saddrp
FE20H to FF1FH Immediate data or labels
FE20H to FF1FH Immediate data or labels (even address only)
addr16
addr11
addr5
0000H to FFFFH Immediate data or labels
(Only even addresses for 16-bit data transfer instructions)
0800H to 0FFFH Immediate data or labels
0040H to 007FH Immediate data or labels (even address only)
word
byte
bit
16-bit immediate data or label
8-bit immediate data or label
3-bit immediate data or label
RBn
RB0 to RB3
Note Addresses from FFD0H to FFDFH cannot be accessed with these operands.
Remark
For special function register symbols, refer to Table 3-5 Special Function Register List.
CHAPTER 24 INSTRUCTION SET
Preliminary User's Manual U16227EJ1V0UD
385
24.1.2 Description of operation column
A:
A register; 8-bit accumulator
X:
X register
B:
B register
C:
C register
D:
D register
E:
E register
H:
H register
L:
L register
AX:
AX register pair; 16-bit accumulator
BC:
BC register pair
DE:
DE register pair
HL:
HL register pair
PC:
Program counter
SP:
Stack pointer
PSW:
Program status word
CY:
Carry flag
AC:
Auxiliary carry flag
Z:
Zero flag
RBS:
Register bank select flag
IE:
Interrupt request enable flag
NMIS:
Non-maskable interrupt servicing flag
( ):
Memory contents indicated by address or register contents in parentheses
X
H
, X
L
:
Higher 8 bits and lower 8 bits of 16-bit register
:
Logical product (AND)
:
Logical sum (OR)
:
Exclusive logical sum (exclusive OR)
:
Inverted data
addr16: 16-bit immediate data or label
jdisp8:
Signed 8-bit data (displacement value)
24.1.3 Description of flag operation column
(Blank): Not affected
0:
Cleared to 0
1:
Set to 1
:
Set/cleared according to the result
R:
Previously saved value is restored
CHAPTER 24 INSTRUCTION SET
Preliminary User's Manual U16227EJ1V0UD
386
24.2 Operation List
Clocks
Flag
Instruction
Group
Mnemonic
Operands
Bytes
Note 1
Note 2
Operation
Z AC CY
r, #byte
2
4
-
r
byte
saddr, #byte
3
6
7
(saddr)
byte
sfr, #byte
3
-
7
sfr
byte
A, r
Note 3
1
2
-
A
r
r, A
Note 3
1
2
-
r
A
A, saddr
2
4
5
A
(saddr)
saddr, A
2
4
5
(saddr)
A
A, sfr
2
-
5
A
sfr
sfr, A
2
-
5
sfr
A
A, !addr16
3
8
9 + n
A
(addr16)
!addr16, A
3
8
9 + m
(addr16)
A
PSW, #byte
3
-
7
PSW
byte
A, PSW
2
-
5
A
PSW
PSW, A
2
-
5
PSW
A
A, [DE]
1
4
5 + n
A
(DE)
[DE], A
1
4
5 + m
(DE)
A
A, [HL]
1
4
5 + n
A
(HL)
[HL], A
1
4
5 + m
(HL)
A
A, [HL + byte]
2
8
9 + n
A
(HL + byte)
[HL + byte], A
2
8
9 + m
(HL + byte)
A
A, [HL + B]
1
6
7 + n
A
(HL + B)
[HL + B], A
1
6
7 + m
(HL + B)
A
A, [HL + C]
1
6
7 + n
A
(HL + C)
MOV
[HL + C], A
1
6
7 + m
(HL + C)
A
A, r
Note 3
1
2
-
A
r
A, saddr
2
4
6
A
(saddr)
A, sfr
2
-
6
A
(sfr)
A, !addr16
3
8
10 + n + m A
(addr16)
A, [DE]
1
4
6 + n + m A
(DE)
A, [HL]
1
4
6 + n + m A
(HL)
A, [HL + byte]
2
8
10 + n + m A
(HL + byte)
A, [HL + B]
2
8
10 + n + m A
(HL + B)
8-bit data
transfer
XCH
A, [HL + C]
2
8
10 + n + m A
(HL + C)
Notes 1.
When the internal high-speed RAM area is accessed or for an instruction with no data access
2.
When an area except the internal high-speed RAM area is accessed
3.
Except "r = A"
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (f
CPU
) selected by the processor clock
control register (PCC).
2. This clock cycle applies to the internal ROM program.
3. n is the number of waits when the external memory expansion area is read.
4. m is the number of waits when the external memory expansion area is written.
CHAPTER 24 INSTRUCTION SET
Preliminary User's Manual U16227EJ1V0UD
387
Clocks
Flag
Instruction
Group
Mnemonic
Operands
Bytes
Note 1
Note 2
Operation
Z AC CY
rp, #word
3
6
-
rp
word
saddrp, #word
4
8
10
(saddrp)
word
sfrp, #word
4
-
10
sfrp
word
AX, saddrp
2
6
8
AX
(saddrp)
saddrp, AX
2
6
8
(saddrp)
AX
AX, sfrp
2
-
8
AX
sfrp
sfrp, AX
2
-
8
sfrp
AX
AX, rp
Note 3
1
4
-
AX
rp
rp, AX
Note 3
1
4
-
rp
AX
AX, !addr16
3
10
12 + 2n AX
(addr16)
MOVW
!addr16, AX
3
10
12 + 2m (addr16)
AX
16-bit data
transfer
XCHW
AX, rp
Note 3
1
4
-
AX
rp
A, #byte
2
4
-
A, CY
A + byte
saddr, #byte
3
6
8
(saddr), CY
(saddr) + byte
A, r
Note 4
2
4
-
A, CY
A + r
r, A
2
4
-
r, CY
r + A
A, saddr
2
4
5
A, CY
A + (saddr)
A, !addr16
3
8
9 + n
A, CY
A + (addr16)
A, [HL]
1
4
5 + n
A, CY
A + (HL)
A, [HL + byte]
2
8
9 + n
A, CY
A + (HL + byte)
A, [HL + B]
2
8
9 + n
A, CY
A + (HL + B)
ADD
A, [HL + C]
2
8
9 + n
A, CY
A + (HL + C)
A, #byte
2
4
-
A, CY
A + byte + CY
saddr, #byte
3
6
8
(saddr), CY
(saddr) + byte + CY
A, r
Note 4
2
4
-
A, CY
A + r + CY
r, A
2
4
-
r, CY
r + A + CY
A, saddr
2
4
5
A, CY
A + (saddr) + CY
A, !addr16
3
8
9 + n
A, CY
A + (addr16) + C
A, [HL]
1
4
5 + n
A, CY
A + (HL) + CY
A, [HL + byte]
2
8
9 + n
A, CY
A + (HL + byte) + CY
A, [HL + B]
2
8
9 + n
A, CY
A + (HL + B) + CY
8-bit
operation
ADDC
A, [HL + C]
2
8
9 + n
A, CY
A + (HL + C) + CY
Notes 1.
When the internal high-speed RAM area is accessed or for an instruction with no data access
2.
When an area except the internal high-speed RAM area is accessed
3.
Only when rp = BC, DE or HL
4.
Except "r = A"
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (f
CPU
) selected by the processor clock
control register (PCC).
2. This clock cycle applies to the internal ROM program.
3. n is the number of waits when the external memory expansion area is read.
4. m is the number of waits when the external memory expansion area is written.
CHAPTER 24 INSTRUCTION SET
Preliminary User's Manual U16227EJ1V0UD
388
Clocks
Flag
Instruction
Group
Mnemonic
Operands
Bytes
Note 1
Note 2
Operation
Z AC CY
A, #byte
2
4
-
A, CY
A - byte
saddr, #byte
3
6
8
(saddr), CY
(saddr) - byte
A, r
Note 3
2
4
-
A, CY
A - r
r, A
2
4
-
r, CY
r - A
A, saddr
2
4
5
A, CY
A - (saddr)
A, !addr16
3
8
9 + n
A, CY
A - (addr16)
A, [HL]
1
4
5 + n
A, CY
A - (HL)
A, [HL + byte]
2
8
9 + n
A, CY
A - (HL + byte)
A, [HL + B]
2
8
9 + n
A, CY
A - (HL + B)
SUB
A, [HL + C]
2
8
9 + n
A, CY
A - (HL + C)
A, #byte
2
4
-
A, CY
A - byte - CY
saddr, #byte
3
6
8
(saddr), CY
(saddr) - byte - CY
A, r
Note 3
2
4
-
A, CY
A - r - CY
r, A
2
4
-
r, CY
r - A - CY
A, saddr
2
4
5
A, CY
A - (saddr) - CY
A, !addr16
3
8
9 + n
A, CY
A - (addr16) - CY
A, [HL]
1
4
5 + n
A, CY
A - (HL) - CY
A, [HL + byte]
2
8
9 + n
A, CY
A - (HL + byte) - CY
A, [HL + B]
2
8
9 + n
A, CY
A - (HL + B) - CY
SUBC
A, [HL + C]
2
8
9 + n
A, CY
A - (HL + C) - CY
A, #byte
2
4
-
A
A byte
saddr, #byte
3
6
8
(saddr)
(saddr) byte
A, r
Note 3
2
4
-
A
A r
r, A
2
4
-
r
r A
A, saddr
2
4
5
A
A (saddr)
A, !addr16
3
8
9 + n
A
A (addr16)
A, [HL]
1
4
5 + n
A
A [HL]
A, [HL + byte]
2
8
9 + n
A
A [HL + byte]
A, [HL + B]
2
8
9 + n
A
A [HL + B]
8-bit
operation
AND
A, [HL + C]
2
8
9 + n
A
A [HL + C]
Notes 1.
When the internal high-speed RAM area is accessed or for an instruction with no data access
2.
When an area except the internal high-speed RAM area is accessed
3.
Except "r = A"
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (f
CPU
) selected by the processor clock
control register (PCC).
2. This clock cycle applies to the internal ROM program.
3. n is the number of waits when the external memory expansion area is read.
CHAPTER 24 INSTRUCTION SET
Preliminary User's Manual U16227EJ1V0UD
389
Clocks
Flag
Instruction
Group
Mnemonic
Operands
Bytes
Note 1
Note 2
Operation
Z AC CY
A, #byte
2
4
-
A
A byte
saddr, #byte
3
6
8
(saddr)
(saddr) byte
A, r
Note 3
2
4
-
A
A r
r, A
2
4
-
r
r A
A, saddr
2
4
5
A
A (saddr)
A, !addr16
3
8
9 + n
A
A (addr16)
A, [HL]
1
4
5 + n
A
A (HL)
A, [HL + byte]
2
8
9 + n
A
A (HL + byte)
A, [HL + B]
2
8
9 + n
A
A (HL + B)
OR
A, [HL + C]
2
8
9 + n
A
A (HL + C)
A, #byte
2
4
-
A
A byte
saddr, #byte
3
6
8
(saddr)
(saddr) byte
A, r
Note 3
2
4
-
A
A r
r, A
2
4
-
r
r A
A, saddr
2
4
5
A
A (saddr)
A, !addr16
3
8
9 + n
A
A (addr16)
A, [HL]
1
4
5 + n
A
A (HL)
A, [HL + byte]
2
8
9 + n
A
A (HL + byte)
A, [HL + B]
2
8
9 + n
A
A (HL + B)
XOR
A, [HL + C]
2
8
9 + n
A
A (HL + C)
A, #byte
2
4
-
A
- byte
saddr, #byte
3
6
8
(saddr)
- byte
A, r
Note 3
2
4
-
A
- r
r, A
2
4
-
r
- A
A, saddr
2
4
5
A
- (saddr)
A, !addr16
3
8
9 + n
A
- (addr16)
A, [HL]
1
4
5 + n
A
- (HL)
A, [HL + byte]
2
8
9 + n
A
- (HL + byte)
A, [HL + B]
2
8
9 + n
A
- (HL + B)
8-bit
operation
CMP
A, [HL + C]
2
8
9 + n
A
- (HL + C)
Notes 1.
When the internal high-speed RAM area is accessed or for an instruction with no data access
2.
When an area except the internal high-speed RAM area is accessed
3.
Except "r = A"
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (f
CPU
) selected by the processor clock
control register (PCC).
2. This clock cycle applies to the internal ROM program.
3. n is the number of waits when the external memory expansion area is read.
CHAPTER 24 INSTRUCTION SET
Preliminary User's Manual U16227EJ1V0UD
390
Clocks
Flag
Instruction
Group
Mnemonic
Operands
Bytes
Note 1
Note 2
Operation
Z AC CY
ADDW
AX, #word
3
6
-
AX, CY
AX + word
SUBW
AX, #word
3
6
-
AX, CY
AX - word
16-bit
operation
CMPW
AX, #word
3
6
-
AX
- word
MULU
X
2
16
-
AX
A X
Multiply/
divide
DIVUW
C
2
25
-
AX (Quotient), C (Remainder)
AX C
r
1
2
-
r
r + 1
INC
saddr
2
4
6
(saddr)
(saddr) + 1
r
1
2
-
r
r - 1
DEC
saddr
2
4
6
(saddr)
(saddr) - 1
INCW
rp
1
4
-
rp
rp + 1
Increment/
decrement
DECW
rp
1
4
-
rp
rp - 1
ROR
A, 1
1
2
-
(CY, A
7
A
0
, A
m
- 1
A
m
)
1 time
ROL
A, 1
1
2
-
(CY, A
0
A
7
, A
m + 1
A
m
)
1 time
RORC
A, 1
1
2
-
(CY
A
0
, A
7
CY, A
m
- 1
A
m
)
1 time
ROLC
A, 1
1
2
-
(CY
A
7
, A
0
CY, A
m + 1
A
m
)
1 time
ROR4
[HL]
2
10
12 + n + m A
3
- 0
(HL)
3
-
0
, (HL)
7
- 4
A
3
- 0
,
(HL)
3
- 0
(HL)
7
- 4
Rotate
ROL4
[HL]
2
10
12 + n + m A
3
- 0
(HL)
7
- 4
, (HL)
3
- 0
A
3
- 0
,
(HL)
7
- 4
(HL)
3
- 0
ADJBA
2
4
-
Decimal Adjust Accumulator after Addition
BCD
adjustment
ADJBS
2
4
-
Decimal Adjust Accumulator after Subtract
CY, saddr.bit
3
6
7
CY
(saddr.bit)
CY, sfr.bit
3
-
7
CY
sfr.bit
CY, A.bit
2
4
-
CY
A.bit
CY, PSW.bit
3
-
7
CY
PSW.bit
CY, [HL].bit
2
6
7 + n
CY
(HL).bit
saddr.bit, CY
3
6
8
(saddr.bit)
CY
sfr.bit, CY
3
-
8
sfr.bit
CY
A.bit, CY
2
4
-
A.bit
CY
PSW.bit, CY
3
-
8
PSW.bit
CY
Bit
manipulate
MOV1
[HL].bit, CY
2
6
8 + n + m (HL).bit
CY
Notes 1.
When the internal high-speed RAM area is accessed or for an instruction with no data access
2.
When an area except the internal high-speed RAM area is accessed
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (f
CPU
) selected by the processor clock
control register (PCC).
2. This clock cycle applies to the internal ROM program.
3. n is the number of waits when the external memory expansion area is read.
4. m is the number of waits when the external memory expansion area is written.
CHAPTER 24 INSTRUCTION SET
Preliminary User's Manual U16227EJ1V0UD
391
Clocks
Flag
Instruction
Group
Mnemonic
Operands
Bytes
Note 1
Note 2
Operation
Z AC CY
CY, saddr.bit
3
6
7
CY
CY saddr.bit)
CY, sfr.bit
3
-
7
CY
CY sfr.bit
CY, A.bit
2
4
-
CY
CY A.bit
CY, PSW.bit
3
-
7
CY
CY PSW.bit
AND1
CY, [HL].bit
2
6
7 + n
CY
CY (HL).bit
CY, saddr.bit
3
6
7
CY
CY (saddr.bit)
CY, sfr.bit
3
-
7
CY
CY sfr.bit
CY, A.bit
2
4
-
CY
CY A.bit
CY, PSW.bit
3
-
7
CY
CY PSW.bit
OR1
CY, [HL].bit
2
6
7 + n
CY
CY (HL).bit
CY, saddr.bit
3
6
7
CY
CY (saddr.bit)
CY, sfr.bit
3
-
7
CY
CY sfr.bit
CY, A.bit
2
4
-
CY
CY A.bit
CY, PSW. bit
3
-
7
CY
CY PSW.bit
XOR1
CY, [HL].bit
2
6
7 + n
CY
CY (HL).bit
saddr.bit
2
4
6
(saddr.bit)
1
sfr.bit
3
-
8
sfr.bit
1
A.bit
2
4
-
A.bit
1
PSW.bit
2
-
6
PSW.bit
1
SET1
[HL].bit
2
6
8 + n + m (HL).bit
1
saddr.bit
2
4
6
(saddr.bit)
0
sfr.bit
3
-
8
sfr.bit
0
A.bit
2
4
-
A.bit
0
PSW.bit
2
-
6
PSW.bit
0
CLR1
[HL].bit
2
6
8 + n + m (HL).bit
0
SET1
CY
1
2
-
CY
1
1
CLR1
CY
1
2
-
CY
0
0
Bit
manipulate
NOT1
CY
1
2
-
CY
CY
Notes 1.
When the internal high-speed RAM area is accessed or for an instruction with no data access
2.
When an area except the internal high-speed RAM area is accessed
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (f
CPU
) selected by the processor clock
control register (PCC).
2. This clock cycle applies to the internal ROM program.
3. n is the number of waits when the external memory expansion area is read.
4. m is the number of waits when the external memory expansion area is written.
CHAPTER 24 INSTRUCTION SET
Preliminary User's Manual U16227EJ1V0UD
392
Clocks
Flag
Instruction
Group
Mnemonic
Operands
Bytes
Note 1
Note 2
Operation
Z AC CY
CALL
!addr16
3
7
-
(SP
- 1) (PC + 3)
H
, (SP
- 2) (PC + 3)
L
,
PC
addr16, SP SP - 2
CALLF
!addr11
2
5
-
(SP
- 1) (PC + 2)
H
, (SP
- 2) (PC + 2)
L
,
PC
15
- 11
00001, PC
10
- 0
addr11,
SP
SP - 2
CALLT
[addr5]
1
6
-
(SP
- 1) (PC + 1)
H
, (SP
- 2) (PC + 1)
L
,
PC
H
(00000000, addr5 + 1),
PC
L
(00000000, addr5),
SP
SP - 2
BRK
1
6
-
(SP
- 1) PSW, (SP - 2) (PC + 1)
H
,
(SP
- 3) (PC + 1)
L
, PC
H
(003FH),
PC
L
(003EH), SP SP - 3, IE 0
RET
1
6
-
PC
H
(SP + 1), PC
L
(SP),
SP
SP + 2
RETI
1
6
-
PC
H
(SP + 1), PC
L
(SP),
PSW
(SP + 2), SP SP + 3,
NMIS
0
R
R R
Call/return
RETB
1
6
-
PC
H
(SP + 1), PC
L
(SP),
PSW
(SP + 2), SP SP + 3
R
R R
PSW
1
2
-
(SP
- 1) PSW, SP SP - 1
PUSH
rp
1
4
-
(SP
- 1) rp
H
, (SP
- 2) rp
L
,
SP
SP - 2
PSW
1
2
-
PSW
(SP), SP SP + 1
R
R R
POP
rp
1
4
-
rp
H
(SP + 1), rp
L
(SP),
SP
SP + 2
SP, #word
4
-
10
SP
word
SP, AX
2
-
8
SP
AX
Stack
manipulate
MOVW
AX, SP
2
-
8
AX
SP
!addr16
3
6
-
PC
addr16
$addr16
2
6
-
PC
PC + 2 + jdisp8
Unconditional
branch
BR
AX
2
8
-
PCH
A, PC
L
X
BC
$addr16
2
6
-
PC
PC + 2 + jdisp8 if CY = 1
BNC
$addr16
2
6
-
PC
PC + 2 + jdisp8 if CY = 0
BZ
$addr16
2
6
-
PC
PC + 2 + jdisp8 if Z = 1
Conditional
branch
BNZ
$addr16
2
6
-
PC
PC + 2 + jdisp8 if Z = 0
Notes 1.
When the internal high-speed RAM area is accessed or for an instruction with no data access
2.
When an area except the internal high-speed RAM area is accessed
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (f
CPU
) selected by the processor clock
control register (PCC).
2. This clock cycle applies to the internal ROM program.
CHAPTER 24 INSTRUCTION SET
Preliminary User's Manual U16227EJ1V0UD
393
Clocks
Flag
Instruction
Group
Mnemonic
Operands
Bytes
Note 1
Note 2
Operation
Z AC CY
saddr.bit, $addr16
3
8
9
PC
PC + 3 + jdisp8 if(saddr.bit) = 1
sfr.bit, $addr16
4
-
11
PC
PC + 4 + jdisp8 if sfr.bit = 1
A.bit, $addr16
3
8
-
PC
PC + 3 + jdisp8 if A.bit = 1
PSW.bit, $addr16
3
-
9
PC
PC + 3 + jdisp8 if PSW.bit = 1
BT
[HL].bit, $addr16
3
10
11 + n
PC
PC + 3 + jdisp8 if (HL).bit = 1
saddr.bit, $addr16
4
10
11
PC
PC + 4 + jdisp8 if(saddr.bit) = 0
sfr.bit, $addr16
4
-
11
PC
PC + 4 + jdisp8 if sfr.bit = 0
A.bit, $addr16
3
8
-
PC
PC + 3 + jdisp8 if A.bit = 0
PSW.bit, $addr16
4
-
11
PC
PC + 4 + jdisp8 if PSW. bit = 0
BF
[HL].bit, $addr16
3
10
11 + n
PC
PC + 3 + jdisp8 if (HL).bit = 0
saddr.bit, $addr16
4
10
12
PC
PC + 4 + jdisp8
if(saddr.bit) = 1
then reset(saddr.bit)
sfr.bit, $addr16
4
-
12
PC
PC + 4 + jdisp8 if sfr.bit = 1
then reset sfr.bit
A.bit, $addr16
3
8
-
PC
PC + 3 + jdisp8 if A.bit = 1
then reset A.bit
PSW.bit, $addr16
4
-
12
PC
PC + 4 + jdisp8 if PSW.bit = 1
then reset PSW.bit
BTCLR
[HL].bit, $addr16
3
10
12 + n + m PC
PC + 3 + jdisp8 if (HL).bit = 1
then reset (HL).bit
B, $addr16
2
6
-
B
B - 1, then
PC
PC + 2 + jdisp8 if B 0
C, $addr16
2
6
-
C
C -1, then
PC
PC + 2 + jdisp8 if C 0
Conditional
branch
DBNZ
saddr, $addr16
3
8
10
(saddr)
(saddr) - 1, then
PC
PC + 3 + jdisp8 if(saddr) 0
SEL
RBn
2
4
-
RBS1, 0
n
NOP
1
2
-
No Operation
EI
2
-
6
IE
1(Enable Interrupt)
DI
2
-
6
IE
0(Disable Interrupt)
HALT
2
6
-
Set HALT Mode
CPU
control
STOP
2
6
-
Set STOP Mode
Notes 1.
When the internal high-speed RAM area is accessed or for an instruction with no data access
2.
When an area except the internal high-speed RAM area is accessed
Remarks 1. One instruction clock cycle is one cycle of the CPU clock (f
CPU
) selected by the processor clock
control register (PCC).
2. This clock cycle applies to the internal ROM program.
3. n is the number of waits when the external memory expansion area is read.
4. m is the number of waits when the external memory expansion area is written.
CHAPTER 24 INSTRUCTION SET
Preliminary User's Manual U16227EJ1V0UD
394
24.3 Instructions Listed by Addressing Type
(1) 8-bit instructions
MOV, XCH, ADD, ADDC, SUB, SUBC, AND, OR, XOR, CMP, MULU, DIVUW, INC, DEC, ROR, ROL, RORC,
ROLC, ROR4, ROL4, PUSH, POP, DBNZ
Second Operand
First Operand
#byte
A
r
Note
sfr
saddr
!addr16
PSW
[DE]
[HL]
[HL + byte]
[HL + B]
[HL + C]
$addr16
1
None
A
ADD
ADDC
SUB
SUBC
AND
OR
XOR
CMP
MOV
XCH
ADD
ADDC
SUB
SUBC
AND
OR
XOR
CMP
MOV
XCH
MOV
XCH
ADD
ADDC
SUB
SUBC
AND
OR
XOR
CMP
MOV
XCH
ADD
ADDC
SUB
SUBC
AND
OR
XOR
CMP
MOV
MOV
XCH
MOV
XCH
ADD
ADDC
SUB
SUBC
AND
OR
XOR
CMP
MOV
XCH
ADD
ADDC
SUB
SUBC
AND
OR
XOR
CMP
ROR
ROL
RORC
ROLC
r
MOV
MOV
ADD
ADDC
SUB
SUBC
AND
OR
XOR
CMP
INC
DEC
B, C
DBNZ
sfr
MOV
MOV
saddr
MOV
ADD
ADDC
SUB
SUBC
AND
OR
XOR
CMP
MOV
DBNZ
INC
DEC
!addr16
MOV
PSW
MOV
MOV
PUSH
POP
[DE]
MOV
[HL]
MOV
ROR4
ROL4
[HL + byte]
[HL + B]
[HL + C]
MOV
X
MULU
C
DIVUW
Note Except r = A
CHAPTER 24 INSTRUCTION SET
Preliminary User's Manual U16227EJ1V0UD
395
(2) 16-bit instructions
MOVW, XCHW, ADDW, SUBW, CMPW, PUSH, POP, INCW, DECW
Second Operand
First Operand
#word
AX
rp
Note
sfrp
saddrp
!addr16
SP
None
AX
ADDW
SUBW
CMPW
MOVW
XCHW
MOVW
MOVW
MOVW
MOVW
rp
MOVW
MOVW
Note
INCW
DECW
PUSH
POP
sfrp
MOVW
MOVW
saddrp
MOVW
MOVW
!addr16
MOVW
SP
MOVW
MOVW
Note Only when rp = BC, DE, HL
(3) Bit manipulation instructions
MOV1, AND1, OR1, XOR1, SET1, CLR1, NOT1, BT, BF, BTCLR
Second Operand
First Operand
A.bit
sfr.bit
saddr.bit
PSW.bit
[HL].bit
CY
$addr16
None
A.bit
MOV1
BT
BF
BTCLR
SET1
CLR1
sfr.bit
MOV1
BT
BF
BTCLR
SET1
CLR1
saddr.bit
MOV1
BT
BF
BTCLR
SET1
CLR1
PSW.bit
MOV1
BT
BF
BTCLR
SET1
CLR1
[HL].bit
MOV1
BT
BF
BTCLR
SET1
CLR1
CY
MOV1
AND1
OR1
XOR1
MOV1
AND1
OR1
XOR1
MOV1
AND1
OR1
XOR1
MOV1
AND1
OR1
XOR1
MOV1
AND1
OR1
XOR1
SET1
CLR1
NOT1
CHAPTER 24 INSTRUCTION SET
Preliminary User's Manual U16227EJ1V0UD
396
(4) Call instructions/branch instructions
CALL, CALLF, CALLT, BR, BC, BNC, BZ, BNZ, BT, BF, BTCLR, DBNZ
Second Operand
First Operand
AX
!addr16
!addr11
[addr5]
$addr16
Basic instruction
BR
CALL
BR
CALLF
CALLT
BR
BC
BNC
BZ
BNZ
Compound
instruction
BT
BF
BTCLR
DBNZ
(5) Other instructions
ADJBA, ADJBS, BRK, RET, RETI, RETB, SEL, NOP, EI, DI, HALT, STOP
Preliminary User's Manual U16227EJ1V0UD
397
CHAPTER 25 ELECTRICAL SPECIFICATIONS (TARGET VALUES)
These specifications are only target values, and may not be satisfied by mass-produced products.
The electrical specifications (target values) of (A1) products are under evaluation.
Absolute Maximum Ratings (T
A
= 25



C)
Parameter
Symbol
Conditions
Ratings
Unit
V
DD
-0.3 to +6.5
V
EV
DD
-0.3 to +6.5
V
V
SS
-0.3 to +0.3
V
EV
SS
-0.3 to +0.3
V
AV
REF
-0.3 to V
DD
+ 0.3
Note 1
V
AV
SS
-0.3 to +0.3
V
Supply voltage
V
PP
PD78F0114 only Note 2
-0.3 to +10.5
V
V
I1
P00, P01, P10 to P17, P20 to P27, P30 to P33,
P60, P61, P70 to P73, P120, P130, X1, X2,
XT1, XT2, RESET
-0.3 to V
DD
+ 0.3
Note 1
V
N-ch open drain
-0.3 to +13
V
I2
P62, P63
On-chip pull-up resistor
-0.3 to V
DD
+ 0.3
Note 1
V
Input voltage
V
I3
V
PP
in flash programming mode
(
PD78F0114 only)
-0.3 to +10.5
V
Output voltage
V
O
-0.3 to V
DD
+ 0.3
Note 1
V
Analog input voltage
V
AN
AV
SS
- 0.3 to AV
REF
+ 0.3
Note 1
and
-0.3 to V
DD
+ 0.3
Note 1
V
Per pin
-10
mA
P00, P01, P10 to P16, P70 to P73
-30
mA
Output current, high
I
OH
Total of all
pins
-60 mA
P17, P30 to P33, P120, P130
-30
mA
P00, P01, P10 to P17, P30 to
P33, P70 to P73, P120, P130
20
mA
Per pin
P60 to P63
30
mA
P00, P01, P10 to P16, P70 to P73
35
mA
Output current, low
I
OL
Total of all
pins 70 mA
P17, P30 to P33, P60 to P63,
P120, P130
35
mA
Operating ambient
temperature
T
A
In normal operation mode
-40 to +85
C
PD780111, 780112, 780113, 780114
-65 to +150
Storage temperature
T
stg
PD78F0114
-40 to +125
C
Notes 1.
Must be 6.5 V or lower.
(Refer to Note 2 on the next page.)
Caution
Product quality may suffer if the absolute maximum rating is exceeded even momentarily for any
parameter. That is, the absolute maximum ratings are rated values at which the product is on the
verge of suffering physical damage, and therefore the product must be used under conditions that
ensure that the absolute maximum ratings are not exceeded.
Remark
Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port pins.
CHAPTER 25 ELECTRICAL SPECIFICATIONS (TARGET VALUES)
Preliminary User's Manual U16227EJ1V0UD
398
Notes 2.
Make sure that the following conditions of the V
PP
voltage application timing are satisfied when the flash
memory is written.



When supply voltage rises
V
PP
must exceed V
DD
10
s or more after V
DD
has reached the lower-limit value (2.7 V) of the operating
voltage range (see a in the figure below).



When supply voltage drops
V
DD
must be lowered 10
s or more after V
PP
falls below the lower-limit value (2.7 V) of the operating
voltage range of V
DD
(see b in the figure below).
2.7 V
V
DD
0 V
0 V
V
PP
2.7 V
a
b
CHAPTER 25 ELECTRICAL SPECIFICATIONS (TARGET VALUES)
Preliminary User's Manual U16227EJ1V0UD
399
X1 Oscillator Characteristics
(T
A
=
-
-
-
-40 to +85C, 2.7 V V
DD
= EV
DD



5.5 V, 2.7 V AV
REF



V
DD
, V
SS
= EV
SS
= AV
SS
= 0 V)
Resonator
Recommended Circuit
Parameter
Conditions
MIN.
TYP.
MAX.
Unit
4.0 V
V
DD
5.5 V
2.0
10
3.3 V
V
DD
< 4.0 V
2.0
8.38
Ceramic
resonator
C1
X2
X1
IC
(V
PP
)
C2
Oscillation
frequency (f
XP
)
Note
2.7 V
V
DD
< 3.3 V
2.0
5.0
MHz
4.0 V
V
DD
5.5 V
2.0
10
3.3 V
V
DD
< 4.0 V
2.0
8.38
Crystal
resonator
C1
X2
X1
IC
(V
PP
)
C2
Oscillation
frequency (f
XP
)
Note
2.7 V
V
DD
< 3.3 V
2.0
5.0
MHz
4.0 V
V
DD
5.5 V
2.0
10
3.3 V
V
DD
< 4.0 V
2.0
8.38
X1 input
frequency (f
XP
)
Note
2.7 V
V
DD
< 3.3 V
2.0
5.0
MHz
4.0 V
V
DD
5.5 V
46
500
3.3 V
V
DD
< 4.0 V
56
500
External
clock
X2
X1
X1 input high-
/low-level width
(t
XPH
, t
XPL
)
2.7 V
V
DD
< 3.3 V
96
500
ns
Note Indicates only oscillator characteristics. Refer to AC Characteristics for instruction execution time.
Cautions 1. When using the X1 oscillator, wire as follows in the area enclosed by the broken lines in the
above figures to avoid an adverse effect from wiring capacitance.
Keep the wiring length as short as possible.
Do not cross the wiring with the other signal lines.
Do not route the wiring near a signal line through which a high fluctuating current flows.
Always make the ground point of the oscillator capacitor the same potential as V
SS
.
Do not ground the capacitor to a ground pattern through which a high current flows.
Do not fetch signals from the oscillator.
2. Since the CPU is started by the Ring-OSC after reset, check the oscillation stabilization time of
the X1 input clock using the oscillation stabilization time status register (OSTC). Determine the
oscillation stabilization time of the OSTC register and oscillation stabilization time select
register (OSTS) after sufficiently evaluating the oscillation stabilization time with the resonator
to be used.
Remark
For the resonator selection and oscillator constant, users are required to either evaluate the oscillation
themselves or apply to the resonator manufacturer for evaluation.
Ring-OSC Oscillator Characteristics
(T
A
=
-
-
-
-40 to +85C, 2.7 V V
DD
= EV
DD



5.5 V, 2.7 V AV
REF



V
DD
, V
SS
= EV
SS
= AV
SS
= 0 V)
Resonator
Parameter
Conditions
MIN.
TYP.
MAX.
Unit
On-chip Ring-OSC oscillator
Oscillation frequency (f
R
)
120
240
480
kHz
CHAPTER 25 ELECTRICAL SPECIFICATIONS (TARGET VALUES)
Preliminary User's Manual U16227EJ1V0UD
400
Subsystem Clock Oscillator Characteristics
(T
A
=
-
-
-
-40 to +85C, 2.7 V V
DD
= EV
DD



5.5 V, 2.7 V AV
REF



V
DD
, V
SS
= EV
SS
= AV
SS
= 0 V)
Resonator
Recommended Circuit
Parameter
Conditions
MIN.
TYP.
MAX.
Unit
Crystal
resonator
XT1
IC
(V
PP
) XT2
C4
C3
Rd
Oscillation frequency
(f
XT
)
Note
32
32.768
35
kHz
XT1 input frequency
(f
XT
)
Note
32
38.5
kHz
External clock
XT1
XT2
XT1 input high-/low-level
width (t
XTH
, t
XTL
)
12
15
s
Note Indicates only oscillator characteristics. Refer to AC Characteristics for instruction execution time.
Cautions 1. When using the subsystem clock oscillator, wire as follows in the area enclosed by the broken
lines in the above figures to avoid an adverse effect from wiring capacitance.



Keep the wiring length as short as possible.



Do not cross the wiring with the other signal lines.



Do not route the wiring near a signal line through which a high fluctuating current flows.



Always make the ground point of the oscillator capacitor the same potential as V
SS
.



Do not ground the capacitor to a ground pattern through which a high current flows.



Do not fetch signals from the oscillator.
2. The subsystem clock oscillator is designed as a low-amplitude circuit for reducing current
consumption, and is more prone to malfunction due to noise than the main system clock
oscillator. Particular care is therefore required with the wiring method when the subsystem
clock is used.
Remark For the resonator selection and oscillator constant, customers are requested to either evaluate the
oscillation themselves or apply to the resonator manufacturer for evaluation.
CHAPTER 25 ELECTRICAL SPECIFICATIONS (TARGET VALUES)
Preliminary User's Manual U16227EJ1V0UD
401
DC Characteristics (1/4)
(T
A
=
-
-
-
-40 to +85C, 2.7 V V
DD
= EV
DD



5.5 V, 2.7 V AV
REF



V
DD
, V
SS
= EV
SS
= AV
SS
= 0 V)
Parameter
Symbol
Conditions
MIN.
TYP.
MAX.
Unit
Per pin
4.0 V
V
DD
5.5 V
-5
mA
Total of P00, P01, P10 to
P16, P70 to P73
4.0 V
V
DD
5.5 V
-25
mA
Total of P17, P30 to P33,
P120, P130
4.0 V
V
DD
5.5 V
-25
mA
Output current, high
I
OH
All pins
2.7 V
V
DD
< 4.0 V
-10
mA
Per pin for P00, P01, P10 to
P17, P30 to P33, P70 to
P73, P120, P130
4.0 V
V
DD
5.5 V
10
mA
Per pin for P60 to P63
4.0 V
V
DD
5.5 V
15
mA
Total of P00, P01, P10 to
P16, P70 to P73
4.0 V
V
DD
5.5 V
30
mA
Total of P17, P30 to P33,
P60 to P63, P120, P130
4.0 V
V
DD
5.5 V
30
mA
Output current, low
I
OL
All pins
2.7 V
V
DD
< 4.0 V
10
mA
V
IH1
P12, P13, P15
0.7V
DD
V
DD
V
V
IH2
P00, P01, P10, P11, P14, P16, P17, P30 to
P33, P70 to P73, P120, RESET
0.8V
DD
V
DD
V
V
IH3
P20 to P27
Note
0.7AV
REF
AV
REF
V
V
IH4
P60, P61
0.7V
DD
V
DD
V
V
IH5
P62, P63
0.7V
DD
12
V
Input voltage, high
V
IH6
X1, X2, XT1, XT2
V
DD
- 0.5
V
DD
V
V
IL1
P12, P13, P15
0
0.3V
DD
V
V
IL2
P00, P01, P10, P11, P14, P16, P17, P30 to
P33, P70 to P73, P120, RESET
0
0.2V
DD
V
V
IL3
P20 to P27
Note
0
0.3AV
REF
V
V
IL4
P60, P61
0
0.3V
DD
V
V
IL5
P62, P63
0
0.3V
DD
V
Input voltage, low
V
IL6
X1, X2, XT1, XT2
0
0.4
V
Note When used as A/D converter analog input pins, set AV
REF
= V
DD
.
Remark
Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port pins.
CHAPTER 25 ELECTRICAL SPECIFICATIONS (TARGET VALUES)
Preliminary User's Manual U16227EJ1V0UD
402
DC Characteristics (2/4)
(T
A
=
-
-
-
-40 to +85C, 2.7 V V
DD
= EV
DD



5.5 V, 2.7 V AV
REF



V
DD
, V
SS
= EV
SS
= AV
SS
= 0 V)
Parameter
Symbol
Conditions
MIN.
TYP.
MAX.
Unit
P00, P01, P10 to
P16, P70 to P73
Total I
OH
=
-25 mA
4.0 V
V
DD
5.5 V,
I
OH
=
-5 mA
V
DD
- 1.0
V
P17, P30 to P33,
P120, P130
Total I
OH
=
-25 mA
4.0 V
V
DD
5.5 V,
I
OH
=
-5 mA
V
DD
- 1.0
V
Output voltage, high
V
OH
I
OH
=
-100
A
2.7 V
V
DD
< 4.0 V
V
DD
- 0.5
V
P00, P01, P10 to
P16, P70 to P73
Total I
OL
= 30 mA
4.0 V
V
DD
5.5 V,
I
OL
= 10 mA
1.3
V
P17, P30 to P33, P60
to P63, P120, P130
Total I
OL
= 30 mA
4.0 V
V
DD
5.5 V,
I
OL
= 10 mA
1.3
V
V
OL1
I
OL
= 400
A
2.7 V
V
DD
< 4.0 V
0.4
V
Output voltage, low
V
OL2
P60 to P63
I
OL
= 15 mA
2.0
V
V
I
= V
DD
P00, P01, P10 to P17, P30
to P33, P60, P61, P70 to
P73, P120, P130, RESET
3
A
I
LIH1
V
I
= AV
REF
P20 to P27
3
A
I
LIH2
V
I
= V
DD
X1, X2, XT1, XT2
20
A
Input leakage current,
high
I
LIH3
V
I
= 12 V
P62, P63 (N-ch open drain)
3
A
I
LIL1
P00, P01, P10 to P17, P20
to P27, P30 to P33, P60,
P61, P70 to P73, P120,
P130, RESET
-3
A
I
LIL2
X1, X2, XT1, XT2
-20
A
Input leakage current,
low
I
LIL3
V
I
= 0 V
P62, P63 (N-ch open drain)
-3
Note
A
Output leakage current,
high
I
LOH
V
O
= V
DD
3
A
Output leakage current,
low
I
LOL
V
O
= 0 V
-3
A
Pull-up resistor
R
L
V
I
= 0 V
10
30
100
k
V
PP
supply voltage
(
PD78F0114 only)
V
PP1
In normal operation mode
0
0.2V
DD
V
Note If there is no on-chip pull-up resistor for P62 and P63 (specified by a mask option) and if port 6 has been set to
input mode when a read instruction is executed to read from port 6, a low-level input leakage current of up to
-45
A flows during only one cycle. At all other times, the maximum leakage current is -3 A.
Remark
Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port pins.
CHAPTER 25 ELECTRICAL SPECIFICATIONS (TARGET VALUES)
Preliminary User's Manual U16227EJ1V0UD
403
DC Characteristics (3/4):



PD78F0114
(T
A
=
-
-
-
-40 to +85C, 2.7 V V
DD
= EV
DD



5.5 V, 2.7 V AV
REF



V
DD
, V
SS
= EV
SS
= AV
SS
= 0 V)
Parameter
Symbol
Conditions
MIN. TYP. MAX. Unit
When A/D converter is stopped
11.5
24.2
mA
f
XP
= 10 MHz
V
DD
= 5.0 V
10%
Note 3
When A/D converter is
operating
Note 4
12.5
26.3
mA
When A/D converter is stopped
5.5
11.6
mA
I
DD1
X1 crystal
oscillation
operating
mode
Note 2
f
XP
= 5 MHz
V
DD
= 3.0 V
10%
Note 3
When A/D converter is
operating
Note 4
6.5
13.7
mA
When peripheral functions are stopped
1.6
3.2
mA
f
XP
= 10 MHz
V
DD
= 5.0 V
10%
Note 3
When peripheral functions are operating
6.4
mA
When peripheral functions are stopped
0.9
1.8
mA
I
DD2
X1 crystal
oscillation HALT
mode
f
XP
= 5 MHz
V
DD
= 3.0 V
10%
Note 3
When peripheral functions are operating
3.6
mA
V
DD
= 5.0 V
10%
0.7
2.1
mA
I
DD3
Ring-OSC
operating
mode
Note 5
V
DD
= 3.0 V
10%
0.4
1.2
mA
V
DD
= 5.0 V
10%
120
240
A
I
DD4
32.768 kHz
crystal oscillation
operating
mode
Notes 5, 7
V
DD
= 3.0 V
10%
100
200
A
V
DD
= 5.0 V
10%
35
70
A
I
DD5
32.768 kHz
crystal oscillation
HALT mode
Notes 5, 7
V
DD
= 3.0 V
10%
7
21
A
POC: OFF, RING: OFF
0.1
30
A
POC: OFF, RING: ON
14
58
A
POC: ON
Note 6
, RING: OFF
3.5
35.5
A
V
DD
= 5.0 V
10%
POC: ON
Note 6
, RING: ON
17.5
63.5
A
POC: OFF, RING: OFF
0.05
10
A
POC: OFF, RING: ON
7.5
25
A
POC: ON
Note 6
, RING: OFF
3.5
15.5
A
Supply
current
Note 1
I
DD6
STOP mode
V
DD
= 3.0 V
10%
POC: ON
Note 6
, RING: ON
11
30.5
A
Notes 1.
Total current flowing through the internal power supply (V
DD
). Peripheral operation current is included
(however, the current that flows through the pull-up resistors of ports is not included).
2.
I
DD1
includes peripheral operation current.
3.
When PCC = 00H.
4.
Including the current that flows through the AV
REF
pin.
5.
When main system clock is stopped.
6.
Including when LVIE (bit 4 of LVIM) = 1 with POC-OFF selected by a mask option.
7.
When POC-OFF (including LVIE = 0) is selected by a mask option and Ring-OSC oscillation is stopped.
CHAPTER 25 ELECTRICAL SPECIFICATIONS (TARGET VALUES)
Preliminary User's Manual U16227EJ1V0UD
404
DC Characteristics (4/4):



PD780111, 780112, 780113, and 780114
(T
A
=
-
-
-
-40 to +85C, 2.7 V V
DD
= EV
DD



5.5 V, 2.7 V AV
REF



V
DD
, V
SS
= EV
SS
= AV
SS
= 0 V)
Parameter
Symbol
Conditions
MIN. TYP. MAX. Unit
When A/D converter is stopped
5.8
13.3
mA
f
XP
= 10 MHz
V
DD
= 5.0 V
10%
Note 3
When A/D converter is
operating
Note 4
6.8
15.5
mA
When A/D converter is stopped
1.8
4.2
mA
I
DD1
X1 crystal
oscillation
operating
mode
Note 2
f
XP
= 5 MHz
V
DD
= 3.0 V
10%
Note 3
When A/D converter is
operating
Note 4
2.8
6.5
mA
When peripheral functions are stopped
1.2
2.4
mA
f
XP
= 10 MHz
V
DD
= 5.0 V
10%
Note 3
When peripheral functions are operating
4.8
mA
When peripheral functions are stopped
0.7
1.4
mA
I
DD2
X1 crystal
oscillation HALT
mode
f
XP
= 5 MHz
V
DD
= 3.0 V
10%
Note 3
When peripheral functions are operating
2.8
mA
V
DD
= 5.0 V
10%
0.3
0.9
mA
I
DD3
Ring-OSC
operating
mode
Note 5
V
DD
= 3.0 V
10%
0.19
0.57
mA
V
DD
= 5.0 V
10%
45
90
A
I
DD4
32.768 kHz
crystal oscillation
operating
mode
Notes 5, 7
V
DD
= 3.0 V
10%
25
50
A
V
DD
= 5.0 V
10%
30
60
A
I
DD5
32.768 kHz
crystal oscillation
HALT mode
Notes 5, 7
V
DD
= 3.0 V
10%
7
21
A
POC: OFF, RING: OFF
0.1
30
A
POC: OFF, RING: ON
14
58
A
POC: ON
Note 6
, RING: OFF
3.5
35.5
A
V
DD
= 5.0 V
10%
POC: ON
Note 6
, RING: ON
17.5
63.5
A
POC: OFF, RING: OFF
0.05
10
A
POC: OFF, RING: ON
7.5
25
A
POC: ON
Note 6
, RING: OFF
3.5
15.5
A
Supply
current
Note 1
I
DD6
STOP mode
V
DD
= 3.0 V
10%
POC: ON
Note 6
, RING: ON
11
30.5
A
Notes 1.
Total current flowing through the internal power supply (V
DD
). Peripheral operation current is included
(however, the current that flows through the pull-up resistors of ports is not included).
2.
I
DD1
includes peripheral operation current.
3.
When PCC = 00H.
4.
Including the current that flows through the AV
REF
pin.
5.
When main system clock is stopped.
6.
Including when LVIE (bit 4 of LVIM) = 1 with POC-OFF selected by a mask option.
7.
When POC-OFF (including LVIE = 0) is selected by a mask option and Ring-OSC oscillation is stopped.
CHAPTER 25 ELECTRICAL SPECIFICATIONS (TARGET VALUES)
Preliminary User's Manual U16227EJ1V0UD
405
AC Characteristics
(1) Basic operation (T
A
=
-
-
-
-40 to +85C, 2.7 V V
DD
= EV
DD



5.5 V, 2.7 V AV
REF



V
DD
, V
SS
= EV
SS
= AV
SS
= 0 V)
Parameter
Symbol
Conditions
MIN.
TYP.
MAX.
Unit
4.0 V
V
DD
5.5 V
0.2
16
s
3.3 V
V
DD
< 4.0 V
0.238
16
s
X1 input
clock
2.7 V
V
DD
< 3.3 V
0.4
16
s
Main system
clock
operation
Ring-OSC clock
4.17
8.33
16.67
s
Instruction cycle (minimum
instruction execution time)
T
CY
Subsystem clock operation
114
122
125
s
4.0 V
V
DD
5.5 V
2/f
sam
+ 0.1
Note
s
TI000, TI010 input high-level
width, low-level width
t
TIH0
,
t
TIL0
2.7 V
V
DD
< 4.0 V
2/f
sam
+ 0.2
Note
s
4.0 V
V
DD
5.5 V
10
TI50, TI51 input frequency
f
TI5
2.7 V
V
DD
< 4.0 V
5
MHz
4.0 V
V
DD
5.5 V
50
ns
TI50, TI51 input high-level width,
low-level width
t
TIH5
,
t
TIL5
2.7 V
V
DD
< 4.0 V
100
ns
Interrupt input high-level width,
low-level width
t
INTH
,
t
INTL
1
s
4.0 V
V
DD
5.5 V
50
ns
Key return input low-level width
t
KR
2.7 V
V
DD
< 4.0 V
100
ns
RESET low-level width
t
RST
10
s
Note Selection of f
sam
= f
XP
, f
XP
/4, or f
XP
/256 is possible using bits 0 and 1 (PRM000, PRM001) of prescaler mode
register 00 (PRM00). Note that when selecting the TI000 or TI010 valid edge as the count clock, f
sam
= f
XP.
T
CY
vs. V
DD
(X1 Input Clock Operation)
5.0
1.0
2.0
0.4
0.2
0.1
Supply voltage V
DD
[V]
Cycle time T
CY
[ s]
0
10.0
1.0
2.0
3.0
4.0
5.0
6.0
5.5
2.7
3.3
Guaranteed
operation range
20.0
16.0
0.238
CHAPTER 25 ELECTRICAL SPECIFICATIONS (TARGET VALUES)
Preliminary User's Manual U16227EJ1V0UD
406
(2) Serial interface (T
A
=
-
-
-
-40 to +85C, 2.7 V V
DD
= EV
DD



5.5 V, 2.7 V AV
REF



V
DD
, V
SS
= EV
SS
= AV
SS
= 0 V)
(a) UART mode (UART6, dedicated baud rate generator output)
Parameter
Symbol
Conditions
MIN.
TYP.
MAX.
Unit
Transfer rate
312.5
kbps
(b) UART mode (UART0, dedicated baud rate generator output)
Parameter
Symbol
Conditions
MIN.
TYP.
MAX.
Unit
Transfer rate
312.5
kbps
(c) 3-wire serial I/O mode (master mode, SCK10... internal clock output)
Parameter
Symbol
Conditions
MIN.
TYP.
MAX.
Unit
4.0 V
V
DD
5.5 V
200
ns
3.3 V
V
DD
< 4.0 V
240
ns
SCK10 cycle time
t
KCY1
2.7 V
V
DD
< 3.3 V
400
ns
SCK10 high-/low-level width
t
KH1
,
t
KL1
t
KCY1
/2
- 10
ns
SI10 setup time (to SCK10
)
t
SIK1
30
ns
SI10 hold time (from SCK10
)
t
KSI1
30
ns
Delay time from SCK10
to
SO10 output
t
KSO1
C = 100 pF
Note
30
ns
Note C is the load capacitance of the SCK10 and SO10 output lines.
(d) 3-wire serial I/O mode (slave mode, SCK10... external clock input)
Parameter
Symbol
Conditions
MIN.
TYP.
MAX.
Unit
SCK10 cycle time
t
KCY2
400
ns
SCK10 high-/low-level width
t
KH2
,
t
KL2
t
KCY2
/2
ns
SI10 setup time (to SCK10
)
t
SIK2
80
ns
SI10 hold time (from SCK10
)
t
KSI2
50
ns
Delay time from SCK10
to
SO10 output
t
KSO2
C = 100 pF
Note
120
ns
Note C is the load capacitance of the SO10 output line.
CHAPTER 25 ELECTRICAL SPECIFICATIONS (TARGET VALUES)
Preliminary User's Manual U16227EJ1V0UD
407
AC Timing Test Points (Excluding X1 Input)
0.8V
DD
0.2V
DD
Test points
0.8V
DD
0.2V
DD
Clock Timing
X1 input
V
IH6
(MIN.)
V
IL6
(MAX.)
1/f
XP
t
XPL
t
XPH
1/f
XT
t
XTL
t
XTH
XT1 input
V
IH6
(MIN.)
V
IL6
(MAX.)
TI Timing
TI00, TI010
t
TIL0
t
TIH0
TI50, TI51
1/f
TI5
t
TIL5
t
TIH5
Interrupt Request Input Timing
INTP0 to INTP5
t
INTL
t
INTH
CHAPTER 25 ELECTRICAL SPECIFICATIONS (TARGET VALUES)
Preliminary User's Manual U16227EJ1V0UD
408
RESET Input Timing
RESET
t
RSL
Serial Transfer Timing
3-wire serial I/O mode:
SI10
SO10
t
KCYm
t
KLm
t
KHm
t
SIKm
t
KSIm
Input data
t
KSOm
Output data
SCK10
Remark
m = 1, 2
CHAPTER 25 ELECTRICAL SPECIFICATIONS (TARGET VALUES)
Preliminary User's Manual U16227EJ1V0UD
409
A/D Converter Characteristics
(T
A
=
-
-
-
-40 to +85C, 2.7 V V
DD
= EV
DD



5.5 V, 2.7 V AV
REF



V
DD
, V
SS
= EV
SS
= AV
SS
= 0 V)
Parameter
Symbol
Conditions
MIN.
TYP.
MAX.
Unit
Resolution
10
10
10
bit
4.0 V
AV
REF
5.5 V
0.2
0.4
%FSR
Overall error
Notes 1, 2
2.7 V
AV
REF
< 4.0 V
0.3
0.6
%FSR
4.0 V
AV
REF
5.5 V
14
100
s
Conversion time
t
CONV
2.7 V
AV
REF
< 4.0 V
17
100
s
4.0 V
AV
REF
5.5 V
0.4
%FSR
Zero-scale error
Notes 1, 2
2.7 V
AV
REF
< 4.0 V
0.6
%FSR
4.0 V
AV
REF
5.5 V
0.4
%FSR
Full-scale error
Notes 1, 2
2.7 V
AV
REF
< 4.0 V
0.6
%FSR
4.0 V
AV
REF
5.5 V
2.5
LSB
Integral non-linearity error
Note 1
2.7 V
AV
REF
< 4.0 V
4.5
LSB
4.0 V
AV
REF
5.5 V
1.5
LSB
Differential non-linearity error
Note 1
2.7 V
AV
REF
< 4.0 V
2.0
LSB
Analog input voltage
V
IAN
AV
SS
AV
REF
V
Notes 1.
Excludes quantization error (
1/2 LSB).
2.
This value is indicated as a ratio (%FSR) to the full-scale value.
POC Circuit Characteristics (T
A
=
-
-
-
-40 to +85C)
Parameter
Symbol
Conditions
MIN.
TYP.
MAX.
Unit
V
POC0
Mask option = 3.5 V
3.3
3.5
3.7
V
Detection voltage
V
POC1
Mask option = 2.85 V
2.7
2.85
3.0
V
V
DD
: 0 V
2.7 V
0.0015
1500
ms
Power supply rise time
t
PTH
V
DD
: 0 V
3.3 V
0.002
1800
ms
Response delay time 1
Note
t
PTHD
When power supply rises, after reaching
detection voltage (MAX.)
3.0
ms
Response delay time 2
Note
t
PD
When power supply falls, V
DD
= 1.7 V
1.0
ms
Minimum pulse width
t
PW
0.2
ms
Note Time required from voltage detection to reset release.
POC Circuit Timing
Supply voltage
(V
DD
)
Time
Detection voltage (MIN.)
Detection voltage (TYP.)
Detection voltage (MAX.)
t
PTH
t
PTHD
t
PW
t
PD
CHAPTER 25 ELECTRICAL SPECIFICATIONS (TARGET VALUES)
Preliminary User's Manual U16227EJ1V0UD
410
LVI Circuit Characteristics (T
A
=
-
-
-
-40 to +85C)
Parameter
Symbol
Conditions
MIN.
TYP.
MAX.
Unit
V
LVI0
4.1
4.3
4.5
V
V
LVI1
3.9
4.1
4.3
V
V
LVI2
3.7
3.9
4.1
V
V
LVI3
3.5
3.7
3.9
V
V
LVI4
3.3
3.5
3.7
V
V
LVI5
3.15
3.3
3.45
V
Detection voltage
V
LVI6
2.95
3.1
3.25
V
Response time
Note 1
t
LD
0.2
2.0
ms
Minimum pulse width
t
LW
0.2
ms
Reference voltage stabilization wait
time
Note 2
t
LWAIT0
0.5
2.0
ms
Operation stabilization wait time
Note 3
t
LWAIT1
0.1
0.2
ms
Notes 1.
Time required from voltage detection to interrupt output or RESET output.
2.
Time required from setting LVIE to 1 to reference voltage stabilization when POC = OFF is selected by
the POC mask option.
3.
Time required from setting LVION to 1 to operation stabilization.
Remarks 1. V
LVI0
> V
LVI1
> V
LVI2
> V
LVI3
> V
LVI4
> V
LVI5
> V
LVI6
2. V
POCn
< V
LVm
(n = 0, 1, m = 0 to 6)
LVI Circuit Timing
Supply voltage
(V
DD
)
Time
Detection voltage (MIN.)
Detection voltage (TYP.)
Detection voltage (MAX.)
t
WAIT0
t
LW
t
LD
t
WAIT1
LVIE
1 LVION 1
Data Memory STOP Mode Low Supply Voltage Data Retention Characteristics (T
A
=
-
-
-
-40 to +85C)
Parameter
Symbol
Conditions
MIN.
TYP.
MAX.
Unit
Data retention supply voltage
V
DDDR
1.6
5.5
V
Release signal set time
t
SREL
0
s
CHAPTER 25 ELECTRICAL SPECIFICATIONS (TARGET VALUES)
Preliminary User's Manual U16227EJ1V0UD
411
Flash Memory Programming Characteristics:



PD78F0114
(T
A
= +10 to +60



C, 2.7 V V
DD
= EV
DD



5.5 V, 2.7 V AV
REF



V
DD
, V
SS
= EV
SS
= AV
SS
= 0 V)
(1) Write erase characteristics
Parameter
Symbol
Conditions
MIN.
TYP.
MAX.
Unit
V
PP
supply voltage
V
PP2
During flash memory programming
9.7
10.0
10.3
V
V
DD
supply current
I
DD
When V
PP
= V
PP2
, f
XP
= 10 MHz, V
DD
= 5.5 V
37
mA
V
PP
supply current
I
PP
V
PP
= V
PP2
100
mA
Step erase time
Note 1
T
er
0.199
0.2
0.201
s
Overall erase time
Note 2
T
era
When step erase time = 0.2 s
20
s/chip
Writeback time
Note 3
T
wb
49.4
50
50.6
ms
Number of writebacks per
writeback command
Note 4
C
wb
When writeback time = 50 ms
60
Times
Number of erases/writebacks
C
erwb
16
Times
Step write time
Note 5
T
wr
48
50
52
s
Overall write time per word
Note 6
T
wrw
When step write time = 50
s (1 word = 1
byte)
48
520
s
Number of rewrites per chip
Note 7
C
erwr
1 erase + 1 write after erase = 1 rewrite
20
Times
Notes 1.
The recommended setting value of the step erase time is 0.2 s.
2.
The prewrite time before erasure and the erase verify time (writeback time) are not included.
3.
The recommended setting value of the writeback time is 50 ms.
4.
Writeback is executed once by the issuance of the writeback command. Therefore, the number of retries
must be the maximum value minus the number of commands issued.
5.
The recommended setting value of the step write time is 50
s.
6.
The actual write time per word is 100
s longer. The internal verify time during or after a write is not
included.
7.
When a product is first written after shipment, "erase
write" and "write only" are both taken as one
rewrite.
Example: P: Write, E: Erase
Shipped product
P E P E P: 3 rewrites
Shipped product
E P E P E P: 3 rewrites
Remark
The range of the operating clock during flash memory programming is the same as the range during normal
operation.
CHAPTER 25 ELECTRICAL SPECIFICATIONS (TARGET VALUES)
Preliminary User's Manual U16227EJ1V0UD
412
(2) Serial write operation characteristics
Parameter
Symbol
Conditions
MIN.
TYP.
MAX.
Unit
Set time from V
DD
to V
PP
t
DP
10
s
Release time from V
PP
to RESET
t
PR
10
s
V
PP
pulse input start time from RESET
t
RP
2
ms
V
PP
pulse high-/low-level width
t
PW
8
s
V
PP
pulse input end time from RESET
t
RPE
20
ms
V
PP
pulse low-level input voltage
V
PPL
0.8V
DD
1.2V
DD
V
V
PP
pulse high-level input voltage
V
PPH
9.7
10.0
10.3
V
Flash Write Mode Setting Timing
V
DD
V
DD
0 V
V
DD
RESET (input)
0 V
V
PPH
V
PPL
V
PP
V
PP
t
RP
t
PR
t
DP
t
PW
t
PW
t
RPE
Preliminary User's Manual U16227EJ1V0UD
413
CHAPTER 26 PACKAGE DRAWING
33
34
22
44
1
12
11
23
44 PIN PLASTIC LQFP (10x10)
ITEM
MILLIMETERS
N
Q
0.1
0.05
0.10
S44GB-80-8ES-2
J
I
H
N
A
12.0
0.2
B
10.0
0.2
C
10.0
0.2
D
12.0
0.2
F
G
H
1.0
0.37
1.0
I
J
K
0.8 (T.P.)
1.0
0.2
0.20
L
0.5
M
0.17
S
T
U
1.6 MAX.
0.25 (T.P.)
0.6
0.15
R
3
+0.08
-0.07
+0.03
-0.06
+4
-3
detail of lead end
F
G
K
M
M
P
1.4
0.05
NOTE
S
S
A
B
C
D
U
R
S
P
Q
L
T
Each lead centerline is located within 0.20 mm of
its true position (T.P.) at maximum material condition.
Preliminary User's Manual U16227EJ1V0UD
414
CHAPTER 27 CAUTIONS FOR WAIT
27.1 Cautions for Wait
This product has two internal system buses.
One is a CPU bus and the other is a peripheral bus that interfaces with the low-speed peripheral hardware.
Because the clock of the CPU bus and the clock of the peripheral bus are asynchronous, unexpected illegal data
may be passed if an access to the CPU conflicts with an access to the peripheral hardware.
When accessing the peripheral hardware that may cause a conflict, therefore, the CPU repeatedly executes
processing, until the correct data is passed.
As a result, the CPU does not start the next instruction processing but waits. If this happens, the number of
execution clocks of an instruction increases by the number of wait clocks (for the number of wait clocks, refer to Table
27-1). This must be noted when real-time processing is performed.
CHAPTER 27 CAUTIONS FOR WAIT
Preliminary User's Manual U16227EJ1V0UD
415
27.2 Peripheral Hardware That Generates Wait
Table 27-1 lists the registers that issue a wait when accessed by the CPU, and the number of CPU wait clocks.
Table 27-1. Registers That Generate Wait and Number of CPU Wait Clocks
Peripheral Hardware
Register
Access
Number of Wait Clocks
Watchdog timer
WDTM
Write
3 clocks (fixed)
Serial interface UART0
ASIS0
Read
1 clock (fixed)
Serial interface UART6
ASIS6
Read
1 clock (fixed)
ADM
Write
ADS
Write
PFM
Write
PFT
Write
2 to 5 clocks
Note
(when ADM.5 flag = "1")
2 to 9 clocks
Note
(when ADM.5 flag = "0")
ADCR
Read
1 to 5 clocks
(when ADM.5 flag = "1")
1 to 9 clocks
(when ADM.5 flag = "0")
A/D converter
<Calculating maximum number of wait clocks>
{(1/f
MACRO
)
2/(1/f
CPU
)} + 1
*The result after the decimal point is truncated if it is less than t
CPUL
after it has been multiplied by
(1/f
CPU
), and is rounded up if it exceeds t
CPUL
.
f
MACRO
:
Macro operating frequency
(When bit 5 (FR2) of ADM = "1": f
X
/2, when bit 5 (FR2) of ADM = "0": f
X
/2
2
)
f
CPU
:
CPU clock frequency
t
CPUL
:
Low-level width of CPU clock
Note No wait cycle is generated for the CPU if the number of wait clocks calculated by the above expression is 1.
Remark
The clock is the CPU clock (f
CPU
).
CHAPTER 27 CAUTIONS FOR WAIT
Preliminary User's Manual U16227EJ1V0UD
416
27.3 Example of Wait Occurrence
<1> Watchdog timer
<On execution of MOV WDTM, A>
Number of execution clocks: 8
(5 clocks when data is written to a register that does not issue a wait (MOV sfr, A).)
<On execution of MOV WDTM, #byte>
Number of execution clocks: 10
(7 clocks when data is written to a register that does not issue a wait (MOV sfr, #byte).)
<2> Serial interface UART6
<On execution of MOV A, ASIS6>
Number of execution clocks: 6
(5 clocks when data is read from a register that does not issue a wait (MOV A, sfr).)
<3> A/D converter
Table 27-2. Number of Wait Clocks and Number of Execution Clocks on Occurrence of Wait (A/D Converter)
<On execution of MOV ADM, A; MOV ADS, A; or MOV A, ADCR>
When f
X
= 10 MHz, t
CPUL
= 50 ns
Value of Bit 5 (FR2)
of ADM Register
f
CPU
Number of Wait Clocks
Number of Execution Clocks
f
X
9 clocks
14 clocks
f
X
/2
5 clocks
10 clocks
f
X
/2
2
3 clocks
8 clocks
f
X
/2
3
2 clocks
7 clocks
0
f
X
/2
4
0 clocks (1 clock
Note
)
5 clocks (6 clocks
Note
)
f
X
5 clocks
10 clocks
f
X
/2
3 clocks
8 clocks
f
X
/2
2
2 clocks
7 clocks
f
X
/2
3
0 clocks (1 clock
Note
)
5 clocks (6 clocks
Note
)
1
f
X
/2
4
0 clocks (1 clock
Note
)
5 clocks (6 clocks
Note
)
Note On execution of MOV A, ADCR
Remark
The clock is the CPU clock (f
CPU
).
f
X
:
X1 input clock frequency
t
CPUL
: Low-level width of CPU clock
Preliminary User's Manual U16227EJ1V0UD
417
APPENDIX A DEVELOPMENT TOOLS
The following development tools are available for the development of systems that employ the 78K0/KC1 Series.
Figure A-1 shows the development tool configuration.



Support for PC98-NX series
Unless otherwise specified, products supported by IBM PC/AT
TM
compatibles are compatible with PC98-NX
series computers. When using PC98-NX series computers, refer to the explanation for IBM PC/AT compatibles.



Windows
Unless otherwise specified, "Windows" means the following OSs.
Windows 3.1
Windows 95, 98, 2000
Windows NT
TM
Ver 4.0
APPENDIX A DEVELOPMENT TOOLS
Preliminary User's Manual U16227EJ1V0UD
418
Figure A-1. Development Tool Configuration
System simulator
Integrated debugger
Device file
Embedded Software
Real-time OS
Debugging Tool
Assembler package
C compiler package
C library source file
Device file
Language Processing Software
Flash memory
write adapter
In-Circuit Emulator
Power supply unit
Emulation probe
Conversion socket or
conversion adapter
Target system
Host Machine (PC)
Interface adapter,
PC card interface, etc.
Emulation board
On-chip flash
memory version
Flash Memory
Write Environment
Flash programmer
Performance board
Remark
The item in the broken-line box differs according to the development environment. See A.4.1
Hardware.
APPENDIX A DEVELOPMENT TOOLS
Preliminary User's Manual U16227EJ1V0UD
419
A.1 Software Package
Development tools (software) common to the 78K/0 Series are combined in this package.
SP78K0
78K/0 Series software package
Part number:
SSP78K0
Remark
in the part number differs depending on the host machine and OS used.
SSP78K0
Host Machine
OS
Supply Medium
AB17
Windows (Japanese version)
BB17
PC-9800 series,
IBM PC/AT compatibles
Windows (English version)
CD-ROM
APPENDIX A DEVELOPMENT TOOLS
Preliminary User's Manual U16227EJ1V0UD
420
A.2 Language Processing Software
This assembler converts programs written in mnemonics into object codes executable
with a microcontroller.
This assembler is also provided with functions capable of automatically creating symbol
tables and branch instruction optimization.
This assembler should be used in combination with a device file (DF780114) (sold
separately).
<Precaution when using RA78K0 in PC environment>
This assembler package is a DOS-based application. It can also be used in Windows,
however, by using the Project Manager (included in assembler package) on Windows.
RA78K0
Assembler package
Part number:
SRA78K0
This compiler converts programs written in C language into object codes executable with
a microcontroller.
This compiler should be used in combination with an assembler package and device file
(both sold separately).
<Precaution when using CC78K0 in PC environment>
This C compiler package is a DOS-based application. It can also be used in Windows,
however, by using the Project Manager (included in assembler package) on Windows.
CC78K0
C compiler package
Part number:
SCC78K0
This file contains information peculiar to the device.
This device file should be used in combination with a tool (RA78K0, CC78K0, SM78K0,
ID78K0-NS, and ID78K0) (all sold separately).
The corresponding OS and host machine differ depending on the tool to be used (all sold
separately).
DF780114
Notes 1, 2
Device file
Part number:
SDF780114
This is a source file of the functions that configure the object library included in the C
compiler package (CC78K0).
This file is required to match the object library included in the C compiler package to the
user's specifications.
CC78K/0-L
Note 3
C library source file
Part number:
SCC78K0-L
Notes 1.
The DF780114 can be used in common with the RA78K0, CC78K0, SM78K0, ID78K0-NS, and
ID78K0.
2.
Under development
3.
The CC78K0-L is not included in the software package (SP78K0).
APPENDIX A DEVELOPMENT TOOLS
Preliminary User's Manual U16227EJ1V0UD
421
Remark
in the part number differs depending on the host machine and OS used.
SRA78K0
SCC78K0
Host Machine
OS
Supply Medium
AB13
Windows (Japanese version)
BB13
Windows (English version)
3.5-inch 2HD FD
AB17
Windows (Japanese version)
BB17
PC-9800 series,
IBM PC/AT compatibles
Windows (English version)
3P17
HP9000 series 700
TM
HP-UX
TM
(Rel. 10.10)
3K17
SPARCstation
TM
SunOS
TM
(Rel. 4.1.4)
Solaris
TM
(Rel. 2.5.1)
CD-ROM
SDF780114
SCC78K0-L
Host Machine
OS
Supply Medium
AB13
Windows (Japanese version)
BB13
PC-9800 series,
IBM PC/AT compatibles
Windows (English version)
3.5-inch 2HD FD
3P16
HP9000 series 700
HP-UX (Rel. 10.10)
DAT
3K13
3.5-inch 2HD FD
3K15
SPARCstation
SunOS (Rel. 4.1.4)
Solaris (Rel. 2.5.1)
1/4-inch CGMT
A.3 Flash Memory Writing Tools
Flashpro III
(part number: FL-PR3, PG-FP3)
Flashpro IV
(part number: FL-PR4, PG-FP4)
Flash programmer
Flash programmer dedicated to microcontrollers with on-chip flash memory.
FA-44GB-8ES
Flash memory writing adapter
Flash memory writing adapter used connected to the Flashpro III/Flashpro IV.
FA-44GB-8ES: For 44-pin plastic LQFP (GB-8ES type)
Remark
FL-PR3, FL-PR4, and FA-44GB-8ES are products of Naito Densei Machida Mfg. Co., Ltd.
TEL: +81-45-475-4191 Naito Densei Machida Mfg. Co., Ltd.
APPENDIX A DEVELOPMENT TOOLS
Preliminary User's Manual U16227EJ1V0UD
422
A.4 Debugging Tools
A.4.1 Hardware
IE-78K0-NS
In-circuit emulator
The in-circuit emulator serves to debug hardware and software when developing
application systems using a 78K/0 Series product. It corresponds to the integrated
debugger (ID78K0-NS). This emulator should be used in combination with a power
supply unit, emulation probe, and the interface adapter required to connect this emulator
to the host machine.
IE-78K0-NS-PA
Performance board
This board is connected to the IE-78K0-NS to expand its functions. Adding this board
adds a coverage function and enhances debugging functions such as tracer and timer
functions.
IE-78K0-NS-A
In-circuit emulator
Product that combines the IE-78K0-NS and IE-78K0-NS-PA
IE-70000-MC-PS-B
Power supply unit
This adapter is used for supplying power from a 100 V to 240 V AC outlet.
IE-70000-98-IF-C
Interface adapter
This adapter is required when using a PC-9800 series computer (except notebook type)
as the IE-78K0-NS(-A) host machine (C bus compatible).
IE-70000-CD-IF-A
PC card interface
This is PC card and interface cable required when using a notebook-type computer as
the IE-78K0-NS(-A) host machine (PCMCIA socket compatible).
IE-70000-PC-IF-C
Interface adapter
This adapter is required when using an IBM PC compatible computer as the IE-78K0-
NS(-A) host machine (ISA bus compatible).
IE-70000-PCI-IF-A
Interface adapter
This adapter is required when using a computer with a PCI bus as the IE-78K0-NS(-A)
host machine.
IE-780148-NS-EM1
Note
Emulation board
This board emulates the operations of the peripheral hardware peculiar to a device. It
should be used in combination with an in-circuit emulator.
NP-44GB-TQ
Emulation probe
This probe is used to connect the in-circuit emulator to a target system and is designed
for use with 44-pin plastic LQFP (GB-8ES type).
TGB-044SAP
Conversion adapter
This conversion socket connects the NP-44BG-TQ to a target system board designed for
a 44-pin plastic LQFP (GB-8ES type).
Note Under development
Remarks 1. NP-44GB-TQ is a product of Naito Densei Machida Mfg. Co., Ltd.
TEL: +81-45-475-4191 Naito Densei Machida Mfg. Co., Ltd.
2. TGB-044SAP is a product made by TOKYO ELETECH CORPORATION.
For further information, contact: Daimaru Kogyo, Ltd.
Tokyo Electronics Department (TEL +81-3-3820-7112)
Osaka Electronics Department (TEL +81-6-6244-6672)
APPENDIX A DEVELOPMENT TOOLS
Preliminary User's Manual U16227EJ1V0UD
423
A.4.2 Software
This system simulator is used to perform debugging at C source level or assembler level
while simulating the operation of the target system on a host machine.
This simulator runs on Windows.
Use of the SM78K0 allows the execution of application logical testing and performance
testing on an independent basis from hardware development without having to use an in-
circuit emulator, thereby providing higher development efficiency and software quality.
The SM78K0 should be used in combination with a device file (DF780114) (sold
separately).
SM78K0
System simulator
Part number:
SSM78K0
This debugger is a control program used to debug 78K/0 Series microcontrollers.
It adopts a graphical user interface, which is equivalent visually and operationally to
Windows or OSF/Motif
TM
. It also has an enhanced debugging function for C language
programs, and thus trace results can be displayed on screen at C-language level by
using the windows integration function which links a trace result with its source program,
disassembled display, and memory display. In addition, by incorporating function
modules such as a task debugger and system performance analyzer, the efficiency of
debugging programs that run on real-time OSs can be improved.
It should be used in combination with a device file (sold separately).
ID78K0-NS
Integrated debugger
(supporting in-circuit emulator
IE-78K0-NS(-A))
Part number:
SID78K0-NS
Remark
in the part number differs depending on the host machine and OS used.
SSM78K0
SID78K0-NS
Host Machine
OS
Supply Medium
AB13
Windows (Japanese version)
BB13
Windows (English version)
3.5-inch 2HD FD
AB17
Windows (Japanese version)
BB17
PC-9800 series,
IBM PC/AT compatibles
Windows (English version)
CD-ROM
Preliminary User's Manual U16227EJ1V0UD
424
APPENDIX B EMBEDDED SOFTWARE
The following embedded products are available for efficient development and maintenance of the 78K0/KC1
Series.
Real-Time OS
The RX78K0 is a real-time OS conforming to the
ITRON specifications.
A tool (configurator) for generating the nucleus of the RX78K0 and multiple information
tables is supplied.
Used in combination with an assembler package (RA78K0) and device file (DF780114)
(both sold separately).
<Precaution when using RX78K0 in PC environment>
The real-time OS is a DOS-based application. It should be used in the DOS prompt when
using it in Windows.
RX78K0
Real-time OS
Part number:
SRX78013-
Caution To purchase the RX78K0, first fill in the purchase application form and sign the user agreement.
Remark
and in the part number differ depending on the host machine and OS used.
SRX78013-
Product Outline
Maximum Number for Use in Mass Production
001
Evaluation object
Do not use for mass-produced product.
100K
0.1 million units
001M
1 million units
010M
Mass-production object
10 million units
S01
Source program
Object source program for mass production
Host Machine
OS
Supply Medium
AA13
PC-9800 series
Windows (Japanese version)
Note
3.5-inch 2HD FD
AB13
Windows (Japanese version)
Note
BB13
IBM PC/AT compatibles
Windows (English version)
Note
3.5-inch 2HD FD
3P16
HP9000 series 700
HP-UX (Rel. 10.10)
DAT
3K13
3.5-inch 2HD FD
3K15
SPARCstation
SunOS (Rel. 4.1.4),
Solaris (Rel. 2.5.1)
1/4-inch CGMT
Note Can also be operated in DOS environment.
Preliminary User's Manual U16227EJ1V0UD
425
APPENDIX C REGISTER INDEX
C.1 Register Index (In Alphabetical Order with Respect to Register Names)
[A]
A/D conversion result register (ADCR) .......................................................................................................................216
A/D converter mode register (ADM)............................................................................................................................218
Analog input channel specification register (ADS) ......................................................................................................220
Asynchronous serial interface control register 6 (ASICL6)..................................................................................271, 278
Asynchronous serial interface operation mode register 0 (ASIM0) .............................................................239, 243, 244
Asynchronous serial interface operation mode register 6 (ASIM6) .............................................................265, 273, 274
Asynchronous serial interface reception error status register 0 (ASIS0).............................................................241, 246
Asynchronous serial interface reception error status register 6 (ASIS6).............................................................267, 276
Asynchronous serial interface transmission status register 6 (ASIF6) ................................................................268, 277
[B]
Baud rate generator control register 0 (BRGC0).................................................................................................242, 253
Baud rate generator control register 6 (BRGC6).................................................................................................270, 295
[C]
Capture/compare control register 00 (CRC00) ...........................................................................................................132
Clock monitor mode register (CLM) ............................................................................................................................351
Clock selection register 6 (CKSR6).....................................................................................................................269, 294
[E]
8-bit timer compare register 50 (CR50).......................................................................................................................161
8-bit timer compare register 51 (CR51).......................................................................................................................161
8-bit timer counter 50 (TM50) .....................................................................................................................................161
8-bit timer counter 51 (TM51) .....................................................................................................................................161
8-bit timer H carrier control register 1 (TMCYC1)........................................................................................................180
8-bit timer H compare register 00 (CMP00) ................................................................................................................177
8-bit timer H compare register 01 (CMP01) ................................................................................................................177
8-bit timer H compare register 10 (CMP10) ................................................................................................................177
8-bit timer H compare register 11 (CMP11) ................................................................................................................177
8-bit timer H mode register 0 (TMHMD0) ....................................................................................................................178
8-bit timer H mode register 1 (TMHMD1) ....................................................................................................................178
8-bit timer mode control register 50 (TMC50) .............................................................................................................164
8-bit timer mode control register 51 (TMC51) .............................................................................................................164
External interrupt falling edge enable register (EGN)..................................................................................................322
External interrupt rising edge enable register (EGP)...................................................................................................322
[I]
Input switch control register (ISC) .................................................................................................................................99
Internal memory size switching register (IMS) ............................................................................................................374
Interrupt mask flag register 0H (MK0H) ......................................................................................................................320
Interrupt mask flag register 0L (MK0L)........................................................................................................................320
Interrupt mask flag register 1L (MK1L)........................................................................................................................320
APPENDIX C REGISTER INDEX
Preliminary User's Manual U16227EJ1V0UD
426
Interrupt request flag register 0H (IF0H) .................................................................................................................... 319
Interrupt request flag register 0L (IF0L)...................................................................................................................... 319
Interrupt request flag register 1L (IF1L)...................................................................................................................... 319
[K]
Key return mode register (KRM) ................................................................................................................................ 332
[L]
Low-voltage detection level selection register (LVIS)................................................................................................. 363
Low-voltage detection register (LVIM)........................................................................................................................ 362
[M]
Main clock mode register (MCM) ............................................................................................................................... 106
Main OSC control register (MOC) .............................................................................................................................. 107
[O]
Oscillation stabilization time counter status register (OSTC) ..............................................................................107, 335
Oscillation stabilization time select register (OSTS)............................................................................................108, 336
[P]
Port 0 (P0).................................................................................................................................................................... 81
Port 1 (P1).................................................................................................................................................................... 83
Port 12 (P12)................................................................................................................................................................ 94
Port 13 (P13)................................................................................................................................................................ 95
Port 2 (P2).................................................................................................................................................................... 89
Port 3 (P3).................................................................................................................................................................... 90
Port 6 (P6).................................................................................................................................................................... 92
Port 7 (P7).................................................................................................................................................................... 93
Port mode register 0 (PM0) ...................................................................................................................................96, 135
Port mode register 1 (PM1) ...................................................................................................................................96, 167
Port mode register 12 (PM12) ...................................................................................................................................... 96
Port mode register 3 (PM3) ...................................................................................................................................96, 167
Port mode register 6 (PM6) .......................................................................................................................................... 96
Port mode register 7 (PM7) .......................................................................................................................................... 96
Power-fail comparison mode register (PFM) .............................................................................................................. 221
Power-fail comparison threshold register (PFT) ......................................................................................................... 221
Prescaler mode register 00 (PRM00)......................................................................................................................... 134
Priority specification flag register 0H (PR0H) ............................................................................................................. 321
Priority specification flag register 0L (PR0L) .............................................................................................................. 321
Priority specification flag register 1L (PR1L) .............................................................................................................. 321
Processor clock control register (PCC) ...................................................................................................................... 103
Pull-up resistor option register 0 (PU0) ........................................................................................................................ 98
Pull-up resistor option register 1 (PU1) ........................................................................................................................ 98
Pull-up resistor option register 12 (PU12) .................................................................................................................... 98
Pull-up resistor option register 3 (PU3) ........................................................................................................................ 98
Pull-up resistor option register 7 (PU7) ........................................................................................................................ 98
[R]
Receive buffer register 0 (RXB0) ............................................................................................................................... 238
APPENDIX C REGISTER INDEX
Preliminary User's Manual U16227EJ1V0UD
427
Receive buffer register 6 (RXB6) ................................................................................................................................264
Reset control flag register (RESF) ..............................................................................................................................349
Ring-OSC mode register (RCM) .................................................................................................................................105
[S]
Serial clock selection register 10 (CSIC10).........................................................................................................304, 307
Serial I/O shift register 10 (SIO10) ..............................................................................................................................302
Serial operation mode register 10 (CSIM10)...............................................................................................303, 305, 306
16-bit timer capture/compare register 000 (CR000)....................................................................................................128
16-bit timer capture/compare register 010 (CR010)....................................................................................................129
16-bit timer counter 00 (TM00) ...................................................................................................................................128
16-bit timer mode control register 00 (TMC00) ...........................................................................................................130
16-bit timer output control register 00 (TOC00) ..........................................................................................................132
[T]
Timer clock selection register 50 (TCL50) ..................................................................................................................162
Timer clock selection register 51 (TCL51) ..................................................................................................................162
Transmit buffer register 10 (SOTB10).........................................................................................................................302
Transmit buffer register 6 (TXB6)................................................................................................................................264
Transmit shift register 0 (TXS0) ..................................................................................................................................238
[W]
Watch timer operation mode register (WTM) ..............................................................................................................199
Watchdog timer enable register (WDTE) ....................................................................................................................208
Watchdog timer mode register (WDTM) .....................................................................................................................207
APPENDIX C REGISTER INDEX
Preliminary User's Manual U16227EJ1V0UD
428
C.2 Register Index (In Alphabetical Order with Respect to Register Symbol)
[A]
ADCR:
A/D conversion result register ................................................................................................................ 216
ADM:
A/D converter mode register................................................................................................................... 218
ADS:
Analog input channel specification register ............................................................................................ 220
ASICL6:
Asynchronous serial interface control register 6..............................................................................271, 278
ASIF6:
Asynchronous serial interface transmission status register 6 ..........................................................268, 277
ASIM0:
Asynchronous serial interface operation mode register 0........................................................239, 243, 244
ASIM6:
Asynchronous serial interface operation mode register 6........................................................265, 273, 274
ASIS0:
Asynchronous serial interface reception error status register 0.......................................................241, 246
ASIS6:
Asynchronous serial interface reception error status register 6.......................................................267, 276
[B]
BRGC0:
Baud rate generator control register 0 .............................................................................................242, 253
BRGC6:
Baud rate generator control register 6 .............................................................................................270, 295
[C]
CKSR6:
Clock selection register 6 ................................................................................................................269, 294
CLM:
Clock monitor mode register................................................................................................................... 351
CMP00:
8-bit timer H compare register 00 ........................................................................................................... 177
CMP01:
8-bit timer H compare register 01 ........................................................................................................... 177
CMP10:
8-bit timer H compare register 10 ........................................................................................................... 177
CMP11:
8-bit timer H compare register 11 ........................................................................................................... 177
CR000:
16-bit timer capture/compare register 000.............................................................................................. 128
CR010:
16-bit timer capture/compare register 010.............................................................................................. 129
CR50:
8-bit timer compare register 50............................................................................................................... 161
CR51:
8-bit timer compare register 51............................................................................................................... 161
CRC00:
Capture/compare control register 00 ...................................................................................................... 132
CSIC10:
Serial clock selection register 10 .....................................................................................................304, 307
CSIM10:
Serial operation mode register 10 ...........................................................................................303, 305, 306
[E]
EGN:
External interrupt falling edge enable register ........................................................................................ 322
EGP:
External interrupt rising edge enable register ......................................................................................... 322
[I]
IF0H:
Interrupt request flag register 0H............................................................................................................ 319
IF0L:
Interrupt request flag register 0L ............................................................................................................ 319
IF1L:
Interrupt request flag register 1L ............................................................................................................ 319
IMS:
Internal memory size switching register.................................................................................................. 374
ISC:
Input switch control register...................................................................................................................... 99
[K]
KRM:
Key return mode register ........................................................................................................................ 332
[L]
LVIM:
Low-voltage detection register................................................................................................................ 362
LVIS:
Low-voltage detection level selection register ........................................................................................ 363
APPENDIX C REGISTER INDEX
Preliminary User's Manual U16227EJ1V0UD
429
[M]
MCM:
Main clock mode register ........................................................................................................................106
MK0H:
Interrupt mask flag register 0H ................................................................................................................320
MK0L:
Interrupt mask flag register 0L.................................................................................................................320
MK1L:
Interrupt mask flag register 1L.................................................................................................................320
MOC:
Main OSC control register .......................................................................................................................107
[O]
OSTC:
Oscillation stabilization time counter status register........................................................................107, 335
OSTS:
Oscillation stabilization time select register .....................................................................................108, 336
[P]
P0:
Port 0 ........................................................................................................................................................81
P1:
Port 1 ........................................................................................................................................................83
P12:
Port 12 ......................................................................................................................................................94
P13:
Port 13 ......................................................................................................................................................95
P2:
Port 2 ........................................................................................................................................................89
P3:
Port 3 ........................................................................................................................................................90
P6:
Port 6 ........................................................................................................................................................92
P7:
Port 7 ........................................................................................................................................................93
PCC:
Processor clock control register ..............................................................................................................103
PFM:
Power-fail comparison mode register ......................................................................................................221
PFT:
Power-fail comparison threshold register ................................................................................................221
PM0:
Port mode register 0..........................................................................................................................96, 135
PM1:
Port mode register 1..........................................................................................................................96, 167
PM12:
Port mode register 12................................................................................................................................96
PM3:
Port mode register 3..........................................................................................................................96, 167
PM6:
Port mode register 6..................................................................................................................................96
PM7:
Port mode register 7..................................................................................................................................96
PR0H:
Priority specification flag register 0H .......................................................................................................321
PR0L:
Priority specification flag register 0L........................................................................................................321
PR1L:
Priority specification flag register 1L........................................................................................................321
PRM00:
Prescaler mode register 00 .....................................................................................................................134
PU0:
Pull-up resistor option register 0................................................................................................................98
PU1:
Pull-up resistor option register 1................................................................................................................98
PU12:
Pull-up resistor option register 12..............................................................................................................98
PU3:
Pull-up resistor option register 3................................................................................................................98
PU7:
Pull-up resistor option register 7................................................................................................................98
[R]
RCM:
Ring-OSC mode register .........................................................................................................................105
RESF:
Reset control flag register .......................................................................................................................349
RXB0:
Receive buffer register 0 .........................................................................................................................238
RXB6:
Receive buffer register 6 .........................................................................................................................264
[S]
SIO10:
Serial I/O shift register 10........................................................................................................................302
SOTB10:
Transmit buffer register 10 ......................................................................................................................302
APPENDIX C REGISTER INDEX
Preliminary User's Manual U16227EJ1V0UD
430
[T]
TCL50:
Timer clock selection register 50 ............................................................................................................ 162
TCL51:
Timer clock selection register 51 ............................................................................................................ 162
TM00:
16-bit timer counter 00............................................................................................................................ 128
TM50:
8-bit timer counter 50 ............................................................................................................................. 161
TM51:
8-bit timer counter 51 ............................................................................................................................. 161
TMC00:
16-bit timer mode control register 00 ...................................................................................................... 130
TMC50:
8-bit timer mode control register 50 ........................................................................................................ 164
TMC51:
8-bit timer mode control register 51 ........................................................................................................ 164
TMCYC1:
8-bit timer H carrier control register 1 ..................................................................................................... 180
TMHMD0:
8-bit timer H mode register 0 .................................................................................................................. 178
TMHMD1:
8-bit timer H mode register 1 .................................................................................................................. 178
TOC00:
16-bit timer output control register 00 ..................................................................................................... 132
TXB6:
Transmit buffer register 6 ....................................................................................................................... 264
TXS0:
Transmit shift register 0 .......................................................................................................................... 238
[W]
WDTE:
Watchdog timer enable register.............................................................................................................. 208
WDTM:
Watchdog timer mode register ............................................................................................................... 207
WTM:
Watch timer operation mode register ..................................................................................................... 199
Although NEC has taken all possible steps
to ensure that the documentation supplied
to our customers is complete, bug free
and up-to-date, we readily accept that
errors may occur. Despite all the care and
precautions we've taken, you may
encounter problems in the documentation.
Please complete this form whenever
you'd like to report errors or suggest
improvements to us.
Hong Kong, Philippines, Oceania
NEC Electronics Hong Kong Ltd.
Fax: +852-2886-9022/9044
Korea
NEC Electronics Hong Kong Ltd.
Seoul Branch
Fax: +82-2-528-4411
P.R. China
NEC Electronics Shanghai, Ltd.
NEC Electronics Taiwan Ltd.
Fax: +86-21-6841-1137
Address
North America
NEC Electronics Inc.
Corporate Communications Dept.
Fax: +1-800-729-9288
+1-408-588-6130
Europe
NEC Electronics (Europe) GmbH
Market Communication Dept.
Fax: +49-211-6503-274
South America
NEC do Brasil S.A.
Fax: +55-11-6462-6829
Taiwan
Asian Nations except Philippines
NEC Electronics Singapore Pte. Ltd.
Fax: +886-2-2719-5951
Fax: +65-250-3583
Japan
NEC Semiconductor Technical Hotline
Fax: +81- 44-435-9608
I would like to report the following error/make the following suggestion:
Document title:
Document number:
Page number:
Thank you for your kind support.
If possible, please fax the referenced page or drawing.
Excellent
Good
Acceptable
Poor
Document Rating
Clarity
Technical Accuracy
Organization
CS 02.3
Name
Company
From:
Tel.
FAX
Facsimile
Message