μPD780058 Micro controllers
μPD780058 Micro controllers
µPD780053 µPD780053Y
µPD780054 µPD780054Y
µPD780055 µPD780055Y
µPD780056 µPD780056Y
µPD780058 µPD780058BY
µPD780058B µPD78F0058Y
µPD78F0058 µPD780053Y(A)
µPD780053(A) µPD780054Y(A)
µPD780054(A) µPD780055Y(A)
µPD780055(A) µPD780056Y(A)
µPD780056(A) µPD780058BY(A)
µPD780058B(A)
Document No. U12013EJ3V2UD00 (3rd edition)
Date Published February 2003 N CP (K)
1997, 2003
Printed in Japan
[MEMO]
Purchase of NEC Electronics I2C components conveys a license under the Philips I2C Patent Rights to use
these components in an I2C system, provided that the system conforms to the I2C Standard Specification as
defined by Philips.
• The information in this document is current as of January, 2003. The information is subject to
change without notice. For actual design-in, refer to the latest publications of NEC Electronics data
sheets or data books, etc., for the most up-to-date specifications of NEC Electronics products. Not
all products and/or types are available in every country. Please check with an NEC Electronics sales
representative for availability and additional information.
• No part of this document may be copied or reproduced in any form or by any means without the prior
written consent of NEC Electronics. NEC Electronics assumes no responsibility for any errors that may
appear in this document.
• NEC Electronics does not assume any liability for infringement of patents, copyrights or other intellectual
property rights of third parties by or arising from the use of NEC Electronics products listed in this document
or any other liability arising from the use of such products. No license, express, implied or otherwise, is
granted under any patents, copyrights or other intellectual property rights of NEC Electronics or others.
• Descriptions of circuits, software and other related information in this document are provided for illustrative
purposes in semiconductor product operation and application examples. The incorporation of these
circuits, software and information in the design of a customer's equipment shall be done under the full
responsibility of the customer. NEC Electronics assumes no responsibility for any losses incurred by
customers or third parties arising from the use of these circuits, software and information.
• While NEC Electronics endeavors to enhance the quality, reliability and safety of NEC Electronics products,
customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely. To
minimize risks of damage to property or injury (including death) to persons arising from defects in NEC
Electronics products, customers must incorporate sufficient safety measures in their design, such as
redundancy, fire-containment and anti-failure features.
• NEC Electronics products are classified into the following three quality grades: "Standard", "Special" and
"Specific".
The "Specific" quality grade applies only to NEC Electronics products developed based on a customer-
designated "quality assurance program" for a specific application. The recommended applications of an NEC
Electronics product depend on its quality grade, as indicated below. Customers must check the quality grade of
each NEC Electronics product before using it in a particular application.
"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 and medical equipment for life support, etc.
The quality grade of NEC Electronics products is "Standard" unless otherwise expressly specified in NEC
Electronics data sheets or data books, etc. If customers wish to use NEC Electronics products in applications
not intended by NEC Electronics, they must contact an NEC Electronics sales representative in advance to
determine NEC Electronics' willingness to support a given application.
(Note)
(1) "NEC Electronics" as used in this statement means NEC Electronics Corporation and also includes its
majority-owned subsidiaries.
(2) "NEC Electronics products" means any product developed or manufactured by or for NEC Electronics
(as defined above).
Some information contained in this document may vary from country to country. Before using any NEC
Electronics product in your application, pIease contact the NEC Electronics office in your country to
obtain a list of authorized representatives and distributors. They will verify:
• Device availability
• Ordering information
• 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 America, Inc. (U.S.) • Filiale Italiana NEC Electronics Hong Kong Ltd.
Santa Clara, California Milano, Italy Hong Kong
Tel: 408-588-6000 Tel: 02-66 75 41 Tel: 2886-9318
800-366-9782 Fax: 02-66 75 42 99 Fax: 2886-9022/9044
Fax: 408-588-6130
800-729-9288 • Branch The Netherlands NEC Electronics Hong Kong Ltd.
Eindhoven, The Netherlands Seoul Branch
NEC Electronics (Europe) GmbH Tel: 040-244 58 45 Seoul, Korea
Duesseldorf, Germany Fax: 040-244 45 80 Tel: 02-528-0303
Tel: 0211-65 03 01 Fax: 02-528-4411
Fax: 0211-65 03 327 • Tyskland Filial
Taeby, Sweden NEC Electronics Shanghai, Ltd.
• Sucursal en España Tel: 08-63 80 820 Shanghai, P.R. China
Madrid, Spain Fax: 08-63 80 388 Tel: 021-6841-1138
Tel: 091-504 27 87 Fax: 021-6841-1137
Fax: 091-504 28 60 • United Kingdom Branch
Milton Keynes, UK NEC Electronics Taiwan Ltd.
• Succursale Française Tel: 01908-691-133 Taipei, Taiwan
Vélizy-Villacoublay, France Fax: 01908-670-290
Tel: 02-2719-2377
Tel: 01-30-67 58 00 Fax: 02-2719-5951
Fax: 01-30-67 58 99
NEC Electronics Singapore Pte. Ltd.
Novena Square, Singapore
Tel: 6253-8311
Fax: 6250-3583
J02.11
Page Description
Throughout Deletion of following product
• µPD780058Y
p. 149 Addition of note on feedback resistor to Figure 7-3 Processor Clock Control Register Format
p. 167 Addition of Table 8-5 INTP1/TI01 Pin Valid Edge and CR00 Capture Trigger Valid Edge
p. 168 Addition of Table 8-6 INTP0/TI00 Pin Valid Edge and CR01 Capture Trigger Valid Edge
p. 177 Correction of note on valid edge of INTP0/TI00/P00 and INTP1/TI01/P01 pin in Figure 8-8
Format of External Interrupt Mode Register 0
p. 185 Addition of Figure 8-17 Configuration of PPG Output
Addition of Figure 8-18 PPG Output Operation Timing
pp. 201 to 204 8.5 16-Bit Timer/Event Counter Operating Cautions
Addition of description on TI01/P01/INTP1 to (5) Valid edge setting
Addition of (c) One-shot pulse output function to (6) Re-trigger of one-shot pulse
Addition of (8) Conflict operation
Addition of (9) Timer operation
Addition of (10) Capture operation
Addition of (11) Compare operation
Addition of (12) Edge detection
p. 235 Modification of note on changing count clock in Figure 10-2 Timer Clock Select Register 2
Format
p. 242 Modification of note on changing count clock in Figure 11-2 Timer Clock Select Register 2
Format
p. 252 Addition of note on rewriting TCL2 in Figure 13-2 Format of Timer Clock Select Register 2
Page Description
p. 263 Modification of Figure 14-5 A/D Converter Basic Operation
Addition of Table 14-2 A/D Conversion Sampling Time and A/D Converter Start Delay Time
pp. 267, 268 Addition of 14.5 How to Read A/D Converter Characteristics Table
pp. 269, 270, 272, 273 14.6 A/D Converter Cautions
Change of description in (1) Power consumption in standby mode
Addition of (3) Conflict operations
Addition of (6) Input impedance of ANI0 to ANI7 pins
Addition of (10) Timing at which A/D conversion result is undefined
Addition of (11) Notes on board design
Addition of (12) AVREF0 pin
Addition of (13) Internal equivalent circuit of ANI0 to ANI7 pins and permissible signal
source impedance
p. 280 Addition of description of processing when D/A converter is not used in 15.5 D/A Converter
Cautions (3) AVREF1 pin
p. 483 Addition of description on TI01/P01/INTP1 pin to Figure 21-5 Format of External Interrupt
Mode Register 0
p. 525 Addition of Caution to 25.1 ROM Correction Function
p. 535 Modification of Table 26-1 Differences Between µPD78F0058, 78F0058Y and Mask ROM
Versions
pp. 538 to 549 Total revision of description on flash memory programming as 26.3 Flash Memory
Characteristics
pp. 567 to 596 Addition of CHAPTER 28 ELECTRICAL SPECIFICATIONS (MASK ROM VERSION)
pp. 597 to 626 Addition of CHAPTER 29 ELECTRICAL SPECIFICATIONS (FLASH MEMORY VERSION)
pp. 627 to 657 Addition of CHAPTER 30 ELECTRICAL SPECIFICATIONS (FLASH MEMORY VERSION (VDD
= 2.2 V))
pp. 658, 659 Addition of CHAPTER 31 CHARACTERISTICS CURVES (REFERENCE VALUES)
pp. 660, 661 Addition of CHAPTER 32 PACKAGE DRAWINGS
Readers This manual has been prepared for user engineers who wish to understand the
functions of the µPD780058 and 780058Y Subseries and design and develop its
application systems and programs.
This manual is intended for the products in the following subseries.
• µPD780058 Subseries
µPD780053, 780054, 780055, 780056, 780058, 780058B, 78F0058, 780053(A),
780054(A), 780055(A), 780056(A), 780058B(A)
• µPD780058Y Subseries
µPD780053Y, 780054Y, 780055Y, 780056Y, 780058BY, 78F0058Y, 780053Y(A),
780054Y(A), 780055Y(A), 780056Y(A), 780058BY(A)
Purpose This manual is intended to give users an understanding of the functions described
in the organization below.
Organization The µPD780058, 780058Y Subseries manual is separated into two parts: this
manual and the instruction edition (common to the 78K/0 Series).
When using this manual as the manual for the µPD780053(A), 780054(A),
780055(A), 780056(A), 780058B(A), 780053Y(A), 780054Y(A), 780055Y(A),
780056Y(A), and 780058BY(A),
→ The only difference between these products and the µPD780053, 780054,
780055, 780056, 780058B, 780053Y, 780054Y, 780055Y, 780056Y, and
780058BY is the quality grade (see 1.9 Differences Between Standard
Model and (A) Model, and 2.9 Differences Between Standard Model and
(A) Model). The correspondence between the standard model and (A) model
is as follows in CHAPTER 6 PORT FUNCTIONS to CHAPTER 27 INSTRUC-
TION SET OUTLINE.
µPD780053 → µPD780053(A) µPD780053Y → µPD780053Y(A)
µPD780054 → µPD780054(A) µPD780054Y → µPD780054Y(A)
µPD780055 → µPD780055(A) µPD780055Y → µPD780055Y(A)
µPD780056 → µPD780056(A) µPD780056Y → µPD780056Y(A)
µPD780058B → µPD780058B(A) µPD780058BY → µPD780058BY(A)
To gain a general understanding the functions:
→ Read this manual in the order of the contents.
To know the µPD780058 and 780058Y Subseries instruction functions in detail:
→ Refer to the 78K/0 Series Instructions User’s Manual (U12326E)
How to interpret the register format:
→ For a bit number enclosed in angle brackets (<>), the bit name is defined as
a reserved word in the RA78K0, and defined in the header file named sfrbit.h
in the CC78K0.
To learn the function of a register whose register name is known:
→ Refer to APPENDIX C REGISTER INDEX.
To see application examples of each function of the µPD780058, 780058Y
Subseries:
→ Refer to 78K/0 Series Basics (III) Application Note (U10182E) separately
available.
To understand the electrical specifications of the µPD780058, 780058Y Subseries:
→ See CHAPTER 28 ELECTRICAL SPECIFICATIONS (MASK ROM VER-
SION), CHAPTER 29 ELECTRICAL SPECIFICATIONS (FLASH MEMORY
VERSION), CHAPTER 30 ELECTRICAL SPECIFICATIONS (FLASH MEMORY
VERSION (VDD = 2.2 V)).
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.
Legend Data significance: Higher digits on the left and lower digits on the right
Active low representations: ××× (overscore over pin or signal name)
Note: Footnote for item marked with Note in the text.
Caution: Information requiring particular attention
Remark: Supplementary information
Numeral representations: Binary ... ×××× or ××××B
Decimal ... ××××
Hexadecimal ... ××××H
Related Documents The related documents indicated in this publication may include preliminary
versions. However, preliminary versions are not marked as such.
Caution The related documents listed above are subject to change without notice. Be sure to use the
latest version of each document for designing.
Caution The related documents listed above are subject to change without notice. Be sure to use the
latest version of each document for designing.
CHAPTER 30 ELECTRICAL SPECIFICATIONS (FLASH MEMORY VERSION (VDD = 2.5 V)) .... 627
APPENDIX A DIFFERENCES BETWEEN µPD78054, 78058F, AND 780058 SUBSERIES ......... 666
16-1 Serial Bus Interface (SBI) System Configuration Example .................................................................. 283
16-2 Block Diagram of Serial Interface Channel 0 ....................................................................................... 285
16-3 Format of Timer Clock Select Register 3 .............................................................................................. 289
16-4 Format of Serial Operating Mode Register 0 ....................................................................................... 290
16-5 Format of Serial Bus Interface Control Register .................................................................................. 292
16-6 Format of Interrupt Timing Specification Register ................................................................................ 294
16-7 3-Wire Serial I/O Mode Timing .............................................................................................................. 299
16-8 RELT and CMDT Operations ................................................................................................................. 299
16-9 Circuit for Switching Transfer Bit Order ................................................................................................. 300
16-10 Example of Serial Bus Configuration with SBI ..................................................................................... 301
16-11 SBI Transfer Timing ................................................................................................................................ 303
16-12 Bus Release Signal ............................................................................................................................... 304
16-13 Command Signal .................................................................................................................................... 304
16-14 Addresses ............................................................................................................................................... 305
16-15 Slave Selection by Address ................................................................................................................... 305
17-1 Serial Bus Configuration Example Using I2C Bus ................................................................................ 335
17-2 Block Diagram of Serial Interface Channel 0 ....................................................................................... 337
17-3 Format of Timer Clock Select Register 3 .............................................................................................. 341
17-4 Format of Serial Operating Mode Register 0 ....................................................................................... 342
17-5 Format of Serial Bus Interface Control Register .................................................................................. 343
17-6 Format of Interrupt Timing Specification Register ................................................................................ 345
17-7 3-Wire Serial I/O Mode Timing .............................................................................................................. 350
17-8 RELT and CMDT Operations ................................................................................................................. 350
17-9 Circuit for Switching Transfer Bit Order ................................................................................................. 351
17-10 Serial Bus Configuration Example Using 2-Wire Serial I/O Mode ...................................................... 352
17-11 2-Wire Serial I/O Mode Timing .............................................................................................................. 355
17-12 RELT and CMDT Operations ................................................................................................................. 356
17-13 Example of Serial Bus Configuration Using I2C Bus ......................................................................... 357
17-14 I2C Bus Serial Data Transfer Timing ................................................................................................... 358
17-15 Start Condition .................................................................................................................................... 359
17-16 Address ............................................................................................................................................... 359
17-17 Transfer Direction Specification .......................................................................................................... 359
17-18 Acknowledge Signal ............................................................................................................................ 360
17-19 Stop Condition ..................................................................................................................................... 360
17-20 Wait Signal .......................................................................................................................................... 361
17-21 Pin Configuration ................................................................................................................................ 366
17-22 Data Transmission from Master to Slave (Both Master and Slave Selected 9-Clock Wait) ............ 368
17-23 Data Transmission from Slave to Master (Both Master and Slave Selected 9-Clock Wait) ............ 371
17-24 Start Condition Output ........................................................................................................................ 374
19-12 Status of Receive Buffer Register (RXB) and Generation of Interrupt Request (INTSR)
When Reception Is Stopped .................................................................................................................. 457
19-13 3-Wire Serial I/O Mode Timing .............................................................................................................. 463
19-14 Circuit for Switching Transfer Bit Order ................................................................................................. 464
19-15 Reception Completion Interrupt Request Generation Timing (When ISRM = 1) ................................ 465
19-16 Receive Buffer Register Read Disable Period ...................................................................................... 466
19-17 P23 Output Selector .............................................................................................................................. 468
22-1 Memory Map When Using External Device Expansion Function ........................................................ 502
22-2 Format of Memory Expansion Mode Register ...................................................................................... 505
22-3 Format of Internal Memory Size Switching Register ............................................................................ 506
22-4 Instruction Fetch from External Memory ............................................................................................... 508
22-5 External Memory Read Timing .............................................................................................................. 509
22-6 External Memory Write Timing .............................................................................................................. 510
22-7 External Memory Read Modify Write Timing ........................................................................................ 511
22-8 Example of Connection Between µPD780054 and Memory ................................................................ 512
9-9 Interval Times When 2-Channel 8-Bit Timer/Event Counters (TM1 and TM2)
Are Used as 16-Bit Timer/Event Counter ............................................................................................. 226
9-10 Square-Wave Output Ranges When 2-Channel 8-Bit Timer/Event Counters (TM1 and TM2)
Are Used as 16-Bit Timer/Event Counter ............................................................................................. 228
26-1 Differences Between µPD78F0058, 78F0058Y and Mask ROM Versions .......................................... 535
26-2 Internal Memory Size Switching Register Setting Values .................................................................... 536
26-3 Internal Expansion RAM Size Switching Register Setting Values ....................................................... 537
26-4 Communication Mode List ..................................................................................................................... 539
26-5 Pin Connection List ................................................................................................................................ 542
A-1 Major Differences Between µPD78054, 78058F, and 780058 Subseries ........................................... 666
B-1 System-Upgrade Method from Former In-Circuit Emulator for 78K/0 Series to IE-78001-R-A ......... 676
1.1 Features
Notes 1. The flash memory capacity can be changed by means of the internal memory size switching register
(IMS).
2. The capacity of the internal high-speed RAM can be changed by means of the internal expansion RAM
size switching register (IXS).
Note The operating voltage range of the A/D and D/A converters of the µPD780058 is VDD = 2.7 to 5.5 V.
Note VDD = 2.2 V can also be supplied to the µPD78F0058. For details, contact an NEC Electronics sales
representative.
1.2 Applications
Car audio systems, cellular phones, pagers, printers, AV equipment, cameras, PPCs, vending machines, car
electrical components, etc.
For details of the quality grades and their applications, see Quality Grades on NEC Electronics Semiconductor
Devices (Document No.: C11531E).
P01/INTP1/TI01
P00/INTP0/TI00
P05/INTP5
P04/INTP4
P03/INTP3
P02/INTP2
P14/ANI4
P13/ANI3
P12/ANI2
P11/ANI1
P10/ANI0
XT1/P07
IC (VPP)
AVREF0
V DD0
VDD1
XT2
VSS0
X1
X2
80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61
P15/ANI5 1 60 RESET
P16/ANI6 2 59 P127/RTP7
P17/ANI7 3 58 P126/RTP6
AVSS 4 57 P125/RTP5
P130/ANO0 5 56 P124/RTP4
P131/ANO1 6 55 P123/RTP3
AVREF1 7 54 P122/RTP2
P70/SI2/RxD0 8 53 P121/RTP1
P71/SO2/TxD0 9 52 P120/RTP0
P72/SCK2/ASCK 10 51 P37
P20/SI1 11 50 P36/BUZ
P21/SO1 12 49 P35/PCL
P22/SCK1 13 48 P34/TI2
P23/STB/TxD1 14 47 P33/TI1
P24/BUSY/RxD1 15 46 P32/TO2
P25/SI0/SB0 16 45 P31/TO1
P26/SO0/SB1 17 44 P30/TO0
P27/SCK0 18 43 P67/ASTB
P40/AD0 19 42 P66/WAIT
P41/AD1 20 41 P65/WR
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
P42/AD2
P43/AD3
P44/AD4
P45/AD5
P46/AD6
P47/AD7
P50/A8
P51/A9
P52/A10
P53/A11
P54/A12
P55/A13
VSS1
P56/A14
P57/A15
P60
P61
P62
P63
P64/RD
Cautions 1. Be sure to connect the IC (Internally Connected) pin to VSS0 or VSS1 directly in the normal
operating mode.
2. Connect the AVSS pin to VSS0.
78K/0 Series product lineup is illustrated below. Part numbers in the boxes indicate subseries names.
Inverter control
64-pin µPD780988 On-chip inverter control circuit and UART. EMI-noise reduced.
VFD drive
100-pin µ PD780208 µ PD78044F with enhanced I/O and VFD C/D. Display output total: 53
80-pin µ PD780232 For panel control. On-chip VFD C/D. Display output total: 53
80-pin µPD78044H µ PD78044F with N-ch open-drain I/O. Display output total: 34
80-pin µPD78044F Basic subseries for driving VFD. Display output total: 34
LCD drive
78K/0
Series 100-pin µ PD780354 µPD780354Y µ PD780344 with enhanced A/D converter
100-pin µ PD780344 µ PD780344Y µ PD780308 with enhanced display function and timer. Segment signal output: 40 pins max.
120-pin µ PD780338 µ PD780308 with enhanced display function and timer. Segment signal output: 40 pins max.
120-pin µ PD780328 µ PD780308 with enhanced display function and timer. Segment signal output: 32 pins max.
120-pin µPD780318 µ PD780308 with enhanced display function and timer. Segment signal output: 24 pins max.
100-pin µ PD780308 µPD780308Y µ PD78064 with enhanced SIO, and expanded ROM and RAM
100-pin µPD78064B EMI-noise reduced version of the µ PD78064
100-pin µPD78064 µ PD78064Y Basic subseries for driving LCDs, on-chip UART
Remark VFD (Vacuum Fluorescent Display) is referred to as FIPTM (Fluorescent Indicator Panel) in some
documents, but the functions of the two are the same.
The following lists the main functional differences between subseries products.
• Non-Y subseries
Function ROM Timer 8-Bit 10-Bit 8-Bit Serial Interface I/O VDD External
Capacity MIN.
Subseries Name (Bytes) 8-Bit 16-Bit Watch WDT A/D A/D D/A Value Expansion
Control µ PD78075B 32 K to 40 K 4 ch 1 ch 1 ch 1 ch 8 ch – 2 ch 3 ch (UART: 1 ch) 88 1.8 V √
µ PD78078 48 K to 60 K
µ PD78070A – 61 2.7 V
µ PD78054 16 K to 60 K 2.0 V
µPD780024A 8 ch –
µ PD780034AS – 4 ch 39 –
µPD780024AS 4 ch –
µ PD78014H 8 ch 2 ch 53 √
µ PD78018F 8 K to 60 K
µ PD78083 8 K to 16 K – – 1 ch (UART: 1 ch) 33 –
µ PD78044H 32 K to 48 K 2 ch 1 ch 1 ch 8 ch 1 ch 68 2.7 V
µ PD78044F 16 K to 40 K 2 ch
µ PD780328 62
µ PD780318 70
µPD78064 16 K to 32 K
P00
TO0/P30
16-bit timer/ Port 0 P01 to P05
TI00/P00
event counter P07
TI01/P01
SI0/SB0/P25
Port 5 P50 to P57
SO0/SB1/P26 Serial interface 0
SCK0/P27
ROM
78K/0
(flash Port 6 P60 to P67
CPU core
SI1/P20 memory)
SO1/P21
SCK1/P22 Serial interface 1
STB/TxD1/P23 Port 7 P70 to P72
BUSY/RxD1/P24
ANI0/P10 to RTP0/P120 to
Real-time output port
ANI7/P17 RTP7/P127
A/D converter
AVSS
AVREF0
AD0/P40 to
AD7/P47
ANO0/P130, A8/P50 to
ANO1/P131 A15/P57
AVSS D/A converter External access RD/P64
AVREF1 WR/P65
WAIT/P66
INTP0/P00 to ASTB/P67
Interrupt control
INTP5/P05
RESET
BUZ/P36 Buzzer output
X1
System control X2
VDD0, VSS0, IC XT1/P07
PCL/P35 Clock output control VDD1 VSS1 (VPP) XT2
Remarks 1. The internal ROM and RAM capacities depend on the product.
2. The pin connection in parentheses is intended for the µPD78F0058.
Notes 1. The capacity of the flash memory can be changed by using the internal memory switching register
(IMS).
2. The capacity of the internal expansion RAM can be changed by using the internal expansion RAM
size switching register (IXS).
Note VDD = 2.2 V can also be supplied. For details, contact an NEC Electronics sales representative.
Notes 1. The watch timer can perform both watch timer and interval timer functions at the same time.
2. The watchdog timer can perform either the watchdog timer function or the interval timer function.
3. When capture/compare registers 00 and 01 (CR00 and CR01) are specified as compare registers.
The mask ROM versions (µPD780053, 780053(A), 780054, 780054(A), 780055, 780055(A), 780056, 780056(A),
780058, 780058B, 780058B(A)) provide pull-up resistor mask options which allow users to specify whether to connect
a pull-up resistor to a specific port pin when the user places an order for the device production. Using this mask option
when pull-up resistors are required reduces the number of components to add to the device, resulting in board space
saving.
The mask options provided in the µPD780058 Subseries are shown in Table 1-1.
The (A) models of the µPD780058 Subseries (µPD780053(A), 780054(A), 780055(A), 780056(A), and 780058B(A))
have improved reliability by increasing the check items from the standard model (µPD780053, 780054, 780055,
780056, and 780058B). The functions and electrical characteristics of the (A) model are the same as those of the
standard model.
2.1 Features
Notes 1. The capacity of flash memory can be changed by means of the internal memory size switching register
(IMS).
2. The capacity of internal high-speed RAM can be changed by means of the internal expansion RAM
size switching register (IXS).
Note VDD = 2.2 V can also be supplied to the µPD78F0058Y. For details, contact an NEC Electronics sales
representative.
2.2 Applications
Car audio systems, cellular phones, pagers, printers, AV equipment, cameras, PPCs, vending machines, car
electrical components, etc.
For details of the quality grades and their applications, see Quality Grades on NEC Electronics Semiconductor
Devices (Document No.: C11531E).
P01/INTP1/TI01
P00/INTP0/TI00
P05/INTP5
P04/INTP4
P03/INTP3
P02/INTP2
P14/ANI4
P13/ANI3
P12/ANI2
P11/ANI1
P10/ANI0
XT1/P07
IC (VPP)
AVREF0
V DD0
VDD1
XT2
VSS0
X1
X2
80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61
P15/ANI5 1 60 RESET
P16/ANI6 2 59 P127/RTP7
P17/ANI7 3 58 P126/RTP6
AVSS 4 57 P125/RTP5
P130/ANO0 5 56 P124/RTP4
P131/ANO1 6 55 P123/RTP3
AVREF1 7 54 P122/RTP2
P70/SI2/RxD0 8 53 P121/RTP1
P71/SO2/TxD0 9 52 P120/RTP0
P72/SCK2/ASCK 10 51 P37
P20/SI1 11 50 P36/BUZ
P21/SO1 12 49 P35/PCL
P22/SCK1 13 48 P34/TI2
P23/STB/TxD1 14 47 P33/TI1
P24/BUSY/RxD1 15 46 P32/TO2
P25/SI0/SB0/SDA0 16 45 P31/TO1
P26/SO0/SB1/SDA1 17 44 P30/TO0
P27/SCK0/SCL 18 43 P67/ASTB
P40/AD0 19 42 P66/WAIT
P41/AD1 20 41 P65/WR
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
P42/AD2
P43/AD3
P44/AD4
P45/AD5
P46/AD6
P47/AD7
P50/A8
P51/A9
P52/A10
P53/A11
P54/A12
P55/A13
VSS1
P56/A14
P57/A15
P60
P61
P62
P63
P64/RD
Cautions 1. Be sure to connect the IC (Internally Connected) pin to VSS0 directly in the normal
operating mode.
2. Connect the AVSS pin to VSS0.
78K/0 Series product lineup is illustrated below. Part numbers in the boxes indicate subseries names.
Inverter control
64-pin µPD780988 On-chip inverter control circuit and UART. EMI-noise reduced.
VFD drive
100-pin µ PD780208 µ PD78044F with enhanced I/O and VFD C/D. Display output total: 53
80-pin µ PD780232 For panel control. On-chip VFD C/D. Display output total: 53
80-pin µPD78044H µ PD78044F with N-ch open-drain I/O. Display output total: 34
80-pin µPD78044F Basic subseries for driving VFD. Display output total: 34
LCD drive
78K/0
Series 100-pin µ PD780354 µPD780354Y µ PD780344 with enhanced A/D converter
100-pin µ PD780344 µ PD780344Y µ PD780308 with enhanced display function and timer. Segment signal output: 40 pins max.
120-pin µ PD780338 µ PD780308 with enhanced display function and timer. Segment signal output: 40 pins max.
120-pin µ PD780328 µ PD780308 with enhanced display function and timer. Segment signal output: 32 pins max.
120-pin µPD780318 µ PD780308 with enhanced display function and timer. Segment signal output: 24 pins max.
100-pin µ PD780308 µPD780308Y µ PD78064 with enhanced SIO, and expanded ROM and RAM
100-pin µPD78064B EMI-noise reduced version of the µ PD78064
100-pin µPD78064 µ PD78064Y Basic subseries for driving LCDs, on-chip UART
Remark VFD (Vacuum Fluorescent Display) is referred to as FIP (Fluorescent Indicator Panel) in some
documents, but the functions of the two are the same.
• Y subseries
Function ROM Timer 8-Bit 10-Bit 8-Bit Serial Interface I/O VDD External
Capacity MIN.
Subseries Name (Bytes) 8-Bit 16-Bit Watch WDT A/D A/D D/A Value Expansion
Control µPD78078Y 48 K to 60 K 4 ch 1 ch 1 ch 1 ch 8 ch – 2 ch 3 ch (UART: 1 ch, I2C: 1 ch) 88 1.8 V √
µPD78070AY – 61 2.7 V
µPD780018AY 48 K to 60 K – 2
3 ch (I C: 1 ch) 88
µPD780058Y 24 K to 60 K 2 ch 2
2 ch 3 ch (time-division UART: 1 ch, I C: 1 ch) 68 1.8 V
µPD78058FY 48 K to 60 K 2
3 ch (UART: 1 ch, I C: 1 ch) 69 2.7 V
µPD78054Y 16 K to 60 K 2.0 V
µPD780078Y 48 K to 60 K 2 ch – 8 ch – 2
4 ch (UART: 2 ch, I C: 1 ch) 52 1.8 V
µPD780034AY 8 K to 32 K 1 ch 3 ch (UART: 1 ch, I C: 1 ch) 512
µPD780024AY 8 ch –
µPD78018FY 8 K to 60 K 2 ch (I2C: 1 ch) 53
LCD µPD780354Y 24 K to 32 K 4 ch 1 ch 1 ch 1 ch – 8 ch – 4 ch (UART: 1 ch, 66 1.8 V –
2
drive I C: 1 ch)
µPD780344Y 8 ch –
µPD780308Y 48 K to 60 K 2 ch 3 ch (time-division UART: 1 ch, I2C: 1 ch) 57 2.0 V
µPD78064Y 16 K to 32 K 2
2 ch (UART: 1 ch, I C: 1 ch)
Remark Functions other than the serial interface are common to both the Y and non-Y subseries.
P00
TO0/P30
16-bit timer/ Port 0 P01 to P05
TI00/P00
event counter P07
TI01/P01
SI0/SB0/P25
Port 5 P50 to P57
SO0/SB1/P26 Serial interface 0
SCK0/P27
ROM
78K/0
(flash Port 6 P60 to P67
CPU core
SI1/P20 memory)
SO1/P21
SCK1/P22 Serial interface 1
STB/TxD1/P23 Port 7 P70 to P72
BUSY/RxD1/P24
ANI0/P10 to RTP0/P120 to
Real-time output port
ANI7/P17 RTP7/P127
A/D converter
AVSS
AVREF0
AD0/P40 to
AD7/P47
ANO0/P130, A8/P50 to
ANO1/P131 A15/P57
AVSS D/A converter External access RD/P64
AVREF1 WR/P65
WAIT/P66
INTP0/P00 to ASTB/P67
Interrupt control
INTP5/P05
RESET
BUZ/P36 Buzzer output
X1
System control X2
VDD0, VSS0, IC XT1/P07
PCL/P35 Clock output control VDD1 VSS1 (VPP) XT2
Remarks 1. The internal ROM and RAM capacities depend on the product.
2. The pin connection in parentheses is intended for the µPD78F0058Y.
Notes 1. The capacity of the flash memory can be changed by using the internal memory switching register
(IMS).
2. The capacity of the internal expansion RAM can be changed by using the internal expansion RAM
size switching register (IXS).
Note VDD = 2.2 V can also be supplied. For details, contact an NEC Electronics sales representative.
Notes 1. The watch timer can perform both watch timer and interval timer functions at the same time.
2. The watchdog timer can perform either the watchdog timer function or the interval timer function.
3. When capture/compare registers 00 and 01 (CR00 and CR01) are specified as compare registers.
The mask ROM versions (µPD780053Y, 780053Y(A), 780054Y, 780054Y(A), 780055Y, 780055Y(A), 780056Y,
780056Y(A), 780058BY, 780058BY(A)) provide pull-up resistor mask options which allow users to specify whether
to connect a pull-up resistor to a specific port pin when the user places an order for the device production. Using
this mask option when pull-up resistors are required reduces the number of components to add to the device, resulting
in board space saving.
The mask options provided in the µPD780058Y Subseries are shown in Table 2-1.
The (A) models of the µPD780058Y Subseries (µPD780053Y(A), 780054Y(A), 780055Y(A), 780056Y(A), and
780058BY(A)) have improved reliability by increasing the check items from the standard model (µPD780053Y,
780054Y, 780055Y, 780056Y, and 780058BY). The functions and electrical characteristics of the (A) model are the
same as those of the standard model.
P05 INTP5
P07Note 1 Input Input only Input XT1
P10 to P17 I/O Port 1 Input ANI0 to ANI7
8-bit I/O port
Input/output can be specified in 1-bit units.
If used as an input port, an on-chip pull-up resistor can be connected by
setting software.Note 2
P20 I/O Port 2 Input SI1
8-bit I/O port
P21 SO1
Input/output can be specified in 1-bit units.
P22 If used as an input port, an on-chip pull-up resistor can be connected by SCK1
P23 setting software. STB/TxD1
P24 BUSY/RxD1
P25 SI0/SB0
P26 SO0/SB1
P27 SCK0
P30 I/O Port 3 Input TO0
8-bit I/O port
P31 TO1
Input/output can be specified in 1-it units.
P32 If used as an input port, an on-chip pull-up resistor can be connected by TO2
P33 setting software. TI1
P34 TI2
P35 PCL
P36 BUZ
P37 —
Notes 1. When the P07/XT1 pin is used as an input port, set bit 6 (FRC) of the processor clock control register
(PCC) to 1 (do not use the feedback resistor incorporated in the subsystem clock oscillator).
2. When pins P10/ANI0 to P17/ANI7 are used as an analog input of the A/D converter, set port 1 to the
input mode. In this case, any connected on-chip pull-up resistors are automatically disabled.
P67 ASTB
P70 I/O Port 7 Input SI2/RxD0
3-bit I/O port
P71 Input/output can be specified in 1-bit units. SO2/TxD0
If used as an input port, an on-chip pull-up resistor can be connected by
P72 setting software. SCK2/ASCK
INTP0 Input External interrupt request inputs with specifiable valid edges (rising Input P00/TI00
edge, falling edge, both rising and falling edges).
INTP1 P01/TI01
INTP2 P02
INTP3 P03
INTP4 P04
INTP5 P05
SI0 Input Serial interface serial data input Input P25/SB0
SI1 P20
SI2 P70/RxD
SO0 Output Serial interface serial data output Input P26/SB1
SO1 P21
SO2 P71/TxD
SB0 I/O Serial interface serial data input/output Input P25/SI0
SB1 P26/SO0
SCK0 I/O Serial interface serial clock input/output Input P27
SCK1 P22
SCK2 P72/ASCK
STB Output Serial interface automatic transmit/receive strobe output Input P23/TxD1
BUSY Input Serial interface automatic transmit/receive busy input Input P24/RxD1
RxD0 Input Asynchronous serial interface serial data input Input P70/SI2
RxD1 P24/BUSY
TxD0 Output Asynchronous serial interface serial data output Input P71/SO2
TxD1 P23/STB
ASCK Input Asynchronous serial interface serial clock input Input P72/SCK2
TI00 Input External count clock input to 16-bit timer (TM0) Input P00/INTP0
AD0 to AD7 I/O Lower address/data bus when expanding memory externally Input P40 to P47
A8 to A15 Output Higher address bus when expanding memory externally Input P50 to P57
RD Output Strobe signal output for read operation from external memory Input P64
ANI0 to ANI7 Input A/D converter analog input Input P10 to P17
ANO0, ANO1 Output D/A converter analog output Input P130, P131
AVREF0 Input A/D converter reference voltage input (also functions as analog power — —
supply)
XT2 — — —
VDD0 — Positive power supply for ports — —
VSS0 — Ground potential for ports — —
(b) TI00
This is a pin for inputting the external count clock to the 16-bit timer/event counter.
(c) TI01
This is a pin for inputting the capture trigger signal to the capture register (CR00) of the 16-bit timer/event
counter.
(d) XT1
This is a crystal connection pin for subsystem clock oscillation.
(d) BUSY
This is an automatic transmit/receive busy input pin of the serial interface.
(e) STB
This is an automatic transmit/receive strobe output pin of the serial interface.
Caution When P20 to P27 are used as serial interface pins, the I/O and output latches must be
set according to the function the user requires. For the setting, see Figure 16-4 Format
of Serial Operation Mode Register 0, Figure 18-3 Format of Serial Operation Mode
Register 1, and Table 19-2 Serial Interface Channel 2 Operating Mode Settings.
(c) PCL
This is a clock output pin.
(d) BUZ
This is a buzzer output pin.
Caution When an external wait is not used in external memory expansion mode, P66 can be used as
an I/O port pins.
(b) SCK2
This is a serial clock I/O pin of the serial interface.
(d) ASCK
This is a serial clock I/O pin of the asynchronous serial interface.
Caution When P70 to P72 are used as serial interface pins, the I/O and output latches must be set
according to the function the user requires.
For the setting, see the operation mode setting list in Table 19-2 Serial Interface Channel
2.
Caution When only one of the D/A converter channels is used with AVREF1 < VDD0, the other pins that
are not used as analog outputs must be set as follows:
• Set the PM13x bit of port mode register 13 (PM13) to 1 (input mode) and connect the pin
to VSS0.
• Clear the PM13x bit of port mode register 13 (PM13) to 0 (output mode) and the output latch
to 0, and output a low level from the pin.
3.2.11 AVREF0
This is the A/D converter reference voltage input pin. This pin also serves as an analog power supply pin. Supply
power to this pin when the A/D converter is used.
When the A/D converter is not used, use the same voltage that of the VDD0 or VSS0 pin.
3.2.12 AVREF1
This is the D/A converter reference voltage input pin.
When the D/A converter is not used, use the same voltage that of the VDD0 pin.
3.2.13 AVSS
This is the ground voltage pin of A/D converter and D/A converter. Always use the same voltage as that of the
VSS0 pin even when the A/D converter or D/A converter is not used.
3.2.14 RESET
This is the low-level active system reset input pin.
3.2.15 X1 and X2
These are crystal resonator connection pins for main system clock oscillation. For external clock supply, input
a signal to X1 and its inverted signal to X2.
VSS0 IC
As short as possible
Table 3-1 shows the pin I/O circuit types and the recommended connection of unused pins.
Refer to Figure 3-1 for the configuration of the I/O circuit of each type.
Pin Name I/O Circuit Type I/O Recommended Connection of Unused Pins
P00/INTP0/TI00 2 Input Connect to VSS0.
P01/INTP1/TI01 8-C I/O Input: Independently connect to VSS0 via a resistor.
P02/INTP2 Output: Leave open.
P03/INTP3
P04/INTP4
P05/INTP5
P07/XT1 16 Input Connect to VDD0.
P10/ANI0 to P17/ANI7 11-D I/O Input: Independently connect to VDD0 or VSS0 via a resistor.
P20/SI1 8-C Output: Leave open.
P21/SO1 5-H
P22/SCK1 8-C
P23/STB/TxD1 5-H
P24/BUSY/RxD1 8-C
P25/SI0/SB0 10-B
P26/SO0/SB1
P27/SCK0
P30/TO0 5-H
P31/TO1
P32/TO2
P33/TI1 8-C
P34/TI2
P35/PCL 5-H
P36/BUZ
P37
P40/AD0 to P47/AD7 5-N I/O Input: Independently connect to VDD0 via a resistor.
Output: Leave open.
P50/A8 to P57/A15 5-H I/O Input: Independently connect to VDD0 or VSS0 via a resistor.
Output: Leave open.
Pin Name I/O Circuit Type I/O Recommended Connection of Unused Pins
P60 to P63 (mask ROM version) 13-J I/O Input: Independently connect to VDD0 via a resistor.
P60 to P63 (flash memory version) 13-K Output: Set 0 to the port and leave open at low level output.
P64/RD 5-H I/O Input: Independently connect to VDD0 or VSS0 via a resistor.
P65/WR Output: Leave open.
P66/WAIT
P67/ASTB
P70/SI2/RxD0 8-C
P71/SO2/TxD0 5-H
P72/SCK2/ASCK 8-C
P120/RTP0 to P127/RTP7 5-H
P130/ANO0, P131/ANO1 12-C I/O Input: Independently connect to VSS0 via a resistor.
Output: Leave open.
RESET 2 Input —
XT2 16 — Leave open.
AVREF0 — Connect to VDD0 or VSS0.
AVREF1 Connect to VDD0.
AVSS Connect to VSS0.
IC (mask ROM version) Connect directly to VSS0.
VPP (flash memory version) Independently connect via a 10 kΩ pull-down resistor, or
connect to VSS0 or VSS1 directly.
Pull-up
P-ch
enable
IN
VDD0
Data P-ch
Pull-up Pull-up
P-ch P-ch
enable enable
VDD0
VDD0
Data
P-ch Data
P-ch
IN/OUT
IN/OUT
Output N-ch Open drain
disable Output disable N-ch
VSS0
VSS0
Input
enable
Pull-up
P-ch
Pull-up enable
P-ch VDD0
enable
VDD0 Data
P-ch
Data IN/OUT
P-ch
Output N-ch
disable
P-ch VSS0
IN/OUT Comparator
+
Output – N-ch
N-ch VSS0
disable
VSS0 VREF (threshold voltage)
Input
enable
IN/OUT
Pull-up
P-ch
enable Data
VDD0 Output disable N-ch
Data VSS0
P-ch
IN/OUT VDD0
Output N-ch
disable RD P-ch
VSS0
Input P-ch
enable Medium breakdown
Analog output input buffer
voltage N-ch
RD P-ch
XT1 XT2
Medium breakdown
input buffer
P05 INTP5
P07Note 1 Input Input only Input XT1
P10 to P17 I/O Port 1 Input ANI0 to ANI7
8-bit I/O port
Input/output can be specified in 1-bit units.
If used as an input port, an on-chip pull-up resistor can be connected by
setting softwareNote 2.
P20 I/O Port 2 Input SI1
8-bit I/O port
P21 SO1
Input/output can be specified in 1-bit units.
P22 If used as an input port, an on-chip pull-up resistor can be connected by SCK1
P23 setting software. STB/TxD1
P24 BUSY/RxD1
P25 SI0/SB0/SDA0
P26 SO0/SB1/SDA1
P27 SCK0/SCL
P30 I/O Port 3 Input TO0
P34 TI2
P35 PCL
P36 BUZ
P37 —
Notes 1. When the P07/XT1 pin is used as an input port, set bit 6 (FRC) of the processor clock control register
(PCC) to 1 (do not use the feedback resistor incorporated in the subsystem clock oscillator).
2. When pins P10/ANI0 to P17/ANI7 are used as an analog input of the A/D converter, set port 1 to the
input mode. In this case, any connected on-chip pull-up resistors are automatically disabled.
P67 ASTB
P70 I/O Port 7 Input SI2/RxD0
3-bit I/O port
P71 Input/output can be specified in 1-bit units. SO2/TxD0
If used as an input port, an on-chip pull-up resistor can be connected by
P72 SCK2/ASCK
setting software.
P120 to P127 I/O Port 12 Input RTP0 to RTP7
8-bit I/O port
Input/output can be specified in 1-bit units.
If used as an input port, an on-chip pull-up resistor can be connected by
setting software.
P130 to P131 I/O Port 13 Input ANO0 to ANO1
2-bit I/O port
Input/output can be specified in 1-bit units.
If used as an input port, an on-chip pull-up resistor can be connected by
setting software.
INTP0 Input External interrupt request inputs with specifiable valid edges (rising Input P00/TI00
edge, falling edge, both rising and falling edges).
INTP1 P01/TI01
INTP2 P02
INTP3 P03
INTP4 P04
INTP5 P05
SI0 Input Serial interface serial data input Input P25/SB0/SDA0
SI1 P20
SI2 P70/RxD
SO0 Output Serial interface serial data output Input P26/SB1/SDA1
SO1 P21
SO2 P71/TxD
SB0 I/O Serial interface serial data input/output Input P25/SI0/SDA0
SB1 P26/SO0/SDA1
SDA0 P25/SI0/SB0
SDA1 P26/SO0/SB1
STB Output Serial interface automatic transmit/receive strobe output Input P23/TxD1
BUSY Input Serial interface automatic transmit/receive busy input Input P24/RxD1
RxD0 Input Asynchronous serial interface serial data input Input P70/SI2
RxD1 P24/BUSY
TxD Output Asynchronous serial interface serial data output Input P71/SO2
TxD1 P23/STB
ASCK Input Asynchronous serial interface serial clock input Input P72/SCK2
TI00 Input External count clock input to 16-bit timer (TM0) Input P00/INTP0
TI01 Capture trigger signal input to capture register (CR00) P01/INTP1
AD0 to AD7 I/O Lower address/data bus when expanding memory externally Input P40 to P47
A8 to A15 Output Higher address bus when expanding memory externally Input P50 to P57
RD Output Strobe signal output for read operation from external memory Input P64
ANI0 to ANI7 Input A/D converter analog input Input P10 to P17
ANO0, ANO1 Output D/A converter analog output Input P130, P131
AVREF0 Input A/D converter reference voltage input (also functions as analog power supply) — —
XT2 — — —
VDD0 — Positive power supply for ports — —
VSS0 — Ground potential for ports — —
(b) TI00
This is a pin for inputting the external count clock to the 16-bit timer/event counter.
(c) TI01
This is a pin for inputting the capture trigger signal to the capture register (CR00) of the 16-bit timer/event
counter.
(d) XT1
This is a crystal connection pin for subsystem clock oscillation.
(c) BUSY
This is an automatic transmit/receive busy input pin of the serial interface.
(d) STB
This is an automatic transmit/receive strobe output pin of the serial interface.
Caution When P20 to P27 are used as a serial interface pins, the I/O and output latches must
be set according to the function the user requires. For the setting, see Figure 17-4
Format of Serial Operation Mode Register 0, Figure 18-3 Format of Serial Operation
Mode Register 1, and Table 19-2 Serial Interface Channel 2 Operating Mode Settings.
(c) PCL
This is a clock output pin.
(d) BUZ
This is a buzzer output pin.
Caution When an external wait is not used in external memory expansion mode, P66 can be used as
an I/O port pin.
(b) SCK2
This is a serial clock I/O pin of the serial interface.
(d) ASCK
This is a serial clock I/O pin of the asynchronous serial interface.
Caution When P70 to P72 are used as serial interface pins, the I/O and output latches must be set
according to the function the user requires.
For the setting, see to the operation mode setting list in Table 19-2 Serial Interface Channel
2.
Caution When only one of the D/A converter channels is used with AVREF1 < VDD0, the other pins that
are not used as analog outputs must be set as follows:
• Set the PM13x bit of port mode register 13 (PM13) to 1 (input mode) and connect the pin
to VSS0.
• Clear the PM13x bit of port mode register 13 (PM13) to 0 (output mode) and the output latch
to 0, and output a low level from the pin.
4.2.11 AVREF0
This is the A/D converter reference voltage input pin. This pin also serves as an analog power supply pin. Supply
power to this pin when the A/D converter is used.
When the A/D converter is not used, use the same voltage that of the VDD0 or VSS0 pin.
4.2.12 AVREF1
This is the D/A converter reference voltage input pin.
When the D/A converter is not used, use the same voltage that of the VDD0 pin.
4.2.13 AVSS
This is the ground voltage pin of A/D converter and D/A converter. Always use the same voltage as that of the
VSS0 pin even when the A/D converter or D/A converter is not used.
4.2.14 RESET
This is the low-level active system reset input pin.
4.2.15 X1 and X2
These are crystal resonator connection pins for main system clock oscillation. For external clock supply, input
a signal to X1 and its inverted signal to X2.
VSS0 IC
As short as possible
Table 4-1 shows the pin I/O circuit types and the recommended connection of unused pins.
Refer to Figure 4-1 for the configuration of the I/O circuit of each type.
Pin Name I/O Circuit Type I/O Recommended Connection of Unused Pins
P00/INTP0/TI00 2 Input Connect to VSS0.
P01/INTP1/TI01 8-C I/O Input: Independently connect to VSS0 via a resistor.
P02/INTP2 Output: Leave open.
P03/INTP3
P04/INTP4
P05/INTP5
P07/XT1 16 Input Connect to VDD0
P10/ANI0 to P17/ANI7 11-D I/O Input: Independently connect to VDD0 or VSS0 via a resistor.
P20/SI1 8-C Output: Leave open.
P21/SO1 5-H
P22/SCK1 8-C
P23/STB/TxD1 5-H
P24/BUSY/RxD1 8-C
P25/SI0/SB0/SDA0 10-B
P26/SO0/SB1/SDA1
P27/SCK0/SCL
P30/TO0 5-H
P31/TO1
P32/TO2
P33/TI1 8-C
P34/TI2
P35/PCL 5-H
P36/BUZ
P37
P40/AD0 to P47/AD7 5-N I/O Input: Independently connect to VDD0 via a resistor.
Output: Leave open.
P50/A8 to P57/A15 5-H I/O Input: Independently connect to VDD0 or VSS0 via a resistor.
Output: Leave open.
Pin Name I/O Circuit Type I/O Recommended Connection of Unused Pins
P60 to P63 (mask ROM version) 13-J I/O Input: Independently connect to VDD0 via a resistor.
Output: Set 0 to the port and leave open at low level output.
P60 to P63 (flash memory version) 13-K I/O Input: Independently connect to VDD0 or VSS0 via a resistor.
P64/RD 5-H Output: Leave open.
P65/WR
P66/WAIT
P67/ASTB
P70/SI2/RxD0 8-C
P71/SO2/TxD0 5-H
P72/SCK2/ASCK 8-C
P120/RTP0 to P127/RTP7 5-H
P130/ANO0, P131/ANO1 12-C I/O Input: Independently connect to VSS0 via a resistor.
Output: Leave open.
RESET 2 Input —
XT2 16 — Leave open.
AVREF0 — Connect to VDD0 or VSS0.
AVREF1 Connect to VDD0.
AVSS Connect to VSS0.
IC (mask ROM version) Connect directly to VSS0.
VPP (flash memory version) Independently connect 10 kΩ pull-down resistor, or connect
to VSS0 or VSS1 directly.
Pull-up
P-ch
enable
IN
VDD0
Data P-ch
Pull-up Pull-up
P-ch P-ch
enable enable
VDD0
VDD0
Data
P-ch Data
P-ch
IN/OUT
IN/OUT
Output N-ch Open drain
disable Output disable N-ch
VSS0
VSS0
Input
enable
Pull-up
P-ch
Pull-up enable
P-ch VDD0
enable
VDD0 Data
P-ch
Data IN/OUT
P-ch
Output N-ch
disable
P-ch VSS0
IN/OUT Comparator
+
Output – N-ch
N-ch VSS0
disable
VSS0 VREF (threshold voltage)
Input
enable
IN/OUT
Pull-up
P-ch
enable Data
VDD0 Output disable N-ch
Data VSS0
P-ch
IN/OUT VDD0
Output N-ch
disable RD P-ch
VSS0
Input P-ch
enable Medium breakdown
Analog output input buffer
voltage N-ch
RD P-ch
XT1 XT2
Medium breakdown
input buffer
FB00H
FAFFH
Unusable
FAE0H
FADFH 5FFFH
Internal buffer RAM
32 × 8 bits Program area
FAC0H
Data memory FABFH 1000H
space Unusable 0FFFH
FA80H
FA7FH
CALLF entry area
0800H
External memory 07FFH
39,552 × 8 bits
Program area
Program
memory
0080H
space
6000H 007FH
5FFFH
CALLT table area
0040H
Internal ROM
003FH
24,576 × 8 bits
Vector table area
0000H 0000H
FB00H
FAFFH
Unusable
FAE0H
FADFH 7FFFH
Internal buffer RAM
32 × 8 bits Program area
FAC0H
Data memory FABFH 1000H
space Unusable 0FFFH
FA80H
FA7FH
CALLF entry area
0800H
External Memory 07FFH
31,360 × 8 bits
Program area
Program
memory
0080H
space
8000H 007FH
7FFFH
CALLT table area
0040H
Internal ROM
003FH
32,768 × 8 bits
Vector table area
0000H 0000H
FB00H
FAFFH
Unusable
FAE0H
FADFH 9FFFH
Internal buffer RAM
32 × 8 bits Program area
FAC0H
Data memory FABFH 1000H
space Unusable 0FFFH
FA80H
FA7FH
CALLF entry area
0800H
External memory 07FFH
23,168 × 8 bits
Program area
Program
memory
0080H
space
A000H 007FH
9FFFH
CALLT table area
0040H
Internal ROM
003FH
40,960 × 8 bits
Vector table area
0000H 0000H
FB00H
FAFFH
Unusable
FAE0H
FADFH BFFFH
Internal buffer RAM
32 × 8 bits Program area
FAC0H
Data memory FABFH 1000H
space Unusable 0FFFH
FA80H
FA7FH
CALLF entry area
0800H
External memory 07FFH
14,976 × 8 bits
Program area
Program
memory
0080H
space
C000H 007FH
BFFFH
CALLT table area
0040H
Internal ROM
003FH
49,152 × 8 bits
Vector table area
0000H 0000H
FB00H
FAFFH
Unusable
FAE0H
FADFH EFFFH
Internal buffer RAM
32 × 8 bits Program area
FAC0H
Data memory FABFH 1000H
space Unusable 0FFFH
F800H
F7FFH
CALLF entry area
Internal
expansion RAM 0800H
1,024 × 8 bits 07FFH
Program area
F400H
F3FFH
Unusable
Note 0080H
F000H 007FH
EFFFH
CALLT table area
Program 0040H
Internal ROM
memory 003FH
61,440 × 8 bits
space
Vector table area
0000H 0000H
Note When the internal ROM size is 60 KB, the area F000H to F3FFH cannot be used. F000H to F3FFH
can be used as external memory by setting the internal ROM size to 56 KB or less using the internal
memory size switching register (IMS).
FB00H
FAFFH
Unusable
FAE0H
FADFH EFFFH
Internal buffer RAM
32 × 8 bits Program area
FAC0H
Data memory FABFH 1000H
space Unusable 0FFFH
F800H
F7FFH
CALLF entry area
Internal
expansion RAM 0800H
1,024 × 8 bits 07FFH
Program area
F400H
F3FFH
Note 0080H
Unusable
F000H 007FH
EFFFH
CALLT table area
Program 0040H
Flash memory
memory 003FH
61,440 × 8 bits
space
Vector table area
0000H 0000H
Note When the flash memory size is 60 KB, the area F000H to F3FFH cannot be used. F000H to F3FFH
can be used as external memory by setting the flash memory size to 56 KB or less using the internal
memory size switching register (IMS).
Internal ROM
Part Number
Type Capacity
µPD780053, 780053(A), 780053Y, 780053Y(A) Mask ROM 24,576 × 8 bits
µPD780054, 780054(A), 780054Y, 780054Y(A) 32,768 × 8 bits
µPD780055, 780055(A), 780055Y, 780055Y(A) 40,960 × 8 bits
µPD780056, 780056(A), 780056Y, 780056Y(A) 49,152 × 8 bits
µPD780058, 780058B, 780058B(A), 780058BY, 780058BY(A) 61,440 × 8 bits
µPD78F0058, 78F0058Y Flash memory 61,440 × 8 bits
The internal program memory is divided into the following three areas.
0008H INTP1
000AH INTP2
000CH INTP3
000EH INTP4
0010H INTP5
0014H INTCSI0
0016H INTCSI1
0018H INTSER
001AH INTSR/INTCSI2
001CH INTST
001EH INTTM3
0020H INTTM00
0022H INTTM01
0024H INTTM1
0026H INTTM2
0028H INTAD
003EH BRK
(3) Internal expansion RAM (µPD780058, 780058B, 780058B(A), 780058BY, 780058BY(A), 78F0058, 78F0058Y
only)
Internal expansion RAM is allocated to the 1,024-byte area from F400H to F7FFH.
FFFFH
Special function
registers (SFRs) SFR addressing
256 × 8 bits
FF20H
FF1FH
FF00H
FEFFH General-purpose registers
Register addressing
32 × 8 bits Short direct
FEE0H
FEDFH addressing
Internal high-speed RAM
1,024 × 8 bits
FE20H
FE1FH
FB00H
FAFFH
Unusable
FAE0H
FADFH
Direct addressing
Internal buffer RAM
32 × 8 bits Register indirect
FAC0H addressing
FABFH
Unusable Based addressing
FA80H
FA7FH Based indexed
addressing
External memory
39,552 × 8 bits
6000H
5FFFH
Internal ROM
24,576 × 8 bits
0000H
FFFFH
Special function
registers (SFRs) SFR addressing
256 × 8 bits
FF20H
FF1FH
FF00H
FEFFH General-purpose registers
Register addressing
32 × 8 bits Short direct
FEE0H
FEDFH addressing
Internal high-speed RAM
1,024 × 8 bits
FE20H
FE1FH
FB00H
FAFFH
Unusable
FAE0H
FADFH
Direct addressing
Internal buffer RAM
32 × 8 bits Register indirect
FAC0H addressing
FABFH
Unusable Based addressing
FA80H
FA7FH Based indexed
addressing
External memory
31,360 × 8 bits
8000H
7FFFH
Internal ROM
32,768 × 8 bits
0000H
FFFFH
Special function
registers (SFRs) SFR addressing
256 × 8 bits
FF20H
FF1FH
FF00H
FEFFH General-purpose registers
Register addressing
32 × 8 bits Short direct
FEE0H
FEDFH addressing
Internal high-speed RAM
1,024 × 8 bits
FE20H
FE1FH
FB00H
FAFFH
Unusable
FAE0H
FADFH
Direct addressing
Internal buffer RAM
32 × 8 bits Register indirect
FAC0H addressing
FABFH
Unusable Based addressing
FA80H
FA7FH Based indexed
addressing
External memory
23,168 × 8 bits
A000H
9FFFH
Internal ROM
40,960 × 8 bits
0000H
FFFFH
Special function
registers (SFRs) SFR addressing
256 × 8 bits
FF20H
FF1FH
FF00H
FEFFH General-purpose registers
Register addressing
32 × 8 bits Short direct
FEE0H
FEDFH addressing
Internal high-speed RAM
1,024 × 8 bits
FE20H
FE1FH
FB00H
FAFFH
Unusable
FAE0H
FADFH
Direct addressing
Internal buffer RAM
32 × 8 bits Register indirect
FAC0H addressing
FABFH
Unusable Based addressing
FA80H
FA7FH Based indexed
addressing
External memory
14,976 × 8 bits
C000H
BFFFH
Internal ROM
49,152 × 8 bits
0000H
Figure 5-11. Data Memory Addressing (µPD780058, 780058B, 780058B(A), 780058BY, 780058BY(A))
FFFFH
Special function
registers (SFRs) SFR addressing
256 × 8 bits
FF20H
FF1FH
FF00H
FEFFH General-purpose registers
Register addressing
32 × 8 bits Short direct
FEE0H
FEDFH addressing
Internal high-speed RAM
1,024 × 8 bits
FE20H
FE1FH
FB00H
FAFFH
Unusable
FAE0H
FADFH
Direct addressing
Internal buffer RAM
32 × 8 bits Register indirect
FAC0H addressing
FABFH
Unusable Based addressing
F800H
F7FFH Based indexed
addressing
Internal expansion RAM
1,024 × 8 bits
F400H
F3FFH
UnusableNote
F000H
EFFFH
Internal ROM
61,440 × 8 bits
0000H
Note When the internal ROM size is 60 KB, the area F000H to F3FFH cannot be used. F000H to F3FFH
can be used as external memory by setting the internal ROM size to 56 KB or less using the internal
memory size switching register (IMS).
FFFFH
Special function
registers (SFRs) SFR addressing
256 × 8 bits
FF20H
FF1FH
FF00H
FEFFH General-purpose registers
Register addressing
32 × 8 bits Short direct
FEE0H
FEDFH addressing
Internal high-speed RAM
1,024 × 8 bits
FE20H
FE1FH
FB00H
FAFFH
Unusable
FAE0H
FADFH
Direct addressing
Internal buffer RAM
32 × 8 bits Register indirect
FAC0H addressing
FABFH
Unusable Based addressing
F800H
F7FFH Based indexed
addressing
Internal expansion RAM
1,024 × 8 bits
F400H
F3FFH
UnusableNote
F000H
EFFFH
Flash memory
61,440 × 8 bits
0000H
Note When the flash memory size is 60 KB, the area F000H to F3FFH cannot be used. F000H to F3FFH
can be used as external memory by setting the flash memory size to 56 KB or less using the internal
memory size switching register (IMS).
The µPD780058 and 780058Y Subseries incorporate the following processor registers.
15 0
PC PC15 PC14 PC13 PC12 PC11 PC10 PC9 PC8 PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0
7 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 (reset) from
the stack memory.
Each stack operation saves/resets data as shown in Figures 5-16 and 5-17.
Caution Because RESET input makes SP contents indeterminate, be sure to initialize the SP before
instruction execution.
Interrupt and
PUSH rp instruction CALL, CALLF, and BRK instruction
CALLT instruction
SP SP _ 3
SP SP _ 2 SP SP _ 2 SP _ 3 PC7 to PC0
SP SP SP
SP SP + 2 SP SP + 2 SP + 2 PSW
SP SP + 3
R5
BANK1 RP2
R4
FEE0H
R3
BANK2 RP1
R2
FEE8H
R1
BANK3 RP0
R0
FEE0H
15 0 7 0
D
BANK1 DE
E
FEF0H
B
BANK2 BC
C
FEE8H
A
BANK3 AX
X
FEE0H
15 0 7 0
• 1-bit manipulation
Describe the symbol reserved by assembler for the 1-bit manipulation instruction operand (sfr.bit).
This manipulation can also be specified using an address.
• 8-bit manipulation
Describe the symbol reserved by assembler for the 8-bit manipulation instruction operand (sfr).
This manipulation can also be specified using an address.
• 16-bit manipulation
Describe the symbol reserved by assembler for the 16-bit manipulation instruction operand (sfrp).
When addressing an address, describe an even address.
Table 5-2 gives a list of special-function registers. The meanings of items in the table are as follows.
• Symbol
Symbol indicating the addresses of the special function register. These symbols are reserved words in the
RA78K0 and defined by header file sfrbit.h in the CC78K0, and can be used as the operands of instructions
when the RA78K0, ID78K0, ID78K0-NS, and SM78K0 are used.
• R/W
Indicates whether the corresponding special-function register can be read or written.
R/W: Read/write enabled
R: Read only
W: Write only
• Manipulatable bit units
√ indicates the bit units (1, 8, or 16 bits) in which the register can be manipulated. — indicates that the register
cannot be manipulated in the indicated bit units.
• After reset
Indicates each register status upon RESET input.
Address Special-Function Register (SFR) Name Symbol R/W Manipulatable Bit Unit After Reset
FF01H Port 1 P1 √ √ —
FF02H Port 2 P2 √ √ —
FF03H Port 3 P3 √ √ —
Address Special-Function Register (SFR) Name Symbol R/W Manipulatable Bit Unit After Reset
Note This register is provided only in the µPD780058, 780058B, 780058B(A), 780058BY, 780058BY(A),
78F0058, and 78F0058Y.
Address Special-Function Register (SFR) Name Symbol R/W Manipulatable Bit Unit After Reset
Notes 1. The external access area cannot be accessed using SFR addressing. Access the area using direct
addressing.
2. The value after reset depends on the product.
µPD780053, 780053(A), 780053Y, 780053Y(A): C6H
µPD780054, 780054(A), 780054Y, 780054Y(A): C8H
µPD780055, 780055(A), 780055Y, 780055Y(A): CAH
µPD780056, 780056(A), 780056Y, 780056Y(A): CCH
µPD780058, 780058B, 780058B(A), 780058BY, 780058BY(A): CFH
µPD78F0058, 78F0058Y: CFH
3. This register is provided only in the µPD780058, 780058B, 780058B(A), 780058BY, 780058BY(A),
78F0058, and 78F0058Y.
The instruction address is determined by the program counter (PC) contents. The contents of the PC are 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 Instructions User’s
Manual (U12326E).
[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 the relative addressing modes, execution branches in a relative range of –128 to +127 from the first address
of the next instruction.
This function is carried out when the BR $addr16 instruction or a conditional branch instruction is executed.
[Illustration]
15 0
15 8 7 6 0
α S
jdisp8
15 0
PC
[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.
The CALL !addr16 and BR !addr16 instructions can branch in the entire memory space. The CALLF !addr11
instruction branches to an area of addresses 0800H to 0FFFH.
[Illustration]
In the case of CALL !addr16 and BR !addr16 instructions
7 0
CALL or BR
Low Addr.
High Addr.
15 8 7 0
PC
7 6 4 3 0
fa10 to 8 CALLF
fa7 to 0
15 11 10 8 7 0
PC 0 0 0 0 1
[Function]
The 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.
Before the CALLT [addr5] instruction is executed, table indirect addressing is performed. This instruction
references an address stored in the memory table at addresses 40H to 7FH, and can branch in the entire memory
space.
[Illustration]
7 6 5 1 0
15 8 7 6 5 1 0
Effective address 0 0 0 0 0 0 0 0 0 1 0
7 Memory (table) 0
Low Addr.
15 8 7 0
PC
[Function]
The register pair (AX) contents to be specified by 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 7 0
rp A X
15 8 7 0
PC
The following methods are available to specify the register and memory (addressing) which undergo manipulation
during instruction execution.
[Function]
The register which functions as an accumulator (A and AX) in the general-purpose register area is automatically
(illicitly) addressed.
In the µPD780058 and 780058Y Subseries instruction words, the following instructions employ implied addressing.
[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 register A and register X is stored in AX. In this example,
the A and AX registers are specified by implied addressing.
[Function]
This addressing accesses a general-purpose register as an operand. The general-purpose register accessed
is specified by the register bank select flags (RBS0 and RBS1) and register specification code (Rn or RPn) in
an instruction 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 by 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 with function names (X, A, C, B, E, D, L, H, AX, BC, DE, and HL) as well as absolute
names (R0 to R7 and RP0 to RP3).
[Description example]
MOV A, C; when selecting C register as r
Operation code 0 1 1 0 0 0 1 0
Operation code 1 0 0 0 0 1 0 0
[Function]
This addressing directly addresses the memory indicated by the immediate data in an instruction word.
[Operand format]
Identifier Description
addr16 Label or 16-bit immediate data
[Description example]
MOV A, !0FE00H; when setting !addr16 to FE00H
0 0 0 0 0 0 0 0 00H
1 1 1 1 1 1 1 0 FEH
[Illustration]
7 0
Opcode
addr16 (lower)
addr16 (higher)
Memory
[Function]
The memory to be manipulated in the fixed space is directly addressed with 8-bit data in an instruction word.
The fixed space to which this address is applied is a 256-byte space of addresses FE20H to FF1FH. An internal
RAM and special-function registers (SFRs) are mapped at FE20H to FEFFH and FF00H to FF1FH, respectively.
The SFR area (FF00H to FF1FH) to which short direct addressing is applied is a part of the entire SFR area.
Ports frequently accessed by the program, and the compare registers and capture registers of timer/event
counters are mapped to this area. These SFRs can be manipulated with a short byte length and few 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. See [Illustration] on next page.
[Operand format]
Identifier Description
[Description example]
MOV 0FE30H, #50H; when setting saddr to FE30H and immediate data to 50H
0 0 1 1 0 0 0 0 30H (saddr-offset)
[Illustration]
7 0
Opcode
saddr-offset
[Function]
The memory-mapped special-function registers (SFRs) are 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]
0 0 1 0 0 0 0 0 20H (sfr-offset)
[Illustration]
7 0
Opcode
sfr-offset
SFR
15 8 7 0
Effective address 1 1 1 1 1 1 1 1
[Function]
This addressing addresses the memory with the contents of a register pair specified as an operand. The register
pair to be accessed is specified by the register bank select flags (RBS0 and RBS1) and register pair specification
code in an instruction code. This addressing can be carried out for all the memory spaces.
[Operand format]
Identifier Description
— [DE], [HL]
[Description example]
Operation code 1 0 0 0 0 1 0 1
[Illustration]
15 8 7 0
DE D E
Contents of addressed
memory are transferred.
7 0
[Function]
This addressing addresses the memory by adding 8-bit immediate data to the contents of the HL register pair
which is used as a base register and by using the result of the addition. The HL register pair to be accessed
is in the register bank specified by the register bank select flags (RBS0 and RBS1). The 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]
Operation code 1 0 1 0 1 1 1 0
0 0 0 1 0 0 0 0
[Function]
This addressing addresses the memory by adding the contents of the HL register, which is used as a base register,
to the contents of the B or C register specified in the instruction word, and by using the result of the addition.
The HL, B, and C registers to be accessed are registers in the register bank specified by the register bank select
flags (RBS0 and RBS1). The addition is performed by extending the contents of the B or C register to 16 bits
as a positive number. 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]
Operation code 1 0 1 0 1 0 1 1
[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.
Stack addressing can be used to address the internal high-speed RAM area only.
[Description example]
Operation code 1 0 1 1 0 1 0 1
The µPD780058 and 780058Y Subseries incorporate two input ports and sixty-six I/O ports. Figure 6-1 shows
the port types. Every port can be manipulated in 1-bit and 8-bit units and can carry out considerably varied control
operations. Besides port functions, the ports can also serve as on-chip hardware I/O pins.
P50 P00
Port 0
Port 5
P05
P07
P57
P60 P10
Port 6 Port 1
P67 P17
P70 P20
Port 7
P72
P120 Port 2
P27
Port 12
P30
P127
P130 Port 3
Port 13
P131
P37
P40
Port 4
P47
P05 INTP5
P07 Input only XT1
P10 to P17 Port 1 ANI0 to ANI7
8-bit I/O port
Input/output can be specified in 1-bit units.
If used as an input port, an on-chip pull-up resistor can be connected by setting software.
P26 SO0/SB1
P27 SCK0
P30 Port 3 TO0
P31 8-bit I/O port TO1
Input/output can be specified in 1-bit units.
P32 TO2
If used as an input port, an on-chip pull-up resistor can be connected by setting software.
P33 TI1
P34 TI2
P35 PCL
P36 BUZ
P37 —
P05 INTP5
P07 Input only XT1
P10 to P17 Port 1 ANI0 to ANI7
8-bit I/O port
Input/output can be specified in 1-bit units.
If used as an input port, an on-chip pull-up resistor can be connected by setting software.
P26 SO0/SB1/SDA1
P27 SCK0/SCL
P30 Port 3 TO0
P34 TI2
P35 PCL
P36 BUZ
P37 —
P40 to P47 Port 4 AD0 to AD7
8-bit I/O port
Input/output can be specified in 8-bit units.
If used as an input port, an on-chip pull-up resistor can be connected by setting software.
The test input flag (KRIF) is set to 1 by falling edge detection.
P50 to P57 Port 5 A8 to A15
8-bit I/O port
LEDs can be driven directly.
Input/output can be specified in 1-bit units.
If used as an input port, an on-chip pull-up resistor can be connected by setting software.
Item Configuration
6.2.1 Port 0
Port 0 is a 7-bit I/O port with an output latch. Pins P01 to P05 can be set to input or output mode in 1-bit units
using port mode register 0 (PM0). Pins P00 and P07 are input-only ports. When pins P01 to P05 are used as input
ports, an on-chip pull-up resistor can be connected to them in 6-bit units using pull-up resistor option register L (PUOL).
Alternate functions include external interrupt request input, external count clock input to the timer and crystal
connection for subsystem clock oscillation.
RESET input sets port 0 to input mode.
Figures 6-2 and 6-3 show block diagrams of port 0.
Caution Because port 0 also serves as external interrupt request input, when the port function output
mode is specified and the output level is changed, the interrupt request flag is set. Thus, when
the output mode is used, set the interrupt mask flag to 1.
RD
Internal bus
P00/INTP0/TI00,
P07/XT1
VDD0
WRPUO
PUO0 P-ch
RD
Selector
Internal bus
WRPORT
P01/INTP1/TI01,
Output latch P02/INTP2
(P01 to P05) to
P05/INTP5
WRPM
PM01 to PM05
6.2.2 Port 1
Port 1 is an 8-bit I/O port with an output latch. Port 1 can be set to input or output mode in 1-bit units using port
mode register 1 (PM1). When pins P10 to P17 are used as an input port, an on-chip pull-up resistor can be connected
to them in 8-bit units using pull-up resistor option register L (PUOL).
Alternate functions include A/D converter analog input.
RESET input sets port 1 to input mode.
Figure 6-4 shows a block diagram of port 1.
Caution A pull-up resistor cannot be used for pins used as A/D converter analog inputs.
VDD0
WRPUO
PUO1
P-ch
RD
Selector
Internal bus
WRPORT
P10/ANI0
Output latch
to
(P10 to P17)
P17/ANI7
WRPM
PM10 to PM17
Cautions 1. When used as serial interface pins, set input/output and the output latch according to the
function. For the setting method, see Figure 16-4 Format of Serial Operating Mode Register
0, Figure 18-3 Format of Serial Operating Mode Register 1, and Table 19-2 Serial Interface
Channel 2 Operating Mode Settings.
2. When reading the pin state in SBI mode, set the PM2n bit of PM2 to 1 (n = 5, 6) (See the
description of (10) Judging busy state of slave in section 16.4.3 SBI mode operation).
VDD0
WRPUO
PUO2
P-ch
RD
Selector
Internal bus
WRPORT
P20/SI1,
Output latch P21/SO1,
(P20, P21, P23 to P26) P23/STB/TxD1,
P24/BUSY/RxD1,
P25/SI0/SB0,
P26/SO0/SB1
WRPM
PM20, PM21
PM23 to PM26
Alternate function
VDD0
WRPUO
PUO2 P-ch
RD
Selector
Internal bus
WRPORT
Output latch
(P22, P27) P22/SCK1,
P27/SCK0
WRPM
PM22, PM27
Alternate function
Caution When used as serial interface pins, set input/output and the output latch according to the
function. For the setting method, see Figure 17-4 Format of Serial Operating Mode Register 0,
Figure 18-3 Format of Serial Operating Mode Register 1, and Table 19-2 Serial Interface Channel
2 Operating Mode Settings.
VDD0
WRPUO
PUO2
P-ch
RD
Selector
Internal bus
WRPORT
Output latch
(P20, P21, P23 to P26)
P20/SI1,
P21/SO1,
P23/STB/TxD1,
P24/BUSY/RxD1,
P25/SI0/SB0/SDA0,
WRPM P26/SO0/SB1/SDA1
PM20, PM21
PM23 to PM26
Alternate function
VDD0
WRPUO
PUO2 P-ch
RD
Selector
Internal bus
WRPORT
Output latch
(P22 and P27) P22/SCK1,
P27/SCK0/SCL
WRPM
PM22, PM27
Alternate function
6.2.5 Port 3
Port 3 is an 8-bit I/O port with an output latch. Pins P30 to P37 can be set to input or output mode in 1-bit units
using port mode register 3 (PM3). When pins P30 to P37 are used as an input port, an on-chip pull-up resistor can
be connected to them in 8-bit units using pull-up resistor option register L (PUOL).
Alternate functions include timer I/O, clock output and buzzer output.
RESET input sets port 3 to input mode.
Figure 6-9 shows a block diagram of port 3.
VDD0
WRPUO
PUO3 P-ch
RD
Selector
Internal bus
WRPORT
P30/TO0
to
Output latch
P32/TO2,
(P30 to P37)
P33/TI1,
P34/TI2,
P35/PCL,
P36/BUZ,
WRPM P37
PM30 to PM37
Alternate function
6.2.6 Port 4
Port 4 is an 8-bit I/O port with an output latch. Pins P40 to P47 can be set to input or output mode in 8-bit units
using the memory expansion mode register (MM). When pins P40 to P47 are used as an input port, an on-chip pull-
up resistor can be connected to them in 8-bit units using pull-up resistor option register L (PUOL).
The test input flag (KRIF) can be set to 1 by detecting a falling edge.
Alternate functions include an address/data bus function in external memory expansion mode.
RESET input sets port 4 to input mode.
Figures 6-10 and 6-11 show a block diagram of port 4 and of the falling edge detector, respectively.
VDD0
WRPUO
PUO4 P-ch
RD
Selector
Internal bus
WRPORT
P40/AD0
Output latch
to
(P40 to P47)
P47/AD7
WRMM
MM
P40
P41
P42
P43 Falling edge detector KRIF set signal
P44
P45
KRMK Standby release
P46
signal
P47
6.2.7 Port 5
Port 5 is an 8-bit I/O port with an output latch. Pins P50 to P57 can be set to input or output mode in 1-bit units
using the port mode register 5 (PM5). When pins P50 to P57 are used as an input port, an on-chip pull-up resistor
can be connected to them in 8-bit units using pull-up resistor option register L (PUOL).
Port 5 can drive LEDs directly.
Alternate functions include an address bus function in external memory expansion mode.
RESET input sets port 5 to input mode.
Figure 6-12 shows a block diagram of port 5.
VDD0
WRPUO
PUO5
P-ch
RD
Selector
Internal bus
WRPORT
P50/A8
Output latch
to
(P50 to P57)
P57/A15
WRPM
PM50 to PM57
6.2.8 Port 6
Port 6 is an 8-bit I/O port with an output latch. Pins P60 to P67 can be set to input or output mode in 1-bit units
using port mode register 6 (PM6).
This port has functions related to pull-up resistors as shown below. These functions differ depending on whether
the higher 4 bits or lower 4 bits of a port are used, and whether the mask ROM model or flash memory model is used.
Higher 4 Bits (P64 to P67 Pins) Lower 4 Bits (P60 to P63 Pins)
Mask ROM On-chip pull-up resistor can be connected in 4-bit Pull-up resistor can be connected in 1-bit
version units by PUO6 units by mask option
Flash memory version Pull-up resistor is not connected
Cautions 1. When an external wait is not used in external memory expansion mode, P66 can be used as
an I/O port.
2. The value of the low-level input leakage current flowing to the P60 to P63 pins differ
depending on the following conditions:
VDD0
WRPORT
Output latch
P60 to P63
(P60 to P63)
WRPM
PM60 to PM63
VDD0
WRPUO
PUO6 P-ch
RD
Selector
Internal bus
WRPORT
P64/RD,
Output latch P65/WR,
(P64 to P67) P66/WAIT,
P67/ASTB
WRPM
PM64 to PM67
6.2.9 Port 7
This is a 3-bit I/O port with an output latch. Pins P70 to P72 can be set to input or output mode in 1-bit units using
port mode register 7 (PM7). When pins P70 to P72 are used as an input port, an on-chip pull-up resistor can be
connected in 3-bit units using pull-up resistor option register L (PUOL).
Alternate functions include serial interface channel 2 data I/O and clock I/O.
RESET input sets port 7 to input mode.
Figures 6-15 and 6-16 show a block diagram of port 7.
Caution When used as serial interface pins, set input/output and the output latch according to the
function. For the setting method, see Table 19-2 Serial Interface Channel 2 Operating Mode
Setting.
VDD0
WRPUO
PUO7
P-ch
RD
Selector
Internal bus
WRPORT
WRPM
PM70
VDD0
WRPUO
PUO7
P-ch
RD
Selector
Internal bus
WRPORT
Output latch
P71/SO2/TxD0,
(P71 and P72)
P72/SCK2/ASCK
WRPM
PM71, PM72
Alternate function
6.2.10 Port 12
This is an 8-bit I/O port with an output latch. Pins P120 to P127 can be set to input or output mode in 1-bit units
using port mode register 12 (PM12). When pins P120 to P127 are used as an input port, an on-chip pull-up resistor
can be connected in 8-bit units using pull-up resistor option register H (PUOH).
These pins have an alternate function, serving as real-time outputs.
RESET input sets port 12 to input mode.
Figure 6-17 shows a block diagram of port 12.
VDD0
WRPUO
PUO12
P-ch
RD
Selector
Internal bus
WRPORT
P120/RTP0
Output latch
to
(P120 to P127)
P127/RTP7
WRPM
PM120 to PM127
6.2.11 Port 13
This is a 2-bit I/O port with an output latch. Pins P130 and P131 can be set to input mode/output mode in 1-bit
units using port mode register 13 (PM13). When pins P130 and P131 are used as an input port, an on-chip pull-up
resistor can be connected in 2-bits using pull-up resistor option register H (PUOH).
These pins have an alternate function, serving as D/A converter analog outputs.
RESET input sets port 13 to input mode.
Figure 6-18 shows a block diagram of port 13.
Caution When only one of the D/A converter channels is used with AVREF1 < VDD0, the other pins that
are not used as analog outputs must be set as follows:
• Set the PM13 bit of port mode register 13 (PM13) to 1 (input mode) and connect the pin
to VSS0.
• Clear the PM13x bit of port mode register 13 (PM13) to 0 (output mode) and the output latch
to 0, and output a low level from the pin.
VDD0
WRPUO
PUO13 P-ch
RD
Selector
Internal bus
WRPORT
WRPM
PM130, PM131
(1) Port mode registers (PM0 to PM3, PM5 to PM7, PM12, PM13)
These registers are used to set port input/output in 1-bit units.
PM0 to PM3, PM5 to PM7, PM12, and PM13 are independently set with a 1-bit or 8-bit memory manipulation
instruction
RESET input sets these registers to FFH.
When port pins are used as the alternate-function pins, set the port mode register and output latch according
to Table 6-5.
Table 6-5. Port Mode Register and Output Latch Settings When Using Alternate Functions
Name I/O
Notes 1. If these ports are read out when these pins are used in the alternate-function mode, undefined values
are read.
2. When the P40 to P47 pins, P50 to P57 pins, and P64 to P67 pins are used for alternate functions,
set the function by the memory extension mode register (MM).
Cautions 1. When not using an external wait in the external memory extension mode, the P66 pin can be
used as an I/O port.
2. When port 2 and port 7 are used for the serial interface, input/output and the output latch
must be set according to the function. For the setting methods, see Figure 16-4 Format
of Serial Operation Mode Register 0, Figure 17-4 Format of Serial Operation Mode
Register 0, Figure 18-3 Format of Serial Operation Mode Register 1, and Table 19-2 Serial
Interface Channel 2 Operating Mode Settings.
After
Symbol 7 6 5 4 3 2 1 0 Address reset R/W
PM1 PM17 PM16 PM15 PM14 PM13 PM12 PM11 PM10 FF21H FFH R/W
PM2 PM27 PM26 PM25 PM24 PM23 PM22 PM21 PM20 FF22H FFH R/W
PM3 PM37 PM36 PM35 PM34 PM33 PM32 PM31 PM30 FF23H FFH R/W
PM5 PM57 PM56 PM55 PM54 PM53 PM52 PM51 PM50 FF25H FFH R/W
PM6 PM67 PM66 PM65 PM64 PM63 PM62 PM61 PM60 FF26H FFH R/W
PM12 PM127 PM126 PM125 PM124 PM123 PM122 PM121 PM120 FF2CH FFH R/W
After
Symbol 7 6 <5> <4> 3 2 1 0 Address reset R/W
PUOL PUO7 PUO6 PUO5 PUO4 PUO3 PUO2 PUO1 PUO0 FFF7H 00H R/W
After
Symbol 7 6 5 4 3 2 1 0 Address reset R/W
MM2 MM1 MM0 Single-chip/memory P40 to P47, P50 to P57, P64 to P67 pin state
expansion mode
selection P40 to P47 P50 to P53 P54, P55 P56, P57 P64 to P67
Note The full address mode allows external expansion for all areas of the 64 KB address space, except the
internal ROM, RAM, SFR, and use-prohibited areas.
Remarks 1. Pins P60 to P63 enter the port mode in both the single-chip and memory expansion mode.
2. Besides setting port 4 input/output mode, MM also sets the wait count and external expansion
area.
After
Symbol 7 6 5 4 3 2 <1> <0> Address reset R/W
Caution When falling edge detection of port 4 is used, KRIF should be cleared to 0 (it is not cleared
to 0 automatically).
Port operations differ depending on whether the input or output mode is set, as shown below.
Caution In the case of a 1-bit memory manipulation instruction, although a single bit is manipulated,
the port is accessed as an 8-bit unit. Therefore, on a port with a mixture of input and output
pins, the output latch contents for pins specified as input are undefined, even for bits other
than the manipulated bit.
Caution In the case of a 1-bit memory manipulation instruction, although a single bit is manipulated,
the port is accessed as an 8-bit unit. Therefore, on a port with a mixture of input and output
pins, the output latch contents for pins specified as input are undefined, even for bits other
than the manipulated bit.
The following mask option is provided in mask ROM versions. The flash memory versions have no mask options.
Table 6-6. Comparison Between Mask ROM Version and Flash Memory Version
Mask option for pins P60 to P63 On-chip pull-up resistors can be selected in 1-bit units. No on-chip pull-up resistor
The clock generator generates the clock to be supplied to the CPU and peripheral hardware. The following two
types of system clock oscillators are available.
Item Configuration
FRC
X1 1/2 Clock to
Main fX
Selector
peripheral
system
X2 Prescaler f XT hardware
clock
oscillator Scaler 2
fX f XX
f XX 4
Selector
2 f XX 23 2 Standby Wait CPU clock
f XX 22 controller controller (fCPU)
f XX 2
To INTP0
3
sampling clock
STOP
MCS MCC FRC CLS CSS PCC2 PCC1 PCC0
Internal bus
Note The feedback resistor is necessary for adjusting the bias point of an oscillated waveform to the middle
level of the supply voltage. Only when the subsystem clock is not used, the current consumption in
the STOP mode can be further reduced by setting bit 6 (FRC) of PCC to 1.
FRC
P-ch
Feedback resistor
XT1 XT2
After
Symbol <7> <6> <5> <4> 3 2 1 0 Address reset R/W
PCC MCC FRC CLS CSS 0 PCC2 PCC1 PCC0 FFFBH 04H R/WNote 1
MCS = 1 MCS = 0
0 0 0 0 fXX fX fX/2
0 0 1 fXX/2 fX/2 fX/22
2 2
0 1 0 fXX/2 fX/2 fX/23
3 3
0 1 1 fXX/2 fX/2 fX/24
1 0 0 fXX/24 fX/24 fX/25
1 0 0 0 fXT/2
0 0 1
0 1 0
0 1 1
1 0 0
Other than above Setting prohibited
Note 3
R/W MCC Main system clock oscillation control
0 Oscillation possible
1 Oscillation stopped
The fastest instruction of the µPD780058, 780058Y Subseries is executed in 2 CPU clocks. Therefore, the
relationship between the CPU clock (fCPU) and minimum instruction execution time is as shown in Table 7-
2.
Table 7-2. Relationship Between CPU Clock and Minimum Instruction Execution Time
fX/22 1.6 µs
fX/23 3.2 µs
fX/24 6.4 µs
fX/25 12.8 µs
fXT/2 122 µs
After
Symbol 7 6 5 4 3 2 1 0 Address reset R/W
Cautions 1. Writing to OSMS should be performed only immediately after reset signal release and before
peripheral hardware operation starts. As shown in Figure 7-5 below, writing data (including
the same data as previously) to OSMS causes a main system clock cycle delay of up to 2/
fX during the write operation. Therefore, if this register is written during the operation, in
peripheral hardware which operates on the main system clock, a temporary error occurs in
the count clock cycle of timer, etc. In addition, because the oscillation mode is changed by
this register, the clock for peripheral hardware as well as that for the CPU is switched.
Write to OSMS
(MCS 0)
Max. 2/fX
fXX
2. When writing 1 to MCS, VDD must be 2.7 V or higher before the write operation.
X2 X2
VSS1 External X1
X1 clock
IC
Crystal
or
ceramic resonator
Cautions 1. Do not execute the STOP instruction or set MCC (bit 7 of the processor clock control register
(PCC)) to 1 if an external clock is used. Otherwise, the operation of the main system clock
will be stopped and the X2 pin will be pulled up to VDD1.
2. When using a main system clock oscillator and a subsystem clock oscillator, carry out wiring
in the broken line area in Figures 7-6 and 7-7 to prevent any effects from wiring capacities.
• Minimize the wiring length.
• Do not allow wiring to intersect with other signal conductors. Do not allow wiring to come
near changing high current.
• Set the potential of the grounding position of the oscillator capacitor to that of VSS1. Do
not ground to any ground pattern where high current is present.
• Do not fetch signals from the oscillator.
IC
XT2 XT2
32.768
kHz
External XT1
VSS1 XT1 Clock
µ PD74HCU04
Caution When using a main system clock oscillator and a subsystem clock oscillator, carry out wiring
in the broken line area in Figures 7-6 and 7-7 to prevent any effects from wiring capacities.
• Minimize the wiring length.
• Do not allow wiring to intersect with other signal conductors. Do not allow wiring to come near
changing high current.
• Set the potential of the grounding position of the oscillator capacitor to that of VSS1. Do not
ground to any ground pattern where high current is present.
• Do not fetch signals from the oscillator.
Take special note of the fact that the subsystem clock oscillator is designed as a low-amplitude
circuit for reducing current consumption.
PORTn
(n = 0 to 7, 12, 13)
X2 X1 IC X2 X1 IC
VSS1 VSS1
(c) Wiring near high fluctuating current (d) Current flowing through ground line
of oscillator (potential at points A, B,
and C fluctuates)
VDD
Pnm
X2 X1 IC
X2 X1 IC
High
Current
A B C
Remark When using the subsystem clock, replace X1 and X2 with XT1 and XT2, respectively. Also, insert
resistors in series on the XT2 side.
X2 X1 IC
VSS1
Remark When using the subsystem clock, replace X1 and X2 with XT1 and XT2, respectively. Also, insert
resistors in series on the XT2 side.
Caution If XT2 and XT1 are wired in parallel, the cross-talk noise of X1 may increase with XT2, resulting
in malfunction. To prevent this, it is recommended to wire XT2 and X1 so that they are not in
parallel, and to connect the IC pin between XT2 and X1 directly to VSS1.
7.4.4 Divider
The divider divides the main system clock oscillator output (fXX) and generates various clocks.
In this state, however, some current may leak via the internal feedback resistor of the subsystem clock oscillator
when the main system clock stops. To suppress the leakage current, disconnect the above internal feedback resistor
by setting bit 6 (FRC) of the processor clock control register (PCC) to 1. In this case also, connect the XT1 and XT2
pins as described above.
The clock generator generates the following clocks and controls the CPU operating mode including the standby
mode.
The following clock generator functions and operations are determined by the processor clock control register
(PCC) and the oscillation mode selection register (OSMS).
(a) Upon generation of the RESET signal, the lowest speed mode of the main system clock (12.8 µs when operated
at 5.0 MHz) is selected (PCC = 04H, OSMS = 00H). Main system clock oscillation stops while a low level
is applied to the RESET pin.
(b) With the main system clock selected, one of the six types of minimum instruction execution times (0.4 µs, 0.8
µs, 1.6 µs, 3.2 µs, 6.4 µs, 12.8 µs @ 5.0 MHz) can be selected by setting the PCC and OSMS registers.
(c) With the main system clock selected, two standby modes, the STOP and HALT modes, are available. In a
system where the subsystem clock is not used, the current consumption in the STOP mode can be further
reduced by specifying with not to use the feedback resistor using bit 6 (FRC) of the PCC register.
(d) The PCC register can be used to select the subsystem clock and to operate the system on a low current
consumption (122 µs when operated at 32.768 kHz).
(e) With the subsystem clock selected, main system clock oscillation can be stopped by the PCC register. The
HALT mode can be used, but not the STOP mode. (Subsystem clock oscillation cannot be stopped.)
(f) The main system clock is divided and supplied to the peripheral hardware. The subsystem clock is supplied
to the 16-bit timer/event counter, watch timer, and clock output functions only. Thus, the 16-bit timer/event
counter (when selecting watch timer output as the count clock when operating on the subsystem clock), the
watch function, and the clock output function can also be continued in the standby state. However, since all
other peripheral hardware operate on the main system clock, the peripheral hardware also stops if the main
system clock is stopped (except external input clock operation).
(a) Because the operation guaranteed instruction execution speed depends on the power supply voltage, the
minimum instruction execution time can be changed by bits 0 to 2 (PCC0 to PCC2) of the PCC register.
(b) If bit 7 (MCC) of the PCC register is set to 1 when operating on the main system clock, the main system clock
oscillation does not stop. When bit 4 (CSS) of PCC is set to 1 and the operation is subsequently switched
to the subsystem clock (CLS = 1), the main system clock oscillation stops (see Figure 7-9).
(a) Operation when MCC is set after setting CSS in case of main system clock operation
MCC
CSS
CLS
CPU clock
(b) Operation when MCC is set in case of main system clock operation
MCC
CSS L
CLS L
Oscillation does not stop.
CPU clock
(c) Operation when CSS is set after setting MCC in case of main system clock operation
MCC
CSS
CLS
CPU clock
(a) The minimum instruction execution time remains constant (122 µs when operating at 32.768 kHz) irrespective
of bits 0 to 2 (PCC0 to PCC2) of the PCC register.
Caution Do not execute the STOP instruction while the subsystem clock is in operation.
7.6.1 Time required for switchover between system clock and CPU clock
The system clock and CPU clock can be switched over by 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 directly after writing to the PCC; operation continues on the pre-
switchover clock for several instructions (see Table 7-3).
Determination as to whether the system is operating on the main system clock or the subsystem clock is performed
using bit 5 (CLS) of the PCC register.
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
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 × × × 1 × × ×
CHAPTER 7
0 0 1
(39 instructions) (20 instructions)
User's Manual U12013EJ3V2UD
CLOCK GENERATOR
(20 instructions) (10 instructions)
Remarks 1. One instruction is executed in the minimum instruction execution time with the pre-switchover CPU clock.
2. MCS: Bit 0 of the oscillation mode selection register (OSMS)
3. Values in parentheses apply to operation with fX = 5.0 MHz or fXT = 32.768 kHz.
Caution Selection of the CPU clock cycle division ratio (PCC0 to PCC2) and switchover from the main system clock to the subsystem
clock (changing CSS from 0 to 1) should not be performed simultaneously. Simultaneous setting is possible, however, for
selection of the CPU clock cycle division ratio (PCC0 to PCC2) and switchover from the subsystem clock to the main system
clock (changing CSS from 1 to 0).
CHAPTER 7 CLOCK GENERATOR
VDD
RESET
Interrupt
request
signal
(1) The CPU is reset by setting the RESET signal to low level after power-on. After that, when reset is released
by setting the RESET signal to high level, the main system clock starts oscillation. At this time, the oscillation
stabilization time (217/fX) is secured automatically.
After that, the CPU starts executing the instruction at the minimum speed of the main system clock (12.8 µs when
operated at 5.0 MHz).
(2) After the lapse of a sufficient time for the VDD voltage to increase to enable operation at maximum speeds,
the processor clock control register (PCC) and oscillation mode selection register (OSMS) are rewritten and
the maximum-speed operation is carried out.
(3) Upon detection of a decrease of the VDD voltage due to an interrupt request signal, the main system clock
is switched to the subsystem clock (which must be in an oscillation stable state).
(4) Upon detection of VDD voltage reset due to an interrupt request signal, bit 7 (MCC) of PCC is cleared to 0 and
oscillation of the main system clock is started. After the lapse of time required for stabilization of oscillation,
the PCC and OSMS registers are rewritten and the maximum-speed operation is resumed.
Caution When the main system clock is stopped and the device is operating on the subsystem clock, wait
until the oscillation stabilization time has been secured by the program before switching back
to the main system clock.
• Interval timer
• PWM output
• Pulse width measurement
• External event counter
• Square-wave output
• One-shot pulse output
PWM output and pulse width measurement can be used at the same time.
2 × watch timer output cycle 216 × watch timer output cycle Watch timer output edge cycle
Item Configuration
Internal bus
Capture/compare
control register 0
INTP1
16-bit capture/compare
TCL06 TCL05 TCL04 control register (CR01) TMC03 TMC02 TMC01 OVF0 OSPT OSPETOC04 LVS0 LVR0 TOC01 TOE0
Timer clock 16-bit timer mode 16-bit timer output
select register 0 CRC02 control register control register
Internal Bus
CRC02
INTTM01
Selector
CRC00
Selector
INTTM00 INV
Q TO0/P30
S
TI00/P00/ Edge
INTP0 detector One-shot pulse R
output controller
3
Internal bus
Remark The circuitry enclosed by the broken line is the output controller.
Table 8-4. INTP0/TI00 Pin Valid Edge and CR00 Capture Trigger Valid Edge
ES11 ES10 INTP0/TI00 Pin Valid Edge CR00 Capture Trigger Valid Edge
Table 8-5. INTP1/TI01 Pin Valid Edge and CR00 Capture Trigger Valid Edge
ES21 ES20 INTP1/TI01 Pin Valid Edge CR00 Capture Trigger Valid Edge
0 0 Falling edge Falling edge
0 1 Rising edge Rising edge
1 0 Setting prohibited
1 1 Both rising and falling edges Both rising and falling edges
Cautions 1. Set the data of PWM (14 bits) to the higher 14 bits of CR00. At this time, clear the lower
2 bits to 00.
2. Set CR00 to a value other than 0000H in the clear & start mode entered on a match between
TM0 and CR00. However, in the free-running mode and in the clear mode using the valid
edge of TI00, if CR00 is set to 0000H, an interrupt request (INTTM00) is generated
following overflow (FFFFH).
3. If the new value of CR00 is less than the value of the 16-bit timer register (TM0), TM0
continues counting, overflows, and then starts counting again from 0. If the new value
of CR00 is less than the old value, the timer must be restarted after changing the value
of CR00.
Table 8-6. INTP0/TI00 Pin Valid Edge and CR01 Capture Trigger Valid Edge
ES11 ES10 INTP0/TI00 Pin Valid Edge CR01 Capture Trigger Valid Edge
0 0 Falling edge Falling edge
Caution Set CR01 to a value other than 0000H in the clear & start mode entered on a match between
TM0 and CR00. However, in the free-running mode and in the clear mode using the valid edge
of TI00, if CR01 is set to 0000H, an interrupt request (INTTM01) is generated following
overflow (FFFFH).
Caution As reading of the value of TM0 is performed via CR01, the previously set value of CR01 is
lost.
The following seven registers are used to control the 16-bit timer/event counter.
Remark TCL0 has the function of setting the PCL output clock in addition to that of setting the count clock
of the 16-bit timer register.
MCS = 1 MCS = 0
MCS = 1 MCS = 0
0 Output disabled
1 Output enabled
Cautions 1. The TI00/INTP0 pin valid edge is set by external interrupt mode register 0 (INTM0), and
the sampling clock frequency is selected by the sampling clock selection register (SCS).
2. When enabling PCL output, set TCL00 to TCL03, then set CLOE to 1 with a 1-bit memory
manipulation instruction.
3. To read the count value when TI00 has been specified as the TM0 count clock, the value
should be read from TM0, not from 16-bit capture/compare register 01 (CR01).
4. When rewriting TCL0 to other data, stop the timer operation beforehand.
Caution The 16-bit timer register starts operation at the moment TMC01 to TMC03 are set to values
other than 0, 0, 0 (operation stop mode). Set TMC01 to TMC03 to 0, 0, 0 to stop the operation.
1 Overflow detected
TMC03 TMC02 TMC01 Operating mode or TO0 output timing selection Interrupt request generation
clear mode selection
Cautions 1. Switch the clear mode and the TO0 output timing after stopping the timer operation
(by clearing TMC01 to TMC03 to 0, 0, 0).
2. Set the valid edge of the TI00/INTP0 pin using external interrupt mode register 0
(INTM0) and select the sampling clock frequency using the sampling clock select
register (SCS).
3. When using the PWM mode, set the PWM mode and then set data to CR00.
4. If clear & start mode entered on a match between TM0 and CR00 is selected, when the
set value of CR00 is FFFFH and the TM0 value changes from FFFFH to 0000H, the OVF0
flag is set to 1.
Symbol 7 <6> <5> 4 <3> <2> 1 <0> Address After reset R/W
TOC0 0 OSPT OSPE TOC04 LVS0 LVR0 TOC01 TOE0 FF4EH 00H R/W
1 Output enabled
0 0 No change
1 1 Setting prohibited
Cautions 1. Timer operation must be stopped before setting TOC0 (except OSPT).
2. If LVS0 and LVR0 are read after data is set, they will be 0.
3. OSPT is cleared automatically after data setting, and will therefore be 0 if read.
4. OSPT can be set only when OSPE = 1.
0 0 Falling edge
0 1 Rising edge
1 0 Setting prohibited
0 0 Falling edge
0 1 Rising edge
1 0 Setting prohibited
0 0 Falling edge
0 1 Rising edge
1 0 Setting prohibited
Caution When using the INTP0/TI00/P00 and INTP1/TI01/P01 pins as timer input pins (TI00 and TI01),
stop the operation of 16-bit timer 0 by clearing bits 1 to 3 (TMC01 to TMC03) of the 16-bit timer
mode control register (TMC0) to 0, 0, 0, before setting the valid edge of TI00 and TI01. When
using the INTP0/TI00/P00 and INTP1/TI01/P01 pins as external interrupt input pins (INTP0 and
INTP1), the valid edge of INTP0 and INTP1 may be set while 16-bit timer 0 is operating.
MCS = 1 MCS = 0
N
0 0 fXX/2
7 7 8
0 1 fXX/2 fX/2 (39.1 kHz) fX/2 (19.5 kHz)
5 5 6
1 0 fXX/2 fX/2 (156.3 kHz) fX/2 (78.1 kHz)
6 6 7
1 1 fXX/2 fX/2 (78.1 kHz) fX/2 (39.1 kHz)
Caution fXX/2N is the clock supplied to the CPU, and fXX/25, fXX/26, and fXX/27 are clocks supplied to
peripheral hardware. The fXX/2N clock is stopped in HALT mode.
Remarks 1. N: Value set to bits 0 to 2 (PCC0 to PCC2) of the processor clock control register (PCC)
(N = 0 to 4)
2. fXX: Main system clock frequency (fX or fX/2)
3. fX: Main system clock oscillation frequency
4. MCS: Bit 0 of oscillation mode select register (OSMS)
5. Values in parentheses apply to operation with fX = 5.0 MHz.
Remark 0/1: Setting 0 or 1 allows another function to be used simultaneously with the interval timer. See
the description of the respective control registers for details.
INTTM3 INTTM00
2fXX
fXX Selector
fXX/2
2
16-bit timer register (TM0) OVF0
fXX/2
TI00/P00/INTP0
Clear circuit
Count clock
CR00 N N N N
INTTM00
TO0
TCL06 TCL05 TCL04 Minimum Interval Time Maximum Interval Time Resolution
0 0 0 2 × TI00 input cycle 216 × TI00 input cycle TI00 input edge cycle
0 0 1 Setting 2 × 1/fX Setting 216 × 1/fX Setting 1/fX
prohibited (400 ns) prohibited (13.1 ms) prohibited (200 ns)
0 1 0 2 × 1/fX 22 × 1/fX 216 × 1/fX 217 × 1/fX 1/fX 2 × 1/fX
(400 ns) (800 ns) (13.1 ms) (26.2 ms) (200 ns) (400 ns)
PWM mode
Remark 0/1: Setting 0 or 1 allows another function to be used simultaneously with PWM output.
See the description of the respective control registers for details.
×: don’t care
By integrating 14-bit resolution PWM pulses with an external low-pass filter, they can be converted to an analog
voltage and used for electronic tuning and D/A converter applications, etc.
The analog output voltage (VAN) used for D/A conversion with the configuration shown in Figure 8-14 is as follows.
µ PD780058, 780058Y
VREF
PWM
signal Analog output (VAN)
TO0/P30 Switching circuit Low-pass filter
Figure 8-15 shows an example in which PWM output is converted to an analog voltage and used in a voltage
synthesizer type TV tuner.
+110 V
µ PD780058, 780058Y
22 kΩ
47 kΩ 47 kΩ 47 kΩ
100 pF
2SC 0.22 µ F 0.22 µ F 0.22 µ F Electronic
TO0/P30 2352 tuner
8.2 kΩ µ PC574J
8.2 kΩ
VSS0 GND
VSS0
Cautions 1. CR00 and CR01 should be set to values in the following range:
0000H ≤ CR01 < CR00n ≤ FFFFH
2. The cycle of the pulse generated through PPG output (CR00 setting value + 1) has a duty of
(CR01 setting value + 1)/(CR00 setting value + 1).
INTTM3
2fXX
Selector
fXX
fXX/2
16-bit timer counter 0 Clear
fXX/22 (TM0) circuit
Noise
Output controller
TI00/P00/INTP0
eliminator
TO0/P30
Count clock
TO0
Pulse width: (M + 1) × t
1 cycle: (N + 1) × t
(1) Pulse width measurement with free-running counter and one capture register
When the 16-bit timer register (TM0) is operated in free-running mode (see register settings in Figure 8-17),
and the edge specified by external interrupt mode register 0 (INTM0) is input to the TI00/P00 pin, the value
of TM0 is taken into 16-bit capture/compare register 01 (CR01) and an external interrupt request signal (INTP0)
is set.
Any of three edge specifications can be selected—rising, falling, or both edges—by bits 2 and 3 (ES10 and
ES11) of INTM0.
For valid edge detection, sampling is performed at the interval selected by the sampling clock select register
(SCS), and a capture operation is only performed when a valid level is detected twice, thus eliminating noise
with a short pulse width.
Figure 8-19. Control Register Settings for Pulse Width Measurement with
Free-Running Counter and One Capture Register
Free-running mode
Remark 0/1: Setting 0 or 1 allows another function to be used simultaneously with pulse width measure-
ment. See the description of the respective control registers for details.
Figure 8-20. Configuration Diagram for Pulse Width Measurement by Free-Running Counter
INTTM3
2fXX
Selector
fXX
16-bit timer register (TM0) OVF0
fXX/2
2
fXX/2
INTP0
Internal bus
Count clock
INTP0
OVF0
Figure 8-22. Control Register Settings for Two Pulse Width Measurements with Free-Running Counter
Free-running mode
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.
Count clock
INTP0
INTP1
OVF0
(3) Pulse width measurement with free-running counter and two capture registers
When the 16-bit timer register (TM0) is operated in free-running mode (see register settings in Figure 8-22),
it is possible to measure the pulse width of the signal input to the TI00/P00 pin.
When the edge specified by bits 2 and 3 (ES10 and ES11) of external interrupt mode register 0 (INTM0) is
input to the TI00/P00 pin, the value of TM0 is taken into 16-bit capture/compare register 01 (CR01) and an
external interrupt request signal (INTP0) is set.
Also, on the reverse input edge to that of the capture operation into CR01, the value of TM0 is taken into 16-
bit capture/compare register 00 (CR00).
Either of two edge specifications can be selected—rising or falling—as the valid edges for the TI00/P00 pin
by bits 2 and 3 (ES10 and ES11) of INTM0.
For TI00/P00 pin valid edge detection, sampling is performed at the interval selected by the sampling clock
select register (SCS), and a capture operation is only performed when a valid level is detected twice, thus
eliminating noise with a short pulse width.
Caution If the valid edge of TI00/P00 is specified to be both the rising and falling edges, capture/
compare register 00 (CR00) cannot perform the capture operation.
Figure 8-24. Control Register Settings for Pulse Width Measurement with
Free-Running Counter and Two Capture Registers
Free-running mode
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.
Count clock
INTP0
OVF0
Caution If the valid edge of TI00/P00 is specified to be both the rising and falling edges, 16-bit capture/
compare register 00 (CR00) cannot perform the capture operation.
Figure 8-26. Control Register Settings for Pulse Width Measurement by Means of Restart
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.
Count clock
INTP0
D1 × t
D2 × t
Remark 0/1: Setting 0 or 1 allows another function to be used simultaneously with the external event
counter. See the description of the respective control registers for details.
16-bit capture/compare
register 00 (CR00)
INTTM00
Clear
INTP0
16-bit capture/compare
register 01 (CR01)
Internal bus
Figure 8-30. External Event Counter Operation Timing (with Rising Edge Specified)
TM0 count value 0000 0001 0002 0003 0004 0005 N–1 N 0000 0001 0002 0003
CR00 N
INTTM00
Caution When reading the external event counter count value, TM0 should be read.
Remark 0/1: Setting 0 or 1 allows another function to be used simultaneously with square-wave output.
See the description of the respective control registers for details.
Count clock
TM0 count value 0000 0001 0002 N–1 N 0000 0001 0002 N–1 N 0000
CR00 N
INTTM0
Note The case where N < M is described here. When N > M, the output becomes active with the CR00
register and inactive with the CR01 register.
Cautions 1. When a one-shot pulse is output by a software trigger, fix the TI00/P00 pin to either the
high or low level.
2. When outputting a one-shot pulse, do not set OSPT to 1. To output a one-shot pulse
again, wait until the current one-shot pulse output is completed.
Figure 8-33. Control Register Settings for One-Shot Pulse Output Operation Using Software Trigger
Free-running mode
Remark 0/1: Setting 0 or 1 allows another function to be used simultaneously with one-shot pulse output.
See the description of the respective control registers for details.
Figure 8-34. One-Shot Pulse Output Operation Timing Using Software Trigger
Count clock
TM0 count value 0000 0001 N N+1 0000 N–1 N M–1 M M+1 0000
OSPT
INTTM01
INTTM00
One-shot pulse
Caution The 16-bit timer register starts operation at the moment TMC01 to TMC03 are set to values
other than 0, 0, 0 (operation stop mode).
Remark N<M
Note The case where N < M is described here. When N > M, the output becomes active with the CR00
register and inactive with the CR01 register.
Caution When outputting one-shot pulses, the external trigger is ignored if generated again.
Figure 8-35. Control Register Settings for One-Shot Pulse Output Operation Using External Trigger
Remark 0/1: Setting 0 or 1 allows another function to be used simultaneously with one-shot pulse output.
See the description of the respective control registers for details.
Count clock
TM0 count value 0000 0001 0000 N N+1 N+2 M–2 M–1 M M+1 M+2 M+3
INTTM01
INTTM00
Caution The 16-bit timer register starts operation at the moment TMC01 to TMC03 are set to values
other than 0, 0, 0 (operation stop mode).
Remark N<M
Count pulse
Timer start
(2) 16-bit compare register setting (when in the clear & start mode entered on a match between TM0 and
CR00)
Set 16-bit capture/compare register 00 (CR00) to the a value other than 0000H.
Thus, when using the 16-bit capture/compare register as event counter, one-pulse count operation cannot
be carried out.
(3) Operation after compare register change during timer count operation
If the value after the 16-bit capture/compare register (CR00) is changed is smaller than that of the 16-bit timer
register (TM0), TM0 continues counting, overflows and then restarts counting from 0. Thus, if the value after
CR00 change (M) is smaller than that before change (N), it is necessary to reset and restart the timer after
changing CR00.
Figure 8-38. Timing After Change of Compare Register During Timer Count Operation
Count pulse
CR00 N M
Remark N>X>M
Count pulse
Edge input
PIF0
Capture operation
ignored
Count pulse
CR00 FFFFH
OVF0
INTTM00
(b) If the match timing of the write period and TM0 conflict
When 16-bit capture/compare registers 00 and 01 (CR00, CR01) are used as capture registers, because
match detection cannot be performed correctly if the match timing of the write period and 16-bit timer
register 0 (TM0) conflict, do not write to CR00 and CR01 close to the match timing.
(a) If the valid edge of TI00 is specified for the count clock
When the valid edge of TI00 is specified for the count clock, the capture register with TI00 specified as
a trigger will not operate correctly.
(b) If both rising and falling edges are selected as the valid edge of TI00.
When both the rising and falling edges are selected as the valid edge of TI00, CR00 cannot perform a
capture operation with TI00 specified as the capture trigger.
(a) When the TI00 or TI01 pin is high level immediately after a system reset
When the TI00 or TI01 pin is high level immediately after a system reset, if the valid edge of the TI00 or
TI01 pin is specified as the rising edge or both rising and falling edges, and the operation of 16-bit timer/
counter 0 (TM0) is then enabled, the rising edge will be detected immediately. Care is therefore needed
when the TI00 or TI01 pin is pulled up. However, when operation is enabled after being stopped, the rising
or falling edge is not detected.
For the 8-bit timer/event counter, two modes are available. One is a mode for the two 8-bit timer/event counter
channels to be used separately (the 8-bit timer/event counter mode) and the other is a mode for the 8-bit timer/event
counter to be used as 16-bit timer/event counter (the 16-bit timer/event counter mode).
• Interval timer
• External event counter
• Square-wave output
211 × 1/fX 212 × 1/fX 219 × 1/fX 220 × 1/fX 211 × 1/fX 212 × 1/fX
(409.6 µs) (819.2 µs) (104.9 ms) (209.7 ms) (409.6 µs) (819.2 µs)
29 × 1/fX 210 × 1/fX 217 × 1/fX 218 × 1/fX 29 × 1/fX 210 × 1/fX
(102.4 µs) (204.8 µs) (26.2 ms) (52.4 ms) (102.4 µs) (204.8 µs)
211 × 1/fX 212 × 1/fX 219 × 1/fX 220 × 1/fX 211 × 1/fX 212 × 1/fX
(409.6 µs) (819.2 µs) (104.9 ms) (209.7 ms) (409.6 µs) (819.2 µs)
29 × 1/fX 210 × 1/fX 225 × 1/fX 226 × 1/fX 29 × 1/fX 210 × 1/fX
(102.4 µs) (204.8 µs) (6.7 s) (13.4 s) (102.4 µs) (204.8 µs)
211 × 1/fX 212 × 1/fX 227 × 1/fX 228 × 1/fX 211 × 1/fX 212 × 1/fX
(409.6 µs) (819.2 µs) (26.8 s) (53.7 s) (409.6 µs) (819.2 µs)
Item Configuration
Internal bus
INTTM1
Note
Selector
Match 8-bit timer/event
counter output TO2/P32
Match controller 2
9
Selector
f XX/2 to fXX/2
8-bit timer 4
11
Selector
f XX/2 register 1 (TM1)
8-bit timer
TI1/P33 register 2 (TM2) INTTM2
Clear
4 Clear
Selector
9
Selector
f XX/2 to fXX/2
11
f XX/2
TI2/P34
Note
8-bit timer/
4 event counter TO1/P31
output controller
4
TCL TCL TCL TCL TCL TCL TCL TCL TMC12 TCE2 TCE1 LVS2 LVR2 TOC TOE2 LVS1 LVR1 TOC TOE1
17 16 15 14 13 12 11 10 15 11
Timer clock 8-bit timer mode 8-bit timer output
select register 1 control register control register
Internal bus
Note See Figures 9-2 and 9-3 for details of 8-bit timer/event counter output controllers 1 and 2, respectively.
Level F/F
(LV1)
LVR1 R
Q
TO1/P31
LVS1 S
INTTM1
TOE1
Level F/F
(LV2)
fSCK
LVR2 R
Q
TO2/P32
LVS2 S
TOC15 P32 PM32Note
INV Output latch
INTTM2
TOE2
Note Bit 2 of port mode register 3 (PM3)
Cautions 1. Before changing the set value of 8-bit compare registers 10 and 20 (CR10 and CR20) while
the 16-bit timer/counter is being used, stop the operation of each of the 8-bit timer/event
counters.
2. When the new values of CR10 and CR20 are less than the count values of the 8-bit timer
registers (TM1 and TM2), TM1 and TM2 continue counting, overflow, and start counting
again from 0. If the new values of CR10 and CR20 are less than the old values, therefore,
it is necessary to restart the timers after changing the values of CR10 and CR20.
The following four registers are used to control the 8-bit timer/event counter.
TCL13 TCL12 TCL11 TCL10 8-bit timer register 1 count clock selection
MCS = 1 MCS = 0
TCL17 TCL16 TCL15 TCL14 8-bit timer register 2 count clock selection
MCS = 1 MCS = 0
Caution When rewriting TCL1 to other data, stop the timer operation beforehand.
1 Operation enabled
1 Operation enabled
Symbol <7> <6> 5 <4> <3> <2> 1 <0> Address After reset R/W
TOC1 LVS2 LVR2 TOC15 TOE2 LVS1 LVR1 TOC11 TOE1 FF4FH 00H R/W
1 Output enabled
LVS1 LVR1 8-bit timer/event counter 1 timer output F/F status set
0 0 Unchanged
1 1 Setting prohibited
1 Output enabled
LVS2 LVR2 8-bit timer/event counter 2 timer output F/F status set
0 0 Unchanged
1 1 Setting prohibited
Count clock
CR10 N N N N
INTTM1
TO1
TCL13 TCL12 TCL11 TCL10 Minimum Interval Time Maximum Interval Time Resolution
MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 0
0 0 0 0 TI1 input cycle 28 × TI1 input cycle TI1 input edge cycle
0 0 0 1 TI1 input cycle 28 × TI1 input cycle TI1 input edge cycle
0 1 1 0 2 × 1/fX 22 × 1/fX 29 × 1/fX 210 × 1/fX 2 × 1/fX 22 × 1/fX
(400 ns) (800 ns) (102.4 µs) (204.8 µs) (400 ns) (800 ns)
0 1 1 1 22 × 1/fX 23 × 1/fX 210 × 1/fX 211 × 1/fX 22 × 1/fX 23 × 1/fX
(800 ns) (1.6 µs) (204.8 µs) (409.6 µs) (800 ns) (1.6 µs)
1 1 1 0 29 × 1/fX 210 × 1/fX 217 × 1/fX 218 × 1/fX 29 × 1/fX 210 × 1/fX
(102.4 µs) (204.8 µs) (26.2 ms) (52.4 ms) (102.4 µs) (204.8 µs)
1 1 1 1 211 × 1/fX 212 × 1/fX 219 × 1/fX 220 × 1/fX 211 × 1/fX 212 × 1/fX
(409.6 µs) (819.2 µs) (104.9 ms) (209.7 ms) (409.6 µs) (819.2 µs)
Other than above Setting prohibited
TCL17 TCL16 TCL15 TCL14 Minimum Interval Time Maximum Interval Time Resolution
1 1 1 1 211 × 1/fX 212 × 1/fX 219 × 1/fX 220 × 1/fX 211 × 1/fX 212 × 1/fX
(409.6 µs) (819.2 µs) (104.9 ms) (209.7 ms) (409.6 µs) (819.2 µs)
Other than above Setting prohibited
Figure 9-9. External Event Counter Operation Timing (with Rising Edge Specified)
CR10 N
INTTM1
29 × 1/fX 210 × 1/fX 217 × 1/fX 218 × 1/fX 29 × 1/fX 210 × 1/fX
(102.4 µs) (204.8 µs) (26.2 ms) (52.4 ms) (102.4 µs) (204.8 µs)
211 × 1/fX 212 × 1/fX 219 × 1/fX 220 × 1/fX 211 × 1/fX 212 × 1/fX
(409.6 µs) (819.2 µs) (104.9 ms) (209.7 ms) (409.6 µs) (819.2 µs)
Count clock
Count start
CR10 N N
TO1Note
Note The initial value of the TO1 output can be set by bits 2 and 3 (LVS1 and LVR1) of the 8-bit timer output
control register (TOC1).
Count clock
TMS (TM1, TM2) count value 0000 0001 N 0000 0001 N 0000 0001 N
CR10, CR20 N N N N
INTTM2
TO2
Caution Even if the 16-bit timer/event counter mode is used, when the TM1 count value matches the
CR10 value, an interrupt request (INTTM1) is generated and the F/F of 8-bit timer/event
counter output controller 1 is inverted. Thus, when using the 8-bit timer/event counter as
a 16-bit interval timer, set the INTTM1 mask flag TMMK1 to 1 to disable INTTM1 acknowledgment.
When reading the 16-bit timer register (TMS) count value, use a 16-bit memory manipulation
instruction.
User's Manual U12013EJ3V2UD 225
CHAPTER 9 8-BIT TIMER/EVENT COUNTER
Table 9-9. Interval Times When 2-Channel 8-Bit Timer/Event Counters (TM1 and TM2)
Are Used as 16-Bit Timer/Event Counter
TCL13 TCL12 TCL11 TCL10 Minimum Interval Time Maximum Interval Time Resolution
1 1 1 1 211 × 1/fX 212 × 1/fX 227 × 1/fX 228 × 1/fX 211 × 1/fX 212 × 1/fX
(409.6 µs) (819.2 µs) (26.8 s) (53.7 s) (409.6 µs) (819.2 µs)
Other than above Setting prohibited
Figure 9-12. External Event Counter Operation Timing (with Rising Edge Specified)
TM1, TM2 count value 0000 0001 0002 0003 0004 0005 N–1 N 0000 0001 0002 0003
CR10, CR20 N
INTTM2
Caution Even if the 16-bit timer/event counter mode is used, when the TM1 count value matches the
CR10 value, an interrupt request (INTTM1) is generated and the F/F of 8-bit timer/event
counter output controller 1 is inverted. Thus, when using the 8-bit timer/event counter as
a 16-bit interval timer, set the INTTM1 mask flag TMMK1 to 1 to disable INTTM1 acknowledgment.
When reading the 16-bit timer register (TMS) count value, use a 16-bit memory manipulation
instruction.
Table 9-10. Square-Wave Output Ranges When 2-Channel 8-Bit Timer/Event Counters
(TM1 and TM2) Are Used as 16-Bit Timer/Event Counter
Count
clock
TM1 00H 01H N N+1 FFH 00H FFH 00H FFH 00H 01H N 00H 01H
CR10 N
CR20 M
Count pulse
Timer start
TO1, TO2
(3) Operation after compare register change during timer count operation
If the values after 8-bit compare registers 10 and 20 (CR10 and CR20) are changed are smaller than those
of the 8-bit timer registers (TM1 and TM2), TM1 and TM2 continue counting, overflow and then restart counting
from 0. Thus, if the value after CR10 and CR20 change (M) is smaller than value before the change (N), it
is necessary to restart the timer after changing CR10 and CR20.
Figure 9-16. Timing After Compare Register Change During Timer Count Operation
Count pulse
CR10, CR20 N M
Remark N>X>M
• Watch timer
• Interval timer
The watch timer and the interval timer can be used simultaneously.
Caution 0.5-second intervals cannot be generated with the 5.0 MHz main system clock. Switch to
the 32.768 kHz subsystem clock to generate 0.5-second intervals.
Item Configuration
Counter 5 bits × 1
Control registers Timer clock select register 2 (TCL2)
Watch timer mode control register (TMC2)
The following two registers are used to control the watch timer.
Remark Besides setting the watch timer count clock, TCL2 sets the watchdog timer count clock and buzzer
output frequency.
TMC21
fW
Selector
7
Clear 214
f XX /2 5-bit counter
Selector
Selector
fW
Prescaler INTWT
f XT Clear
fW fW fW fW fW fW fW
24 25 26 27 28 29 213
Selector
INTTM3
To 16-bit timer/
event counter
3
Internal bus
After
Symbol 7 6 5 4 3 2 1 0 Address R/W
reset
TCL2 TCL27 TCL26 TCL25 TCL24 0 TCL22 TCL21 TCL20 FF42H 00H R/W
TCL22 TCL21 TCL20 Watchdog timer count clock selection (see CHAPTER 11 WATCHDOG TIMER)
MCS = 1 MCS = 0
3 3 4
0 0 0 f XX /2 f X /2 (625 kHz) f X /2 (313 kHz)
MCS = 1 MCS = 0
1 f XT (32.768 kHz)
TCL27 TCL26 TCL25 Buzzer output frequency selection (see CHAPTER 13 BUZZER OUTPUT CONTROLLER)
MCS = 1 MCS = 0
1 1 1 Setting prohibited
Caution When changing the count clock, be sure to stop operation of the watch timer before
rewriting TCL2 (stopping operation is not necessary when rewriting the same data).
1 Operation enable
1 Operation enable
0 0 0 2 /f W (410 µ s)
4
2 /f W (488 µ s)
4
24/f W (488 µ s)
Caution When the watch timer is used, the prescaler should not be cleared frequently.
TMC26 TMC25 TMC24 Interval Time When Operated at When Operated at When Operated at
fXX = 5.0 MHz fXX = 4.19 MHz fXT = 32.768 kHz
0 0 0 24 × 1/fW 410 µs 488 µs 488 µs
0 0 1 25 × 1/fW 819 µs 977 µs 977 µs
0 1 0 26 × 1/fW 1.64 ms 1.95 ms 1.95 ms
• Watchdog timer
• Interval timer
Caution Select the watchdog timer mode or the interval timer mode using the watchdog timer mode
register (WDTM) (the watchdog timer and interval timer cannot be used at the same time).
213 × 1/fXX 213 × 1/fX (1.64 ms) 214 × 1/fX (3.28 ms)
214 × 1/fXX 214 × 1/fX (3.28 ms) 215 × 1/fX (6.55 ms)
215 × 1/fXX 215 × 1/fX (6.55 ms) 216 × 1/fX (13.1 ms)
216 × 1/fXX 216 × 1/fX (13.1 ms) 217 × 1/fX (26.2 ms)
217 × 1/fXX 217 × 1/fX (26.2 ms) 218 × 1/fX (52.4 ms)
219 × 1/fXX 219 × 1/fX (104.9 ms) 220 × 1/fX (209.7 ms)
213 × 1/fXX 213 × 1/fX (1.64 ms) 214 × 1/fX (3.28 ms)
214 × 1/fXX 214 × 1/fX (3.28 ms) 215 × 1/fX (6.55 ms)
215 × 1/fXX 215 × 1/fX (6.55 ms) 216 × 1/fX (13.1 ms)
216 × 1/fXX 216 × 1/fX (13.1 ms) 217 × 1/fX (26.2 ms)
217 × 1/fXX 217 × 1/fX (26.2 ms) 218 × 1/fX (52.4 ms)
219 × 1/fXX 219 × 1/fX (104.9 ms) 220 × 1/fX (209.7 ms)
Item Configuration
Internal bus
f XX /23 Prescaler
TMMK4
f XX f XX f XX f XX f XX f XX f XX RUN
24 25 26 27 28 29 211 INTWDT
TMIF4 Maskable
Selector
interrupt
8-bit counter request
Controller
RESET
INTWDT
3 Non-maskable
interrupt
request
Internal bus
The following two registers are used to control the watchdog timer.
Remark Besides setting the watchdog timer count clock, TCL2 sets the watch timer count clock and buzzer
output frequency.
After
Symbol 7 6 5 4 3 2 1 0 Address R/W
reset
TCL2 TCL27 TCL26 TCL25 TCL24 0 TCL22 TCL21 TCL20 FF42H 00H R/W
MCS = 1 MCS = 0
3 3 4
0 0 0 f XX /2 f X /2 (625 kHz) f X /2 (313 kHz)
TCL24 Watch timer count clock selection (see CHAPTER 10 WATCH TIMER)
MCS = 1 MCS = 0
7 7 8
0 f XX /2 f X /2 (39.1 kHz) f X /2 (19.5 kHz)
1 f XT (32.768 kHz)
TCL27 TCL26 TCL25 Buzzer output frequency selection (see CHAPTER 13 BUZZER OUTPUT CONTROLLER)
MCS = 1 MCS = 0
1 1 1 Setting prohibited
Caution Changing the count clock (rewriting TCL20 to TCL22) after watchdog timer operation has
started is prohibited.
After
Symbol <7> 6 5 4 3 2 1 0 Address R/W
reset
WDTM RUM 0 0 WDTM4 WDTM3 0 0 0 FFF9H 00H R/W
0 Count stop
Cautions 1. When RUN is set to 1 so that the watchdog timer is cleared, the actual overflow time is
up to 0.5% shorter than the time set by timer clock select register 2 (TCL2).
2. To use watchdog timer modes 1 and 2, make sure that the interrupt request flag (TMIF4)
is 0, and then set WDTM4 to 1.
If WDTM4 is set to 1 when TMIF4 is 1, the non-maskable interrupt request occurs,
regardless of the contents of WDTM3.
Cautions 1. The actual loop detection time may be shorter than the set time by a maximum of
0.5%.
2. When the subsystem clock is selected for the CPU clock, the watchdog timer count operation
is stopped.
0 0 1 212 × 1/fXX 212 × 1/fX (819 µs) 213 × 1/fX (1.64 ms)
0 1 0 213 × 1/fXX 213 × 1/fX (1.64 ms) 214 × 1/fX (3.28 ms)
0 1 1 214 × 1/fXX 214 × 1/fX (3.28 ms) 215 × 1/fX (6.55 ms)
1 0 0 215 × 1/fXX 215 × 1/fX (6.55 ms) 216 × 1/fX (13.1 ms)
1 0 1 216 × 1/fXX 216 × 1/fX (13.1 ms) 217 × 1/fX (26.2 ms)
1 1 0 217 × 1/fXX 217 × 1/fX (26.2 ms) 218 × 1/fX (52.4 ms)
1 1 1 219 × 1/fXX 219 × 1/fX (104.9 ms) 220 × 1/fX (209.7 ms)
Cautions 1. Once bit 4 (WDTM4) of WDTM is set to 1 (with the watchdog timer mode selected), the interval
timer mode is not set unless RESET input is applied.
2. The interval time just after setting by WDTM may be shorter than the set time by a maximum
of 0.5%.
3. When the subsystem clock is selected for the CPU clock, the watchdog timer count operation
is stopped.
0 1 0 213 × 1/fXX 213 × 1/fX (1.64 ms) 214 × 1/fX (3.28 ms)
0 1 1 214 × 1/fXX 214 × 1/fX (3.28 ms) 215 × 1/fX (6.55 ms)
1 0 0 215 × 1/fXX 215 × 1/fX (6.55 ms) 216 × 1/fX (13.1 ms)
1 0 1 216 × 1/fXX 216 × 1/fX (13.1 ms) 217 × 1/fX (26.2 ms)
1 1 0 217 × 1/fXX 217 × 1/fX (26.2 ms) 218 × 1/fX (52.4 ms)
1 1 1 219 × 1/fXX 219 × 1/fX (104.9 ms) 220 × 1/fX (209.7 ms)
The clock output controller is used for carrier output during remote controlled transmission and clock output for
supply to peripheral LSI devices. The clock selected by timer clock select register 0 (TCL0) is output from the PCL/
P35 pin.
Follow the procedure below to output clock pulses.
(1) Select the clock pulse output frequency (with clock pulse output disabled) using bits 0 to 3 (TCL00 to TCL03)
of TCL0.
(2) Set the P35 output latch to 0.
(3) Set bit 5 (PM35) of port mode register 3 (PM3) to 0 (set to output mode).
(4) Set bit 7 (CLOE) of timer clock select register 0 (TCL0) to 1.
Caution Clock output cannot be used when the P35 output latch is set to 1.
Remark When clock output enable/disable is switched, the clock output controller does not output pulses with
small widths (see the portions marked with * in Figure 12-1).
CLOE
* *
PCL/P35 pin output
Item Configuration
f XX
f XX /2
f XX /22
f XX /23
Selector
f XX /24
Synchronizing
f XX /25 circuit PCL /P35
f XX /26
f XX /27
f XT
4
Internal Bus
The following two registers are used to control the clock output function.
Remark Besides setting the PCL output clock, TCL0 sets the 16-bit timer register count clock.
After
Symbol <7> 6 5 4 3 2 1 0 Address R/W
reset
TCL0 CLOE TCL06 TCL05 TCL04 TCL03 TCL02 TCL01 TCL00 FF40H 00H R/W
MCS = 1 MCS = 0
0 0 0 0 f XT (32.768 kHz)
MCS = 1 MCS = 0
0 Output disabled
1 Output enabled
Cautions 1. The TI00/P00/INTP0 pin valid edge is set by external interrupt mode register 0 (INTM0),
and the sampling clock frequency is selected by the sampling clock select register
(SCS).
2. When enabling PCL output, set TCL00 to TCL03, then set CLOE to 1 with a 1-bit memory
manipulation instruction.
3. When reading the count value when TI00 has been specified as the TM0 count clock,
the value should be read from TM0, not from the 16-bit capture/compare register (CR01).
4. When rewriting TCL0 to other data, stop the clock operation beforehand.
After
Symbol 7 6 5 4 3 2 1 0 Address R/W
reset
PM3 PM37 PM36 PM35 PM34 PM33 PM32 PM31 PM30 FF23H FFH R/W
The buzzer output controller outputs 1.2 kHz, 2.4 kHz, 4.9 kHz, or 9.8 kHz frequency square waves. The buzzer
frequency selected by timer clock select register 2 (TCL2) is output from the BUZ/P36 pin.
Follow the procedure below to output the buzzer frequency.
(1) Select the buzzer output frequency using bits 5 to 7 (TCL25 to TCL27) of TCL2.
(2) Set the P36 output latch to 0.
(3) Set bit 6 (PM36) of port mode register 3 (PM3) to 0 (set to output mode).
Caution Buzzer output cannot be used when the P36 output latch is set to 1.
Item Configuration
Control registers Timer clock select register 2 (TCL2)
Port mode register 3 (PM3)
f XX /29
Selector
f XX /210 BUZ/P36
f XX /211
P36
TCL27 TCL26 TCL25 Output latch PM36
Internal bus
The following two registers are used to control the buzzer output function.
Remark Besides setting the buzzer output frequency, TCL2 sets the watch timer count clock and the
watchdog timer count clock.
After
Symbol 7 6 5 4 3 2 1 0 Address R/W
reset
TCL2 TCL27 TCL26 TCL25 TCL24 0 TCL22 TCL21 TCL20 FF42H 00H R/W
TCL22 TCL21 TCL20 Watchdog timer count clock selection (see CHAPTER 11 WATCHDOG TIMER)
MCS = 1 MCS = 0
3 3 4
0 0 0 f XX /2 f X /2 (625 kHz) f X /2 (313 kHz)
TCL24 Watch timer count clock selection (see CHAPTER 10 WATCH TIMER)
MCS = 1 MCS = 0
7 7 8
0 f XX /2 f X /2 (39.1 kHz) f X /2 (19.5 kHz)
1 f XT (32.768 kHz)
MCS = 1 MCS = 0
1 1 1 Setting prohibited
Cautions 1. Be sure to stop operation of the watch timer or buzzer to be changed before rewriting
TCL2 (stop operation is not necessary when rewriting the same data).
The operation is stopped by the following methods.
2. Changing the count clock (rewriting TCL20 to TCL22) after watchdog timer operation
has started is prohibited.
After
Symbol 7 6 5 4 3 2 1 0 Address R/W
reset
PM3 PM37 PM36 PM35 PM34 PM33 PM32 PM31 PM30 FF23H FFH R/W
The A/D converter converts an analog input into a digital value. It consists of 8 channels (ANI0 to ANI7) with an
8-bit resolution.
The conversion method is based on successive approximation and the conversion result is held in the 8-bit A/D
conversion result register (ADCR).
A/D conversion can be started in the following two ways.
One analog input channel is selected from ANI0 to ANI7 and A/D conversion is carried out. In the case of hardware
start, A/D conversion stops when an A/D conversion operation ends, and an interrupt request (INTAD) is generated.
In the case of software start, A/D conversion is repeated. Each time an A/D conversion operation ends, an interrupt
request (INTAD) is generated.
Item Configuration
Analog inputs 8 channels (ANI0 to ANI7)
Control registers A/D converter mode register (ADM)
A/D converter input select register (ADIS)
External interrupt mode register 1 (INTM1)
Internal bus
4
Series resistor string
ANI0/P10
ANI1/P11
Sample & hold circuit
Tap selector
ANI2/P12 Note 1 Note 2 Voltage AVREF0
Selector
ADM1 to ADM3
Edge
INTP3/P03 Controller INTAD
detector
Internal bus
Notes 1. Selector to select the number of channels to be used for analog input.
2. Selector to select the channel for A/D conversion.
3. ES40, ES41: Bits 0 and 1 of external interrupt mode register 1 (INTM1)
Cautions 1. Use the ANI0 to ANI7 input voltages within the specified range. If a voltage higher than
or equal to AVREF0 or lower than or equal to AVSS is applied (even if within the absolute
maximum ratings), the converted value of the corresponding channel becomes undefined
and may adversely affect the converted values of other channels.
2. The analog input pins (ANI0 to ANI7) also function as I/O port pins (port 1). When A/D
conversion is performed with any of pins ANI0 to ANI7 selected, be sure not to execute
an instruction that inputs data to port 1 while conversion is in progress, as this may
reduce the conversion resolution.
Also, if digital pulses are applied to a pin adjacent to the pin in the process of A/D
conversion, the expected A/D conversion value may not be obtained due to coupling
noise. Therefore, avoid applying pulses to pins adjacent to the pin undergoing A/D
conversion.
Caution A series resistor string of approximately 10 kΩ is connected between the AVREF0 pin and
AV SS pin. Therefore, if the output impedance of the reference voltage source is high, this
will result in series connection to the series resistor string between AVREF0 pin and the
AV SS pin, resulting in a large reference voltage error.
The following three registers are used to control the A/D converter.
0 0 0 ANI0
0 0 1 ANI1
0 1 0 ANI2
0 1 1 ANI3
1 0 0 ANI4
1 0 1 ANI5
1 1 0 ANI6
1 1 1 ANI7
1 0 1 100/f X (20.0 µs) 200/f X (40.0 µ s) 100/f X (23.8 µs) 200/f X (47.7 µ s)
0 Operation stop
1 Operation start
Cautions 1. The following sequence is recommended for reducing the power consumption of the
A/D converter when the standby function is used: Clear bit 7 (CS) to 0 first to stop
the A/D conversion operation, and then execute the HALT or STOP instruction.
2. When restarting a stopped A/D conversion operation, start the A/D conversion
operation after clearing the interrupt request flag (ADIF) to 0.
Cautions 1. Set the analog input channel using the following procedure.
(1) Set the number of analog input channels using ADIS.
(2) Using the A/D converter mode register (ADM), select one channel to undergo A/D
conversion from among the channels set to analog input by ADIS.
2. No internal pull-up resistor can be used for the channels set to analog input by ADIS,
irrespective of the value of bit 1 (PUO1) of pull-up resistor option register L (PUOL).
After
Symbol 7 6 5 4 3 2 1 0 Address R/W
reset
ADIS 0 0 0 0 ADIS3 ADIS2 ADIS1 ADIS0 FF84H 00H R/W
After
Symbol 7 6 5 4 3 2 1 0 Address R/W
reset
INTM1 0 0 ES61 ES60 ES51 ES50 ES41 ES40 FFEDH 00H R/W
0 0 Falling edge
0 1 Rising edge
1 0 Setting prohibited
0 0 Falling edge
0 1 Rising edge
1 0 Setting prohibited
0 0 Falling edge
0 1 Rising edge
1 0 Setting prohibited
(1) Set the number of analog input channels using the A/D converter input select register (ADIS).
(2) From among the analog input channels set by ADIS, select one channel for A/D conversion using the A/D
converter mode register (ADM).
(3) Sample the voltage input to the selected analog input channel using the sample & hold circuit.
(4) Sampling for the specified period of time sets the sample & hold circuit to the hold state so that the circuit
holds the input analog voltage until the end of A/D conversion.
(5) Bit 7 of the successive approximation register (SAR) is set. The series resistor string voltage tap is set to
(1/2) AVREF0 by the tap selector.
(6) 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) AVREF0, the MSB of SAR remains set. If the input
is smaller than (1/2) AVREF0, the MSB is reset.
(7) Next, bit 6 of SAR is automatically set and the operation proceeds to the next comparison. In this case, the
series resistor string voltage tap is selected according to the preset value of bit 7 as described below.
• Bit 7 = 1: (3/4) AVREF0
• Bit 7 = 0: (1/4) AVREF0
The voltage tap and analog input voltage are compared and bit 6 of SAR is manipulated with the result as
follows.
• Analog input voltage ≥ Voltage tap: Bit 6 = 1
• Analog input voltage < Voltage tap: Bit 6 = 0
(8) Comparison of this sort continues up to bit 0 of SAR.
(9) Upon completion of the comparison of 8 bits, a valid digital result remains in SAR and that value is transferred
to and latched in the A/D conversion result register (ADCR).
At the same time, the A/D conversion end interrupt request (INTAD) can also be generated.
CS = 0 → 1,
or external trigger, or ADM rewrite
A/D conversion start delay time Conversion time
Sampling time
A/D converter
Sampling A/D conversion
operation
ADCR Conversion
result
INTAD
CS
A/D conversion operations are performed continuously until bit 7 (CS) of the AD converter mode register (ADM)
is reset to 0 by software.
RESET input makes ADCR undefined.
Check the completion of A/D conversion by using the A/D conversion end interrupt request flag (ADIF).
Table 14-2. A/D Converter Sampling Time and A/D Conversion Start Delay Time
0 0 1 80/fX (16.0 µs) 160/fX (32.0 µs) 9/fX 18/fX 6/fX 12/fX
0 1 1 40/fX (setting prohibitedNote 2) 80/fX (16.0 µs) 4.5/fX 9/fX 3/fX 6/fX
1 0 0 50/fX (setting prohibitedNote 2) 100/fX (20.0 µs) 5.25/fX 10.5/fX 4.5/fX 9/fX
1 0 1 100/fX (20.0 µs) 200/fX (40.0 µs) 10.5/fX 21/fX 9/fX 18/fX
Other than above Setting prohibited – –
VIN
ADCR = INT ( × 256 + 0.5)
AVREF0
or
AVREF0
(ADCR – 0.5) × ≤ VIN < (ADCR + 0.5) × AVREF0
256 256
Figure 14-6 shows the relationship between the analog input voltage and the A/D conversion result.
Figure 14-6. Relationship Between Analog Input Voltage and A/D Conversion Result
255
254
0
1 1 3 2 5 3 507 254 509 255 511
1
512 256 512 256 512 256 512 256 512 256 512
Input voltage/AVREF0
The A/D conversion result is stored in the A/D conversion result register (ADCR) and the interrupt request signal
(INTAD) is simultaneously generated.
INTP3
A /D conversion Standby ANIn ANIn Standby ANIn Standby ANIm ANIm ANIm
state state state
INTAD
Remark n = 0, 1, ..., 7
m = 0, 1, ..., 7
Conversion suspended
Conversion results are Stop
not stored.
INTAD
Remark n = 0, 1, ..., 7
m = 0, 1, ..., 7
(1) Resolution
This is the minimum analog input voltage that can be identified. That is, the percentage of the analog input
voltage per 1 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).
1……1 1……1
Ideal line
Digital output
Digital output
Overall
error
1/2LSB Quantization error
1/2LSB
0……0 0……0
0 AVREF0 0 AVREF0
Analog input Analog input
Sampling
time
Conversion time
AVREF0
P-ch CS
AVSS
<1> Conflict between A/D conversion result register (ADCR) write and ADCR read by instruction upon end
of conversion
ADCR read is given priority. After the read operation, the new conversion result is written to ADCR.
<2> Conflict between ADCR write and external trigger signal input upon end of conversion
The external trigger signal is not acknowledged during A/D conversion. Therefore, the external trigger
signal is not acknowledged during ADCR write.
<3> Conflict between ADCR write and A/D converter mode register (ADM) write or A/D converter input select
register (ADIS) write
ADM or ADIS write is given priority. ADCR write is not performed, nor is the conversion end interrupt
request signal (INTAD) generated.
ANI0 to ANI7
C = 100 to 1,000 pF
VDD0
AVSS
VSS0
INTAD
Remark n = 0, 1, ..., 7
m = 0, 1, ..., 7
Figure 14-14. Timing of Reading Conversion Result (When Conversion Result is Undefined)
INTAD
CS
Figure 14-15. Timing of Reading Conversion Result (When Conversion Result is Normal)
INTAD
CS
AVREF0
C1 C2
AVSS
(13) Internal equivalent circuit of ANI0 to ANI7 pins and permissible signal source impedance
To complete sampling within the sampling time with sufficient A/D conversion accuracy, the impedance of the
signal source such as a sensor must be sufficiently low. Figure 14-17 shows the internal equivalent circuit
of the ANI0 to ANI7 pins.
If the impedance of the signal source is high, connect capacitors with a high capacitance to the ANI0 to ANI7
pins. An example of this is shown in Figure 14-18. In this case, however, the microcontroller cannot follow
an analog signal with a high differential coefficient because a low-pass filter is created.
To convert a high-speed analog signal or to convert an analog signal in the scan mode, insert a low-impedance
buffer.
R1 R2
ANIn
C1 C2 C3
Remark n = 0 to 7
AVREF0 R1 R2 C1 C2 C3
1.8 V 75 kΩ 30 kΩ 8 pF 4 pF 2 pF
2.7 V 12 kΩ 8 kΩ 8 pF 3 pF 2 pF
Caution The resistances and capacitances in Table 14-3 are not guaranteed values.
Output impedance R1 R2
ANIn
of sensor
R0
C1 C2 C3
C0 ≤ 0.1 µF C0
Low-pass filter
is created.
Remark n = 0 to 7
The D/A converter converts a digital input into an analog value. The D/A converter used is a 2-channel 8-bit
resolution voltage output type D/A converter.
The conversion method used is the R-2R resistor ladder method.
Start D/A conversion by setting bits 0 and 1 (DACE0 and DACE1) of the D/A converter mode register (DAM).
There are two modes for the D/A converter, as follows.
Item Configuration
Internal bus
Selector
2R R
2R
Internal bus
DACSn
ANOn output voltage = AVREF1 ×
256
where, n = 0, 1
Cautions 1. In the real-time output mode, when data that is set in DACS0 and DACS1 is read before
an output trigger is generated, the previous data is read rather than the set data.
2. In the real-time output mode, data should be set to DACS0 and DACS1 after an output
trigger and before the next output trigger.
The D/A converter mode register (DAM) controls the D/A converter. This register sets D/A converter operation
enable/stop.
DAM is set with a 1-bit or an 8-bit memory manipulation instruction.
RESET input clears DAM to 00H.
After
Symbol 7 6 5 4 3 2 <1> <0> Address R/W
reset
DAM 0 0 DAM5 DAM4 0 0 DACE1 DACE0 FF98H 00H R/W
0 Normal mode
0 Normal mode
Cautions 1. When using the D/A converter, alternate-function port pins should be set to the input mode,
and pull-up resistors should be disconnected.
2. Always set bits 2, 3, 6, and 7 to 0.
3. When D/A conversion is stopped, the output state is high-impedance.
4. The output triggers are INTTM1 and INTTM2 for channel 0 and channel 1, respectively, in the
real-time output mode.
(1) The channel 0 operating mode and channel 1 operating mode are selected by bits 4 and 5 (DAM4 and DAM5),
respectively, of the D/A converter mode register (DAM).
(2) Set the data corresponding to the analog voltages output to the ANO0/P130 and ANO1/P131 pins to
D/A conversion value setting registers 0 and 1 (DACS0 and DACS1), respectively.
(3) D/A conversion of channel 0 or channel 1 can be started by setting bits 0 or 1 (DACE0 or DACE1) of DAM,
respectively.
(4) In the normal mode, the analog voltage signals are output to the ANO0/P130 and ANO1/P131 pins immediately
after D/A conversion. In the real-time output mode, the analog voltage signals are output synchronously with
the output triggers.
(5) In the normal mode, the analog voltage signals to be output are held until new data is set in DACS0 and DACS1.
In the realtime output mode, new data is set in DACS0 and DACS1 and then held until the next trigger is
generated.
Caution Set DACE0 and DACE1 after setting data in DACS0 and DACS1.
µPD780058, 780058Y
Subseries C
R2
R1
ANOn
(b) Voltage-follower
µ PD780058, 780058Y
Subseries
R
ANOn
R1 C
The µPD780058 Subseries incorporates three serial interface channels. Differences between channels 0, 1,
and 2 are as follows (see CHAPTER 18 SERIAL INTERFACE CHANNEL 1 for details of serial interface channel
1 and CHAPTER 19 SERIAL INTERFACE CHANNEL 2 for details of serial interface channel 2).
3-wire serial I/O Clock selection fXX/2, fXX/22, fXX/23, fXX/2, fXX/22, fXX/23, External clock, baud
fXX/24, fXX/25, fXX/26, fXX/24, fXX/25, fXX/26, rate generator output
fXX/27, fXX/28, external fXX/27, fXX/28, external
clock, TO2 output clock, TO2 output
Transfer method MSB/LSB switchable MSB/LSB switchable as MSB/LSB switchable as
as the start bit the start bit the start bit
Automatic transmit/
receive function
Transfer end flag Serial transfer end Serial transfer end Serial transfer end
interrupt request flag interrupt request flag interrupt request flag
(CSIIF0) (CSIIF1) (SRIF)
Caution Do not change the operating mode (3-wire serial I/O, 2-wire serial I/O, or SBI) while serial interface
channel 0 is enabled to operate. To change the operating mode, stop the serial operation first.
Actually, the master device outputs an “address” to the serial bus to select one of the slave devices with which
the master device is to communicate. After that, “commands” and “data” are transmitted or received between
the master and slave devices (this is the serial transfer). The receiver can automatically identify the received
data as an “address”, “command”, or “data” by hardware.
This function enables the I/O ports to be used effectively and the serial interface control portions of the
application program to be simplified.
In this mode, the wakeup function for handshake and the output function of acknowledge and busy signals
can also be used.
VDD0
SCK0 SCK0
SB0 SB0
Slave CPU2
SCK0
SB0
Slave CPUn
SCK0
SB0
Item Configuration
Note See Figure 6-5 Block Diagram of P20, P21, and P23 to P26 and Figure 6-6 Block Diagram of P22
and P27.
Internal bus
Controller
CSIM00 CSIM00 4
CSIM01 CSIM01
P27
Output latch
Internal bus
Remark The output control block performs selection between CMOS output and N-ch open-drain output.
• In the 3-wire serial I/O mode and 2-wire serial I/O mode
This circuit generates an interrupt request signal every eight serial clocks.
Remark WUP is the wakeup function specification bit. It is bit 5 of serial operating mode register 0 (CSIM0).
When using the wakeup function (WUP = 1), clear bit 5 (SIC) of the interrupt timing specification
register (SINT) to 0.
The following four registers are used to control serial interface channel 0.
TCL3 TCL37 TCL36 TCL35 TCL34 TCL33 TCL32 TCL31 TCL30 FF43H 88H R/W
TCL33 TCL32 TCL31 TCL30 Serial interface channel 0 serial clock selection
MCS = 1 MCS = 0
TCL37 TCL36 TCL35 TCL34 Serial interface channel 1 serial clock selection
MCS = 1 MCS = 0
Caution When rewriting TCL3 to other data, stop the serial transfer operation beforehand.
Caution Do not change the operating mode (3-wire serial I/O, 2-wire serial I/O, or SBI) while serial
interface channel 0 is enabled to operate. To change the operating mode, stop the serial
operation first.
CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00 FF60H 00H R/WNote 1
R/W CSIM CSIM CSIM PM25 P25 PM26 P26 PM27 P27 Operation Start bit SI0/SB0/P25 SO0/SB1/P26 SCK0/P27
04 03 02 mode pin function pin function pin function
Note 2 Note 2
0 × 0 1 × 0 0 0 1 3-wire serial MSB SI0Note 2 SO0 SCK0
1 l/O mode LSB (input) (CMOS output) (CMOS I/O)
Note 3 Note 3
1 0 0 × × 0 0 0 1 SBI mode MSB P25 SB1 SCK0
(CMOS I/O) (N-ch (CMOS I/O)
open-drain I/O)
Note 3 Note 3
1 0 0 × × 0 1 SB0 P26
(N-ch (CMOS I/O)
open-drain I/O)
Note 3 Note 3
1 1 0 × × 0 0 0 1 2-wire serial MSB P25 SB1 SCK0
l/O mode (CMOS I/O) (N-ch (N-ch
open-drain I/O) open-drain I/O)
Note 3 Note 3
1 0 0 × × 0 1 SB0 P26
(N-ch (CMOS I/O)
open-drain I/O)
(Cont’d)
Notes 1. Bit 6 (COI) is a read-only bit.
2. Can be used as P25 (CMOS I/O) when used only for transmission.
3. Can be used freely as a port function.
Notes 1. When using the wakeup function (WUP = 1), clear bit 5 (SIC) of the interrupt timing specification
register (SINT) to 0.
2. When CSIE0 = 0, COI becomes 0.
Symbol <7> <6> <5> <4> <3> <2> <1> <0> Address After reset R/W
SBIC BSYE ACKD ACKE ACKT CMDD RELD CMDT RELT FF61H 00H R/WNote
R/W ACKT The acknowledge signal is output in synchronization with the falling edge of the SCK0 clock just after
execution of the instruction that sets this bit to 1, and after acknowledge signal output, ACKT is automatically
cleared to 0.
ACKT is used with ACKE = 0. ACKT is also cleared to 0 upon start of serial interface transfer or when
CSIE0 = 0.
Note Bits 2, 3, and 6 (RELD, CMDD and ACKD) are read-only bits.
Remarks 1. Bits 0, 1, and 4 (RELT, CMDT, and ACKT) are 0 when read after data setting.
2. CSIE0: Bit 7 of serial operating mode register 0 (CSIM0)
1 Before completion of The acknowledge signal is output in synchronization with the falling edge of the 9th
transfer SCK0 clock (automatically output when ACKE = 1).
After completion of The acknowledge signal is output in synchronization with the falling edge of
transfer SCK0 just after execution of the instruction that sets this bit to 1
(automatically output when ACKE = 1).
However, ACKE is not automatically cleared to 0 after acknowledge signal is output.
• Falling edge of SCK0 immediately after busy • When acknowledge signal (ACK) is detected at the
mode is released after executing the transfer rising edge of the SCK0 clock after completion of
start instruction
• When CSIE0 = 0 transfer
• When RESET input is applied
Note
R/W BSYE Synchronizing busy signal output control
0 Disable the busy signal which is output in synchronization with the falling edge the SCK0 clock just after
execution of the instruction that clears this bit to 0.
1 Output the busy signal at the falling edge of the SCK0 clock following the acknowledge signal.
Note The busy mode can be cleared by start of serial interface transfer. However, the BSYE flag is
not cleared to 0.
R/W
SVAM SVA bit to be used as slave address
0 Bits 0 to 7
1 Bits 1 to 7
R/W
SIC INTCSI0 interrupt source selectionNote 2
0 CSIIF0 is set upon termination of serial interface
channel 0 transfer
1 CSIIF0 is set upon bus release detection or
termination of serial interface channel 0 transfer
R
CLD SCK0/P27 pin levelNote 3
0 Low level
1 High level
The following four operating modes are available for serial interface channel 0.
CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00 FF60H 00H R/W
CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00 FF60H 00H R/WNote 1
R/W CSIM CSIM CSIM PM25 P25 PM26 P26 PM27 P27 Operation Start bit SIO/SB0/P25 SO0/SB1/P26 SCK0/P27
04 03 02 mode pin function pin function pin function
Note 2 Note 2
0 × 0 1 × 0 0 0 1 3-wire serial MSB SI0Note 2 SO0 SCK0
l/O mode (input) (CMOS output) (CMOS I/O)
1 LSB
1 1 2-wire serial I/O mode (see 16.4.4 2-wire serial I/O mode operation.)
Symbol <7> <6> <5> <4> <3> <2> <1> <0> Address After reset R/W
SBIC BSYE ACKD ACKE ACKT CMDD RELD CMDT RELT FF61H 00H R/W
R/W RELT When RELT = 1, the SO0 Iatch is set to 1. After the SO0 Iatch is set, RELT is automatically cleared to 0.
It is also cleared to 0 when CSIE0 = 0.
R/W CMDT When CMDT = 1, the SO0 Iatch is cleared to 0. After the SO0 latch is cleared, CMDT is automatically
cleared to 0.
It is also cleared to 0 when CSIE0 = 0.
SCK0 1 2 3 4 5 6 7 8
CSIIF0
End of transfer
Transfer start at the falling edge of SCK0
The SO0 pin is a CMOS output pin and outputs the current SO0 latch status. Thus, the SO0 pin output status
can be manipulated by setting bit 0 (RELT) and bit 1 (CMDT) of the serial bus interface control register (SBIC).
However, do not carry out this manipulation during serial transfer.
Control the SCK0 pin output level in the output mode (internal system clock mode) by manipulating the P27
output latch (see 16.4.5 SCK0/P27 pin output manipulation).
SO0 latch
RELT
CMDT
7
6
Internal bus
1
0
LSB-first
MSB-first Read/write gate Read/write gate
SO0 latch
SI0 Serial I/O shift register 0 (SIO0) D Q
SO0
SCK0
Start bit switching is realized by switching the bit order for data write to SIO0. The SIO0 shift order remains
unchanged.
Thus, switching between MSB-first and LSB-first must be performed before writing data to SIO0.
Caution If CSIE0 is set to 1 after data write to SIO0, transfer does not start.
Upon termination of 8-bit transfer, serial transfer automatically stops and the interrupt request flag (CSIIF0)
is set.
VDD0
Serial clock
SCK0 SCK0 Slave CPU
Master CPU
Serial data bus
SB0 (SB1) SB0 (SB1) Address 1
• •
• •
• •
SCK0 Slave IC
Caution When exchanging the master CPU/slave CPU, a pull-up resistor is necessary for the serial clock
line (SCK0) as well because serial clock line (SCK0) input/output switching is carried out
asynchronously between the master and slave CPUs.
Address transfer
SCK0 8 9
Bus release
signal Address
Command transfer
Command signal
SCK0 9
Command
Data transfer
SCK0 8 9
Data
The bus release signal and the command signal are output by the master device. BUSY is output by the slave
device. ACK can be output by either the master or slave device (normally, the 8-bit data receiver outputs).
Serial clocks continue to be output by the master device from 8-bit data transfer start to BUSY reset.
SCK0 “H”
SB0 (SB1)
The bus release signal indicates that the master device is going to transmit an address to the slave device.
The slave device incorporates hardware to detect the bus release signal.
Caution The transition of the SB0 (SB1) line from low to high when the SCK0 line is high is
recognized as a bus release signal. If the transition timing of the bus is shifted due to
the influence of board capacitance, transmitted data may be judged as a bus release
signal. Exercise care in wiring so that noise is not superimposed on the signal lines.
SCK0 “H”
SB0 (SB1)
The command signal indicates that the master is going to transmit a command to the slave (however,
a command signal following a bus release signal indicates that an address is transmitted).
The slave device incorporates hardware to detect the command signal.
Caution The transition of the SB0 (SB1) line from high to low when the SCK0 line is high is
recognized as a command signal. If the transition timing of the bus is shifted due to the
influence of board capacitance, transmitted data may be judged as a command signal.
Exercise care in wiring so that noise is not superimposed on the signal lines.
(c) Address
An address is 8-bit data which the master device outputs to the slave devices connected to the bus line
in order to select a particular slave device.
SCK0 1 2 3 4 5 6 7 8
SB0 (SB1) A7 A6 A5 A4 A3 A2 A1 A0
Address
Bus release
signal Command signal
8-bit data following bus release and command signals is defined as an “address”. In the slave device,
this condition is detected by hardware and whether or not 8-bit data matches the own specification number
(slave address) is checked by hardware. If the 8-bit data matches the slave address, the slave device
has been selected. After that, communication with the master device continues until a release instruction
is received from the master device.
Slave 2
Address transmission
Slave 2 Selected
SCK0 1 2 3 4 5 6 7 8
SB0 (SB1) C7 C6 C5 C4 C3 C2 C1 C0
SCK0 1 2 3 4 5 6 7 8
SB0 (SB1) D7 D6 D5 D4 D3 D2 D1 D0
Data
8-bit data following a command signal is defined as “command” data. 8-bit data without a command signal
is defined as “data”. Command and data operation procedures can be determined by the user according
to their communication specifications.
SCK0 8 9 10 11
SCK0 8 9
The acknowledge signal is one-shot pulse generated at the falling edge of SCK0 after 8-bit data transfer.
It can be positioned anywhere and can be synchronized with any SCK0 clock.
After 8-bit data transmission, the transmitter checks whether the receiver has returned the acknowledge
signal. If the acknowledge signal is not returned for the preset period of time after data transmission,
it can be judged that data reception has not been carried out correctly.
SCK0 8 9
In SBI, the slave device notifies the master device of the busy state by setting the SB0 (SB1) line to low
level.
BUSY signal output follows acknowledge signal output from the master or slave device. It is set/reset
at the falling edge of SCK0. When the BUSY signal is reset, the master device automatically terminates
the output of the SCK0 serial clock.
When the BUSY signal is reset and the READY signal is set, the master device can start the next transfer.
Caution In the SBI mode, the BUSY signal is output until the next serial clock (SCK0) falls after
a command that resets the BUSY signal has been issued. If WUP is set to 1 during this
period by mistake, the BUSY signal is not reset. Therefore, be sure to confirm that the
SB0 (SB1) pin has gone high after resetting the BUSY signal, by setting WUP to 1.
CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00 FF60H 00H R/WNote 1
R/W CSIM CSIM CSIM PM25 P25 PM26 P26 PM27 P27 Operation Start bit SI0/SB0/P25 SO0/SB1/P26 SCK0/P27
04 03 02 mode pin function pin function pin function
0 × 3-wire serial I/O mode (see 16.4.2 3-wire serial I/O mode operation.)
Note 2 Note 2
1 0 0 × × 0 0 0 1 SBI mode MSB P25 SB1 SCK0
(CMOS I/O) (N-ch (CMOS I/O)
open-drain I/O)
Note 2 Note 2
1 0 0 × × 0 1 SB0 P26
(N-ch (CMOS I/O)
open-drain I/O)
1 1 2-wire serial I/O mode (see 16.4.4 2-wire serial I/O mode operation.)
Note 3
R/W WUP Wakeup function control
0 Interrupt request signal generation with each serial transfer in any mode
1 Interrupt request signal generation when the address received after bus release
(when CMDD = RELD = 1) matches the slave address register (SVA) data in SBI mode
Note 4
R COI Slave address comparison result flag
0 Slave address register (SVA) not equal to serial I/O shift register 0 (SIO0) data
1 Slave address register (SVA) equal to serial I/O shift register 0 (SIO0) data
Symbol <7> <6> <5> <4> <3> <2> <1> <0> Address After reset R/W
SBIC BSYE ACKD ACKE ACKT CMDD RELD CMDT RELT FF61H 00H R/WNote
R/W ACKT The acknowledge signal is output in synchronization with the falling edge of the SCK0 clock just after
execution of the instruction that sets this bit to 1 and, after acknowledge signal output, ACKT is automatically
cleared to 0.
ACKT is used with ACKE = 0. ACKT is also cleared to 0 upon start of serial interface transfer or when
CSIE0 = 0.
1 Before completion of The acknowledge signal is output in synchronization with the falling edge of the 9th
transfer SCK0 clock (automatically output when ACKE = 1).
After completion of The acknowledge signal is output in synchronization with falling edge of the SCK0
transfer clock just after execution of the instruction that sets this bit to 1
(automatically output when ACKE = 1).
However, ACKE is not automatically cleared to 0 after acknowledge signal output.
(Cont’d)
Note Bits 2, 3, and 6 (RELD, CMDD and ACKD) are read-only bits.
Remarks 1. Bits 0, 1, and 4 (RELT, CMDT, and ACKT) are 0 when read after data setting.
2. CSIE0: Bit 7 of serial operating mode register 0 (CSIM0)
Note
R/W Synchronizing busy signal output control
BSYE
0 Disable the busy signal which is output in synchronization with the falling edge of SCK0 clock just after
execution of the instruction that clears this bit to 0 (set READY status).
1 Output the busy signal at the falling edge of the SCK0 clock following the acknowledge signal.
Note Busy mode can be cleared by start of serial interface transfer. However, the BSYE flag is not
cleared to 0.
R/W
SVAM SVA bit to be used as slave address
0 Bits 0 to 7
1 Bits 1 to 7
R/W
SIC INTCSI0 interrupt source selectionNote 2
R
CLD SCK0/P27 pin levelNote 3
0 Low level
1 High level
SIO0
SCK0
SB0 (SB1)
RELT
CMDT
RELD
CMDD
SIO0 A7 A6 A1 A0
SCK0 1 2 7 8 9
READY
SB0 (SB1) A7 A6 A1 A0 ACK
RELD
CMDD
SCK0 6 7 8 9
If ACKT is set
during this period
SCK0 1 2 7 8 9
ACKE
SCK0 6 7 8 9
SCK0 1 2 7 8 9
ACKE
SCK0
ACKE
ACKD
ACKD
Transfer start
instruction
SIO0
SCK0 6 7 8 9
ACKD
SCK0 6 7 8 9
BSYE
Output Output
Signal Name Definition Timing Chart Effects on Flag Meaning of Signal
Device Conditions
Bus release Master SB0 (SB1) rising edge • RELT set • RELD set CMD signal is output
SCK0 “H”
signal when SCK0 = 1 • CMDD clear to indicate that
(REL) transmit data is an
SB0 (SB1)
CHAPTER 16
address.
Command Master SB0 (SB1) falling edge • CMDT set • CMDD set i) Transmit data is an
signal when SCK0 = 1 address after REL
(CMD) SCK0 “H” signal output.
ii) REL signal is not
command.
Output Output
Signal Name Definition Timing Chart Effects on Flag Meaning of Signal
Device Conditions
Serial clock Master Synchronous clock to output When CSIE0 = 1, CSIIF0 set (rising Timing of signal
(SCK0) address/command/data, execution of edge of 9th clock output to serial data
ACK signal, synchronous SCK0 1 2 7 8 9 10 instruction for of SCK0)Note 1 bus
CHAPTER 16
BUSY signal, etc. Address/ data write to
command/data is transferred SB0 (SB1) SIO0 (serial
with the first eight transfer start
synchronous clocks. instruction)Note 2
Notes 1. When WUP = 0, CSIIF0 is set at the rising edge of the 9th clock of SCK0.
When WUP = 1, an address is received. Only when the address matches the slave address register (SVA) value, CSIIF0 is set (if the address does not
match the value of SVA, RELD is cleared).
2. In the BUSY state, transfer starts after the READY state is set.
CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD780058 SUBSERIES)
Because the serial data bus line has an N-ch open-drain output, an external pull-up resistor is necessary.
Slave device
Master service
(Clock input)
VDD0
SI0 SI0
Caution Because the N-ch open-drain output must made to go into a high-impedance state during
data reception, write FFH to serial I/O shift register 0 (SIO0) in advance. The N-ch open-drain
output can always go into a high-impedance state during transfer. However, when the wake-
up function specification bit (WUP) = 1, the N-ch open-drain output always goes into a high-
impedance state. Thus, it is not necessary to write FFH to SIO0 before reception.
Cautions 1. Slave selection/non-selection is detected by matching of the slave address received after
bus release (RELD = 1).
For this match detection, the match interrupt request (INTCSI0) of the address to be
generated with WUP = 1 is normally used. Thus, execute selection/non-selection
detection by slave address when WUP = 1.
2. When detecting selection/non-selection without the use of an interrupt request with WUP
= 0, do so by means of transmission/reception of the command preset by program instead
of using the address match detection method.
CHAPTER 16
Hardware operation Serial transmission INTCSI0 ACKD SCK0
generation set stop
SCK0 pin 1 2 3 4 5 6 7 8 9
User's Manual U12013EJ3V2UD
Address
ACKT BUSY
Program processing WUP←0 set clear
CHAPTER 16
Hardware operation Serial transmission INTCSI0 ACKD SCK0
generation set stop
SCK0 pin 1 2 3 4 5 6 7 8 9
User's Manual U12013EJ3V2UD
Command
CHAPTER 16
Hardware operation Serial transmission INTCSI0 ACKD SCK0
generation set stop
SCK0 pin 1 2 3 4 5 6 7 8 9
User's Manual U12013EJ3V2UD
Data
Program processing FFH write SIO0 ACKT FFH Write Receive data processing
to SIO0 read set to SIO0
CHAPTER 16
SCK0 INTCSI0 ACK Serial
Hardware operation Serial reception reception
stop generation output
SCK0 pin 1 2 3 4 5 6 7 8 9 1 2
User's Manual U12013EJ3V2UD
Data
Write Write
Program processing to SIO0 to SIO0
Cautions 1. If CSIE0 is set to “1” after data write to SIO0, transfer does not start.
2. Because the N-ch open-drain output must go into a high-impedance state during data
reception, write FFH to SIO0 in advance.
However, when the wakeup function specification bit (WUP) = 1, the N-ch open-drain
output always goes into a high-impedance state. Thus, it is not necessary to write FFH
to SIO0 before reception.
3. If data is written to SIO0 when the slave is busy, the data is not lost.
When the busy state is cleared and SB0 (or SB1) input is set to the high level (READY)
state, transfer starts.
Upon termination of 8-bit transfer, serial transfer automatically stops and the interrupt request flag (CSIIF0)
is set.
For pins that are to be used for data I/O, be sure to carry out the following settings before serial transfer of
the 1st byte after RESET input.
After detection of the READY state, clear the port mode register to 0 and return to the output mode.
(a) Slave selection/non-selection is detected by match detection of the slave address received after bus
release (RELD = 1).
For this match detection, the match interrupt request (INTCSI0) of the address to be generated with WUP
= 1 is normally used. Thus, execute selection/non-selection detection by slave address when WUP =
1.
(b) When detecting selection/non-selection without the use of an interrupt with WUP = 0, do so by means
of transmission/reception of the command preset by program instead of using the address match detection
method.
(c) In the SBI mode, the BUSY signal is output until the next serial clock falls after a command that resets
the BUSY signal has been issued. If WUP is set to 1 during this period by mistake, the BUSY signal is
not reset. Therefore, be sure to confirm that the SB0 (SB1) pin has gone high after resetting the BUSY
signal, by setting WUP to 1.
(d) For pins that are to be used for data I/O, be sure to carry out the following settings before serial transfer
of the 1st byte after RESET input.
(e) The transition of the SB0 (SB1) line from low to high or from high to low when the SCK0 line is high is
recognized as a bus release signal or a command signal, respectively. If the transition timing of the bus
is shifted due to the influence of board capacitance, transmitted data may be judged as a bus release
signal (or a command signal). Exercise care in wiring so that noise is not superimposed on the signal
lines.
Figure 16-31. Serial Bus Configuration Example Using 2-Wire Serial I/O Mode
VDD0 VDD0
Master Slave
SCK0 SCK0
CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00 FF60H 00H R/WNote 1
R/W CSIM CSIM CSIM PM25 P25 PM26 P26 PM27 P27 Operation Start bit SIO/SB0/P25 SO0/SB1/P26 SCK0/P27
04 03 02 mode pin function pin function pin function
0 × 3-wire serial I/O mode (see 16.4.2 3-wire serial I/O mode operation)
1 Interrupt request signal generation when the address received after bus release
(when CMDD = RELD = 1) matches the slave address register (SVA) data in SBI mode
Symbol <7> <6> <5> <4> <3> <2> <1> <0> Address After reset R/W
SBIC BSYE ACKD ACKE ACKT CMDD RELD CMDT RELT FF61H 00H R/W
R/W RELT When RELT = 1, the SO0 Iatch is set to 1. After the SO0 Iatch is set, RELT is automatically cleared to 0.
It is also cleared to 0 when CSIE0 = 0.
R/W CMDT When CMDT = 1, the SO0 Iatch is cleared to 0. After the SO0 latch is cleared, CMDT is automatically
cleared to 0.
It is also cleared to 0 when CSIE0 = 0.
R/W
SIC INTCSI0 interrupt factor selection
0 CSIIF0 is set upon termination of serial interface
channel 0 transfer
R
CLD SCK0/P27 pin levelNote 2
0 Low level
1 High level
SCK0 1 2 3 4 5 6 7 8
SB0 (SB1) D7 D6 D5 D4 D3 D2 D1 D0
CSIIF0
End of transfer
The SB0 (or SB1) pin specified for the serial data bus is an N-ch open-drain I/O and thus it must be externally
connected to a pull-up resistor. Because an N-ch open-drain output must go into a high-impedance state during
data reception, write FFH to SIO0 in advance.
The SB0 (or SB1) pin generates the SO0 latch status and thus the SB0 (or SB1) pin output status can be
manipulated by setting bit 0 (RELT) and bit 1 (CMDT) of the serial bus interface control register (SBIC).
However, do not carry out this manipulation during serial transfer.
Control the SCK0 pin output level in the output mode (internal system clock mode) by manipulating the P27
output latch (see 16.4.5 SCK0/P27 pin output manipulation).
SO0 latch
RELT
CMDT
Cautions 1. If CSIE0 is set to 1 after data write to SIO0, transfer does not start.
2. Because the N-ch open-drain output must go into a high-impedance state during data
reception, write FFH to SIO0 in advance.
Upon termination of 8-bit transfer, serial transfer automatically stops and the interrupt request flag (CSIIF0)
is set.
1 Set serial operating mode register 0 (CSIM0) (SCK0 pin: Output mode, serial operation: Enabled). SCK0 =
1 while serial transfer is suspended.
2 Manipulate the P27 output latch with a bit manipulation instruction.
Manipulated by bit
manipulation instruction
SCK0/P27 To internal P27
circuit Output Latch
The µPD780058Y Subseries incorporates three serial interface channels. Differences between channels 0, 1,
and 2 are as follows (see CHAPTER 18 SERIAL INTERFACE CHANNEL 1 for details of serial interface channel
1 and CHAPTER 19 SERIAL INTERFACE CHANNEL 2 for details of serial interface channel 2).
Caution Do not change the operating mode (3-wire serial I/O, 2-wire serial I/O, or SBI) while serial interface
channel 0 is enabled to operate. To change the operating mode, stop the serial operation first.
VDD0 VDD0
SCL SCL
Slave CPU2
SCL
SDA0 (SDA1)
Slave CPUn
SCL
SDA0 (SDA1)
Item Configuration
Note See Figure 6-7 Block Diagram of P20, P21, and P23 to P26 and Figure 6-8 Block Diagram of P22
and P27.
Internal bus
Controller
CSIM00 CSIM00 2 4
CSIM01 CSIM01
P27
Output latch
CLD SIC SVAM CLC WREL WAT1 WAT0 TCL33 TCL32 TCL31 TCL30
Internal bus
Remark The output control block performs selection between CMOS output and N-ch open-drain output.
Caution Do not execute an instruction that writes SIO0 in the I2C bus mode while WUP (bit 5 of serial
operating mode register 0 (CSIM0)) = 1. Even if such an instruction is not executed, data
can be received when the wake-up function is used (WUP = 1). For the detail of the wake-
up function, see 17.4.4 (1) (c) Wake-up function.
Remark BSYE: Bit 7 of the serial bus interface control register (SBIC)
ACKE: Bit 5 of the serial bus interface control register (SBIC)
The following four registers are used to control serial interface channel 0.
TCL3 TCL37 TCL36 TCL35 TCL34 TCL33 TCL32 TCL31 TCL30 FF43H 88H R/W
TCL33 TCL32 TCL31 TCL30 Serial interface channel 0 serial clock selection
Serial clock in I2C bus mode Serial clock in 2-wire or 3-wire
serial I/O mode
MCS = 1 MCS = 0 MCS = 1 MCS = 0
0 1 1 1 f XX/26 f X/26 (78.1 kHz) f X/27 (39.1 kHz) f XX/22 f X/22 (1.25 MHz) f X/23 (625 kHz)
1 0 0 0 f XX/27 f X/27 (39.1 kHz) f X/28 (19.5 kHz) f XX/23 f X/23 (625 kHz) f X/24 (313 kHz)
1 0 0 1 f XX/28 f X/28 (19.5 kHz) f X/29 (9.77 kHz) f XX/24 f X/24 (313 kHz) f X/25 (156 kHz)
1 0 1 0 f XX/29 f X/29 (9.77 kHz) f X/210 (4.88 kHz) f XX/25 f X/25 (156 kHz) f X/26 (78.1 kHz)
1 0 1 1 f XX/210 f X/210 (4.88 kHz) f X/211 (2.44 kHz) f XX/26 f X/26 (78.1 kHz) f X/27 (39.1 kHz)
1 1 0 0 f XX/211 f X/211 (2.44 kHz) f X/212 (1.22 kHz) f XX/27 f X/27 (39.1 kHz) f X/28 (19.5 kHz)
1 1 0 1 f XX/212 f X/212 (1.22 kHz) f X/213 (0.61 kHz) f XX/28 f X/28 (19.5 kHz) f X/29 (9.8 kHz)
TCL37 TCL36 TCL35 TCL34 Serial interface channel 1 serial clock selection
MCS = 1 MCS = 0
Caution When rewriting TCL3 to other data, stop the serial transfer operation beforehand.
Caution Do not change the operating mode (3-wire serial I/O, 2-wire serial I/O, or SBI) while serial
interface channel 0 is enabled to operate. To change the operating mode, stop the serial
operation first.
CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00 FF60H 00H R/WNote 1
1 Interrupt request signal generation when the address received after detecting start condition
(when CMDD = 1) matches the slave address register (SVA) data in I2C bus mode
Note 6
R COI Slave address comparison result flag
0 Slave address register (SVA) not equal to serial I/O shift register 0 (SIO0) data
1 Slave address register (SVA) equal to serial I/O shift register 0 (SIO0) data
Symbol <7> <6> <5> <4> <3> <2> <1> <0> Address After reset R/W
SBIC BSYE ACKD ACKE ACKT CMDD RELD CMDT RELT FF61H 00H R/WNote
R/W ACKT Used to generate the ACK signal by software when 8-clock wait mode is selected.
Keeps SDA0 (SDA1) low from set instruction (ACKT = 1) execution to the next falling edge of SCL.
ACKT is also cleared to 0 upon start of serial interface transfer or when CSIE0 = 0.
Note Bits 2, 3, and 6 (RELD, CMDD, and ACKD) are read-only bits.
• While executing the transfer start instruction • When acknowledge signal (ACK) is detected at the
• When CSIE0 = 0 rising edge of the SCL clock after completion of
• When RESETinput is applied transfer
Note 3
R/W
BSYE Control of N-ch open-drain output for transmission in I2C Bus ModeNote 4
Symbol 7 <6> <5> <4> <3> <2> 1 0 Address After reset R/W
SINT 0 CLD SIC SVAM CLC WREL WAT1 WAT0 FF63H 00H R/WNote 1
0 1 Setting prohibited
Notes 1. When using the wakeup function in the I2C mode, clear SIC to 0.
2. When CSIE0 = 0, CLD becomes 0.
The following four operating modes are available for serial interface channel 0.
CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00 FF60H 00H R/W
CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00 FF60H 00H R/WNote 1
1 1 2-wire serial I/O mode (see 17.4.3 2-wire serial I/O mode operation.)
or
2 2
I C bus mode (see 17.4.4 I C bus mode operation.)
1 Interrupt request signal generation when the address received after detecting start condition
(when CMDD = 1) matches the slave address register (SVA) data in I2C bus mode
SBIC BSYE ACKD ACKE ACKT CMDD RELD CMDT RELT FF61H 00H R/W
R/W RELT When RELT = 1, the SO0 Iatch is set to 1. After the SO0 Iatch is set, RELT is automatically cleared to 0.
It is also cleared to 0 when CSIE0 = 0.
R/W CMDT When CMDT = 1, the SO0 Iatch is cleared to 0. After the SO0 latch is cleared, CMDT is automatically
cleared to 0.
It is also cleared to 0 when CSIE0 = 0.
SCK0 1 2 3 4 5 6 7 8
CSIIF0
End of transfer
Transfer start at the falling edge of SCK0
The SO0 pin is a CMOS output pin and outputs the current SO0 latch status. Thus, the SO0 pin output status
can be manipulated by setting bit 0 (RELT) and bit 1 (CMDT) of the serial bus interface control register (SBIC).
However, do not carry out this manipulation during serial transfer.
Control the SCK0 pin output level in the output mode (internal system clock mode) by manipulating the P27
output latch (see 17.4.8 SCK0/SCL/P27 pin output manipulation).
SO0 latch
RELT
CMDT
7
6
Internal bus
1
0
LSB-first
MSB-first Read/write gate Read/write gate
SO0 latch
SI0 Serial I/O shift register 0 (SIO0) D Q
SO0
SCK0
Start bit switching is realized by switching the bit order for data write to SIO0. The SIO0 shift order remains
unchanged.
Thus, switching between MSB-first and LSB-first must be performed before writing data to SIO0.
Caution If CSIE0 is set to 1 after data write to SIO0, transfer does not start.
Upon termination of 8-bit transfer, serial transfer automatically stops and the interrupt request flag (CSIIF0)
is set.
Figure 17-10. Serial Bus Configuration Example Using 2-Wire Serial I/O Mode
VDD0 VDD0
Master Slave
SCK0 SCK0
CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00 FF60H 00H R/WNote 1
R/W CSIM CSIM CSIM PM25 P25 PM26 P26 PM27 P27 Operation Start bit SI0/SB0/SDA0 SO0/SB1/SDA1 SCK0/SCL/P27
04 03 02 mode /P25 pin function /P26 pin function pin function
0 × 3-wire serial I/O mode (see 17.4.2 3-wire serial I/O mode operation)
Note 2 Note 2
2-wire serial MSB P25 SB1/SDA1 SCK0/SCL
1 1 0 × × 0 0 0 1
l/O mode (CMOS I/O) (N-ch (N-ch
or open-drain I/O open-drain I/O)
I2C bus mode
Note 2 Note 2
SB0/SDA0 P26
1 0 0 × × 0 1 (N-ch (CMOS I/O)
open-drain I/O)
1 Interrupt request signal generation when the address received after detecting start condition
(when CMDD = 1) matches the slave address register (SVA) data in I2C bus mode
Symbol <7> <6> <5> <4> <3> <2> <1> <0> Address After reset R/W
SBIC BSYE ACKD ACKE ACKT CMDD RELD CMDT RELT FF61H 00H R/W
R/W RELT When RELT = 1, the SO0 Iatch is set to 1. After the SO0 Iatch is set, RELT is automatically cleared to 0.
It is also cleared to 0 when CSIE0 = 0.
R/W CMDT When CMDT = 1, the SO0 Iatch is cleared to 0. After the SO0 latch is cleared, CMDT is automatically
cleared to 0.
It is also cleared to 0 when CSIE0 = 0.
Symbol 7 <6> <5> <4> <3> <2> 1 0 Address After reset R/W
SINT 0 CLD SIC SVAM CLC WREL WAT1 WAT0 FF63H 00H R/WNote 1
1 CSIIF0 is set to 1 upon bus release detection or termination of serial interface channel 0 transfer
1 High level
Caution Be sure to clear bits 0 to 3 to 0 in the 2-wire serial I/O mode is used.
SCK0 1 2 3 4 5 6 7 8
SB0 (SB1) D7 D6 D5 D4 D3 D2 D1 D0
CSIIF0
End of Transfer
The SB0 (or SB1) pin specified for the serial data bus is an N-ch open-drain input/output and thus it must be
externally connected to a pull-up resistor. Because N-ch open-drain output must go into a high-impedance
state during data reception, write FFH to SIO0 in advance.
The SB0 (or SB1) pin generates the SO0 latch status and thus the SB0 (or SB1) pin output status can be
manipulated by setting bit 0 (RELT) and bit 1 (CMDT) of the serial bus interface control register (SBIC).
However, do not carry out this manipulation during serial transfer.
Control the SCK0 pin output level in the output mode (internal system clock mode) by manipulating the P27
output latch (see 17.4.8 SCK0/SCL/P27 pin output manipulation).
SO0 latch
RELT
CMDT
Cautions 1. If CSIE0 is set to 1 after data write to SIO0, transfer does not start.
2. Because the N-ch open-drain output must go into a high-impedance state during data
reception, write FFH to SIO0 in advance.
Upon termination of 8-bit transfer, serial transfer automatically stops and the interrupt request flag (CSIIF0)
is set.
(a) Method of comparing SIO0 data before transmission to that after transmission
In this case, if two data differ from each other, a transmit error is judged to have occurred.
VDD0 VDD0
Serial clock
SCL SCL
Slave CPU2
SCL
SDA0 (SDA1)
Slave IC
SCL
SDA
SCL 1 to 7 8 9 1 to 7 8 9 1 to 7 8 9
SDA0 (SDA1)
The start condition, slave address, and stop condition signals are output by the master. The acknowledge
signal (ACK) is output by either the master or the slave device (normally by the device which has received
the 8-bit data that was sent). A serial clock (SCL) is continuously supplied from the master device.
H
SCL
SDA0 (SDA1)
(b) Address
The 7 bits following the start condition signal are defined as an address.
The 7-bit address data is output by the master device to specify a specific slave from among those
connected to the bus line. Each slave device on the bus line must therefore have a different address.
Therefore, after a slave device detects the start condition, it compares the 7-bit address data received
and the data of the slave address register (SVA). After the comparison, only the slave device in which
the data are a match becomes the communication partner, and subsequently performs communication
with the master device until the master device sends a start condition or stop condition signal.
SCL 1 2 3 4 5 6 7
Address
SCL 1 2 3 4 5 6 7 8
Transfer direction
specification
SCL 1 2 3 4 5 6 7 8 9
H
SCL
SDA0 (SDA1)
SCL of
6 7 8 9 1 2 3 4
master device
SCL of
slave device
SCL
SCL of
master device 6 7 8 9 1 2 3
SCL of
slave device
SCL
CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00 FF60H 00H R/WNote 1
R/W CSIM CSIM CSIM PM25 P25 PM26 P26 PM27 P27 Operation Start SI0/SB0/SDA0/ SO0/SB1/SDA1/ SCK0/SCL/P27
04 03 02 mode bit P25 pin function P26 pin function pin function
0 × 3-wire serial I/O mode (see 17.4.2 Operation in 3-wire serial I/O mode)
1 1 0 × × 0 0 0 1 2-wire MSB P25 SB1/SDA1 SCK0/SCL
Note 3 Note 3 serial I/O or (CMOS I/O) N-ch open- N-ch open-
I2C bus mode drain I/O drain I/O
1 1 1 0 0 × × 0 1 2-wire MSB SB0/SDA0 P26 SCK0/SCL
Note 3 Note 3 serial I/O or N-ch open- (CMOS I/O) N-ch open-
I2C bus mode drain I/O drain I/O
SBIC BSYE ACKD ACKE ACKT CMDD RELD CMDT RELT FF61H 00H R/WNote 1
R/W RELT Use for stop condition output. When RELT = 1, the SO0 latch is set to 1. After the SO0 latch is set, RELT
is automatically cleared to 0. Also cleared to 0 when CSIE0 = 0.
R/W CMDT Use for start condition output. When CMDT = 1, the SO0 latch is cleared to 0. After the SO0 latch is
cleared, CMDT is automatically cleared to 0. It is also cleared to 0 when CSIE0 = 0.
R/W ACKT SDA0 (SDA1) is set to low after the Set instruction execution (ACKT = 1) before the next SCL falling edge.
Used for generating an ACK signal by software if the 8-clock wait mode is selected. Cleared to 0 if CSIE0
= 0 when a transfer by the serial interface is started.
Symbol 7 <6> <5> <4> <3> <2> 1 0 Address After reset R/W
SINT 0 CLD SIC SVAM CLC WREL WAT1 WAT0 FF63H 00H R/WNote 1
Notes 1. The level of the serial clock can be controlled with bit 3 (CLC) of interrupt timing specify register
(SINT).
2. Execution of instruction to write data to SIO0 when CSIE0 = 1 (serial transfer start directive). In
the wait state, the serial transfer operation will be started after the wait state is released.
3. If the 8-clock wait is selected when WUP = 0, CSIIF0 is set at the rising edge of the 8th clock cycle
of SCL. If the 9-clock wait is selected when WUP = 0, CSIIF0 is set at the rising edge of the 9th
clock cycle of SCL. CSIIF0 is set if an address is received and that address matches the value
of the slave address register (SVA) when WUP = 1, or if the stop condition is detected.
(a) SCL
Pin for serial clock input/output alternate-function pin.
<1> Master ..... N-ch open-drain output
<2> Slave ....... Schmitt input
Note that pull-up resistors are required to be connected to both the serial clock line and serial data bus
line, because open-drain buffers are used for the serial clock pin (SCL) and the serial data bus pin
(SDA0 or SDA1) on the I2C bus.
Master device
SCL SCL
Clock output VDD0 (Clock output)
VSS0 VSS0
(Clock input) Clock input
SDA0 (SDA1)
Data output SDA0 (SDA1) Data output
VSS0 VSS0
Data input Data input
Caution To receive data, the N-ch open-drain output must made to go into a high-impedance
state. Therefore, set bit 7 (BSYE) of the serial bus interface control register (SBIC) to
1 in advance, and write FFH to serial I/O shift register 0 (SIO0).
When the wakeup function is used (by setting bit 5 (WUP) of serial operating mode
register 0 (CSIM0)), however, do not write FFH to SIO0 before reception. Even if FFH
is not written to SIO0, the N-ch open-drain output always goes into a high-impedance
state.
Caution Slave selection/non-selection is detected by matching of the data (address) received after
the start condition.
For this match detection, the match interrupt request (INTCSI0) of the address to be
generated with WUP = 1 is normally used. Thus, execute selection/non-selection detection
by slave address when WUP = 1.
Transfer line
SCL 1 2 3 4 5 6 7 8 9 1 2 3 4 5
SDA0 A6 A5 A4 A3 A2 A1 A0 W ACK D7 D6 D5 D4 D3
(b) Data
Transfer line
SCL 1 2 3 4 5 6 7 8 9 1 2 3 4 5
SDA0 D7 D6 D5 D4 D3 D2 D1 D0 ACK D7 D6 D5 D4 D3
Transfer line
SCL 1 2 3 4 5 6 7 8 9 1 2 3 4
SDA0 D7 D6 D5 D4 D3 D2 D1 D0 ACK A6 A5 A4 A3
Transfer line
SCL 1 2 3 4 5 6 7 8 9 1 2 3 4 5
SDA0 A6 A5 A4 A3 A2 A1 A0 R ACK D7 D6 D5 D4 D3
(b) Data
Transfer line
SCL 1 2 3 4 5 6 7 8 9 1 2 3 4 5
SDA0 D7 D6 D5 D4 D3 D2 D1 D0 ACK D7 D6 D5 D4 D3
Transfer line
SCL 1 2 3 4 5 6 7 8 9 1 2 3 4
SDA0 D7 D6 D5 D4 D3 D2 D1 D0 NAK A6 A5 A4 A3
Cautions 1. Be sure to set CSIE0 to 1 before writing data in SIO0. Setting CSIE0 to 1 after writing data
in SIO0 does not initiate transfer operation.
2. Because the N-ch open-drain output must made to go into a high-impedance state during
data reception, set bit 7 (BSYE) of the serial bus interface control register (SBIC) to 1
before writing FFH to SIO0.
Do not write FFH to SIO0 before reception when the wakeup function is used (by setting
bit 5 (WUP) of serial operating mode register 0 (CSIM0)). Even if FFH is not written to
SIO0, the N-ch open-drain output always goes into a high-impedance state.
3. If data is written to SIO0 while the slave is in the wait state, that data is held. The transfer
is started when SCL is output after the wait state is cleared.
When an 8-bit data transfer ends, serial transfer is stopped automatically and the interrupt request flag
(CSIIF0) is set.
SCL
SDA0 (SDA1)
CLC
CMDT
CLD
Writing
Software operation FFH
to SIO0
Transfer line
SCL 9 a 1 2 3
Writing
Software operation data to
SIO0
Setting Setting
Hardware operation Serial transmission
ACKD CSIIF0
Transfer line
SCL 9 1 2 3
Description: If the wakeup function is executed (by setting bit 5 of serial operating mode register 0
(CSIM0) to 1) in the serial transfer statusNote, the µPD780058Y Subseries checks the
address of the data between the other slaves and the master. If that data happens to
match the slave address of the µPD780058Y Subseries, the µPD780058Y Subseries
takes part in communication, destroying the communication data.
Note The serial transfer status is the status from when data is written to serial I/O shift
register 0 (SIO0) until the interrupt request flag (CSIIF0) is set to 1 by completion
of the serial transfer.
Preventive measure: The above phenomenon can be avoided by modifying the program.
Before executing the wakeup function, execute the following program that clears the
serial transfer status. When executing the wakeup function, do not execute an instruction
that writes data to SIO0. Even if such an instruction is not executed, data can be received
when the wakeup function is executed.
This program releases the serial transfer status. To release the serial transfer status,
serial interface channel 0 must be disabled once (by clearing the CSIE0 flag (bit 7 of the
serial operating mode register (CSIM0) to 0). If serial interface channel 0 is disabled in
the I2C bus mode, however, the SCL pin outputs a high level, and the SDA0 (SDA1) pin
outputs a low level, affecting communication of the I2C bus. Therefore, this program
makes the SCL and SDA0 (SDA1) pins go into a high-impedance state to prevent the
I2C bus from being affected.
In this example, the SDA0 (/P25) pin is used as a serial data input/output pin. When
SDA1 (/P26) is used, take P2.5 and PM2.5 in the program example below as P2.6 and
PM2.6.
For the timing of each signal when this program is executed, see Figure 17-22.
<1> This instruction prevents the SDA0 pin from outputting a low level when the I2C bus mode is restored
by instruction <5>. The output of the SDA0 pin goes into a high-impedance state.
<2> This instruction sets the P25 (/SDA0) pin in the input mode to protect the SDA0 line from adverse
influence when the port mode is set by instruction <4>. The P25 pin is set in the input mode when
instruction <2> is executed.
<3> This instruction sets the P27 (/SCL) pin in the input mode to protect the SCL line from adverse influence
when the port mode is set by instruction <4>. The P27 pin is set in the input mode when instruction
<3> is executed.
<4> This instruction changes the mode from I2C bus mode to port mode.
<5> This instruction restores the I2C bus mode from the port mode.
<6> This instruction prevents the SDA0 pin from outputting a low level when instruction <8> is executed.
<7> This instruction sets the P27 pin in the output mode because the P27 pin must be in the output mode
in the I2C bus mode.
<8> This instruction clears the output latch of the P25 pin to 0 because the output latch of the P25 pin
must be cleared to 0 in the I2C bus mode.
<9> This instruction sets the P25 pin in the output mode because the P25 pin must be in the output mode
in the I2C bus mode.
Condition: If a low level is used when CSIE0 is set to 1 when using the P26/SDA as the SDA line and P25/SDA0
as an input port
Cautions 1. After that, RELD = 1 (stop condition is detected) until data that does not match the source
station slave address (SVA) is received.
2. Even if a start condition is satisfied while RELD = 1 (stop condition is detected), the
interrupt occurs if it is enabled and CMDD = 1 (start condition is detected).
(2) When using as slave device in I2C bus mode (if restrictions in 17.4.6 apply)
Example of program releasing serial transfer status
Cautions 1. After that, RELD = 1 (stop condition is detected) until data that does not match the source
station slave address (SVA) is received.
2. Even if a start condition is satisfied while RELD = 1 (stop condition is detected), the
interrupt occurs if it is enabled and CMDD = 1 (start condition is detected).
(1) In 3-wire serial I/O mode and 2-wire serial I/O mode
The output level of the SCK0/SCL/P27 pin is manipulated by the P27 output latch.
<1> Set serial operating mode register 0 (CSIM0) (SCK0 pin: Output mode, serial operation: Enabled).
SCK0 = 1 while serial transfer is stopped.
<2> Manipulate the contents of the P27 output latch by executing a bit manipulation instruction.
<1> Set serial operating mode register 0 (CSIM0) (SCL pin: Output mode, serial operation: Enabled). Set
the P27 output latch to 1. SCL = 0 while serial transfer is stopped.
<2> Manipulate the CLC bit of SINT by executing a bit manipulation instruction.
Set 1
Note
SCL
From serial clock
CSIE0 = 1 and CSIM01 and CSIM00 are 1, 0 or 1, 1, respectively controller
Note The level of the SCL signal is in accordance with the contents of the logic circuits shown in Figure
17-29.
Remarks 1. This figure indicates the relationship of the signals and does not indicate the internal circuit.
2. CLC: Bit 3 of interrupt timing specification register (SINT)
(3) 3-wire serial I/O mode with automatic transmit/receive function (MSB-/LSB-first switchable)
This mode is equivalent to the 3-wire serial I/O mode with the addition of an automatic transmit/receive function.
The automatic transmit/receive function is used to transmit/receive data with a maximum of 32 bytes. This
function enables the hardware to transmit/receive data to/from the OSD (On Screen Display) device and a
device with built-in display controller/driver independently of the CPU, thus alleviating the software load.
Caution When using the P23/STB/TxD1 and P24/BUSY/RxD1 pins in the asynchronous serial interface
(UART) mode of serial interface channel 2, the busy control option and busy & strobe control
option are invalid.
Item Configuration
Registers Serial I/O shift register 1 (SIO1)
Automatic data transmit/receive address pointer (ADTP)
Control registers Timer clock select register 3 (TCL3)
Serial operating mode register 1 (CSIM1)
Automatic data transmit/receive control register (ADTC)
Automatic data transmit/receive interval specification register (ADTI)
Port mode register 2 (PM2)Note
Note See Figures 6-5 and 6-7 Block Diagram of P20, P21, and P23 to P26 and Figures 6-6 and 6-8 Block
Diagram of P22 and P27.
Internal bus
Automatic data
transmit/receive
Buffer RAM address pointer
(ADTP)
Internal bus
ARLD
Clear
SCK1/ Selector fXX/2 to fXX/28
Selector
P22 R
Q TO2 4
S
PM22 P22 output latch TCL TCL TCL TCL
37 36 35 34
Timer clock
select register 3
Internal bus
Caution Do not write data to SIO1 while the automatic transmit/receive function is activated.
Caution Do not write data to ADTP while the automatic transmit/receive function is activated.
The following four registers are used to control serial interface channel 1.
Remark Besides setting the serial clock of serial interface channel 1, TCL3 sets the serial clock of serial
interface channel 0.
TCL3 TCL37 TCL36 TCL35 TCL34 TCL33 TCL32 TCL31 TCL30 FF43H 88H R/W
TCL37 TCL36 TCL35 TCL34 Serial interface channel 1 serial clock selection
MCS = 1 MCS = 0
Caution When rewriting other data to TCL3 , stop the serial transfer operation beforehand.
CSIE1 CSIM11 PM20 P20 PM21 P21 PM22 P22 Shift register Serial clock counter SI1/P20 pin SO1/P21 pin SCK1/P22
1 operation operation control function function pin function
Note 2 Note 2 Note 2 Note 2 Note 2 Note 2
Operation Clear P20 P21 P22
0 × × × × × × ×
stop (CMOS I/O) (CMOS I/O) (CMOS I/O)
Note 3 Note 3
Operation Count SI1Note 3 SO1 (CMOS SCK1
1 0 1 × 0 0 1 × enable operation (input) output) (input)
1 0 1 SCK1
(CMOS
output)
Notes 1. If the external clock input has been selected with CSIM11 cleared to 0, clear bit 1 (BUSY1) and
bit 2 (STRB) of the automatic data transmit/receive control register (ADTC) to 0, 0.
2. Can be used freely as a port function.
3. Can be used as P20 (CMOS I/O) when only transmission is performed (clear bit 7 (RE) of ADTC
to 0).
ADTC RE ARLD ERCE ERR TRF STRB BUSY1 BUSY0 FF69H 00H R/WNote 1
R/W
BUSY1 BUSY0 Busy input control
0 × Not using busy input
1 0 Busy input enabled (active high)
1 1 Busy input enabled (active low)
R/W
STRB Strobe output control
0 Strobe output disabled
1 Strobe output enabled
R
TRF Status of automatic transmit/receive functionNote 2
0 Detection of termination of automatic transmission/
reception. (This bit is set to 0 upon suspension of
automatic transmission/reception or when ARLD = 0.)
1 During automatic transmission/reception
(This bit is set to 1 when data is written to SIO1.)
R
ERR Error detection of automatic transmit/receive function
No error
0
(This bit is set to 0 when data is written to SIO1.)
1 Error occurred
R/W
ERCE Error check control of automatic transmit/receive function
R/W
ARLD Operating mode selection of automatic transmit/receive function
0 One-shot mode
1 Repetitive one-shot mode
R/W
RE Receive control of automatic transmit/receive function
0 Receive disabled
1 Receive enabled
Cautions 1. When an external clock input is selected by clearing bit 1 (CSIM11) of serial operating mode
register 1 (CSIM1) to 0, clear STRB and BUSY1 of ADTC to 0, 0.
2. When using the P23/STB/TxD1 and P24/BUSY/RxD1 pins in the asynchronous serial interface
(UART) mode of serial interface channel 2, the busy control option and busy & strobe control
option are invalid.
Figure 18-5. Format of Automatic Data Transmit/Receive Interval Specification Register (1/4)
ADTI ADTI7 0 0 ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 FF6BH 00H R/W
ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 Data transfer interval specification (fXX = 5.0 MHz operation)
MinimumNote 2 MaximumNote 2
Figure 18-5. Format of Automatic Data Transmit/Receive Interval Specification Register (2/4)
ADTI ADTI7 0 0 ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 FF6BH 00H R/W
ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 Data transfer interval specification (fXX = 5.0 MHz operation)
MinimumNote MaximumNote
Note The data transfer interval includes an error. The data transfer minimum and maximum intervals
are found from the following expressions (n: Value set in ADTI0 to ADTI4). However, if a minimum
which is calculated by the following expression is smaller than 2/fSCK, the minimum interval time
is 2/fSCK.
Minimum = (n + 1) × 26 + 28 + 0.5
fXX fXX fSCK
Maximum = (n + 1) × 26 + 36 + 1.5
fXX fXX fSCK
Cautions 1. Do not write to ADTI during operation of the automatic data transmit/receive function.
2. Be sure to clear bits 5 and 6 to 0.
3. When controlling the data transfer interval by means of automatic transmission/
reception using ADTI, busy control (see 18.4.3 (4) (a) Busy control option) is invalid.
Figure 18-5. Format of Automatic Data Transmit/Receive Interval Specification Register (3/4)
Symbol 7 6 5 4 3 2 1 0 Address After reset R/W
ADTI ADTI7 0 0 ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 FF6BH 00H R/W
ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 Data transfer interval specification (fXX = 2.5 MHz operation)
MinimumNote 2 MaximumNote 2
Minimum = (n + 1) × 26 + 28 + 0.5
fXX fXX fSCK
Maximum = (n + 1) × 26 + 36 + 1.5
fXX fXX fSCK
Cautions 1. Do not write to ADTI during operation of the automatic data transmit/receive function.
2. Be sure to clear bits 5 and 6 to 0.
3. When controlling the data transfer interval by means of automatic transmission/
reception using ADTI, busy control (see 18.4.3 (4) (a) Busy control option) is invalid.
Figure 18-5. Format of Automatic Data Transmit/Receive Interval Specification Register (4/4)
ADTI ADTI7 0 0 ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 FF6BH 00H R/W
ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 Data transfer interval specification (fXX = 2.5 MHz operation)
MinimumNote MaximumNote
Note The data transfer interval includes an error. The data transfer minimum and maximum intervals
are found from the following expressions (n: Value set in ADTI0 to ADTI4). However, if a minimum
which is calculated by the following expression is smaller than 2/fSCK, the minimum interval time
is 2/fSCK.
Minimum = (n + 1) × 26 + 28 + 0.5
fXX fXX fSCK
Maximum = (n + 1) × 26 + 36 + 1.5
fXX fXX fSCK
Cautions 1. Do not write to ADTI during operation of the automatic data transmit/receive function.
2. Be sure to clear bits 5 and 6 to 0.
3. When controlling the data transfer interval by means of automatic transmission/
reception using ADTI, busy control (see 18.4.3 (4) (a) Busy control option) is invalid.
The following three operating modes are available for serial interface channel 1.
CSIE1 CSIM11 PM20 P20 PM21 P21 PM22 P22 Shift register Serial clock counter SI1/P20 pin SO1/P21 pin SCK1/P22
1 operation operation control function function pin function
Note 1 Note 1 Note 1 Note 1 Note 1 Note 1
Operation Clear P20 P21 P22
0 × × × × × × ×
stop (CMOS I/O) (CMOS I/O) (CMOS I/O)
Note 2 Note 2
Operation Count SI1Note 2 SO1 (CMOS SCK1
1 0 1 × 0 0 1 ×
enable operation (input) output) (input)
1 0 1 SCK1
(CMOS
output)
Note If the external clock input has been selected by setting CSIM11 to 0, set bit 1 (BUSY1) and bit 2 (STRB)
of the automatic data transmit/receive control register (ADTC) to 0, 0.
CSIE1 CSIM11 PM20 P20 PM21 P21 PM22 P22 Shift register 1 Serial clock counter SI1/P20 pin SO1/P21 pin SCK1/P22
operation operation control function function pin function
Note 1 Note 1 Note 1 Note 1 Note 1 Note 1
Operation Clear P20 P21 P22
0 × × × × × × ×
stop (CMOS I/O) (CMOS I/O) (CMOS I/O)
Note 2 Note 2
Operation Count SI1Note 2 SO1 (CMOS SCK1
1 0 1 × 0 0 1 × (input) output)
enable operation (input)
1 0 1 SCK1
(CMOS
output)
SCK1 1 2 3 4 5 6 7 8
CSIIF1
End of transfer
Transfer start at the falling edge of SCK1
SIO1 write
7
6
Internal bus
1
0
LSB-first
MSB-first Read/write gate Read/write gate
SO1 latch
SI1 Shift register 1 (SIO1) D Q
SO1
SCK1
Start bit switching is realized by switching the bit order for data write to SIO1. The SIO1 shift order remains
unchanged.
Thus, switching between MSB-first and LSB-first must be performed before writing data to the shift register.
Caution If CSIE1 is set to 1 after data write to SIO1, transfer does not start.
Upon termination of 8-bit transfer, serial transfer automatically stops and the interrupt request flag (CSIIF1)
is set.
18.4.3 3-wire serial I/O mode operation with automatic transmit/receive function
This 3-wire serial I/O mode is used for transmission/reception of a maximum of 32 bytes of data without the use
of software. Once transfer is started, the set number of bytes of the data prestored in the RAM can be transmitted,
and the set number of bytes of data can be received and stored in the RAM.
Handshake signals (STB and BUSY) are supported by hardware to transmit/receive data continuously. An OSD
(On Screen Display) LSI and peripheral LSI including an LCD controller/driver can thus be connected without difficulty.
CSIE1 CSIM11 PM20 P20 PM21 P21 PM22 P22 Shift register 1 Serial clock counter SI1/P20 pin SO1/P21 pin SCK1/P22
operation operation control function function pin function
Note 2 Note 2 Note 2 Note 2 Note 2 Note 2
Operation Clear P20 P21 P22
0 × × × × × × ×
stop (CMOS I/O) (CMOS I/O) (CMOS I/O)
Note 3 Note 3
Operation Count SI1Note 3 SO1 (CMOS SCK1
1 0 1 × 0 0 1 ×
enable operation (input) output) (input)
1 0 1 SCK1
(CMOS
output)
Notes 1. If the external clock input has been selected by clearing CSIM11 to 0, clear bit 1 (BUSY 1)
and bit 2 (STRB) of the automatic data transmit/receive control register (ADTC) to 0, 0.
2. Can be used freely as a port function.
3. Can be used as P20 (CMOS input/output) when only transmission is performed (clear bit 7
(RE) of ADTC to 0).
ADTC RE ARLD ERCE ERR TRF STRB BUSY1 BUSY0 FF69H 00H R/WNote 1
R/W
BUSY1 BUSY0 Busy input control
0 × Not using busy input
1 0 Busy input enabled (active high)
1 1 Busy input enabled (active low)
R/W
STRB Strobe output control
0 Strobe output disabled
1 Strobe output enabled
R
TRF Status of automatic transmit/receive functionNote 2
0 Detection of termination of automatic transmission/reception
(This bit is set to 0 upon suspension of automatic
transmission/reception or when ARLD = 0.)
1 During automatic transmission/reception
(This bit is set to 1 when data is written to SIO1.)
R
ERR Error detection of automatic transmit/receive function
0 No error
(This bit is set to 0 when data is written to SIO1.)
1 Error occurred
R/W
ERCE Error check control of automatic transmit/receive function
R/W
ARLD Operating mode selection of automatic transmit/receive
function
0 One-shot mode
1 Repetitive one-shot mode
R/W
RE Receive control of automatic transmit/receive function
0 Receive disabled
1 Receive enabled
Caution When an external clock input is selected by clearing bit 1 (CSIM11) of serial operating
mode register 1 (CSIM1) to 0, clear STRB and BUSY1 of ADTC to 0, 0 (handshake control
cannot be executed when an external clock is input).
ADTI ADTI7 0 0 ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 FF6BH 00H R/W
ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 Data transfer interval specification (fXX = 5.0 MHz operation)
MinimumNote 2 MaximumNote 2
ADTI ADTI7 0 0 ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 FF6BH 00H R/W
ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 Data transfer interval specification (fXX = 5.0 MHz operation)
MinimumNote MaximumNote
Note The data transfer interval includes an error. The data transfer minimum and maximum intervals
are found from the following expressions (n: Value set in ADTI0 to ADTI4). However, if a minimum
which is calculated by the following expression is smaller than 2/fSCK, the minimum interval time
is 2/fSCK.
Minimum = (n + 1) × 26 + 28 + 0.5
fXX fXX fSCK
Maximum = (n + 1) × 26 + 36 + 1.5
fXX fXX fSCK
Cautions 1. Do not write to ADTI during operation of the automatic data transmit/receive function.
2. Be sure to clear bits 5 and 6 to 0.
3. When controlling the data transfer interval by means of automatic transmission/
reception using ADTI, busy control (see 18.4.3 (4) (a) Busy control option) is invalid.
ADTI ADTI7 0 0 ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 FF6BH 00H R/W
ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 Data transfer interval specification (fXX = 2.5 MHz operation)
MinimumNote 2 MaximumNote 2
Minimum = (n + 1) × 26 + 28 + 0.5
fXX fXX fSCK
6
Maximum = (n + 1) × 2 + 36 + 1.5
fXX fXX fSCK
Cautions 1. Do not write to ADTI during operation of the automatic data transmit/receive function.
2. Be sure to clear bits 5 and 6 to 0.
3. When controlling the data transfer interval by means of automatic transmission/
reception using ADTI, busy control (see 18.4.3 (4) (a) Busy control option) is invalid.
ADTI ADTI7 0 0 ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 FF6BH 00H R/W
ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 Data transfer interval specification (fXX = 2.5 MHz operation)
MinimumNote MaximumNote
Note The data transfer interval includes an error. The data transfer minimum and maximum intervals
are found from the following expressions (n: Value set in ADTI0 to ADTI4). However, if a minimum
which is calculated by the following expression is smaller than 2/fSCK, the minimum interval time
is 2/fSCK.
Minimum = (n + 1) × 26 + 28 + 0.5
fXX fXX fSCK
Maximum = (n + 1) × 26 + 36 + 1.5
fXX fXX fSCK
Cautions 1. Do not write to ADTI during operation of the automatic data transmit/receive function.
2. Be sure to clear bits 5 and 6 to 0.
3. When controlling the data transfer interval by means of automatic transmission/
reception using ADTI, busy control (see 18.4.3 (4) (a) Busy control option) is invalid.
<1> Write transmit data from the least significant address FAC0H of buffer RAM (up to FADFH at
maximum). The transmit data should be in order from higher address to lower address.
<2> Set the value obtained by subtracting 1 from the number of transmit data bytes to the automatic
data transmit/receive address pointer (ADTP).
<1> Set CSIE1 and ATE of serial operating mode register 1 (CSIM1) to 1.
<2> Set RE of the automatic data transmit/receive control register (ADTC) to 1.
<3> Set a data transmit/receive interval in the automatic data transmit/receive interval specification
register (ADTI).
<4> Write any value to serial I/O shift register 1 (SIO1) (transfer start trigger).
Caution Writing any value to SIO1 orders the start of the automatic transmit/receive operation;
the written value has no meaning.
The following operations are automatically carried out when (a) and (b) are carried out.
• After the buffer RAM data specified by ADTP is transferred to SIO1, transmission is carried out (start
of automatic transmission/reception).
• The received data is written to the buffer RAM address specified by ADTP.
• ADTP is decremented and the next data transmission/reception is carried out. Data transmission/
reception continues until the ADTP decremental output becomes 00H and the data at address FAC0H
is output (end of automatic transmission/reception).
• When automatic transmission/reception is terminated, TRF is cleared to 0.
Interval
SCK1
SO1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
SI1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
CSIIF1
TRF
Start
Transmission/reception
Decrement pointer value
operation
Hardware execution
Write receive data from
SIO1 to internal buffer RAM
No
Pointer value = 0
Yes
No
TRF = 0
Software execution
Yes
End
In 6-byte transmission/reception (ARLD = 0, RE = 1) in basic transmit/receive mode, the internal buffer RAM
operates as follows.
FADFH
FADFH
FADFH
Interval
SCK1
SO1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
CSIIF1
TRF
Cautions 1. Because, in the basic transmission mode, the automatic transmit/receive function
reads data from the internal buffer RAM after 1-byte transmission, an interval is
inserted until the next transmission. As buffer RAM read is performed at the same
time as CPU processing, the maximum interval is dependent upon the CPU process-
ing and the value of the automatic data transmit/receive interval specification
register (ADTI) (see (5) Automatic data transmit/receive interval).
2. When TRF is cleared, the SO1 pin becomes low level.
Start
Transmit operation
Hardware execution
No
Pointer value = 0
Yes
No
TRF = 0
Software execution
Yes
End
In 6-byte transmission (ARLD = 0, RE = 0) in basic transmit mode, the internal buffer RAM operates as follows.
FADFH
FADFH
Interval Interval
SCK1
SO1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5
Caution Because, in the repeat transmission mode, a read is performed on the buffer RAM after
the transmission of one byte, an interval is inserted in the period up to the next
transmission. As buffer RAM read is performed at the same time as CPU processing,
the maximum interval is dependent upon the CPU operation and the value of the
automatic data transmit/receive interval specification register (ADTI) (see (5) Automatic
data transmit/receive interval).
Start
Transmit operation
Hardware execution
No
Pointer value = 0
Yes
Reset ADTP
In 6-byte transmission (ARLD = 1, RE = 0) in repeat transmit mode, the internal buffer RAM operates as follows.
FADFH
FADFH
FADFH
SO1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
SI1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
Figure 18-18 shows the system configuration of the master device and a slave device when the busy
control option is used.
Master device
( µPD780058, 780058Y Subseries) Slave device
SCK1 SCK1
SO1 SI1
SI1 SO1
BUSY
The master device inputs the busy signal output by the slave device to the BUSY/P24 pin. The master
device samples the input busy signal in synchronization with the falling edge of the serial clock. Even
if the busy signal becomes active while 8-bit data is being transmitted or received, transmission/reception
by the master is not kept waiting. If the busy signal is active at the rising edge of the serial clock 2 clocks
after completion of transmission/reception of the 8-bit data, the busy input becomes valid. After that, the
master transmission/reception is kept waiting while the busy signal is active.
The active level of the busy signal is set by bit 0 (BUSY0) of ADTC.
When using the busy control option, select the internal clock as the serial clock. Control with the busy
signal cannot be implemented with an external clock.
Figure 18-19 shows the operation timing when the busy control option is used.
Caution Busy control cannot be used simultaneously with the interval time control function of
the automatic data transmit/receive interval specification register (ADTI). If used, busy
control is invalid.
Figure 18-19. Operation Timing When Busy Control Option Is Used (When BUSY0 = 0)
SCK1
SO1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
SI1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
BUSY
Wait
CSIIF1
TRF
When the busy signal becomes inactive, waiting is released. If the sampled busy signal is inactive,
transmission/reception of the next 8-bit data is started at the falling edge of the next clock.
Because the busy signal is asynchronous to the serial clock, it takes up to 1 clock until the busy signal
is sampled, even if made inactive by the slave. It takes 0.5 clock until data transfer is started after the
busy signal was sampled.
To accurately release waiting, the slave must keep the busy signal inactive at least for the duration of
1.5 clocks.
Figure 18-20 shows the timing of the busy signal and wait release. This figure shows an example where
the busy signal is active as soon as transmission/reception has been started.
SCK1
SO1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
SI1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
Usually, the busy control and strobe control options are simultaneously used as handshake signals. In
this case, the strobe signal is output from the STB/P23 pin, the BUSY/P24 pin is sampled, and
transmission/reception can be kept waiting while the busy signal is input.
When the strobe control option is not used, the P23/STB pin can be used as a normal I/O port pin.
Figure 18-21 shows the operation timing when the busy & strobe control options are used.
When the strobe control option is used, the interrupt request flag (CSIIF1) that is set on completion of
transmission/reception is set after the strobe signal is output.
Figure 18-21. Operation Timing When Busy & Strobe Control Options Are Used (When BUSY0 = 0)
SCK1
SO1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
SI1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
STB
BUSY
CSIIF1
TRF
Figure 18-22. Operation Timing of Bit Shift Detection Function by Busy Signal (When BUSY0 = 1)
SCK1
(master)
Bit shift due to noise
SCK1
(slave)
SO1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D7 D6 D5 D4 D3 D2 D1 D0
SI1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D7 D6 D5 D4 D3 D2 D1 D0
BUSY
CSIIF1
CSIE1
ERR
Interval
SCK1
SO1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
SI1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
CSIIF1
(a) When the automatic transmit/receive function is used with the internal clock
If bit 1 (CSIM11) of serial operating mode register 1 (CSIM1) is set to 1, the internal clock operates.
If the automatic transmit/receive function is operated with the internal clock, the interval timing according
to CPU processing is as follows.
When bit 7 (ADTI7) of the automatic data transmit/receive interval specification register (ADTI) is cleared
to 0, the interval depends on the CPU processing. When ADTI7 is set to 1, it depends on the contents
of ADTI or the CPU processing, whichever is greater.
See Figure 18-5 Automatic Data Transmit/Receive Interval Specification Register Format for the
intervals set by ADTI.
Table 18-2. Interval Timing According to CPU Processing (When Internal Clock Is Operating)
TSCK: 1/fSCK
fSCK: Serial clock frequency
TCPU: 1/fCPU
fCPU: CPU clock (set by bits 0 to 2 (PCC0 to PCC2) of the processor clock control register
(PCC) and bit 0 (MCS) of the oscillation mode select register (OSMS))
MAX. (a, b): a or b, whichever is greater
Figure 18-24. Operation Timing with Automatic Data Transmit/Receive Function Performed Using
Internal Clock
fX
TCPU
f CPU
TSCK Interval
SCK1
SO1 D7 D6 D5 D4 D3 D2 D1 D0
SI1 D7 D6 D5 D4 D3 D2 D1 D0
Table 18-3. Interval Time According to CPU Processing (with External Clock)
TCPU: 1/fCPU
fCPU: CPU clock (set by the bits 0 to 2 (PCC0 to PCC2) of the processor clock control register (PCC)
and bit 0 (MCS) of the oscillation mode select register (OSMS))
(2) Asynchronous serial interface (UART) mode (with time-division transfer function)
In this mode, one byte of data is transmitted/received following the start bit, and full-duplex operation is
possible.
A dedicated UART baud rate generator is incorporated, allowing communication over a wide range of baud
rates. In addition, the baud rate can be defined by dividing the clock input to the ASCK pin.
The MIDI standard baud rate (31.25 kbps) can be used by employing the dedicated UART baud rate generator.
Two sets of data I/O pins (RxD and TxD) are provided, and the pin to be used can be selected by software
(time-division transfer function). However, only one set of pins can be used at one time.
Cautions 1. If it is not necessary to change the data I/O pin, use of the RxD0/SI2/P70 and TxD0/SO2/
P71 pins is recommended. If only port 2 (RxD1/BUSY/P24 and TxD1/STB/P23) is used
as data I/O pins, the function of port 7 is limited.
2. When using the busy control option or busy & strobe control option in the 3-wire serial
I/O mode with automatic transmit/receive function of serial interface channel 1, the RxD1/
BUSY/P24 and TxD1/STB/P23 pins cannot be used as data I/O pins.
Item Configuration
Registers Transmit shift register (TXS)
Receive shift register (RXS)
Receive buffer register (RXB)
Control registers Serial operating mode register 2 (CSIM2)
Asynchronous serial interface mode register (ASIM)
Asynchronous serial interface status register (ASIS)
Baud rate generator control register (BRGC)
Serial interface pin select register (SIPS)
Internal bus
Asynchronous Asynchronous
Serial interface pin serial interface serial interface
select register status register mode register
Receive buffer Direction
SIPS21 SIPS20 register PE FE OVE TXE RXE PS1 PS0 CL SL ISRM SCK
controller
(RXB/SIO2)
Transmit shift
Direction register
controller
(TXS/SIO2)
Selector
RxD0/SI2/P70
Receive shift
register (RXS)
RxD1/BUSY/P24
Selector
TxD0/SO2/P71
PM71
TxD1/STB/P23 INTSER SCK Output
Reception Transmission controller
PM23
controller INTSR/INTCSI2 controller
PM72 ISRM INTST
ASCK/
SCK2/P72
Note
Baud rate generator
f XX to f XX /210
CSIE2
SCK
TXE 4 4 CSCK
RXE
CSIE2
CSIM CSCK
MDL3 MDL2 MDL1 MDL0 TPS3 TPS2 TPS1 TPS0
22
Serial operating Baud rate generator
mode register 2 control register
Internal bus
Note See Figure 19-2 for the baud rate generator configuration.
CSIE2
TXE
Start bit
sampling clock
5-bit
counter
Selector
Selector
ASCK/SCK2/P72
Transmit
Selector
clock
1/2 Match Selector f XX to f XX /210
4 TPS0 to TPS3
MDL0 to MDL3 SCK
CSCK
Decoder
4
Selector
Receive
clock Match
1/2
5-bit
counter
RXE
Start bit detection TPS3 TPS2 TPS1 TPS0 MDL3 MDL2 MDL1 MDL0
Internal bus
Caution TXS must not be written during a transmit operation. TXS and the receive buffer register
(RXB) are allocated to the same address, and when a read is performed, the value of RXB
is read.
Caution RXB and the transmit shift register (TXS) are allocated to the same address, and when a write
is performed, the value is written to TXS.
ASIM TXE RXE PS1 PS0 CL SL ISRM SCK FF70H 00H R/W
1 0 Odd parity
1 1 Even parity
Note When SCK is set to 1 and the baud rate generator output is selected, the ASCK pin can be used as
an I/O port.
Cautions 1. When the 3-wire serial I/O mode is selected, ASIM should be cleared to 00H.
2. The serial transmit/receive operation must be stopped before changing the operating
mode.
User's Manual U12013EJ3V2UD 433
CHAPTER 19 SERIAL INTERFACE CHANNEL 2
ASIM CSIM2 SIPS PM70 P70 PM71 P71 PM23 P23 PM24 P24 PM72 P72 Start Shift P70/SI2/ P71/SO2/ P23/STB/ P24/BUSY/ P72/SCK2
bit clock RxD0 pin TxD0 pin TxD1 pin RxD1 pin /ASCK pin
TXE RXE SCK CSIE2 CSIM22 CSCK SIPS21 SIPS20 function function function function function
0 0 × 0 × × × × ×Note 1 ×Note 1 ×Note 1 ×Note 1 ×Note 1 ×Note 1 ×Note 1 ×Note 1 ×Note 1 ×Note 1 — — P70 P71 P23/STB P24/BUSY P72
ASIM CSIM2 SIPS PM70 P70 PM71 P71 PM23 P23 PM24 P24 PM72 P72 Start Shift P70/SI2/ P71/SO2/ P23/STB/ P24/BUSY/ P72/SCK2
bit clock RxD0 pin TxD0 pin TxD1 pin RxD1 pin /ASCK pin
TXE RXE SCK CSIE2 CSIM22 CSCK SIPS21 SIPS20 function function function function function
Note 1 Note 1 Note 1 Note 1 Note 2
0 0 0 1 0 0 × × ×
Note 2 Note 2
× 0 1 × × × × 1 × MSB External SI2 SO2 P23/STB P24/BUSY SCK2 input
clock (CMOS
output)
1 0 1 Internal SCK2 output
clock
ASIM CSIM2 SIPS PM70 P70 PM71 P71 PM23 P23 PM24 P24 PM72 P72 Start Shift P70/SI2/ P71/SO2/ P23/STB/ P24/BUSY/ P72/SCK2
bit clock RxD0 pin TxD0 pin TxD1 pin RxD1 pin /ASCK pin
TXE RXE SCK CSIE2 CSIM22 CSCK SIPS21 SIPS20 function function function function function
Note 1 Note 1 Note 1 Note 1
1 0 0 0 0 0 0 0 ×
Note 1 Note 1
× 0 1 × × × × 1 × LSB External P70 TxD0 P23/STB P24/BUSY ASCK input
clock (CMOS
output)
1 ×
Note 1
×
Note 1 Internal P72
clock
0 1 0 0 0 0 0 0 1 × ×
Note 1
×
Note 1
×
Note 1
×
Note 1
×
Note 1
×
Note 1
1 × External RxD0 P71 ASCK input
clock
1 ×
Note 1
×
Note 1 Internal P72
clock
1 ×
Note 1
×
Note 1 Internal P72
clock
0 1 0 0 0 0 0 1 1 × ×
Note 1
×
Note 1
×
Note 1
×
Note 1
1 × 1 × External P70 P71 P23/STB RxD1 ASCK input
clock (Input)
Notes 1. The receive buffer register (RXB) must be read when an overrun error occurs. Overrun errors will
continue to occur until RXB is read.
2. Even if the stop bit length has been set as 2 bits by bit 2 (SL) of the asynchronous serial interface
mode register (ASIM), only single stop bit detection is performed during reception.
BRGC TPS3 TPS2 TPS1 TPS0 MDL3 MDL2 MDL1 MDL0 FF73H 00H R/W
MDL3 MDL2 MDL1 MDL0 Baud rate generator input clock selection k
0 0 0 0 fSCK/16 0
0 0 0 1 fSCK/17 1
0 0 1 0 fSCK/18 2
0 0 1 1 fSCK/19 3
0 1 0 0 fSCK/20 4
0 1 0 1 fSCK/21 5
0 1 1 0 fSCK/22 6
0 1 1 1 fSCK/23 7
1 0 0 0 fSCK/24 8
1 0 0 1 fSCK/25 9
1 0 1 0 fSCK/26 10
1 0 1 1 fSCK/27 11
1 1 0 0 fSCK/28 12
1 1 0 1 fSCK/29 13
1 1 1 0 fSCK/30 14
1 1 1 1 fSCKNote —
Caution When BRGC is written during a communication operation, baud rate generator output is
disrupted and communication cannot be performed normally. Therefore, BRGC must not
be written during a communication operation.
The baud rate transmit/receive clock generated is either a signal divided from the main system clock, or a signal
divided from the clock input from the ASCK pin.
(a) Generation of baud rate transmit/receive clock from main system clock
The transmit/receive clock is generated by dividing the main system clock. The baud rate generated from
the main system clock is obtained from the following expression.
fXX
[Baud rate] = [Hz]
2n × (k + 16)
Table 19-3. Relationship Between Main System Clock and Baud Rate
(b) Generation of baud rate transmit/receive clock from external clock input from ASCK pin
The transmit/receive clock is generated by dividing the clock input from the ASCK pin. The baud rate
generated from the clock input from the ASCK pin is obtained from the following expression.
fASCK
[Baud rate] = [Hz]
2 × (k + 16)
Table 19-4. Relationship Between ASCK Pin Input Frequency and Baud Rate (When BRGC Is Set to 00H)
The following three operating modes are available for serial interface channel 2.
ASIM TXE RXE PS1 PS0 CL SL ISRM SCK FF70H 00H R/W
19.4.2 Asynchronous serial interface (UART) mode (with time-division transfer function)
In this mode, one byte of data is transmitted/received following the start bit, and full-duplex operation is possible.
A dedicated UART baud rate generator is incorporated, allowing communication over a wide range of baud rates.
In addition, the baud rate can be defined by dividing the clock input to the ASCK pin.
The MIDI standard baud rate (31.25 kbps) can be used by employing the dedicated UART baud rate generator.
Two sets of data I/O pins (RxD and TxD) are provided, and the pin to be used can be selected by software (time-
division transfer function). However, only one set of pins can be used at one time.
Cautions 1. If it is not necessary to change the data I/O pin, use of the RxD0/SI2/P70 and TxD0/SO2/P71
pins is recommended. If only port 2 (RxD1/BUSY/P24 and TxD1/STB/P23) is used as data I/O
pins, the function of port 7 is limited.
2. When using the busy control option or busy & strobe control option in the 3-wire serial I/O
mode with automatic transmit/receive function of serial interface channel 1, the RxD1/BUSY/
P24 and TxD1/STB/P23 pins cannot be used as data I/O pins.
ASIM TXE RXE PS1 PS0 CL SL ISRM SCK FF70H 00H R/W
Note When SCK is set to 1 and the baud rate generator output is selected, the ASCK pin can be used
as an I/O port.
Caution The serial transmit/receive operation must be stopped before changing the operating
mode.
Notes 1. The receive buffer register (RXB) must be read when an overrun error occurs. Overrun errors
will continue to occur until RXB is read.
2. Even if the stop bit length has been set as 2 bits by bit 2 (SL) of the asynchronous serial
interface mode register (ASIM), only single stop bit detection is performed during reception.
BRGC TPS3 TPS2 TPS1 TPS0 MDL3 MDL2 MDL1 MDL0 FF73H 00H R/W
MDL3 MDL2 MDL1 MDL0 Baud rate generator input clock selection k
0 0 0 0 fSCK/16 0
0 0 0 1 fSCK/17 1
0 0 1 0 fSCK/18 2
0 0 1 1 fSCK/19 3
0 1 0 0 fSCK/20 4
0 1 0 1 fSCK/21 5
0 1 1 0 fSCK/22 6
0 1 1 1 fSCK/23 7
1 0 0 0 fSCK/24 8
1 0 0 1 fSCK/25 9
1 0 1 0 fSCK/26 10
1 0 1 1 fSCK/27 11
1 1 0 0 fSCK/28 12
1 1 0 1 fSCK/29 13
1 1 1 0 fSCK/30 14
(Cont’d)
Caution When BRGC is written during a communication operation, baud rate generator output
is disrupted and communication cannot be performed normally. Therefore, BRGC must
not be written to during a communication operation.
The baud rate transmit/receive clock generated is either a signal divided from the main system clock, or
a signal divided from the clock input from the ASCK pin.
(i) Generation of baud rate transmit/receive clock from main system clock
The transmit/receive clock is generated by dividing the main system clock. The baud rate generated
from the main system clock is obtained from the following expression.
fXX
[Baud rate] = [Hz]
2n × (k + 16)
Table 19-5. Relationship Between Main System Clock and Baud Rate
(ii) Generation of baud rate transmit/receive clock from external clock input from ASCK pin
The transmit/receive clock is generated by dividing the clock input from the ASCK pin. The baud rate
generated from the clock input from the ASCK pin is obtained from the following expression.
fASCK
[Baud rate] = [Hz]
2 × (k + 16)
Table 19-6. Relationship Between ASCK Pin Input Frequency and Baud Rate (When BRGC Is Set to 00H)
Start Parity
D0 D1 D2 D3 D4 D5 D6 D7 Stop bit
bit bit
Character bit
The specification of character bit length, parity selection, and specification of stop bit length for each data
frame is carried out by the asynchronous serial interface mode register (ASIM).
When 7 bits are selected as the number of character bits, only the lower 7 bits (bits 0 to 6) are valid; in
transmission the most significant bit (bit 7) is ignored, and in reception the most significant bit (bit 7) is
always “0”.
The serial transfer rate is selected by means of ASIM and the baud rate generator control register (BRGC).
If a serial data receive error occurs, the receive error contents can be determined by reading the status
of the asynchronous serial interface status register (ASIS).
• Reception
The number of bits with a value of “1”, including the parity bit, in the receive data is counted. If
it is odd, a parity error occurs.
• Reception
The number of bits with a value of “1”, including the parity bit, in the receive data is counted. If
it is even, a parity error occurs.
(iii) 0 Parity
When transmitting, the parity bit is set to “0” irrespective of the transmit data.
At reception, a parity bit check is not performed. Therefore, a parity error does not occur, irrespective
of whether the parity bit is set to “0” or “1”.
(iv) No parity
A parity bit is not added to the transmit data. At reception, data is received assuming that there is
no parity bit. Since there is no parity bit, a parity error does not occur.
(c) Transmission
A transmit operation is started by writing transmit data to the transmit shift register (TXS). The start bit,
parity bit and stop bit(s) are added automatically.
When the transmit operation starts, the data in the transmit shift register (TXS) is shifted out, and when
the transmit shift register (TXS) is empty, a transmission completion interrupt request (INTST) is
generated.
Figure 19-9. Asynchronous Serial Interface Transmission Completion Interrupt Request Generation Timing
STOP
TxD0 (TxD1) (output) D0 D1 D2 D6 D7 Parity
START
INTST
START
INTST
Caution Rewriting the asynchronous serial interface mode register (ASIM) should not be per-
formed during a transmit operation. If rewriting the ASIM is performed during transmis-
sion, subsequent transmit operations may not be possible (the normal state is restored
by RESET input).
It is possible to determine whether transmission is in progress by software by using a
transmission completion interrupt request (INTST) or the interrupt request flag (STIF)
set by INTST.
(d) Reception
When the RXE bit of the asynchronous serial interface mode register (ASIM) is set to 1, a receive operation
is enabled and sampling of the RxD0 (RxD1) pin input is started.
RxD0 (RxD1) pin input sampling is performed using the serial clock specified by ASIM.
When the RxD0 (RxD1) pin input becomes low, the 5-bit counter of the baud rate generator (see Figure
19-2) starts counting, and at the time when the half time determined by specified baud rate has passed,
the data sampling start timing signal is output. If the RxD0 (RxD1) pin input sampled again as a result
of this start timing signal is low, it is identified as a start bit, the 5-bit counter is initialized and starts counting,
and data sampling is performed. When character data, a parity bit, and one stop bit are detected after
the start bit, reception of one frame of data ends.
When one frame of data has been received, the receive data in the shift register is transferred to the receive
buffer register (RXB), and a reception completion interrupt request (INTSR) is generated.
If an error occurs, the receive data in which the error occurred is still transferred to RXB. If bit 1 (ISRM)
of ASIM is cleared to 0 on occurrence of the error, INTSR is generated.
If the RXE bit is reset to 0 during the receive operation, the receive operation is stopped immediately.
In this case, the contents of RXB and the asynchronous serial interface status register (ASIS) are not
changed, and INTSR and INTSER are not generated.
Figure 19-10. Asynchronous Serial Interface Reception Completion Interrupt Request Generation Timing
STOP
RxD0 (RxD1) (input) D0 D1 D2 D6 D7 Parity
START
INTSR
Caution The receive buffer register (RXB) must be read even if a receive error occurs. If RXB
is not read, an overrun error will occur when the next data is received, and the receive
error state will continue indefinitely.
START
INTSRNote
Note INTSR is not generated if a receive error occurs while bit 1 (ISRM) of the asynchronous serial
interface mode register (ASIM) is set to 1.
Cautions 1. The contents of the asynchronous serial interface status register (ASIS) are reset to
0 by reading the receive buffer register (RXB) or receiving the next data. To ascertain
the error contents, ASIS must be read before reading RXB.
2. The receive buffer register (RXB) must be read even if a receive error occurs. If RXB
is not read, an overrun error will occur when the next data is received, and the receive
error state will continue indefinitely.
(a) When the transmission under execution has been stopped by clearing bit 7 (TXE) of the asynchronous
serial interface mode register (ASIM) to 0, be sure to set the transmit shift register (TXS) to FFH, then
set TXE to 1 before executing the next transmission.
(b) When the reception under execution has been stopped by clearing bit 6 (RXE) of the asynchronous serial
interface mode register (ASIM) to 0, the status of the receive buffer register (RXB) and whether the receive
completion interrupt request (INTSR) is generated differ depending on the timing at which reception is
stopped. Figure 19-12 shows the timing.
RXB
INTSR
<1> <3>
<2>
When RXE is cleared to 0 at the time indicated by <1>, RXB holds the previous data and does not generate
INTSR.
When RXE is cleared to 0 at the time indicated by <2>, RXB renews the data and does not generate INTSR.
When RXE is cleared to 0 at the time indicated by <3>, RXB renews the data and generates INTSR.
ASIM TXE RXE PS1 PS0 CL SL ISRM SCK FF70H 00H R/W
BRGC TPS3 TPS2 TPS1 TPS0 MDL3 MDL2 MDL1 MDL0 FF73H 00H R/W
MDL3 MDL2 MDL1 MDL0 Baud rate generator input clock selection k
0 0 0 0 fSCK/16 0
0 0 0 1 fSCK/17 1
0 0 1 0 fSCK/18 2
0 0 1 1 fSCK/19 3
0 1 0 0 fSCK/20 4
0 1 0 1 fSCK/21 5
0 1 1 0 fSCK/22 6
0 1 1 1 fSCK/23 7
1 0 0 0 fSCK/24 8
1 0 0 1 fSCK/25 9
1 0 1 0 fSCK/26 10
1 0 1 1 fSCK/27 11
1 1 0 0 fSCK/28 12
1 1 0 1 fSCK/29 13
1 1 1 0 fSCK/30 14
1 1 1 1 fSCK —
(Cont’d)
Caution When BRGC is written during a communication operation, baud rate generator output
is disrupted and communication cannot be performed normally. Therefore, BRGC must
not be written during a communication operation.
When the internal clock is used as the serial clock in the 3-wire serial I/O mode, set BRGC as described below.
BRGC setting is not required if an external serial clock is used.
SCK2 1 2 3 4 5 6 7 8
SRIF
End of transfer
Transfer start at the falling edge of SCK2
7
6
Internal bus
1
0
LSB-first
MSB-first Read/write gate Read/write gate
SO2 latch
SI2 Transmit shift register (TXS/SIO2) D Q
SO2
SCK2
Start bit switching is realized by switching the bit order for data write to SIO2. The SIO2 shift order remains
unchanged.
Thus, switching between MSB-first and LSB-first must be performed before writing data to the shift register.
Caution If CSIE2 is set to 1 after data write to TXS/SIO2, transfer does not start.
Upon termination of 8-bit transfer, serial transfer automatically stops and the interrupt request flag (SRIF) is
set.
• Description
If bit 1 (ISRM) of the asynchronous serial interface mode register (ASIM) is set to 1, the reception completion
interrupt request (INTSR) is not generated on occurrence of a reception error. If the receive buffer register (RXB)
is read at certain timing (“a” in Figure 19-15) during the reception error interrupt (INTSER) servicing, the internal
error flag is cleared to 0. As a result, it is judged that no reception error has occurred, and INTSR, which should
not be generated, is generated. Figure 19-15 illustrates this operation.
Figure 19-15. Reception Completion Interrupt Request Generation Timing (When ISRM = 1)
fSCK
Cleared on
INTSR reading RXB
Interrupt processing
routine of CPU
Remark ISRM: Bit 1 of the asynchronous serial interface mode register (ASIM)
fSCK: Source clock of 5-bit counter of baud rate generator
RXB: Receive buffer register
• Preventive measures
START
INTSR
T1 T2
T1: Time of one data of baud rate selected by baud rate generator control register (BRGC) (1/baud rate)
T2: Time of 2 clocks of source clock (fSCK) of 5-bit counter selected by BRGC
[Conditions]
fX = 5.0 MHz
Processor clock control register (PCC) = 00H
Oscillation mode select register (OSMS) = 01H
Baud rate generator control register (BRGC) = B0H (2,400 bps selected as baud rate)
TCY = 0.4 µs (tCY = 0.2 µs)
1
T1 = = 416.7 µs
2,400
T2 = 12.8 × 2 = 25.6 µs
T1 + T2
= 2,212 (clocks)
tCY
[Example]
EI
INTSER generated
MOV A, RXB
RETI
Cautions 1. Perform this processing each time a transmit operation is enabled by using the TxD1 pin as
an output pin.
2. Perform this processing each time the output pin is switched from the TxD0 pin to the TxD1
pin because the transmit operation must be stopped once and then enabled again.
SET1 P2.3 ; This line is necessary only for the actual device. Delete it when the IE is used.
CLR1 ASIM.7 ; Stops transmission (TXE = 0).
Cautions 1. Perform this processing each time a transmit operation is enabled by using the TxD1 pin as
an output pin.
2. Perform this processing each time the output pin is switched from the TxD0 pin to the TxD1
pin because the transmit operation must be stopped once and then enabled again.
PM23
PM23
Data set previously in the real-time output buffer register can be transferred to the output latch by hardware
concurrently with the generation of a timer interrupt request or external interrupt request, then output externally. This
is called the real-time output function. The pins that output data externally are called real-time output ports.
By using a real-time output, a signal which has no jitter can be output. This port is therefore suitable for control
of stepper motors, etc.
Port mode/real-time output port mode can be specified in 1-bit units.
Item Configuration
Register Real-time output buffer register (RTBL, RTBH)
Control registers Port mode register 12 (PM12)
Real-time output port mode register (RTPM)
Real-time output port control register (RTPC)
Internal bus
Output latch
P127 P120
Higher Lower
4 bits 4 bits
FF30H RTBL
FF31H RTBH
Notes 1. Only the bits set in the real-time output port mode can be read. When a bit set in the port mode
is read, 0 is read.
2. After setting data in the real-time output port, output data should be set to RTBL and RTBH by the
time a real-time output trigger is generated.
PM12 PM127 PM126 PM125 PM124 PM123 PM122 PM121 PM120 FF2CH FFH R/W
RTPM RTPM7 RTPM6 RTPM5 RTPM4 RTPM3 RTPM2 RTPM1 RTPM0 FF34H 00H R/W
0 Port mode
Cautions 1. When using these bits as a real-time output port, set the ports at which real-time output
is performed to the output mode (clear the corresponding bit of port mode register 12
(PM12) to 0).
2. In ports specified as real-time output ports, data cannot be set to the output latch.
Therefore, when setting an initial value, data should be set to the output latch before
setting the real-time output mode.
0 4 bits × 2 channels
1 8 bits × 1 channel
Table 20-3. Real-Time Output Port Operating Mode and Output Trigger
BYTE EXTR Operating Mode RTBH → Port Output RTBL → Port Output
0 0 4 bits × 2 channels INTTM2 INTTM1
1 INTTM1 INTP2
1 0 8 bits × 1 channel INTTM1
1 INTP2
A total of 21 non-maskable, maskable, and software interrupts are provided as interrupt sources (see Table
21-1).
Notes 1. The default priority is the priority used when two or more maskable interrupt requests are generated
simultaneously. 0 is the highest priority and 17 is the lowest.
2. Basic configuration types (A) to (E) correspond to (A) to (E) of Figure 21-1.
Notes 1. The default priority is the priority used when two or more maskable interrupt requests are generated
simultaneously. 0 is the highest priority and 17 is the lowest.
2. Basic configuration types (A) to (E) correspond to (A) to (E) of Figure 21-1.
Internal bus
Standby
release signal
Internal bus
MK IE PR ISP
Vector table
Interrupt Priority controller address
IF generator
request
Standby
release signal
Internal bus
Vector table
Interrupt Sampling Edge Priority controller address
IF generator
request clock detector
Standby
release signal
Internal bus
External interrupt
mode register MK IE PR ISP
(INTM0, INTM1)
Vector table
Interrupt Edge Priority controller address
IF generator
request detector
Standby
release signal
Internal bus
The following six types of registers are used to control the interrupt functions.
Table 21-2 gives a listing of interrupt request flags, interrupt mask flags, and priority specification flags
corresponding to interrupt request sources.
Interrupt Source Interrupt Request Flag Interrupt Mask Flag Priority Specification Flag
Register Register Register
INTWDT TMIF4 IF0L TMMK4 MK0L TMPR4 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
INTCSI0 CSIIF0 IF0H CSIMK0 MK0H CSIPR0 PR0H
INTCSI1 CSIIF1 CSIMK1 CSIPR1
INTSER SERIF SERMK SERPR
INTSR/INTCSI2 SRIF SRMK SRPR
INTST STIF STMK STPR
INTTM3 TMIF3 TMMK3 TMPR3
INTTM00 TMIF00 TMMK00 TMPR00
INTTM01 TMIF01 TMMK01 TMPR01
INTTM1 TMIF1 IF1L TMMK1 MK1L TMPR1 PR1L
INTTM2 TMIF2 TMMK2 TMPR2
INTAD ADIF ADMK ADPR
Symbol 7 <6> <5> <4> <3> <2> <1> <0> Address After reset R/W
IF0L 0 PIF5 PIF4 PIF3 PIF2 PIF1 PIF0 TMIF4 FFE0H 00H R/W
Note WTIF is the test input flag. A vectored interrupt request is not generated.
Cautions 1. The TMIF4 flag is R/W enabled only when the watchdog timer is used as an interval timer.
If the watchdog timer is used in watchdog timer mode 1, clear the TMIF4 flag to 0.
2. Be sure to clear IF0L bit 7 and IF1L bits 3 to 6 to 0.
3. When an interrupt is acknowledged, the interrupt request flag is automatically cleared,
and then servicing of the interrupt routine is started.
Symbol 7 <6> <5> <4> <3> <2> <1> <0> Address After reset R/W
MK0L 1 PMK5 PMK4 PMK3 PMK2 PMK PMK TMMK4 FFE4H FFH R/W
MK0H TMMK01 TMMK00 TMMK3 STMK SRMK SERMK CSIMK1 CSIMK0 FFE5H FFH R/W
Note WTMK controls standby mode release enable/disable; it does not control the interrupt function.
Cautions 1. If the TMMK4 flag is read when the watchdog timer is used in watchdog timer mode 1,
the MK0 value becomes undefined.
2. Because port 0 also functions as an external interrupt request input, when the output
level is changed by specifying the output mode of the port function, an interrupt request
flag is set. Therefore, the interrupt mask flag should be set to 1 before using the output
mode.
3. Be sure to set MK0L bit 7 and MK1L bits 3 to 6 to 1.
Symbol 7 <6> <5> <4> <3> <2> <1> <0> Address After reset R/W
PR0L 1 PPR5 PPR4 PPR3 PPR2 PPR1 PPR0 TMPR4 FFE8H FFH R/W
Cautions 1. If the watchdog timer is used in watchdog timer mode 1, set the TMPR4 flag to 1.
2. Be sure to set PR0L bit 7 and PR1L bits 3 to 7 to 1.
INTM0 ES31 ES30 ES21 ES20 ES11 ES10 0 0 FFECH 00H R/W
0 0 Falling edge
0 1 Rising edge
1 0 Setting prohibited
0 0 Falling edge
0 1 Rising edge
1 0 Setting prohibited
0 0 Falling edge
0 1 Rising edge
1 0 Setting prohibited
Caution When using the TI00/P00/INTP0 and TI01/P01/INTP1 pins as timer input pins (TI00 and
TI01), stop the operation of 16-bit timer 0 by clearing bits 1 to 3 (TMC01 to TMC03) of
the 16-bit timer mode control register (TMC0) to 0, 0, 0, before setting the valid edge of
TI00 and TI01. The valid edge is set by bits 2 and 3 (ES10 and ES11) of external interrupt
mode register 0 (INTM0). When using the TI00/P00/INTP0 and TI01/P01/INTP1 pins as
external interrupt input pins (INTP0 and INTP1), the valid edge of INTP0 and INTP1 may
be set while 16-bit timer 0 is operating.
INTM1 0 0 ES61 ES60 ES51 ES50 ES41 ES40 FFEDH 00H R/W
0 0 Falling edge
0 1 Rising edge
1 0 Setting prohibited
0 0 Falling edge
0 1 Rising edge
1 0 Setting prohibited
0 0 Falling edge
0 1 Rising edge
1 0 Setting prohibited
Caution fXX/2N is the clock supplied to the CPU and fXX/25, fXX/26, and fXX/27 are clocks supplied to the
peripheral hardware. fXX/2N stops in the HALT mode.
Remarks 1. N: Value (N = 0 to 4) of bits 0 to 2 (PCC0 to PCC2) of processor clock control register (PCC)
2. fXX: Main system clock frequency (fX or fX/2)
3. fX: Main system clock oscillation frequency
4. MCS: Bit 0 of the oscillation mode select register (OSMS)
5. Values in parentheses apply to operation with fX = 5.0 MHz.
When the sampled INTP0 input level is the active level twice in succession, the noise eliminator sets the
interrupt request flag (PIF0) to 1.
Figure 21-8 shows the I/O timing of the noise eliminator.
Figure 21-8. Noise Eliminator I/O Timing (During Rising Edge Detection)
tSMP
Sampling clock
INTP0
PIF0 “L”
tSMP
Sampling clock
<1> <2>
INTP0
PIF0
Because the sampled INTP0 level is high twice in succession in <2>,
the PIF0 flag is set to 1.
(c) When input is more than twice the cycle frequency (tSMP)
tSMP
Sampling clock
INTP0
PIF0
Because the INTP0 level is high twice in succession,
the PIF0 flag is set to 1.
7 6 5 4 3 2 1 0 After reset
0 Disabled
1 Enabled
Start
WDTM4 = 1
(with watchdog timer No
mode selected)?
Interval timer
Yes
No
Overflow in WDT?
Yes
WDTM3 = 0
(with non-maskable No
interrupt selected)?
Reset processing
Yes
Interrupt request generation
No
WDT interrupt servicing?
Interrupt request
held pending
Yes
Interrupt control No
register unaccessed?
Yes
Interrupt
servicing start
TMIF4
Main routine
Main routine
Table 21-3. Times from Maskable Interrupt Request Generation to Interrupt Servicing
Note If an interrupt request is generated just before a divide instruction, the wait time becomes the
maximum.
1
Remark 1 clock: (fCPU: CPU clock)
fCPU
If two or more maskable interrupt requests are generated simultaneously, the request specified as higher priority
with the priority specification flag is acknowledged first. If two or more requests specified as the same priority by the
interrupt priority specification flag are generated simultaneously, the one with the higher default priority is acknowl-
edged first.
Any pending interrupt requests are acknowledged when they become acknowledgeable.
Figure 21-13 shows an interrupt request acknowledgment algorithm.
If a maskable interrupt request is acknowledged, the contents of acknowledged interrupt are saved in the stack,
program status word (PSW) and program counter (PC), in that order, the IE flag is reset to 0, and the acknowledged
interrupt priority specification flag contents are transferred to the ISP flag. Further, the vector table data determined
for each interrupt request is loaded into the PC and branched.
Restoration from the interrupt is possible with the RETI instruction.
Start
No
× × IF = 1?
Yes
Interrupt request
held pending
Yes (high priority)
× × PR = 0?
No (low priority)
Any high-
priority interrupt among Any
Yes
simultaneously generated simultaneously Yes
××PR = 0 interrupt generated ××PR = 0
interrupt
requests? requests?
Interrupt request
held pending Interrupt request
No No held pending
No Any
IE = 1? simultaneously
generated high-priority Yes
interrupt
Interrupt request Yes requests?
held pending Interrupt request
Vectored interrupt No held pending
servicing
No
IE = 1?
6 clocks
× × IF
(× × PR = 1)
8 clocks
× × IF
(× × PR = 0)
7 clocks
1
Remark 1 clock: (fCPU: CPU clock)
fCPU
25 clocks 6 clocks
× × IF
(× × PR = 1)
33 clocks
× × IF
(× × PR = 0)
32 clocks
1
Remark 1 clock: (fCPU: CPU clock)
fCPU
Caution Do not use the RETI instruction for restoring from the software interrupt.
Table 21-4. Interrupt Request Enabled for Multiple Interrupt Servicing During Interrupt Servicing
IE = 0 IE = 0 IE = 0
EI
EI EI
RETI RETI
Two interrupt requests, INTyy and INTzz, are acknowledged while the INTxx interrupt is being serviced. Before
each interrupt request is acknowledged, the EI instruction is always issued and interrupt requests are enabled.
Example 2. Multiple interrupt servicing does not occur because of interrupt priority
EI IE = 0
EI
INTyy
INTxx (PR = 1)
(PR = 0)
RETI
1 instruction
execution IE = 0
RETI
INTyy, which occurs while INTxx is being serviced is not acknowledged for multiple interrupt servicing because
the priority of INTyy is lower than that of INTxx. INTyy is held pending and is acknowledged after one instruction
of the main processing has been executed.
PR = 0: High-priority interrupt
PR = 1: Low-priority interrupt
IE = 0: Interrupt acknowledgment disabled
Example 3. Multiple interrupt servicing does not occur because interrupts are not enabled
EI IE = 0
INTyy
INTxx (PR = 0)
(PR = 0) RETI
1 instruction
IE = 0
execution
RETI
In the servicing of INTxx, other interrupts are not enabled (the EI instruction is not executed). Therefore, INTyy
is not acknowledged for multiple interrupt servicing. This interrupt is held pending and acknowledged after one
instruction of the main processing has been executed.
PR = 0: High-priority interrupt
IE = 0: Interrupt acknowledgment disabled
Caution The BRK instruction is not an interrupt request pending instruction. However, the IE flag is
cleared to 0 by a software interrupt that is started by BRK instruction execution. Thus, even if
a maskable interrupt request is generated during BRK instruction execution, that interrupt
request is not acknowledged. However, a non-maskable interrupt request is acknowledged.
Figure 21-17 shows the timing at which an interrupt request is held pending.
× × IF
When the watch timer overflows and the port 4 falling edge is detected, the internal test input flag is set to 1, and
the standby release signal is generated.
Unlike the interrupt function, vectored processing is not performed.
There are two test input sources as shown in Table 21-5. The basic configuration is shown in Figure 21-18.
Internal bus
MK
The names of the test input flags and test mask flags corresponding to the test input signals are listed in Table
21-6.
Test Input Signal Name Test Input Flag Test Mask Flag
INTWT WTIF WTMK
INTPT4 KRIF KRMK
0 Not detected
1 Detected
0 Not detected
Caution When port 4 falling edge detection is used, be sure to clear KRIF to 0 (it is not cleared to 0
automatically).
The external device expansion function connects external devices to areas other than the internal ROM, RAM,
and SFR. Ports 4 to 6 are used for connection of external devices. Ports 4 to 6 control addresses/data, the read/
write strobe, wait, address strobe etc.
Caution When the external wait function is not used, the WAIT pin can be used as a port in all modes.
Memory maps when using the external device expansion function are as follows.
Figure 22-1. Memory Map When Using External Device Expansion Function (1/3)
(a) Memory map of µPD780053 and 780053Y, (b) Memory map of µPD780054 and 780054Y,
and µPD780058, 780058B, 780058BY, and µPD780058, 780058B, 780058BY,
78F0058, and 78F0058Y with internal ROM 78F0058, and 78F0058Y with internal ROM
(flash memory) set to 24 KB (flash memory) set to 32 KB
FFFFH FFFFH
SFR SFR
FF00H FF00H
FEFFH FEFFH
FB00H FB00H
FAFFH FAFFH
Reserved Reserved
FAE0H FAE0H
FADFH FADFH
Internal buffer RAM Internal buffer RAM
FAC0H FAC0H
FABFH FABFH
Reserved Reserved
FA80H FA80H
FA7FH FA7FH
A000H C000H
9FFFH BFFFH
7000H 9000H
6FFFH 8FFFH
4 KB expansion mode 4 KB expansion mode
(when MM2 to MM0 = 100) (when MM2 to MM0 = 100)
6100H 8100H
60FFH 80FFH
256-byte expansion mode 256-byte expansion mode
(when MM2 to MM0 = 011) (when MM2 to MM0 = 011)
6000H 8000H
5FFFH 7FFFH
0000H 0000H
Figure 22-1. Memory Map When Using External Device Expansion Function (2/3)
(c) Memory map of µPD780055 and 780055Y, (d) Memory map of µPD780056 and 780056Y,
and µPD780058, 780058B, 780058BY, and µPD780058, 780058B, 780058BY,
78F0058, and 78F0058Y with internal ROM 78F0058, and 78F0058Y with internal ROM
(flash memory) set to 40 KB (flash memory) set to 48 KB
FFFFH FFFFH
SFR SFR
FF00H FF00H
FEFFH FEFFH
FB00H FB00H
FAFFH FAFFH
Reserved Reserved
FAE0H FAE0H
FADFH FADFH
Internal buffer RAM Internal buffer RAM
FAC0H FAC0H
FABFH FABFH
Reserved Reserved
FA80H FA80H
FA7FH FA7FH
Full-address mode
Full-address mode
(when MM2 to MM0 = 111)
(when MM2 to MM0 = 111)
or
E000H 16 KB expansion mode
DFFFH (when MM2 to MM0 = 101)
16 KB expansion mode
(when MM2 to MM0 = 101) D000H
CFFFH
B000H
AFFFH 4 KB expansion mode
(when MM2 to MM0 = 100)
4 KB expansion mode
(when MM2 to MM0 = 100) C100H
A100H
C0FFH
A0FFH 256-byte expansion mode
256-byte expansion mode C000H (when MM2 to MM0 = 011)
A000H (when MM2 to MM0 = 011) BFFFH
9FFFH
Single-chip mode
Single-chip mode
0000H 0000H
Figure 22-1. Memory Map When Using External Device Expansion Function (3/3)
(e) µPD780058, 780058B, 780058BY, 78F0058, (f) µPD780058, 780058B, 780058BY, 78F0058,
78F0058Y Memory map when internal ROM 78F0058Y Memory map when internal ROM
(flash memory) size is 56 KB (flash memory) size is 60 KB
FFFFH FFFFH
SFR SFR
FF00H FF00H
FEFFH FEFFH
FB00H FB00H
FAFFH FAFFH
Reserved Reserved
FAE0H FAE0H
FADFH FADFH
Internal buffer RAM Internal buffer RAM
FAC0H FAC0H
FABFH FABFH
Reserved Reserved
F800H F800H
F7FFH F7FFH
Internal expansion RAM Internal expansion RAM
F400H F400H
F3FFH F3FFH
Full-address mode
(when MM2 to MM0 = 111)
or Reserved
16 KB expansion mode
(when MM2 to MM0 = 101)
F000H F000H
EFFFH EFFFH
4 KB expansion mode
(when MM2 to MM0 = 100)
E100H
F0FFH
256-byte expansion mode
(when MM2 to MM0 = 011)
E000H
DFFFH
Single-chip mode
Single-chip mode
0000H 0000H
Caution When the internal ROM (flash memory) size is 60 KB, the area from F000H to F3FFH cannot be
used. F000H to F3FFH can be used as external memory by setting the internal ROM (flash
memory) size to 56 KB or less using the internal memory size switching register (IMS).
The external device expansion function is controlled by the memory expansion mode register (MM) and internal
memory size switching register (IMS).
MM2 MM1 MM0 Single-chip/ P40 to P47, P50 to P57, P64 to P67 pin state
memory expansion
mode selection P40 to P47 P50 to P53 P54, P55 P56, P57 P64 to P67
0 0 No wait
1 0 Setting prohibited
Note The full-address mode allows external expansion to the entire 64 KB address space except for the
internal ROM, RAM, and SFR areas and the reserved areas.
Remark P60 to P63 are used as port pins without regard to the mode (single-chip mode or memory expansion
mode).
Symbol 7 6 5 4 3 2 1 0
Address After reset R/W
IMS RAM2 RAM1 RAM0 0 ROM3 ROM2 ROM1 ROM0
FFF0H Note R/W
1 0 0 0 32 KB
1 0 1 0 40 KB
1 1 0 0 48 KB
1 1 1 0 56 KB
1 1 1 1 60 KB
1 1 0 1,024 bytes
Note The values after reset depend on the product (see Table 22-3).
Table 22-3. Values After Internal Memory Size Switching Register Is Reset
The timing control signal output pins in the external memory expansion mode are as follows.
(5) AD0 to AD7, A8 to A15 pins (alternate function: P40 to P47, P50 to P57)
Address/data signal output pin. A valid signal is output or input during data accesses and instruction fetches
from external memory.
These signals change when the internal memory is accessed (output values are undefined).
ASTB
RD
ASTB
RD
ASTB
RD
WAIT
ASTB
RD
ASTB
RD
ASTB
RD
WAIT
ASTB
WR
Hi-Z
AD0 to AD7 Lower address Write data
ASTB
WR
Hi-Z
AD0 to AD7 Lower address Write data
ASTB
WR
Hi-Z
AD0 to AD7 Lower address Write data
WAIT
ASTB
RD
WR
Hi-Z
AD0 to AD7 Lower address Read data Write data
ASTB
RD
WR
Hi-Z
AD0 to AD7 Lower address Read data Write data
ASTB
RD
WR
Hi-Z
AD0 to AD7 Lower address Read data Write data
WAIT
Figure 22-8 shows an example of the connection between the µPD780054 and external memory. SRAM is used
as the external memory in this diagram. In addition, the external device expansion function is used in the full-address
mode, and the addresses from 0000H to 7FFFH (32 KB) are allocated to internal ROM, and the addresses after 8000H
to SRAM.
µ PD780054 µ PD43256B
VDD
CS
RD OE
WR Data
WE bus
I/O1 to I/O8
A8 to A14 A0 to A14
Address
74HC573 bus
ASTB LE
Q0 to Q7
AD0 to AD7 D0 to D7
OE
In any mode, all the contents of the registers, flags and data memory just before standby mode is set are held.
The I/O port output latches and output buffer statuses are also held.
Cautions 1. The STOP mode can be used only when the system operates on the main system clock
(subsystem clock oscillation cannot be stopped). The HALT mode can be used with either
the main system clock or the subsystem clock.
2. When shifting to the STOP mode, be sure to stop the peripheral hardware operation before
executing the 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 (CS) 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.
Caution The wait time that elapses when the STOP mode is released does not include the time required
for the clock to start oscillation (see “a” in the illustration below) after the STOP mode is released.
The same applies when the STOP mode is released by RESET input and by generation of an
interrupt request.
X1 pin voltage
waveform
Setting of HALT Mode On Execution of HALT Instruction During Main On Execution of HALT Instruction during
System Clock Operation Subsystem Clock Operation
Without subsystem With subsystem When main system clock When main system
Item clockNote 1 clock Note 2 continues oscillation clock stops oscillation
Clock generator Both main system and subsystem clocks can be oscillated. Clock supply to the CPU stops.
CPU Operation stops
Ports (output latches) Status before HALT mode setting is held
16-bit timer/event counter Operable Operable when watch
timer output is selected
as count clock (fXT is
selected as count clock
of watch timer) or when
TI00 is selected
8-bit timer/event counter Operable Operable when TI1 or
TI2 is selected as
count clock
Watch timer Operable when fXX/27 is Operable Operable when fXT is
selected as count clock selected as count clock
Watchdog timer Operable Operation stops
A/D converter Operable Operation stops
D/A converter Operable
Real-time output port Operable
Serial interface Other than Operable Operable when
automatic external SCK is used
transmit/
receive
function
Automatic Operation stops
transmit/
receive
function
External interrupt INTP0 INTP0 is operable when clock supplied for peripheral hardware is selected Operation stops
requests as sampling clock (fXX/25, fXX/26, fXX/27)
INTP1 to INTP5 Operable
Bus line for AD0 to AD7 High impedance
external A0 to A15 Status before HALT mode setting is held
expansion
ASTB Low level
WR, RD High level
WAIT High impedance
HALT Interrupt
instruction request Wait
Standby
release signal
Operating
mode HALT mode Wait Operating mode
Oscillation
Clock
Remarks 1. The broken lines indicate the case when the interrupt request which has released the
standby status is acknowledged.
2. The wait time will be as follows:
• When the program branches to the vector table: 8 to 9 clocks
• When the program does not branch to the vector table: 2 to 3 clocks
Wait
HALT (217/f X : 26.2 ms)
Instruction
RESET
signal
Oscillation
Operating Reset stabilization Operating
mode HALT mode period wait status mode
Oscillation
Oscillation stop Oscillation
Clock
Cautions 1. When the STOP mode is set, the X2 pin is internally connected to VDD1 via a pull-up resistor
to minimize the leakage current at the crystal oscillator. Thus, do not use the STOP mode
in a system where an external clock is used for the main system clock.
2. 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. After the wait time set using
the oscillation stabilization time select register (OSTS) elapses, the operating mode is
set.
Wait
STOP Interrupt (time set by OSTS)
instruction request
Standby
release signal
Remark The broken lines indicate the case when the interrupt request which has released the standby
status is acknowledged.
Wait
STOP (217/f X : 26.2 ms)
instruction
RESET
signal
Oscillation
Operating Reset stabilization Operating
mode STOP mode period wait status mode
The external reset and internal reset have no functional differences. In both cases, program execution starts at
the address at 0000H and 0001H by RESET input.
When a low level is input to the RESET pin or the watchdog timer overflows, a reset is applied and each hardware
unit is set to the status shown in Table 24-1. Each pin is high impedance during reset input or during the oscillation
stabilization time just after reset is released.
When a high level is input to the RESET pin, the reset is cleared and program execution starts after the lapse of
oscillation stabilization time (217/fX). The reset applied by watchdog timer overflow is automatically cleared after a
reset and program execution starts after the lapse of oscillation stabilization time (217/fX) (see Figures 24-2 to 24-
4).
Cautions 1. For an external reset, input a low level to the RESET pin for 10 µs or more.
2. During reset input, main system clock oscillation remains stopped but subsystem clock
oscillation continues.
3. When the STOP mode is cleared by reset, the STOP mode contents are held during reset input.
However, the port pin becomes high impedance.
Reset
RESET Reset controller signal
Over-
flow Interrupt
Count clock Watchdog timer function
Stop
X1
RESET
Internal
reset signal
Delay
Delay
Hi-Z
Port pin
X1
Internal
reset signal
Hi-Z
Port pin
X1
RESET
Internal
reset signal
Delay Delay
Hi-Z
Port pin
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. If the reset signal is input in the standby mode, the status before reset is retained even after reset.
3. The values after reset depend on the product.
µPD780053, 780053Y: C6H, µPD780054, 780054Y: C8H, µPD780055, 780055Y: CAH,
µPD780056, 780056Y: CCH, µPD780058, 780058B, 780058BY: CFH, µPD78F0058, 78F0058Y: CFH
4. Provided only in the µPD780058, 780058B, 780058BY, 78F0058, and 78F0058Y.
Note Provided only in the µPD780058, 780058B, 780058BY, 78F0058, and 78F0058Y.
The µPD780058, 780058B, 780058BY, 78F0058, 78F0058Y can replace part of a program in the mask ROM or
flash memory with a program in the internal expansion RAM.
Instruction bugs found in the mask ROM or flash memory can be avoided, and program flow can be changed by
using the ROM correction function.
The ROM correction function can be used to correct two places (max.) of the internal ROM or flash memory
(program).
Cautions 1. ROM correction can be used only for the µPD780058, 780058B, 780058BY, 78F0058, and
78F0058Y.
2. ROM correction function cannot be emulated by the in-circuit emulator (IE-78000-R, IE-78000-
R-A, IE-78K0-NS, IE-78K0-NS-A, IE-78001-R-A).
Item Configuration
Match
Comparator Correction branch request
signal (BR !F7FDH)
Correction address
CORENn CORSTn
register (CORADn)
Correction control register
Internal bus
Remark n = 0, 1
Cautions 1. Set CORAD0 and CORAD1 when bit 1 (COREN0) and bit 3 (COREN1) of the correction
control register (CORCN: See Figure 25-3) are 0.
2. Only addresses where operation codes are stored can be set to CORAD0 and CORAD1.
3. Do not set the following addresses to CORAD0 and CORAD1.
• Address value in table area of table reference instruction (CALLT instruction): 0040H
to 007FH
• Address value in vector table area: 0000H to 003FH
(2) Comparator
The comparator continuously compares the correction address value set in correction address registers 0 and
1 (CORAD0, CORAD1) with the fetch address value. When bit 1 (COREN0) or bit 3 (COREN1) of the correction
control register (CORCN) is 1 and the correction address matches the fetch address value, the correction
branch request signal (BR !F7FDH) is generated from the ROM correction circuit.
The ROM correction function is controlled by the correction control register (CORCN).
0 Not detected
1 Detected
0 Disabled
1 Enabled
0 Not detected
1 Detected
0 Disabled
1 Enabled
(1) Store the correction address and instruction after correction (patch program) to nonvolatile memory (such as
EEPROMTM) outside the microcontroller.
When two places should be corrected, store the branch destination judgment program as well. The branch
destination judgment program checks which one of the addresses set to correction address registers 0 and
1 (CORAD0 or CORAD1) generates the correction branch.
00H 00
CSEG AT 1000H
01H 10
02H 0D ADD A, #2
RA78K/0
02
BR !1002H
9B
02
10
FFH
(2) Assemble in advance the initialization routine as shown in Figure 25-5 to correct the program.
Initialization
ROM correction
Is ROM No
correction used?Note
Yes
Main program
Note Whether the ROM correction function is used or not should be judged by the port input level. For example,
when the P20 input level is high, ROM correction is used, otherwise, it is not used.
(3) After reset, store the contents that were previously stored in the external nonvolatile memory by the user
initialization routine for ROM correction to internal expansion RAM (see Figure 25-5).
Set the start address of the instruction to be corrected to CORAD0 and CORAD1, and set bits 1 and 3
(COREN0, COREN1) of the correction control register (CORCN) to 1.
(4) Set the entire-space branch instruction (BR !addr16) to the specified address (F7FDH) of the internal
expansion RAM using the main program.
(5) After the main program is started, the fetch address value and the values set in CORAD0 and CORAD1 are
continuously compared by the comparator in the ROM correction circuit. When these values match, the
correction branch request signal is generated. Simultaneously the corresponding correction status flag
(CORST0 or CORST1) is set to 1.
(6) Branch to the address F7FDH via the correction branch request signal.
(7) Branch to the internal expansion RAM address set by the main program via the entire-space branch instruction
of the address F7FDH.
(8) When one place is corrected, the correction program is executed. When two places are corrected, the
correction status flag is checked by the branch destination judgment program, and the program branches to
the correction program.
Yes
ROM correction
Correction branch
(branch to address F7FDH)
An example of ROM correction when the instruction at address 1000H “ADD A, #1” is changed to “ADD A, #2”
is shown below.
F702H ADD A, #2
(3) BR !1002H
1000H ADD A, #1
1002H MOV B, A (2)
(1)
F7FDH
BR !F702H
F7FFH
EFFFH
(1) The program branches to address F7FDH when the preset value 1000H in the correction address register
matches the fetch address value after the main program is started.
(2) The program branches to any address (address F702H in this example) by setting the entire-space branch
instruction (BR !addr16) to address F7FDH by the main program.
(3) The program returns to the internal ROM (flash memory) program after executing the substitute instruction
ADD A, #2.
Figures 25-8 and 25-9 show the program transition diagrams when the ROM correction is used.
FFFFH
F7FFH
BR !JUMP
F7FDH
(2)
Correction program
JUMP
(1)
(3)
Internal ROM
Correction place
xxxxH
Internal ROM
(flash memory)
0000H
(1) The program branches to address F7FDH when the fetch address matches the correction address
(2) The program branches to the correction program
(3) The program returns to the internal ROM (flash memory) program
Figure 25-9. Program Transition Diagram (When Two Places Are Corrected)
FFFFH
F7FFH (6)
BR !JUMP
F7FDH (2)
Correction program 2
yyyyH
(7)
Correction program 1
xxxxH
(3)
Destination judge program
JUMP (8)
(4)
Internal ROM
(flash memory)
Correction place 1
Internal ROM
(flash memory)
0000H
(1) The program branches to address F7FDH when the fetch address matches the correction address
(2) The program branches to the branch destination judgment program
(3) The program branches to correction program 1 via the branch destination judgment program (BTCLR
!CORST0, $xxxxH)
(4) The program returns to the internal ROM (flash memory) program
(5) The program branches to address F7FDH when the fetch address matches the correction address
(6) The program branches to the branch destination judgment program
(7) The program branches to correction program 2 via the branch destination judgment program (BTCLR
!CORST1, $yyyyH)
(8) The program returns to the internal ROM (flash memory) program
(1) Address values set in correction address registers 0 and 1 (CORAD0, CORAD1) must be addresses where
instruction codes are stored.
(2) Correction address registers 0 and 1 (CORAD0, CORAD1) should be set when the correction enable flag
(COREN0, COREN1) is 0 (when the correction branch is in the disabled state). If an address is set to CORAD0
or CORAD1 when COREN0 or COREN1 is 1 (when the correction branch is in the enabled state), the correction
branch may start with a different address from the set address value.
(3) Do not set the address value of an instruction immediately after the instruction that sets the correction enable
flag (COREN0, COREN1) to 1, to correction address register 0 or 1 (CORAD0, CORAD1); otherwise the
correction branch may not start.
(4) Do not set the address value in the table area of the table reference instruction (CALLT instruction) (0040H
to 007FH), and the address value in the vector table area (0000H to 003FH) to correction address registers
0 and 1 (CORAD0, CORAD1).
(5) Do not set two addresses immediately after the instructions shown below to correction address registers 0
and 1 (CORAD0, CORAD1). (That is, when the mapped terminal address of these instructions is N, do not
set the address values of N + 1 and N + 2.)
• RET
• RETI
• RETB
• BR $addr16
• STOP
• HALT
The µPD78F0058 and 78F0058Y have flash memory whose contents can be written, erased, rewritten with the
device mounted on a PC board. Table 26-1 lists the differences between the flash memory versions (µPD78F0058
and 78F0058Y) and the mask ROM versions (µPD780053, 780054, 780055, 780056, 780058, 780058B, 780053Y,
780054Y, 780055Y, 780056Y, and 780058BY).
Table 26-1. Differences Between µPD78F0058, 78F0058Y and Mask ROM Versions
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 version.
Remark Only the µPD780058, 780058B, 78F0058, 780058BY, and 78F0058Y are provided with an internal
expansion RAM size switching register.
The µPD78F0058 and 78F0058Y allow users to define the internal ROM size using the internal memory size
switching register (IMS), so that the same memory mapping as that of a mask ROM version with a different-size internal
ROM is possible.
IMS is set with an 8-bit memory manipulation instruction.
RESET input sets IMS to CFH.
IMS RAM2 RAM1 RAM0 0 ROM3 ROM2 ROM1 ROM0 FFF0H CFH R/W
1 0 0 0 32 KB
1 0 1 0 40 KB
1 1 0 0 48 KB
1 1 1 0 56 KBNote
1 1 1 1 60 KB
1 1 0 1,024 bytes
Other than above Setting prohibited
Note When using the external device expansion function of the µPD780058, 780058B, 780058BY, 78F0058,
and 78F0058Y, set the internal ROM capacity to 56 KB or less.
The IMS settings to give the same memory map as mask ROM versions are shown in Table 26-2.
The µPD78F0058 and 78F0058Y allow users to define the internal expansion RAM size by using the internal
expansion RAM size switching register (IXS), so that the same memory mapping as that of a mask ROM version with
a different-size internal expansion RAM is possible.
IXS is set with an 8-bit memory manipulation instruction.
RESET input sets IXS to 0AH.
1 1 0 0 0 bytes
1 0 1 0 1,024 bytes
The IXS settings that give the same memory map as the mask ROM versions are shown in Table 26-3.
Table 26-3. Internal Expansion RAM Size Switching Register Setting Values
Flash memory programming is performed by connecting a dedicated flash programmer (Flashpro III (part no. FL-
PR3, PG-FP3)/Flashpro IV (part no. FL-PR4, PG-FP4)) to the target system with the flash memory mounted on the
target system (on-board). A flash memory writing adapter (program adapter), which is a target board used exclusively
for programming, is also provided.
Remark FL-PR3, FL-PR4, and the program adapter are products of Naito Densei Machida Mfg. Co., Ltd. (TEL
+81-45-475-4191).
• Software can be modified after the microcontroller is solder-mounted on the target system.
• Distinguishing software facilities low-quantity, varied model production
• Easy data adjustment when starting mass production
VPP
RS-232C VDD
VSS
USB
RESET
Dedicated flash SIO/UART/PORT µ PD78F0058,
programmer µPD78F0058Y
Host machine
Mode COMM PORT SIO Clock CPU Flash Clock Multiple of VPP
CLOCK Rate Pulses
Notes 1. Selection items for TYPE settings on the dedicated flash programmer (Flashpro III (part no. FL-PR3,
PG-FP3)/Flashpro IV (part no. FL-PR4, PG-FP4)).
2. The possible setting range differs depending on the voltage. For details, see CHAPTER 29 ELEC-
TRICAL SPECIFICATIONS (FLASH MEMORY VERSION), CHAPTER 30 ELECTRICAL SPECIFI-
CATIONS (FLASH MEMORY VERSION (VDD = 2.2 V).
3. Because factors other than the baud rate error, such as the signal waveform slew, also affect UART
communication, thoroughly evaluate the slew as well as the baud rate error.
VPP pulses
10 V
VPP VDD
VSS
VDD
RESET
VSS Flash memory write mode
Note Connect this pin when the system clock is supplied from the dedicated flash programmer. If a resonator
is already connected to the X1 pin, the CLK pin does not need to be connected.
Caution The VDD0 and VDD1 pins, if already connected to the power supply, must be connected to the VDD
pin of the dedicated flash programmer. When using the power supply connected to the VDD0 and
VDD1 pins, supply voltage before starting programming.
VPP1 VPP
VDD VDD0, VDD1, AVREF
RESET RESET
SO (TXD) RXD0
SI (RXD) TXD0
CLKNote X1
GND VSS0, VSS1, AVSS
VPP1 VPP
VDD VDD0, VDD1, AVREF
RESET RESET
SO (TXD) RXD1
SI (RXD) TXD1
CLKNote X1
GND VSS0, VSS1, AVSS
Note Connect this pin when the system clock is supplied from the dedicated flash programmer. If a resonator
is already connected to the X1 pin, the CLK pin does not need to be connected.
Caution The VDD0 and VDD1 pins, if already connected to the power supply, must be connected to the VDD
pin of the dedicated flash programmer. When using the power supply connected to the VDD0 and
VDD1 pins, supply voltage before starting programming.
If Flashpro III (part no. FL-PR3, PG-FP3)/Flashpro IV is used as a dedicated flash programmer, the following signals
are generated for the µPD78F0058, 78F0058Y. For details, refer to the manual of Flashpro III/Flashpro IV.
Signal Name I/O Pin Function Pin Name 3-Wire UART Pseudo 3-Wire
Serial I/O Serial I/O
VPP2 − − − × × ×
VDD I/O VDD voltage generation/ VDD0, VDD1, AVREF Note Note Note
voltage monitoring
<VPP pin>
In normal operation mode, input 0 V to the VPP pin. In flash memory programming mode, a write voltage of 10.0
V (TYP.) is supplied to the VPP pin, so perform the following.
µ PD78F0058, 78F0058Y
RxD1, TxD1
When connecting the dedicated flash programmer to a serial interface pin that is connected to another device on-
board, signal conflict or abnormal operation of the other device may occur. Care must therefore be taken with
such connections.
µPD78F0058, 78F0058Y
Connection pin of
dedicated flash
Signal conflict programmer
Input pin
Other device
Output pin
µ PD78F0058, 78F0058Y
Connection pin of
dedicated flash
programmer
Pin
Other device
Input pin
µPD78F0058, 78F0058Y
Connection pin of
dedicated flash
programmer
Pin
Other device
Input pin
<RESET pin>
If the reset signal of the dedicated flash programmer is connected to the RESET pin connected to the reset signal
generator on-board, a signal conflict occurs. To prevent this, isolate the connection with the reset signal generator.
If the reset signal is input from the user system in the flash memory programming mode, a normal programming
operation cannot be performed. Therefore, do not input reset signals from other than the dedicated flash
programmer.
µ PD78F0058, 78F0058Y
Connection pin of
dedicated flash
Signal conflict programmer
RESET
Reset signal generator
Output pin
The signal output by the reset signal generator and the signal output from
the dedicated flash programmer conflict in the flash memory programming
mode, so isolate the signal of the reset signal generator.
<Port pins>
When the µPD78F0058 and 78F0058Y enter the flash memory programming mode, all the pins other than those
that communicate in flash memory programming are in the same status as immediately after reset.
If the external device does not recognize initial statuses such as the output high impedance status, therefore,
connect the external device to VDD0 or VSS0 via a resistor.
<Oscillator>
When using the on-board clock, connect X1, X2, XT1, and XT2 as required in the normal operation mode.
When using the clock output of the flash programmer, connect it directly to X1, disconnecting the main oscillator
on-board, and leave the X2 pin open. The subsystem clock conforms to the normal operation mode.
<Power supply>
To use the power output from the flash programmer, connect the VDD0 and VDD1 pins to VDD of the flash programmer,
and the VSS0 and VSS1 pins to GND of the flash programmer.
To use the on-board power supply, make connections that accord with the normal operation mode. However,
because the voltage is monitored by the flash programmer, be sure to connect VDD of the flash programmer.
Supply the same power as in the normal operation mode to the other power supply pins (AVREF0, AVREF1, and AVSS).
Figure 26-10. Wiring Example for Flash Writing Adapter in 3-Wire Serial I/O Mode (SIO ch-0)
80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61
1 60
2 59
3 58
4 57
5 56
6 55
7 54
8 53
9 52
10 51
µPD78F0058 50
11
µ PD78F0058Y 49
12
13 48
14 47
15 46
16 45
17 44
18 43
19 42
20 41
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
GND
VDD
VDD2 (LVDD)
WRITER INTERFACE
Figure 26-11. Wiring Example for Flash Writing Adapter in 3-Wire Serial I/O Mode (SIO ch-1)
80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61
1 60
2 59
3 58
4 57
5 56
6 55
7 54
8 53
9 52
10 51
µ PD78F0058 50
11
µPD78F0058Y 49
12
13 48
14 47
15 46
16 45
17 44
18 43
19 42
20 41
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
GND
VDD
VDD2 (LVDD)
WRITER INTERFACE
Figure 26-12. Wiring Example for Flash Writing Adapter in 3-Wire Serial I/O Mode (SIO ch-2)
80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61
1 60
2 59
3 58
4 57
5 56
6 55
7 54
8 53
9 52
10 51
µ PD78F0058 50
11
µ PD78F0058Y 49
12
13 48
14 47
15 46
16 45
17 44
18 43
19 42
20 41
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
GND
VDD
VDD2 (LVDD)
WRITER INTERFACE
Figure 26-13. Wiring Example for Flash Writing Adapter in UART Mode (UART ch-0)
80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61
1 60
2 59
3 58
4 57
5 56
6 55
7 54
8 53
9 52
10 51
µ PD78F0058 50
11
µ PD78F0058Y 49
12
13 48
14 47
15 46
16 45
17 44
18 43
19 42
20 41
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
GND
VDD
VDD2 (LVDD)
WRITER INTERFACE
Figure 26-14. Wiring Example for Flash Writing Adapter in UART Mode (UART ch-1)
80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61
1 60
2 59
3 58
4 57
5 56
6 55
7 54
8 53
9 52
10 51
µPD78F0058 50
11
µ PD78F0058Y 49
12
13 48
14 47
15 46
16 45
17 44
18 43
19 42
20 41
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
GND
VDD
VDD2 (LVDD)
WRITER INTERFACE
Figure 26-15. Wiring Example for Flash Writing Adapter in Pseudo 3-Wire Mode
80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61
1 60
2 59
3 58
4 57
5 56
6 55
7 54
8 53
9 52
10 51
µ PD78F0058 50
11
µ PD78F0058Y 49
12
13 48
14 47
15 46
16 45
17 44
18 43
19 42
20 41
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
GND
VDD
VDD2 (LVDD)
WRITER INTERFACE
This chapter describes each instruction set of the µPD780058 and 780058Y Subseries in table form. For details
of the operations and operation codes, refer to the separate document 78K/0 Series Instructions User’s Manual
(U12326E).
In the case of immediate data, describe an appropriate numeric value or a label. When using a label, be sure to
describe 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 description.
Note Addresses from FFD0H to FFDFH cannot be accessed with these operands.
Remark For special-function register symbols, see Table 5-2 Special-Function Register List.
A, [HL + B] 2 8 10 + n + m A ↔ (HL + B)
A, [HL + C] 2 8 10 + n + m A ↔ (HL + C)
Notes 1. When the internal high-speed RAM area is accessed or instruction that performs no data access is
executed.
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 (fCPU) 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 external memory expansion area is read from.
4. m is the number of waits when external memory expansion area is written to.
Notes 1. When the internal high-speed RAM area is accessed or instruction that performs no data access is
executed.
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 (fCPU) 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 external memory expansion area is read from.
4. m is the number of waits when external memory expansion area is written to.
Notes 1. When the internal high-speed RAM area is accessed or instruction that performs no data access is
executed.
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 (fCPU) 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 external memory expansion area is read from.
Notes 1. When the internal high-speed RAM area is accessed or instruction that performs no data access is
executed.
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 (fCPU) 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 external memory expansion area is read from.
Notes 1. When the internal high-speed RAM area is accessed or instruction that performs no data access is
executed.
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 (fCPU) 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 external memory expansion area is read from.
4. m is the number of waits when external memory expansion area is written to.
SET1 CY 1 2 – CY ← 1 1
CLR1 CY 1 2 – CY ← 0 0
NOT1 CY 1 2 – CY ← CY ×
Notes 1. When the internal high-speed RAM area is accessed or instruction that performs no data access is
executed.
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 (fCPU) 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 external memory expansion area is read from.
4. m is the number of waits when external memory expansion area is written to.
Notes 1. When the internal high-speed RAM area is accessed or instruction that performs no data access is
executed.
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 (fCPU) selected by the processor clock
control register (PCC).
2. This clock cycle applies to the internal ROM program.
Notes 1. When the internal high-speed RAM area is accessed or instruction that performs no data access is
executed.
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 (fCPU) 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 external memory expansion area is read from.
4. m is the number of waits when external memory expansion area is written to.
B, C DBNZ
sfr MOV MOV
saddr MOV MOV DBNZ INC
ADD DEC
ADDC
SUB
SUBC
AND
OR
XOR
CMP
!addr16 MOV
PSW MOV MOV PUSH
POP
[DE] MOV
C DIVUW
Note Except r = A
Second Operand
#word AX rp Note sfrp saddrp !addr16 SP None
1st Operand
AX ADDW MOVW MOVW MOVW MOVW MOVW
SUBW XCHW
CMPW
!addr16 MOVW
SP MOVW MOVW
Second Operand
A.bit sfr.bit saddr.bit PSW.bit [HL].bit CY $addr16 None
First Operand
Second Operand
AX !addr16 !addr11 [addr5] $addr16
First Operand
Basic instruction BR CALL CALLF CALLT BR
BR BC
BNC
BZ
BNZ
Compound BT
instruction BF
BTCLR
DBNZ
rms value 70 mA
Total for P10 to P17, P20 to P27, Peak value 50 mA
P40 to P47, P70 to P72, P130, P131 rms value 20 mA
Note The rms value should be calculated as follows: [rms value] = [Peak value] × √Duty
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.
Main System Clock Oscillator Characteristics (TA = –40 to +85°C, VDD = 1.8 to 5.5 V)
Notes 1. Indicates only oscillator characteristics. See AC Characteristics for instruction execution time.
2. Time required to stabilize oscillation after reset or STOP mode release.
Cautions 1. When using the main system 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.
2. When the main system clock is stopped and the system is operating on the subsystem clock,
wait until the oscillation stabilization time has been secured by the program before switching
back to the main system clock.
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.
Subsystem Clock Oscillator Characteristics (TA = –40 to +85°C, VDD = 1.8 to 5.5 V)
Notes 1. Indicates only oscillator characteristics. See AC Characteristics for instruction execution time.
2. Time required to stabilize oscillation after VDD reaches oscillation voltage MIN.
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.
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.
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port pins.
Input voltage, VIH1 P10 to P17, P21, P23, P30 to P32, VDD = 2.7 to 5.5 V 0.7VDD VDD V
high P35 to P37, P40 to P47,
P50 to P57, P64 to P67, P71, VDD = 1.8 to 5.5 V 0.8VDD VDD V
P120 to P127, P130, P131
VIH2 P00 to P05, P20, P22, P24 to P27, VDD = 2.7 to 5.5 V 0.8VDD VDD V
P33, P34, P70, P72, RESET VDD = 1.8 to 5.5 V 0.85VDD VDD V
VIH3 P60 to P63 VDD = 2.7 to 5.5 V 0.7VDD 15 V
(N-ch open drain) VDD = 1.8 to 5.5 V 0.8VDD 15 V
VIH4 X1, X2 VDD = 2.7 to 5.5 V VDD – 0.5 VDD V
VDD = 1.8 to 5.5 V VDD – 0.2 VDD V
VIH5 XT1/P07, XT2 4.5 V ≤ VDD ≤ 5.5 V 0.8VDD VDD V
2.7 V ≤ VDD < 4.5 V 0.9VDD VDD V
1.8 V ≤ VDD < 2.7 VNote 0.9VDD VDD V
Input voltage, VIL1 P10 to P17, P21, P23, P30 to P32, VDD = 2.7 to 5.5 V 0 0.3VDD V
low P35 to P37, P40 to P47,
P50 to P57, P64 to P67, P71, VDD = 1.8 to 5.5 V 0 0.2VDD V
P120 to P127, P130, P131
VIL2 P00 to P05, P20, P22, P24 to P27, VDD = 2.7 to 5.5 V 0 0.2VDD V
P33, P34, P70, P72, RESET VDD = 1.8 to 5.5 V 0 0.15VDD V
VIL3 P60 to P63 4.5 V ≤ VDD ≤ 5.5 V 0 0.3VDD V
2.7 V ≤ VDD < 4.5 V 0 0.2VDD V
1.8 V ≤ VDD < 2.7 V 0 0.1VDD V
VIL4 X1, X2 VDD = 2.7 to 5.5 V 0 0.4 V
VDD = 1.8 to 5.5 V 0 0.2 V
VIL5 XT1/P07, XT2 4.5 V ≤ VDD ≤ 5.5 V 0 0.2VDD V
2.7 V ≤ VDD < 4.5 V 0 0.1VDD V
1.8 V ≤ VDD < 2.7 VNote 0 0.1VDD V
Output voltage, VOH VDD = 4.5 to 5.5 V, IOH = –1 mA VDD – 1.0 V
high VDD = 1.8 to 5.5 V, IOH = –100 µA VDD – 0.5 V
Output voltage, VOL1 P50 to P57, P60 to P63 VDD = 4.5 to 5.5 V, 0.4 2.0 V
low IOL = 15 mA
P01 to P05, P10 to P17, P20 to VDD = 4.5 to 5.5 V, 0.4 V
P27, P30 to P37, P40 to P47, IOL = 1.6 mA
P64 to P67, P70 to P72, P120 to
P127, P130, P131
VOL2 SB0, SB1, SCK0 VDD = 4.5 to 5.5 V, 0.2VDD V
open drain,
pulled-up (R = 1 kΩ)
VOL3 IOL = 400 µA 0.5 V
Note When P07/XT1 pin is used as P07, the inverse phase of P07 should be input to XT2 pin using an inverter.
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port pins.
Note When pull-up resistors are not connected to P60 to P63 (specified by the mask option), a low-level input
leakage current of –200 µA (MAX.) flows only for 1.5 clocks (without wait) after a read instruction has been
executed to port 6 (P6) or port mode register 6 (PM6). At times other than this 1.5-clock interval, a –3 µA
(MAX.) current flows.
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port pins.
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port pins.
Notes 1. High-speed mode operation (when the processor clock control register (PCC) is cleared to 00H).
2. Low-speed mode operation (when the PCC is set to 04H).
3. Operation with main system clock fXX = fX/2 (when the oscillation mode select register (OSMS) is cleared
to 00H)
4. Operation with main system clock fXX = fX (when OSMS is set to 01H)
5. Refer to the current flowing to the VDD0 and VDD1 pins. The current flowing to the A/D converter, D/A
converter, and on-chip pull-up resistor is not included.
6. When the main system clock operation is stopped.
AC Characteristics
Notes 1. Operation with main system clock fXX = fX/2 (when the oscillation mode select register (OSMS) is cleared
to 00H)
2. Operation with main system clock fXX = fX (when OSMS is set to 01H)
3. Value when external clock is used. When a crystal resonator is used, it is 114 µs (MIN.)
4. Selection of fsam = fXX/2N, fXX/32, fXX/64, and fXX/128 is possible with bits 0 and 1 (SCS0, SCS1) of the sampling
clock select register (SCS) (when N = 0 to 4).
TCY vs. VDD (@fXX = fX/2 main system clock operation) TCY vs. VDD (@fXX = fX main system clock operation)
60 60
10 10
2.0 2.0
1.0 1.0
0.5 0.5
0.4 0.4
0 0
1 2 3 4 5 6 1 2 3 4 5 6
Supply voltage VDD [V] Supply voltage VDD [V]
(a) When MCS = 1, PCC2 to PCC0 = 000B (TA = –40 to +85°C, VDD = 3.5 to 5.5 V)
tRDWT2 2tCY – 60 ns
(b) When MCS = 0 or PCC2 to PCC0 ≠ 000B (TA = –40 to +85°C, VDD = 2.7 to 5.5 V)
(c) When MCS = 0 or PCC2 to PCC0 ≠ 000B (TA = –40 to +85°C, VDD = 1.8 to 2.7 V)
(i) 3-wire serial I/O mode (SCK0 ... Internal clock output)
Note C is the load capacitance of the SCK0 and SO0 output lines.
(ii) 3-wire serial I/O mode (SCK0 ... External clock input)
(iii) 2-wire serial I/O mode (SCK0 ... Internal clock output)
Note R and C are the load resistance and load capacitance of the SCK0, SB0, and SB1 output lines.
(iv) 2-wire serial I/O mode (SCK0 ... Internal clock input)
Delay time from SCK0↓ tKSO4 R = 1 kΩ, 4.5 V ≤ VDD ≤ 5.5 V 0 300 ns
to SB0, SB1 output C = 100 pFNote 2.0 V ≤ VDD < 4.5 V 0 500 ns
SCK0 rise/fall time tR4, tF4 When using external device 160 ns
expansion function
Note R and C are the load resistance and load capacitance of the SB0 and SB1 output lines.
(v) SBI mode (SCK0 ... Internal clock output) (µPD78005x only)
Note R and C are the load resistance and load capacitance of the SCK0, SB0, and SB1 output lines.
(vi) SBI mode (SCK0 ... External clock input) (µPD78005x only)
Note R and C are the load resistance and load capacitance of the SB0 and SB1 output lines.
(vii) I2C bus mode (SCL ... Internal clock output) (µPD78005xY only)
Note R and C are the load resistance and load capacitance of the SCL, SDA0, and SDA1 output lines.
(viii) I2C bus mode (SCL ... External clock input) (µPD78005xY only)
Note R and C are the load resistance and load capacitance of the SDA0 and SDA1 output lines.
(i) 3-wire serial I/O mode (SCK1 ... Internal clock output)
Note C is the load capacitance of the SCK1 and SO1 output lines.
(ii) 3-wire serial I/O mode (SCK1 ... External clock input)
(iii) 3-wire serial I/O mode with automatic transmit/receive function (SCK1 ... Internal clock output)
Note C is the load capacitance of the SCK1 and SO1 output lines.
(iv) 3-wire serial I/O mode with automatic transmit/receive function (SCK1...External clock input)
Clock Timing
1/fX
tXL tXH
VIH4 (MIN.)
X1 input
VIL4 (MAX.)
1/fXT
tXTL tXTH
VIH5 (MIN.)
XT1 input
VIL5 (MAX.)
TI Timing
TI00, TI01
1/fTI1
tTIL1 tTIH1
TI1, TI2
tINTL tINTH
INTP0 to INTP5,
P40 to P47
tRSL
RESET
Read/Write Operation
tADD1
Lower Hi-Z
AD0 to AD7 8-bit Operation
address code
tADS tRDD1 tRDADH
tADH
tASTH
tRDAST
ASTB
RD
tADD1
Lower Hi-Z Operation
AD0 to AD7 8-bit
address code
tADS tRDD1 tRDADH
tADH
tASTH
tRDAST
ASTB
RD
WAIT
tWTRD
tRDWT1 tWTL
tADD2
Lower Hi-Z Hi-Z Hi-Z
AD0 to AD7 8-bit Read data Write data
address
tADS tRDD2
tADH tRDH
tASTH
ASTB
RD
tASTRD tWDH
tRDL2 tRDWD tWDS
tWRADH
tWRWD
WR
tASTWR tWRL
tADD2
Lower Hi-Z Hi-Z Hi-Z
AD0 to AD7 8-bit Read data Write data
address
tADS tRDD2
tADH tRDH
tASTH
ASTB
tASTRD
RD
tWDH
tRDL2 tRDWD tWDS
tWDWR
WR
WAIT
tRDWT2 tWTRD
tWTL tWRWT tWTL tWTWR
tKCYm
tKLm tKHm
tRn tFn
SCK0 to SCK2
tSIKm tKSIm
tKSOm
m = 1, 2, 9, 10, 13, 14
n = 2, 10, 14
tKCY3, 4
tKL3, 4 tKH3, 4
tR4 tF4
SCK0
tSIK3, 4 tKSI3, 4
tKSO3, 4
SB0, SB1
tKCY5, 6
tKL5, 6 tKH5, 6
tR6 tF6
SCK0
SB0, SB1
tKSO5, 6
tKCY5,6
tKL5, 6 tKH5, 6
tF6
tR6
SCK0
tSIK5, 6
tKSB tSBK tKSI5, 6
SB0, SB1
tKSO5, 6
tF8 tR8
tKCYm
SCL
tKSB
tSIKm tKSB
tKLm tKHm
tKSIm
tKSOm tSBK
SDA0,
SDA1
tSBH tSIKm
m = 7, 8
SO1 D2 D1 D0 D7
SI1 D2 D1 D0 D7
tSIK11, 12 tKSI11, 12
tKH11, 12
tKSO11, 12 tF12
SCK1
tR12
tSBD tSBW
tKL11, 12
tKCY11, 12
STB
3-wire serial I/O mode with automatic transmit/receive function (busy processing):
BUSY
(Active high)
Note The signal is not actually driven low here; it is shown as such to indicate the timing.
t KCY15
t KL15 t KH15
tR15 tF15
ASCK
Notes 1. Excludes quantization error (±1/2 LSB). This value is indicated as a ratio to the full-scale value (%FSR).
2. The current flowing to the AVREF0 pin when bit 7 (CS) of the A/D converter mode register (ADM) is 1.
3. The current flowing to the AVREF0 pin when bit 7 (CS) of the A/D converter mode register (ADM) is 0.
Notes 1. Excludes quantization error (±1/2 LSB). This value is indicated as a ratio to the full-scale value (%FSR).
2. The current flowing to the AVREF0 pin when bit 7 (CS) of the A/D converter mode register (ADM) is 1.
3. The current flowing to the AVREF0 pin when bit 7 (CS) of the A/D converter mode register (ADM) is 0.
Caution The operating voltage range of the A/D converter and D/A converter of the µPD780058 is VDD = 2.7 to
5.5 V.
Notes 1. R and C are the D/A converter output pin load resistance and load capacitance, respectively.
2. Value for one D/A converter channel
Notes 1. R and C are the D/A converter output pin load resistance and load capacitance, respectively.
2. Value for one D/A converter channel
Caution The operating voltage range of the A/D converter and D/A converter of the µPD780058 is VDD = 2.7 to
5.5 V.
Data Memory STOP Mode Low Supply Voltage Data Retention Characteristics (TA = –40 to +85°C)
Note Selection of 212/fXX and 214/fXX to 217/fXX is possible with bits 0 to 2 (OSTS0 to OSTS2) of the oscillation stabilization
time select register (OSTS).
VDD VDDDR
tSREL
STOP instruction execution
RESET
tWAIT
Data Retention Timing (Standby Release Signal: STOP Mode Release by Interrupt Request Signal)
HALT mode
VDD VDDDR
tSREL
STOP instruction execution
tWAIT
Analog input voltage V AN P10 to P17 Analog input pin AVSS – 0.3 to AVREF0 + 0.3 V
Output IOH Per pin –10 mA
current, high
Total for P01 to P05, P30 to P37, P56, P57, P60 to P67, –15 mA
P120 to P127
Total for P10 to P17, P20 to P27, P40 to P47, –15 mA
P50 to P55, P70 to P72, P130, P131
Output IOLNote 2 Per pin for other than P50 to P57, Peak value 20 mA
current, low P60 to P63 rms value 10 mA
rms value 70 mA
Total for P56, P57, P60 to P63 Peak value 100 mA
rms value 70 mA
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.
Notes 1. Make sure that the following conditions of the VPP voltage application timing are satisfied when the flash
memory is written.
- When supply voltage rises
VPP must exceed VDD 10 µs or more after VDD has reached the lower-limit value (2.7 V) of the operating
voltage range (see a in the figure below).
- When supply voltage drops
VDD must be lowered 10 µs or more after VPP falls below the lower-limit value (2.7 V) of the operating
voltage range of VDD (see b in the figure below).
2.7 V
VDD
0V
a b
VPP
2.7 V
0V
2. The rms value should be calculated as follows: [rms value] = [Peak value] × √Duty
Main System Clock Oscillator Characteristics (TA = –40 to +85°C, VDD = 2.7 to 5.5 V)
Notes 1. Indicates only oscillator characteristics. See AC Characteristics for instruction execution time.
2. Time required to stabilize oscillation after reset or STOP mode release.
Cautions 1. When using the main system 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.
2. When the main system clock is stopped and the system is operating on the subsystem clock,
wait until the oscillation stabilization time has been secured by the program before switching
back to the main system clock.
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.
Subsystem Clock Oscillator Characteristics (TA = –40 to +85°C, VDD = 2.7 to 5.5 V)
Notes 1. Indicates only oscillator characteristics. See AC Characteristics for instruction execution time.
2. Time required to stabilize oscillation after VDD reaches oscillation voltage range MIN.
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.
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.
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port pins.
Input voltage, VIH1 P10 to P17, P21, P23, P30 to P32, VDD = 2.7 to 5.5 V 0.7 VDD VDD V
high P35 to P37, P40 to P47,
P50 to P57, P64-P67, P71,
P120 to P127, P130, P131
VIH2 P00 to P05, P20, P22, P24 to P27, VDD = 2.7 to 5.5 V 0.8 VDD VDD V
P33, P34, P70, P72, RESET
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port pins.
Note A low-level input leakage current of –200 µA (MAX.) flows only for 1.5 clocks (without wait) after a read
instruction has been executed to port 6 (P6) or port mode register 6 (PM6). At times other than this 1.5-clock
interval, a –3 µA (MAX.) current flows.
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port pins.
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port pins.
Notes 1. High-speed mode operation (when the processor clock control register (PCC) is cleared to 00H).
2. Low-speed mode operation (when PCC is set to 04H).
3. Operation with main system clock fXX = fX/2 (when the oscillation mode select register (OSMS) is cleared
to 00H)
4. Operation with main system clock fXX = fX (when OSMS is set to 01H)
5. Refers to the current flowing to the VDD0 and VDD1 pins. The current flowing to the A/D converter, D/A
converter, and on-chip pull-up resistor is not included.
6. When the main system clock operation is stopped.
AC Characteristics
Notes 1. Operation with main system clock fXX = fX/2 (when the oscillation mode select register (OSMS) is cleared
to 00H)
2. Operation with main system clock fXX = fX (when OSMS is set to 01H)
3. Value when external clock is used. When a crystal resonator is used, it is 114 µs (MIN.)
4. Selection of fsam = fXX/2N, fXX/32, fXX/64, and fXX/128 is possible with bits 0 and 1 (SCS0, SCS1) of the sampling
clock select register (SCS) (when N = 0 to 4).
TCY vs. VDD (@fXX = fX/2 main system clock operation) TCY vs. VDD (@fXX = fX main system clock operation)
60 60
10 10
Guaranteed
Cycle time TCY [µs]
Operation
2.0 2.0
1.0 1.0
0.5 0.5
0.4 0.4
0 0
1 2 3 4 5 6 1 2 3 4 5 6
Supply voltage VDD [V] Supply voltage VDD [V]
(a) When MCS = 1, PCC2 to PCC0 = 000B (TA = –40 to +85°C, VDD = 3.5 to 5.5 V)
tRDWT2 2tCY – 60 ns
(b) When MCS = 0 or PCC2 to PCC0 ≠ 000B (TA = –40 to +85°C, VDD = 2.7 to 5.5 V)
(i) 3-wire serial I/O mode (SCK0 ... Internal clock output)
Note C is the load capacitance of the SCK0 and SO0 output lines.
(ii) 3-wire serial I/O mode (SCK0 ... External clock input)
SCK0 rise/fall time tR2, tF2 When using external device 160 ns
expansion function
When not using external device 1,000 ns
expansion function
(iii) 2-wire serial I/O mode (SCK0 ... Internal clock output)
SCK0 high-level width tKH3 C = 100 pFNote VDD = 2.7 to 5.5 V tKCY3/2 – 160 ns
Note R and C are the load resistance and load capacitance of the SCK0, SB0, and SB1 output lines.
(iv) 2-wire serial I/O mode (SCK0 ... External clock input)
SCK0 rise/fall time tR4, tF4 When using external device 160 ns
expansion function
Note R and C are the load resistance and load capacitance of the SB0 and SB1 output lines.
(v) SBI mode (SCK0 ... Internal clock output) (µPD78F0058 only)
Note R and C are the load resistance and load capacitance of the SCK0, SB0, and SB1 output lines.
(vi) SBI mode (SCK0 ... External clock input) (µPD78F0058 only)
Note R and C are the load resistance and load capacitance of the SB0 and SB1 output lines.
(vii) I2C bus mode (SCL ... Internal clock output) (µPD78F0058Y only)
Note R and C are the load resistance and load capacitance of the SCL, SDA0, and SDA1 output lines.
(viii) I2C bus mode (SCL ... External clock input) (µPD78F0058Y only)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
SCL cycle time tKCY8 1 µs
SCL high-level width tKH8 400 ns
SDA0, SDA1 setup time tSIK8 200 ns
(to SCL↑)
Note R and C are the load resistance and load capacitance of the SDA0 and SDA1 output lines.
(i) 3-wire serial I/O mode (SCK1 ... Internal clock output)
Note C is the load capacitance of the SCK1 and SO1 output lines.
(ii) 3-wire serial I/O mode (SCK1 ... External clock input)
(iii) 3-wire serial I/O mode with automatic transmit/receive function (SCK1 ... Internal clock output)
Note C is the load capacitance of the SCK1 and SO1 output lines.
(iv) 3-wire serial I/O mode with automatic transmit/receive function (SCK1 ... External clock input)
(i) 3-wire serial I/O mode (SCK2 ... Internal clock output)
(ii) 3-wire serial I/O mode (SCK2 ... External clock input)
Clock Timing
1/fX
tXL tXH
VIH4 (MIN.)
X1 input
VIL4 (MAX.)
1/fXT
tXTL tXTH
VIH5 (MIN.)
XT1 input
VIL5 (MAX.)
TI Timing
TI00, TI01
1/fTI1
tTIL1 tTIH1
TI1, TI2
tINTL tINTH
INTP0 to INTP5,
P40 to P47
tRSL
RESET
Read/Write Operation
tADD1
Lower Hi-Z
AD0 to AD7 8-bit Operation
address code
tADS tRDD1 tRDADH
tADH
tASTH
tRDAST
ASTB
RD
tADD1
Lower Hi-Z Operation
AD0 to AD7 8-bit
address code
tADS tRDD1 tRDADH
tADH
tASTH
tRDAST
ASTB
RD
WAIT
tWTRD
tRDWT1 tWTL
tADD2
Lower Hi-Z Hi-Z Hi-Z
AD0 to AD7 8-bit Read data Write data
address
tADS tRDD2
tADH tRDH
tASTH
ASTB
RD
tASTRD tWDH
tRDL2 tRDWD tWDS
tWRADH
tWRWD
WR
tASTWR tWRL
tADD2
Lower Hi-Z Hi-Z Hi-Z
AD0 to AD7 8-bit Read data Write data
address
tADS tRDD2
tADH tRDH
tASTH
ASTB
tASTRD
RD
tWDH
tRDL2 tRDWD tWDS
tWRWD
WR
WAIT
tRDWT2 tWTRD
tWTL tWRWT tWTL tWTWR
tKCYm
tKLm tKHm
tRn tFn
SCK0 to SCK2
tSIKm tKSIm
tKSOm
m = 1, 2, 9, 10, 13, 14
n = 2, 10, 14
tKCY3, 4
tKL3, 4 tKH3, 4
tR4 tF4
SCK0
tSIK3, 4 tKSI3, 4
tKSO3, 4
SB0, SB1
tKL5, 6 tKH5, 6
tR6 tF6
SCK0
SB0, SB1
tKSO5, 6
tKCY5,6
tKL5, 6 tKH5, 6
tF6
tR6
SCK0
tSIK5, 6
tKSB tSBK tKSI5, 6
SB0, SB1
tKSO5, 6
SCL
tKSB
tSIKm tKSB
tKLm tKHm
tKSIm
tKSOm tSBK
SDA0,
SDA1
tSBH tSIKm
m = 7, 8
SO1 D2 D1 D0 D7
SI1 D2 D1 D0 D7
tSIK11, 12 tKSI11, 12
tKH11, 12
tKSO11, 12 tF12
SCK1
tR12
tSBD tSBW
tKL11, 12
tKCY11, 12
STB
3-wire serial I/O mode with automatic transmit/receive function (busy processing):
BUSY
(Active high)
Note The signal is not actually driven low here; it is shown as such to indicate the timing.
t KCY15
t KL15 t KH15
tR15 tF15
ASCK
A/D Converter Characteristics (TA = –40 to +85°C, VDD = 2.7 to 5.5 V, AVSS = VSS = 0 V)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
Resolution 8 8 8 bit
Overall errorNote 1 2.7 V ≤ AVREF0 < 4.5 V ±1.0 %FSR
4.5 V ≤ AVREF0 ≤ 5.5 V ±0.6 %FSR
Conversion time TCONV 2.7 V ≤ AVREF0 ≤ 5.5 V 16 100 µs
Analog input voltage VIAN AVSS AVREF0 V
Reference voltage AVREF0 2.7 VDD V
AVREF0 current IREF0 When A/D converter is operatingNote 2 500 1,500 µA
When A/D converter is not operatingNote 3 0 3 µA
Notes 1. Excludes quantization error (±1/2 LSB). This value is indicated as a ratio to the full-scale value (%FSR).
2. The current flowing to the AVREF0 pin when bit 7 (CS) of the A/D converter mode register (ADM) is 1.
3. The current flowing to the AVREF0 pin when bit 7 (CS) of the A/D converter mode register (ADM) is 0.
D/A Converter Characteristics (TA = –40 to +85°C, VDD = 2.7 to 5.5 V, AVSS = VSS = 0 V)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
Resolution 8 bit
Overall error R=2 MΩNote 1 ±1.2 %
R = 4 MΩNote 1 ±0.8 %
R = 10 MΩNote 1 ±0.6 %
Note 1
Settling time C = 30 pF 15 µs
Output resistance RO Note 2 8 kΩ
Analog reference voltage AVREF1 1.8 VDD V
AVREF1 current IREF1 Note 2 2.5 mA
Resistance between AVREF1 and AVSS RAIREF1 DACS0, DACS1 = 55HNote 2 4 8 kΩ
Notes 1. R and C are the D/A converter output pin load resistance and load capacitance, respectively.
2. Value for one D/A converter channel
Data Memory STOP Mode Low Supply Voltage Data Retention Characteristics (TA = –40 to +85°C)
Note Selection of 212/fXX and 214/fXX to 217/fXX is possible with bits 0 to 2 (OSTS0 to OSTS2) of the oscillation stabilization
time select register (OSTS).
VDD VDDDR
tSREL
STOP instruction execution
RESET
tWAIT
Data Retention Timing (Standby Release Signal: STOP Mode Release by Interrupt Request Signal)
HALT mode
VDD VDDDR
tSREL
STOP instruction execution
tWAIT
Write current (VDD pin)Note 1 IDDW When VPP = VPP1 5.0 MHz crystal oscillation 15.5 mA
operation mode
(fXX = 2.5 MHz)Note 2
Write current (VPP pin)Note 1 IPPW When VPP = VPP1 5.0 MHz crystal oscillation 19.5 mA
operation mode
(fXX = 2.5 MHz)Note 2
Delete current (VDD pin)Note 1 IDDE When VPP = VPP1 5.0 MHz crystal oscillation 15.5 mA
operation mode
(fXX = 2.5 MHz)Note 2
Notes 1. AVREF current and Port current (current flowing to internal pull-up resistor) are not included.
2. When main system clock is operating at fXX = fXX/2 (when oscillation mode select register (OSMS) is
cleared to 00H).
3. When main system clock is operating at fXX = fXX (when OSMS is set to 01H).
VDD
VDD
0V tDRPSR tRFCF tCH
VPPH
VPP VPP
VPPL tCL
tPSRON tPSRRF
tCOUNT
VDD
RESET (input)
0V
Caution The product that can operate on VDD = 2.2 V has “0232” or later as the first 4 digits of the lot number
inscribed on the package.
Note Make sure that the following conditions of the VPP voltage application timing are satisfied when the flash
memory is written.
• When supply voltage rises
VPP must exceed VDD 10 µs or more after VDD has reached the lower-limit value (2.2 V) of the operating voltage
range (see a in the figure below).
• When supply voltage drops
VDD must be lowered 10 µs or more after VPP falls below the lower-limit value (2.2 V) of the operating voltage
range of VDD (see b in the figure below).
2.2 V
VDD
0V
a b
VPP
2.2 V
0V
Output IOLNote Per pin for other than P50 to P57, Peak value 20 mA
current, low P60 to P63 rms value 10 mA
Per pin for P50 to P57, P60 to P63 Peak value 30 mA
rms value 15 mA
Total for P50 to P55 Peak value 100 mA
rms value 70 mA
Note The rms value should be calculated as follows: [rms value] = [Peak value] × √Duty
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.
Main System Clock Oscillator Characteristics (TA = –40 to +85°C, VDD = 2.2 to 5.5 V)
Notes 1. Indicates only oscillator characteristics. See AC Characteristics for instruction execution time.
2. Time required to stabilize oscillation after reset or STOP mode release.
Cautions 1. When using the main system 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.
2. When the main system clock is stopped and the system is operating on the subsystem clock,
wait until the oscillation stabilization time has been secured by the program before switching
back to the main system clock.
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.
Subsystem Clock Oscillator Characteristics (TA = –40 to +85°C, VDD = 2.2 to 5.5 V)
Notes 1. Indicates only oscillator characteristics. See AC Characteristics for instruction execution time.
2. Time required to stabilize oscillation after VDD reaches oscillation voltage range MIN.
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.
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.
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port pins.
Input voltage, VIH1 P10 to P17, P21, P23, P30 to P32, VDD = 2.7 to 5.5 V 0.7 VDD VDD V
high P35 to P37, P40 to P47, VDD = 2.2 to 5.5 V 0.8 VDD VDD V
P50 to P57, P64 to P67, P71,
P120 to P127, P130, P131
VIH2 P00 to P05, P20, P22, P24 to P27, VDD = 2.7 to 5.5 V 0.8 VDD VDD V
P33, P34, P70, P72, RESET VDD = 2.2 to 5.5 V 0.85 VDD VDD V
VIH3 P60 to P63 VDD = 2.7 to 5.5 V 0.7 VDD 15 V
(N-ch open drain) VDD = 2.2 to 5.5 V 0.8 VDD 15 V
VIH4 X1, X2 VDD = 2.7 to 5.5 V VDD – 0.5 VDD V
VDD = 2.2 to 5.5 V VDD – 0.2 VDD V
VIH5 XT1/P07, XT2 4.5 V ≤ VDD ≤ 5.5 V 0.8 VDD VDD V
2.7 V ≤ VDD < 4.5 V 0.9 VDD VDD V
2.2 V ≤ VDD < 2.7 V 0.9 VDD VDD V
Input voltage, VIL1 P10 to P17, P21, P23, P30 to P32, VDD = 2.7 to 5.5 V 0 0.3 VDD V
low P35 to P37, P40 to P47, VDD = 2.2 to 5.5 V 0 0.2 VDD V
P50 to P57, P64 to P67, P71,
P120 to P127, P130, P131
VIL2 P00 to P05, P20, P22, P24 to P27, VDD = 2.7 to 5.5 V 0 0.2 VDD V
P33, P34, P70, P72, RESET VDD = 2.2 to 5.5 V 0 0.15 VDD V
VIL3 P60 to P63 4.5 V ≤ VDD ≤ 5.5 V 0 0.3 VDD V
2.7 V ≤ VDD < 4.5 V 0 0.2 VDD V
2.2 V ≤ VDD < 2.7 V 0 0.1 VDD V
VIL4 X1, X2 VDD = 2.7 to 5.5 V 0 0.4 V
VDD = 2.2 to 5.5 V 0 0.2 V
VIL5 XT1/P07, XT2 4.5 V ≤ VDD ≤ 5.5 V 0 0.2 VDD V
2.7 V ≤ VDD < 4.5 V 0 0.1 VDD V
2.2 V ≤ VDD < 2.7 V 0 0.1 VDD V
Output voltage, VOH VDD = 4.5 to 5.5 V, IOH = –1 mA VDD – 1.0 V
high VDD = 2.2 to 5.5 V, IOH = –100 µA VDD – 0.5 V
Output voltage, VOL1 P50 to P57, P60 to P63 VDD = 4.5 to 5.5 V, 0.4 2.0 V
low IOL = 15 mA
P01 to P05, P10 to P17, VDD = 4.5 to 5.5 V, 0.4 V
P20 to P27, P30 to P37, IOL = 1.6 mA
P40 to P47, P64 to P67,
P70 to P72, P120-P127, P130,
P131
VOL2 SB0, SB1, SCK0 VDD = 4.5 to 5.5 V, 0.2VDD V
open drain,
pulled-up (R = 1 kΩ)
VOL3 IOL = 400 µA 0.5 V
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port pins.
Note A low-level input leakage current of –200 µA (MAX.) flows only for 1.5 clocks (without wait) after a read
instruction has been executed to port 6 (P6) or port mode register 6 (PM6). At times other than this 1.5-clock
interval, a –3 µA (MAX.) current flows.
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port pins.
Remark Unless specified otherwise, the characteristics of alternate-function pins are the same as those of port pins.
Notes 1. High-speed mode operation (when the processor clock control register (PCC) is cleared to 00H).
2. Low-speed mode operation (when PCC is set to 04H).
3. Operation with main system clock fXX = fX/2 (when the oscillation mode select register (OSMS) is cleared
to 00H)
4. Operation with main system clock fXX = fX (when OSMS is set to 01H)
5. Refers to the current flowing to the VDD0 and VDD1 pins. The current flowing to the A/D converter, D/A
converter, and on-chip pull-up resistor is not included.
6. When the main system clock operation is stopped.
AC Characteristics
Notes 1. Operation with main system clock fXX = fX/2 (when the oscillation mode select register (OSMS) is cleared
to 00H)
2. Operation with main system clock fXX = fX (when OSMS is set to 01H)
3. Value when external clock is used. When a crystal resonator is used, it is 114 µs (MIN.)
4. Selection of fsam = fXX/2N, fXX/32, fXX/64, and fXX/128 is possible with bits 0 and 1 (SCS0, SCS1) of the sampling
clock select register (SCS) (when N = 0 to 4).
TCY vs. VDD (@fXX = fX/2 main system clock operation) TCY vs. VDD (@fXX = fX main system clock operation)
60 60
10 10
Guaranteed
Operation
operation
guaranteed
range
range
2.0 2.0
1.0 1.0
0.5 0.5
0.4 0.4
0 0
1 2 3 4 5 6 1 2 3 4 5 6
Supply voltage VDD [V] Supply voltage VDD [V]
(a) When MCS = 1, PCC2 to PCC0 = 000B (TA = –40 to +85°C, VDD = 3.5 to 5.5 V)
tRDWT2 2tCY – 60 ns
(b) When MCS = 0 or PCC2 to PCC0 ≠ 000B (TA = –40 to +85°C, VDD = 2.7 to 5.5 V)
(c) When MCS = 0 or PCC2 to PCC0 ≠ 000B (TA = –40 to +85°C, VDD = 2.2 to 5.5 V)
(i) 3-wire serial I/O mode (SCK0 ... Internal clock output)
Note C is the load capacitance of the SCK0 and SO0 output lines.
(ii) 3-wire serial I/O mode (SCK0 ... External clock input)
SCK0 rise/fall time tR2, tF2 When using external device 160 ns
expansion function
When not using external device 1,000 ns
expansion function
(iii) 2-wire serial I/O mode (SCK0 ... Internal clock output)
Note R and C are the load resistance and load capacitance of the SCK0, SB0, and SB1 output lines.
(iv) 2-wire serial I/O mode (SCK0 ... External clock input)
SCK0 rise/fall time tR4, tF4 When using external device 160 ns
expansion function
Note R and C are the load resistance and load capacitance of the SB0 and SB1 output lines.
(v) SBI mode (SCK0 ... Internal clock output) (µPD78F0058, 78F0058Y only)
Note R and C are the load resistance and load capacitance of the SCK0, SB0, and SB1 output lines.
(vi) SBI mode (SCK0 ... External clock input) (µPD78F0058, 78F0058Y only)
Note R and C are the load resistance and load capacitance of the SB0 and SB1 output lines.
(vii) I2C bus mode (SCL ... Internal clock output) (µPD78F0058Y only)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
SCL cycle time tKCY7 R = 1 kΩ, 2.7 V ≤ VDD ≤ 5.5 V 10 µs
C = 100 pFNote 2.2 V ≤ VDD < 2.7 V 20 ns
SCL high-level width tKH7 VDD = 2.7 to 5.5 V tKCY7 – 160 ns
VDD = 2.2 to 5.5 V tKCY7 – 190 ns
SCL low-level width tKL7 VDD = 4.5 to 5.5 V tKCY7 – 50 ns
VDD = 2.2 to 5.5 V tKCY7 – 100 ns
SDA0, SDA1 setup time tSIK7 2.7 V ≤ VDD ≤ 5.5 V 200 ns
(to SCL↑) 2.2 V ≤ VDD < 2.7 V 300 ns
SDA0, SDA1 hold time tKSI7 0 ns
(from SCL↓)
SDA0, SDA1 output delay tKSO7 4.5 V ≤ VDD ≤ 5.5 V 0 300 ns
time from SCL↓ 2.2 V ≤ VDD < 4.5 V 0 500 ns
SDA0, SDA1↓ from SCL↑ tKSB 200 ns
or SDA0, SDA1↑ from SCL↑
SCL↓ from SDA0, SDA1↓ tSBK 400 ns
SDA0, SDA1 high-level width tSBH 500 ns
Note R and C are the load resistance and load capacitance of the SCL, SDA0, and SDA1 output lines.
(viii) I2C bus mode (SCL ... External clock input) (µPD78F0058Y only)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
SCL cycle time tKCY8 1 µs
SCL high-level width tKH8 400 ns
SDA0, SDA1 setup time tSIK8 200 ns
(to SCL↑)
Note R and C are the load resistance and load capacitance of the SDA0 and SDA1 output lines.
(i) 3-wire serial I/O mode (SCK1 ... Internal clock output)
Note C is the load capacitance of the SCK1 and SO1 output lines.
(ii) 3-wire serial I/O mode (SCK1 ... External clock input)
(iii) 3-wire serial I/O mode with automatic transmit/receive function (SCK1 ... Internal clock output)
Note C is the load capacitance of the SCK1 and SO1 output lines.
(iv) 3-wire serial I/O mode with automatic transmit/receive function (SCK1 ... External clock input)
(i) 3-wire serial I/O mode (SCK2 ... Internal clock output)
(ii) 3-wire serial I/O mode (SCK2 ... External clock input)
Clock Timing
1/fX
tXL tXH
VIH4 (MIN.)
X1 input
VIL4 (MAX.)
1/fXT
tXTL tXTH
VIH5 (MIN.)
XT1 input
VIL5 (MAX.)
TI Timing
TI00, TI01
1/fTI1
tTIL1 tTIH1
TI1, TI2
tINTL tINTH
INTP0 to INTP5,
P40 to P47
tRSL
RESET
Read/Write Operation
tADD1
Lower Hi-Z
AD0 to AD7 8-bit Operation
address code
tADS tRDD1 tRDADH
tADH
tASTH
tRDAST
ASTB
RD
tADD1
Lower Hi-Z Operation
AD0 to AD7 8-bit
address code
tADS tRDD1 tRDADH
tADH
tASTH
tRDAST
ASTB
RD
WAIT
tWTRD
tRDWT1 tWTL
tADD2
Lower Hi-Z Hi-Z Hi-Z
AD0 to AD7 8-bit Read data Write data
address
tADS tRDD2
tADH tRDH
tASTH
ASTB
RD
tASTRD tWDH
tRDL2 tRDWD tWDS
tWRADH
tWRWD
WR
tASTWR tWRL
tADD2
Lower Hi-Z Hi-Z Hi-Z
AD0 to AD7 8-bit Read data Write data
address
tADS tRDD2
tADH tRDH
tASTH
ASTB
tASTRD
RD
tWDH
tRDL2 tRDWD tWDS
tWRWD
WR
WAIT
tRDWT2 tWTRD
tWTL tWRWT tWTL tWTWR
tKCYm
tKLm tKHm
tRn tFn
SCK0 to SCK2
tSIKm tKSIm
tKSOm
m = 1, 2, 9, 10, 13, 14
n = 2, 10, 14
tKCY3, 4
tKL3, 4 tKH3, 4
tR4 tF4
SCK0
tSIK3, 4 tKSI3, 4
tKSO3, 4
SB0, SB1
tKL5, 6 tKH5, 6
tR6 tF6
SCK0
SB0, SB1
tKSO5, 6
tKCY5,6
tKL5, 6 tKH5, 6
tF6
tR6
SCK0
tSIK5, 6
tKSB tSBK tKSI5, 6
SB0, SB1
tKSO5, 6
SCL
tKSB
tSIKm tKSB
tKLm tKHm
tKSIm
tKSOm tSBK
SDA0,
SDA1
tSBH tSIKm
m = 7, 8
SO1 D2 D1 D0 D7
SI1 D2 D1 D0 D7
tSIK11, 12 tKSI11, 12
tKH11, 12
tKSO11, 12 tF12
SCK1
tR12
tSBD tSBW
tKL11, 12
tKCY11, 12
STB
3-wire serial I/O mode with automatic transmit/receive function (busy processing):
BUSY
(Active high)
Note The signal is not actually driven low here; it is shown as such to indicate the timing.
t KCY15
t KL15 t KH15
tR15 tF15
ASCK
A/D Converter Characteristics (TA = –40 to +85°C, VDD = 2.2 to 5.5 V, AVSS = VSS = 0 V)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
Resolution 8 8 8 bit
Overall errorNote 1 2.7 V ≤ AVREF0 ≤ 5.5 V ±0.6 %FSR
2.2 V ≤ AVREF0 < 2.7 V ±1.4 %FSR
Conversion time TCONV1 2.2 V ≤ AVREF0 < 2.7 V 40 100 µs
TCONV2 2.7 V ≤ AVREF0 < 5.5 V 16 100 µs
Analog input voltage VIAN AVSS AVREF0 V
Reference voltage AVREF0 2.2 VDD V
AVREF0 current IREF0 When A/D converter is operatingNote 2 500 1,500 µA
When A/D converter is not operatingNote 3 0 3.0 µA
Notes 1. Excludes quantization error (±1/2 LSB). This value is indicated as a ratio to the full-scale value (%FSR).
2. The current flowing to the AVREF0 pin when bit 7 (CS) of the A/D converter mode register (ADM) is 1.
3. The current flowing to the AVREF0 pin when bit 7 (CS) of the A/D converter mode register (ADM) is 0.
D/A Converter Characteristics (TA = –40 to +85°C, VDD = 2.2 to 5.5 V, AVSS = VSS = 0 V)
Parameter Symbol Conditions MIN. TYP. MAX. Unit
Resolution 8 bit
Overall error R=2 MΩNote 1 ±1.2 %
R = 4 MΩNote 1 ±0.8 %
R = 10 MΩNote 1 ±0.6 %
Overall errorNote 1 C= 30 pFNote 1 AVREF1 = 2.2 to 2.7 V 10 µs
AVREF1 = 2.2 to 5.5 V 15 µs
Output resistance RO Note 2 8 kΩ
Analog reference voltage AVREF1 1.8 VDD V
AVREF1 current IREF1 Note 2 2.5 mA
Resistance between AVREF1 and AVSS RAIREF1 DACS0, DACS1 = 55HNote 2 4 8 kΩ
Notes 1. R and C are the D/A converter output pin load resistance and load capacitance, respectively.
2. Value for one D/A converter channel
Data Memory STOP Mode Low Supply Voltage Data Retention Characteristics (TA = –40 to +85°C)
Note Selection of 212/fXX and 214/fXX to 217/fXX is possible with bits 0 to 2 (OSTS0 to OSTS2) of the oscillation stabilization
time select register (OSTS).
VDD VDDDR
tSREL
STOP instruction execution
RESET
tWAIT
Data Retention Timing (Standby Release Signal: STOP Mode Release by Interrupt Request Signal)
HALT mode
VDD VDDDR
tSREL
STOP instruction execution
tWAIT
Write current (VDD pin)Note 1 IDDW When VPP = VPP1 5.0 MHz crystal oscillation 15.5 mA
operation mode
(fXX = 2.5 MHz)Note 2
Write current (VPP pin)Note 1 IPPW When VPP = VPP1 5.0 MHz crystal oscillation 19.5 mA
operation mode
(fXX = 2.5 MHz)Note 2
Erase current (VDD pin)Note 1 IDDE When VPP = VPP1 5.0 MHz crystal oscillation 15.5 mA
operation mode
(fXX = 2.5 MHz)Note 2
Notes 1. AVREF current and port current (current flowing to internal pull-up resistors) are not included.
2. When main system clock is operating at fXX = fXX/2 (when oscillation mode select register (OSMS) is cleared
to 00H).
3. When main system clock is operating at fXX = fXX (when OSMS is set to 01H).
VDD
VDD
0V tDRPSR tRFCF tCH
VPPH
VPP VPP
VPPL tCL
tPSRON tPSRRF
tCOUNT
VDD
RESET (input)
0V
VDD vs IDD (mask ROM version, fX = 5.0 MHz, fXX = 2.5 MHz)
(TA = 25°C)
10
PCC = 00H
PCC = 01H
PCC = 02H
PCC = 03H
PCC = 04H
PCC = 30H
1 HALT (X1 oscillating, XT1 oscillating)
Supply current IDD [mA]
0.1
PCC = B0H
0.01
0.001
0 2 3 4 5 6 7
(TA = 25°C)
10
PCC = 00H
PCC = 01H
PCC = 02H
PCC = 03H
PCC = 04H
PCC = 30H
HALT (X1 oscillating, Approximately the same curve
XT1 oscillating)
1
Supply current IDD [mA]
0.1
PCC = B0H
0.01
0.001
0 2 3 4 5 6 7
60 41
61 40
C D
R
Q
80 21
1 20
J
G H I M
P
K
S
N S L
NOTE
M
ITEM MILLIMETERS
Each lead centerline is located within 0.13 mm of A 17.20±0.20
its true position (T.P.) at maximum material condition. B 14.00±0.20
C 14.00±0.20
D 17.20±0.20
F 0.825
G 0.825
H 0.32±0.06
I 0.13
J 0.65 (T.P.)
K 1.60±0.20
L 0.80±0.20
M 0.17 +0.03
−0.07
N 0.10
P 1.40±0.10
Q 0.125±0.075
R +7°
3° −3°
S 1.70 MAX.
P80GC-65-8BT-1
A
B
60 41
61 40
C D
Q R
80 21
1 20
F
G J
H I M
P K
S
N S L
M
NOTE ITEM MILLIMETERS
Each lead centerline is located within 0.10 mm of A 14.0±0.2
its true position (T.P.) at maximum material condition. B 12.0±0.2
C 12.0±0.2
D 14.0±0.2
F 1.25
G 1.25
H 0.22±0.05
I 0.10
J 0.5 (T.P.)
K 1.0±0.2
L 0.5±0.2
M 0.145±0.05
N 0.10
P 1.0±0.05
Q 0.1±0.05
R 3° +7°
−3°
S 1.2 MAX.
S80GK-50-9EU-1
The µ PD780058 and 780058Y Subseries should be soldered and mounted under the following recommended
conditions.
For details of the recommended soldering conditions, refer to the document Semiconductor Device
Mounting Technology Manual (C10535E).
For soldering methods and conditions other than those recommended below, contact an NEC Electronics
sales representative.
Caution Do not use different soldering methods together (except for partial heating).
Partial heating Pin temperature: 300°C or less, Time: 3 seconds max. (per pin row) –
Note After opening the dry pack, store it below 25°C and 65% RH for the allowable storage period.
Caution Do not use different soldering methods together (except for partial heating).
Note After opening the dry pack, store it below 25°C and 65% RH for the allowable storage period.
Caution Do not use different soldering methods together (except for partial heating).
Note After opening the dry pack, store it below 25°C and 65% RH for the allowable storage period.
Caution Do not use different soldering methods together (except for partial heating).
Table A-1 shows the major differences between the µPD78054, 78058F, and 780058 Subseries.
Table A-1. Major Differences Between µPD78054, 78058F, and 780058 Subseries (1/2)
Table A-1. Major Differences Between µPD78054, 78058F, and 780058 Subseries (2/2)
The following development tools are available for the development of systems which employ the µPD780058,
780058Y Subseries.
Figure B-1 shows a configuration example of the tools.
• Windows
Unless otherwise specified, “Windows” means the following OSs.
• Windows 3.1
• Windows 95
• Windows 98
• Windows 2000
• Windows NTTM Ver. 4.0
Software package
• Software package
Control software
• Project Manager
(Windows only)Note 2 Embedded software
• Real-time OS
Interface adapter,
PC card interface, etc.
Emulation board
Flash programmer
Performance board
Flash memory
Emulation probe
Conversion socket or
conversion adapter
Target system
Notes 1. The C library source file is not included in the software package.
2. The Project Manager is included in the assembler package.
The Project Manager is only used for Windows.
SP78K0 This package contains various software tools for 78K/0 Series development.
Software package The following tools are included.
RA78K0, CC78K0, ID78K0-NS, SM78K0, and various device files
µS××××SP78K0
RA78K0 This assembler converts programs written in mnemonics into object codes executable
Assembler package with a microcontroller.
Further, this assembler is provided with functions capable of automatically creating
symbol tables and branch instruction optimization.
This assembler should be used in combination with a device file (DF780058) (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) in Windows.
Notes 1. The DF780058 can be used in common with the RA78K0, CC78K0, SM78K0, ID78K0-NS, ID78K0, and
RX78K0.
2. CC78K0-L is not included in the software package (SP78K0).
Remark ×××× in the part number differs depending on the host machine and OS used.
µS××××RA78K0
µS××××CC78K0
µS××××DF780058
µS××××CC78K0-L
Project Manager This is control software designed to enable efficient user program development in the
Windows environment. All operations used in development of a user program, such as
starting the editor, building, and starting the debugger, can be performed from the Project
Manager.
<Caution>
The Project Manager is included in the assembler package (RA78K0).
It can only be used in Windows.
Flashpro III Flash programmer dedicated to microcontrollers with on-chip flash memory.
(Part number: FL-PR3, PG-FP3)
Flashpro IV
(Part number: FL-PR4, PG-FP4)
Flash programmer
FA-80GC-8BT Flash memory writing adapter used connected to Flashpro III/Flashpro IV.
FA-80GK-9EU • FA-80GC-8BT: 80-pin plastic QFP (GC-8BT type)
Flash memory writing adapter • FA-80GK-9EU: 80-pin plastic TQFP (GK-9EU type)
Remark FL-PR3, FL-PR4, FA-80GC-8EU, and FA-80GK-9EU are products of Naito Densei Machida Mfg. Co.,
Ltd.
Contact: +81-45-475-4191 Naito Densei Machida Mfg. Co., Ltd.
IE-78K0-NS The in-circuit emulator serves to debug hardware and software when developing
In-circuit emulator application systems using a 78K/0 Series product. It corresponds to an integrated
debugger (ID78K0-NS). This emulator should be used in combination with a power
supply unit, emulation probe, and interface adapter which is required to connect this
emulator to the host machine.
IE-78K0-NS-PA This board is used for extending the IE-78K0-NS functions, and is used connected to
Performance board the IE-78K0-NS. With the addition of this board, the addition of a coverage function,
enhancement of tracer and timer functions, and other such debugging function
enhancements are possible.
IE-70000-98-IF-C This adapter is required when using a PC-9800 series computer (except notebook type)
Interface adapter as the IE-78K0-NS host machine (C bus compatible).
IE-70000-CD-IF-A This is PC card and interface cable required when using a notebook-type computer as
PC card interface the IE-78K0-NS host machine (PCMCIA socket compatible).
IE-70000-PC-IF-C This adapter is required when using an IBM PC/AT compatible computer as the IE-78K0-
Interface adapter NS host machine (ISA bus compatible).
IE-70000-PCI-IF-A This adapter is required when using a PC with a PCI bus as the IE-78K0-NS host
Interface adapter machine.
IE-780308-NS-EM1 This board emulates the operations of the peripheral hardware peculiar to a device
Emulation board (common to µPD780308 subseries). It should be used in combination with an in-circuit
emulator.
NP-80GC-TQ This probe is used to connect the in-circuit emulator to the target system and is designed
NP-H80GC-TQ for an 80-pin plastic QFP (GC-8BT type). It should be used in combination with the TGC-
Emulation probe 080SBP.
TGC-080SBP This conversion socket connects the NP-80GC-TQ or NP-H80GC-TQ to the target
Conversion adapter system board designed to mount an 80-pin plastic QFP (GC-8BT type).
(See Figure B-2)
NP-80GC This probe is for an 80-pin plastic QFP (GC-8BT type) and connects an in-circuit
Emulation Probe emulator and the target system.
EV-9200GC-80 This conversion socket connects the board of the target system created to mount an
Conversion Socket 80-pin plastic QFP (GC-8BT type) and NP-80GC.
(See Figure B-2)
NP-80GK This probe is for an 80-pin plastic TQFP (GK-9EU type) and connects an in-circuit
Emulation Probe emulator and the target system.
TGK-080SDW This conversion adapter connects the board of the target system created to mount
Conversion Adapter 80-pin plastic TQFP (GK-9EU type) and TGK-080SDW.
Remarks 1. NP-80GC, NP-80GC-TQ, NP-H80GC-TQ, and NP-80GK are products of Naito Densei Machida Mfg.
Co., Ltd.
Contact: +81-45-475-4191 Naito Densei Machida Mfg. Co., Ltd.
2. TGC-080SBP and TGK-080SDW are products of TOKYO ELETECH CORPORATION.
Inquiry: Daimaru Kogyo, Ltd. Phone: Tokyo +81-3-3820-7112 Electronics Dept.
Osaka +81-6-6244-6672 Electronics 2nd Dept.
IE-78001-R-A This is an in-circuit emulator for debugging the hardware and software when an
In-circuit emulator application system using the 78K/0 Series is developed. It supports an integrated
debugger (ID78K0). This emulator is used with an emulation probe and interface
adapter for connecting a host machine.
IE-70000-98-IF-C This adapter is necessary when a PC-9800 series PC (except notebook type) is
Interface adapter used as the host machine for the IE-78001-R-A (C bus compatible).
IE-70000-PC-IF-C This adapter is necessary when an IBM PC/AT or compatible machine is used as
Interface adapter the host machine for the IE-78001-R-A (ISA bus compatible).
IE-780308-R-EM This board is used with an in-circuit emulator to emulate device-specific peripheral
Emulation board hardware.
EP-78230GC-R This probe is for an 80-pin plastic QFP (GC-8BT type) and connects an in-circuit
Emulation probe emulator and the target system.
EV-9200GC-80 This conversion socket connects the board of the target system created to mount an
Conversion socket 80-pin plastic QFP (GC-8BT type) and EP-78230GC-R.
(See Figure B-2)
EP-78054GK-R This probe is for an 80-pin plastic TQFP (GK-9EU type) and connects an in-circuit
Emulation probe emulator and the target system.
TGK-080SDW This conversion adapter connects the board of the target system created to mount
Conversion adapter an 80-pin plastic TQFP (GK-9EU type) and EP-78054GK-R.
(See Figure B-3)
SM78K0 This is a system simulator for the 78K/0 Series. The SM78K0 is Windows-based
System simulator software.
It is used to perform debugging at the C source level or assembler level while simulating
the operation of the target system on a host machine.
Use of the SM78K0 allows the execution of application logical testing and performance
testing on an independent basis from hardware development, thereby providing higher
development efficiency and software quality.
The SM78K0 should be used in combination with a device file (DF780058) (sold
separately).
ID78K0-NS This debugger supports the in-circuit emulators for the 78K/0 Series. The
Integrated debugger ID78K0-NS is Windows-based software.
(supporting in-circuit emulators It has improved C-compatible debugging functions and can display the results of
IE-78K0-NS and IE-78K0-NS-A) tracing with the source program using an integrating window function that associates
the source program, disassemble display, and memory display with the trace result.
ID78K0
It should be used in combination with a device file (sold separately).
Integrated debugger
(supporting in-circuit emulator Part Number: µS××××ID78K0-NS
IE-78001-R-A) µS××××ID78K0
Remark ×××× in the part number differs depending on the host machine and OS used.
µS××××SM78K0
µS××××ID78K0-NS
µS××××ID78K0
Caution When purchasing the RX78K0, fill in the purchase application form in advance and sign the user
agreement.
Remark ×××× and ∆∆∆∆ in the part number differ depending on the host machine and OS used.
µS××××RX78013-∆∆∆∆
B.8 System-Upgrade Method from Former In-Circuit Emulator for 78K/0 Series to IE-78001-R-A
If you already have a former in-circuit emulator for 78K/0 Series microcontrollers (IE-78000-R or IE-78000-R-A),
that in-circuit emulator can operate as an equivalent to the IE-78001-R-A by replacing its internal break board with
the IE-78001-R-BK.
Table B-1. System-Upgrade Method from Former In-Circuit Emulator for 78K/0 Series to IE-78001-R-A
Note For upgrading a cabinet, send your in-circuit emulator to NEC Electronics.
A M
E B N O
F
R
D
S
J
K
L
EV-9200GC-80
Q
No.1 pin index
P
G
H
I
EV-9200GC-80-G0
ITEM MILLIMETERS INCHES
A 18.0 0.709
B 14.4 0.567
C 14.4 0.567
D 18.0 0.709
E 4-C 2.0 4-C 0.079
F 0.8 0.031
G 6.0 0.236
H 16.0 0.63
I 18.7 0.736
J 6.0 0.236
K 16.0 0.63
L 18.7 0.736
M 8.2 0.323
O 8.0 0.315
N 2.5 0.098
P 2.0 0.079
Q 0.35 0.014
R φ 2.3 φ 0.091
S φ 1.5 φ 0.059
Based on EV-9200GC-80
(2) Pad drawing (in mm)
J
K
D
E
F
H
L
I
C
B
A
EV-9200GC-80-P1E
ITEM MILLIMETERS INCHES
A 19.7 0.776
B 15.0 0.591
C 0.65±0.02 × 19=12.35±0.05 0.026+0.001
–0.002 × 0.748=0.486 –0.002
+0.003
E 15.0 0.591
F 19.7 0.776
G 6.0 ± 0.05 0.236+0.003
–0.002
K φ 2.3 φ 0.091
Caution Dimensions of mount pad for EV-9200 and that for target
device (QFP) may be different in some parts. For the
recommended mount pad dimensions for QFP, refer to
"SEMICONDUCTOR DEVICE MOUNTING TECHNOLOGY
MANUAL" (C10535E).
A
B
C U
T
D V
R
Q
Q
Q c e
M2 screw
H b
G F E P a
S
O d
O
O
N
K W Z
I JJJ L L LM
X
Y
g v
k f u
r
t
j
i s
h q
p
l Protrusion : 4 places
n o
m
ITEM MILLIMETERS INCHES ITEM MILLIMETERS INCHES
A 18.0 0.709 a 0.5x19=9.5±0.10 0.020x0.748=0.374±0.004
B 11.77 0.463 b 0.25 0.010
C 0.5x19=9.5 0.020x0.748=0.374 c φ 5.3 φ 0.209
D 0.5 0.020 d φ 5.3 φ 0.209
E 0.5x19=9.5 0.020x0.748=0.374 e φ 1.3 φ 0.051
F 11.77 0.463 f φ 3.55 φ 0.140
G 18.0 0.709 g φ 0.3 φ 0.012
H 0.5 0.020 h 1.85±0.2 0.073±0.008
I 1.58 0.062 i 3.5 0.138
J 1.2 0.047 j 2.0 0.079
K 7.64 0.301 k 3.0 0.118
L 1.2 0.047 l 0.25 0.010
M 1.58 0.062 m 14.0 0.551
N 1.58 0.062 n 1.4±0.2 0.055±0.008
O 1.2 0.047 o 1.4±0.2 0.055±0.008
P 7.64 0.301 p h=1.8 φ 1.3 h=0.071 φ 0.051
Q 1.2 0.047 q 0~5° 0.000~0.197°
R 1.58 0.062 r 5.9 0.232
S φ 3.55 φ 0.140 s 0.8 0.031
T C 2.0 C 0.079 t 2.4 0.094
U 12.31 0.485 u 2.7 0.106
V 10.17 0.400 v 3.9 0.154
W 6.8 0.268 TGK-080SDW-G1E
X 8.24 0.324
Y 14.8 0.583
Z 1.4±0.2 0.055±0.008
I A J
B K
C W
G F E D L V
S
Protrusion height T
U
M
O
H
P
Y Q
Z
g X
m
l
c
a
;
Figures B-6 to B-9 show the conditions when connecting the emulation probe to the conversion socket. Follow
the configuration below and consider the shape of parts to be mounted on the target system when designing a system.
Figure B-6. Distance Between In-Circuit Emulator and Conversion Socket (80GC)
In-circuit emulator
IE-78K0-NS or IE-78K0-NS-A
Target system
Emulation board
IE-780308-NS-EM1
155 mmNote
CN6
Emulation probe
NP-80GC, NP-80GC-TQ, Conversion socket
NP-H80GC-TQ EV-9200GC-80 or
conversion adapter
TGC-080SBP
Remark NP-80GC, NP-80GC-TQ, and NP-H80GC-TQ are products of Naito Densei Machida Mfg. Co., Ltd.
TGC-080SBP is a product of TOKYO ELETECH CORPORATION.
Emulation board
IE-780308-NS-EM1
Emulation probe
NP-80GC-TQ
23 mm
Conversion socket
TGC-080SBP 11 mm
40 mm 34 mm
Target system
Figure B-8. Distance Between In-Circuit Emulator and Conversion Socket (80GK)
In-circuit emulator
IE-78K0-NS or IE-78K0-NS-A
Target system
Emulation board
IE-780308-NS-EM1
155 mmNote
CN6
Emulation probe
NP-80GK, NP-H80GK-TQ Conversion adapter
TGK-080SDW
Remark NP-80GK and NP-H80GK-TQ are products of Naito Densei Machida Mfg. Co., Ltd.
TGK-080SDW is a product of TOKYO ELETECH CORPORATION.
Emulation board
IE-780308-NS-EM1
Emulation probe
NP-80GK
23 mm
Extension probe
TGK-080SDW 11 mm
40 mm 34 mm
Target system
[A]
A/D conversion result register (ADCR) ............................................................................................................. 256
A/D converter input select register (ADIS) ........................................................................................................ 260
A/D converter mode register (ADM) .................................................................................................................. 258
Asynchronous serial interface mode register (ASIM) ....................................................................................... 433
Asynchronous serial interface status register (ASIS) ....................................................................................... 436
Automatic data transmit/receive address pointer (ADTP) ................................................................................ 385
Automatic data transmit/receive control register (ADTC) ................................................................................ 389
Automatic data transmit/receive interval specification register (ADTI) ............................................................ 390
[B]
Baud rate generator control register (BRGC) ................................................................................................... 437
[C]
Capture/compare control register 0 (CRC0) ..................................................................................................... 173
Capture/compare register 00 (CR00) ................................................................................................................ 167
Capture/compare register 01 (CR01) ................................................................................................................ 168
Compare register 10 (CR10) ............................................................................................................................. 213
Compare register 20 (CR20) ............................................................................................................................. 213
Correction address register 0 (CORAD0) ......................................................................................................... 526
Correction address register 1 (CORAD1) ......................................................................................................... 526
Correction control register (CORCN) ................................................................................................................ 527
[D]
D/A conversion value set register 0 (DACS0) .................................................................................................. 277
D/A conversion value set register 1 (DACS1) .................................................................................................. 277
D/A converter mode register (DAM) .................................................................................................................. 278
[E]
External interrupt mode register 0 (INTM0) ............................................................................................. 177, 483
External interrupt mode register 1 (INTM1) ............................................................................................. 261, 483
[I]
Internal expansion RAM size switching register (IXS) ..................................................................................... 537
Internal memory size switching register (IMS) ........................................................................................ 506, 536
[K]
Key return mode register (KRM) .............................................................................................................. 143, 500
[M]
Memory expansion mode register (MM) .................................................................................................. 142, 505
[O]
Oscillation mode select register (OSMS) .......................................................................................................... 151
Oscillation stabilization time select register (OSTS) ........................................................................................ 514
[P]
Port 0 (P0) ......................................................................................................................................................... 122
Port 1 (P1) ......................................................................................................................................................... 124
Port 12 (P12) ...................................................................................................................................................... 136
Port 13 (P13) ...................................................................................................................................................... 137
Port 2 (P2) ................................................................................................................................................ 125, 127
Port 3 (P3) ......................................................................................................................................................... 129
Port 4 (P4) ......................................................................................................................................................... 130
Port 5 (P5) ......................................................................................................................................................... 131
Port 6 (P6) ......................................................................................................................................................... 132
Port 7 (P7) ......................................................................................................................................................... 134
Port mode register 0 (PM0) ............................................................................................................................... 138
Port mode register 1 (PM1) ............................................................................................................................... 138
Port mode register 12 (PM12) .................................................................................................................. 138, 472
Port mode register 13 (PM13) ........................................................................................................................... 138
Port mode register 2 (PM2) ............................................................................................................................... 138
Port mode register 3 (PM3) ............................................................................................. 138, 176, 218, 249, 253
Port mode register 5 (PM5) ............................................................................................................................... 138
Port mode register 6 (PM6) ............................................................................................................................... 138
Port mode register 7 (PM7) ............................................................................................................................... 138
Priority specify flag register 0H (PR0H) ............................................................................................................ 482
Priority specify flag register 0L (PR0L) ............................................................................................................. 482
Priority specify flag register 1L (PR1L) ............................................................................................................. 482
Processor clock control register (PCC) ............................................................................................................. 148
Program status word (PSW) ....................................................................................................................... 96, 487
Pull-up resistor option register H (PUOH) ........................................................................................................ 141
Pull-up resistor option register L (PUOL) .......................................................................................................... 141
[R]
Real-time output buffer register H (RTBH) ....................................................................................................... 471
Real-time output buffer register L (RTBL) ........................................................................................................ 471
Real-time output port control register (RTPC) .................................................................................................. 473
Real-time output port mode register (RTPM) ................................................................................................... 472
Receive buffer register (RXB) ........................................................................................................................... 431
Receive shift register (RXS) .............................................................................................................................. 431
[S]
Sampling clock select register (SCS) ....................................................................................................... 178, 485
Serial bus interface control register (SBIC) ............................................................................................. 293, 343
Serial I/O shift register 0 (SIO0) ............................................................................................................... 286, 338
Serial I/O shift register 1 (SIO1) ........................................................................................................................ 385
Serial interface pin select register (SIPS) ......................................................................................................... 441
Serial operating mode register 0 (CSIM0) ............................................................................................... 290, 342
Serial operating mode register 1 (CSIM1) ........................................................................................................ 388
Serial operating mode register 2 (CSIM2) ........................................................................................................ 432
Slave address register (SVA) ................................................................................................................... 286, 338
[T]
Timer clock select register 0 (TCL0) ........................................................................................................ 169, 247
Timer clock select register 1 (TCL1) ................................................................................................................. 214
Timer clock select register 2 (TCL2) ................................................................................................ 233, 241, 251
Timer clock select register 3 (TCL3) ................................................................................................ 288, 340, 386
Transmit shift register (TXS) ............................................................................................................................. 431
[W]
Watch timer mode control register (TMC2) ...................................................................................................... 236
Watchdog timer mode register (WDTM) ........................................................................................................... 243
[A]
ADCR: A/D conversion result register ........................................................................................................ 256
ADIS: A/D converter input select register ................................................................................................. 260
ADM: A/D converter mode register .......................................................................................................... 258
ADTC: Automatic data transmit/receive control register ........................................................................... 389
ADTI: Automatic data transmit/receive interval specification register .................................................... 390
ADTP: Automatic data transmit/receive address pointer .......................................................................... 385
ASIM: Asynchronous serial interface mode register ................................................................................ 433
ASIS: Asynchronous serial interface status register ............................................................................... 436
[B]
BRGC: Baud rate generator control register .............................................................................................. 437
[C]
CORAD0: Correction address register 0 ......................................................................................................... 526
CORAD1: Correction address register 1 ......................................................................................................... 526
CORCN: Correction control register .............................................................................................................. 527
CR00: Capture/compare register 00 .......................................................................................................... 167
CR01: Capture/compare register 01 .......................................................................................................... 168
CR10: Compare register 10 ....................................................................................................................... 213
CR20: Compare register 20 ....................................................................................................................... 213
CRC0: Capture/compare control register 0 ............................................................................................... 173
CSIM0: Serial operating mode register 0 ........................................................................................... 290, 342
CSIM1: Serial operating mode register 1 .................................................................................................... 388
CSIM2: Serial operating mode register 2 .................................................................................................... 432
[D]
DACS0: D/A conversion value set register 0 ............................................................................................... 277
DACS1: D/A conversion value set register 1 ............................................................................................... 277
DAM: D/A converter mode register .......................................................................................................... 278
[I]
IF0H: Interrupt request flag register 0H ................................................................................................... 480
IF0L: Interrupt request flag register 0L .................................................................................................... 480
IF1L: Interrupt request flag register 1L ........................................................................................... 480, 499
IMS: Internal memory size switching register ............................................................................... 506, 536
INTM0: External interrupt mode register 0 ........................................................................................ 177, 483
INTM1: External interrupt mode register 1 ........................................................................................ 261, 483
IXS: Internal expansion RAM size switching register ............................................................................ 537
[K]
KRM: Key return mode register ....................................................................................................... 143, 500
[M]
MK0H: Interrupt mask flag register 0H ....................................................................................................... 481
MK0L: Interrupt mask flag register 0L ....................................................................................................... 481
[O]
OSMS: Oscillation mode selection register ................................................................................................ 151
OSTS: Oscillation stabilization time select register ................................................................................... 514
[P]
P0: Port 0 ............................................................................................................................................... 122
P1: Port 1 ............................................................................................................................................... 124
P12: Port 12 ............................................................................................................................................. 136
P13: Port 13 ............................................................................................................................................. 137
P2: Port 2 ...................................................................................................................................... 125, 127
P3: Port 3 ............................................................................................................................................... 129
P4: Port 4 ............................................................................................................................................... 130
P5: Port 5 ............................................................................................................................................... 131
P6: Port 6 ............................................................................................................................................... 132
P7: Port 7 ............................................................................................................................................... 134
PCC: Processor clock control register ..................................................................................................... 148
PM0: Port mode register 0 ....................................................................................................................... 138
PM1: Port mode register 1 ....................................................................................................................... 138
PM12: Port mode register 12 ............................................................................................................ 138, 472
PM13: Port mode register 13 ..................................................................................................................... 138
PM2: Port mode register 2 ....................................................................................................................... 138
PM3: Port mode register 3 ..................................................................................... 138, 176, 218, 249, 253
PM5: Port mode register 5 ....................................................................................................................... 138
PM6: Port mode register 6 ....................................................................................................................... 138
PM7: Port mode register 7 ....................................................................................................................... 138
PR0H: Priority specification flag register 0H ............................................................................................. 482
PR0L: Priority specification flag register 0L .............................................................................................. 482
PR1L: Priority specification flag register 1L .............................................................................................. 482
PSW: Program status word ................................................................................................................ 96, 487
PUOH: Pull-up resistor option register H ................................................................................................... 141
PUOL: Pull-up resistor option register L .................................................................................................... 141
[R]
RTBH: Real-time output buffer register H .................................................................................................. 471
RTBL: Real-time output buffer register L .................................................................................................. 471
RTPC: Real-time output port control register ............................................................................................ 473
RTPM: Real-time output port mode register .............................................................................................. 472
RXB: Receive buffer register .................................................................................................................... 431
RXS: Receive shift register ...................................................................................................................... 431
[S]
SBIC: Serial bus interface control register ...................................................................................... 293, 343
SCS: Sampling clock select register ............................................................................................... 178, 485
SFR: Special-function register ................................................................................................................. 115
SINT: Interrupt timing specification register .................................................................................... 294, 345
[T]
TCL0: Timer clock select register 0 ................................................................................................. 169, 247
TCL1: Timer clock select register 1 .......................................................................................................... 214
TCL2: Timer clock select register 2 ......................................................................................... 233, 241, 251
TCL3: Timer clock select register 3 ......................................................................................... 288, 340, 386
TM0: 16-bit timer register ......................................................................................................................... 168
TM1: 8-bit timer register 1 ........................................................................................................................ 213
TM2: 8-bit timer register 2 ........................................................................................................................ 213
TMC0: 16-bit timer mode control register .................................................................................................. 171
TMC1: 8-bit timer mode control register .................................................................................................... 216
TMC2: Watch timer mode control register ................................................................................................. 236
TOC0: 16-bit timer output control register ................................................................................................. 174
TOC1: 8-bit timer output control register ................................................................................................... 217
TXS: Transmit shift register ..................................................................................................................... 431
[W]
WDTM: Watchdog timer mode register ....................................................................................................... 243
The revision history of this edition is listed in the table below. “Chapter” indicates the chapter of the previous edition
where the revision was made.
Addition of Table 7-2 Relationships between CPU Clock and CHAPTER 7 CLOCK GENERATOR
Minimum Instruction Execution Time
Addition of Figures 9-10 and 9-13 Square Wave Output CHAPTER 9 8-BIT TIMER/EVENT COUNTER
Operation Timing
Addition of (7) Conversion result immediately after A/D CHAPTER 14 A/D CONVERTER
converter start to 14.5 How to Read the A/D Converter
Characteristics Table
Correction of Note on BSYE in Figure 16-5 Serial Bus CHAPTER 16 SERIAL INTERFACE
Interface Control Register Format CHANNEL 0 (µPD780058 Subseries)
Addition of (3) MSB/LSB switching as the start bit to 18.4.2 CHAPTER 18 SERIAL INTERFACE
3-wire serial I/O mode operation CHANNEL 1
Change of 18.4.3 (3) (d) Busy control option, (e) Busy &
strobe control option, and (f) Bit slippage detection function
in old edition to (4) Synchronization control, and improvement
of explanation
Addition of Note to 26.1 Memory Size Switching Register CHAPTER 26 µPD78F0058, 78F0058Y
Total revision: Support of in-circuit emulators IE-78K0-NS and APPENDIX B DEVELOPMENT TOOLS
IE-78001-R-A
Total revision: Deletion of fuzzy inference development support APPENDIX C EMBEDDED SOFTWARE
system
Change of recommended connection of unused pins and connection of P60 (µPD780058 SUBSERIES)
to P63, AVREF1, and VPP pins in Table 3-1 Pin I/O Circuit Types
Change of processing when A/D converter is not used in 4.2.11 AVREF0 CHAPTER 4 PIN FUNCTIONS
Change of recommended connection of unused pins and connection of P60 (µPD780058Y SUBSERIES)
to P63, AVREF1, and VPP pins in Table 4-1 Pin I/O Circuit Types
Modification of Note 2 in 6.2.8 Port 6 CHAPTER 6 PORT FUNCTIONS
Addition of note on feedback resistor to Figure 7-3 Format of Processor CHAPTER 7 CLOCK
Clock Control Register GENERATOR
Addition of Table 8-5 INTP1/TI01 Pin Valid Edge and CR00 Capture CHAPTER 8 16-BIT
Trigger Valid Edge TIMER/EVENT COUNTER
Addition of Table 8-6 INTP0/TI00 Pin Valid Edge and CR01 Capture
Trigger Valid Edge
Modification of note on changing count clock in Figure 10-2 Format of CHAPTER 10 WATCH TIMER
Timer Clock Select Register 2
Addition of note on rewriting TCL2 in Figure 13-2 Format of Timer Clock CHAPTER 13 BUZZER
Select Register 2 OUTPUT CONTROLLER
Modification of Figure 14-5 A/D Converter Basic Operation CHAPTER 14 A/D
Addition of Table 14-2 A/D Conversion Sampling Time and A/D CONVERTER
Converter Start Delay Time
Addition of 14.5 How to Read A/D Converter Characteristics Table