
µ PD78058F, 78058FY Subseries
8-Bit Single-Chip Microcontrollers
µPD78056F µPD78058F µPD78P058F µPD78058F(A) µPD78056FY µPD78058FY µPD78P058FY µPD78058FY(A)
Document No. U12068EJ2V0UM00 (2nd edition) Date Published April 1998 N CP (K)
Printed in Japan ©
![Page 2 of the NEC PD78056F user manual — [MEMO]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-2.webp?w=400)

1 PRECAUTION AGAINST ESD FOR SEMICONDUCTORS
Strong electric field, when exposed to a MOS device, can cause destruction of the gate oxide and
ultimately degrade the device operation. Steps must be taken to stop generation of static
electricity as much as possible, and quickly dissipate it once, when it has occurred. Environmental
control must be adequate. When it is dry, humidifier should be used. It is recommended to avoid
using insulators that easily build static electricity. Semiconductor devices must be stored and
transported in an anti-static container, static shielding bag or conductive material. All test and
measurement tools including work bench and floor should be grounded. The operator should be
grounded using wrist strap. Semiconductor devices must not be touched with bare hands. Similar
precautions need to be taken for PW boards with semiconductor devices on it.
No connection for CMOS device inputs can be cause of malfunction. If no connection is provided
to the input pins, it is possible that an internal input level may be generated due to noise, etc., hence
causing malfunction. CMOS devices behave differently than Bipolar or NMOS devices. Input
levels of CMOS devices must be fixed high or low by using a pull-up or pull-down circuitry. Each
unused pin should be connected to VDD or GND with a resistor, if it is considered to have a
possibility of being an output pin. All handling related to the unused pins must be judged device
by device and related specifications governing the devices.
Power-on does not necessarily define initial status of MOS device. Production process of MOS
does not define the initial operation status of the device. Immediately after the power source is
turned ON, the devices with reset function have not yet been initialized. Hence, power-on does
not guarantee out-pin levels, I/O settings or contents of registers. Device is not initialized until
the reset signal is received. Reset operation must be executed immediately after power-on for
devices having reset function.
FIP, EEPROM, and IEBus are trademarks of NEC Corporation.
MS-DOS, Windows, and WindowsNT are either registered trademarks or trademarks of Microsoft Corpo-
ration in the United States and/or other countries.
IBM DOS, PC/AT, and PC DOS are trademarks of International Business Machines Corporation.
HP9000 Series 700 and HP-UX are trademarks of Hewlett-Packard Company.
SPARCstation is a trademark of SPARC International, Inc.
SunOS is a trademark of Sun Microsystems, Inc.
Ethernet is a trademark of XEROX Corporation.
NEWS and NEWS-OS are trademarks of SONY Corporation.
OSF/Motif is a trademark of Open Software Foundation, Inc.
TRON is an abbreviation of The Realtime Operating System Nucleus.
ITRON is an abbreviation of Industrial TRON.

The export of this product from Japan is regulated by the Japanese government. To export this product may be prohibited without governmental license, the need for which must be judged by the customer. The export or re-export of this product from a country other than Japan may also be prohibited without a license from that country. Please call an NEC sales representative.
The application circuits and their parameters are for reference only and are not intended for use in actual design-ins.
Purchase of NEC 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 subject to change without notice. No part of this document may be copied or reproduced in any form or by any means without the prior written consent of NEC Corporation. NEC Corporation assumes no responsibility for any errors which may appear in this document. NEC Corporation does not assume any liability for infringement of patents, copyrights or other intellectual property rights of third parties by or arising from use of a device described herein or any other liability arising from use of such device. No license, either express, implied or otherwise, is granted under any patents, copyrights or other intellectual property rights of NEC Corporation or others. While NEC Corporation has been making continuous effort to enhance the reliability of its semiconductor devices, the possibility of defects cannot be eliminated entirely. To minimize risks of damage or injury to persons or property arising from a defect in an NEC semiconductor device, customers must incorporate sufficient safety measures in its design, such as redundancy, fire-containment, and anti-failure features. NEC devices are classified into the following three quality grades: "Standard", "Special", and "Specific". The Specific quality grade applies only to devices developed based on a customer designated “quality assurance program“ for a specific application. The recommended applications of a device depend on its quality grade, as indicated below. Customers must check the quality grade of each device before using it in a particular application.
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: Aircrafts, aerospace equipment, submersible repeaters, nuclear reactor control systems, life support systems or medical equipment for life support, etc. The quality grade of NEC devices is "Standard" unless otherwise specified in NEC's Data Sheets or Data Books. If customers intend to use NEC devices for applications other than those specified for Standard quality grade, they should contact an NEC sales representative in advance. Anti-radioactive design is not implemented in this product.

Some information contained in this document may vary from country to country. Before using any NEC product in your application, please contact the NEC office in your country to obtain a list of authorized representatives and distributors. They will verify:
In addition, trademarks, registered trademarks, export restrictions, and other legal issues may also vary from country to country.
NEC Electronics Hong Kong Ltd. Hong Kong Tel: 2886-9318 Fax: 2886-9022/9044
NEC Electronics (Germany) GmbH Benelux Office Eindhoven, The Netherlands Tel: 040-2445845 Fax: 040-2444580
NEC Electronics Hong Kong Ltd. Seoul Branch Seoul, Korea Tel: 02-528-0303 Fax: 02-528-4411
NEC Electronics (France) S.A. Velizy-Villacoublay, France Tel: 01-30-67 58 00 Fax: 01-30-67 58 99
NEC Electronics (Germany) GmbH Duesseldorf, Germany Tel: 0211-65 03 02 Fax: 0211-65 03 490
NEC Electronics Singapore Pte. Ltd. United Square, Singapore 1130 Tel: 65-253-8311 Fax: 65-250-3583
NEC Electronics Taiwan Ltd. Taipei, Taiwan Tel: 02-719-2377 Fax: 02-719-5951
NEC Electronics Italiana s.r.1. Milano, Italy Tel: 02-66 75 41 Fax: 02-66 75 42 99
NEC Electronics (Germany) GmbH Scandinavia Office Taeby, Sweden Tel: 08-63 80 820 Fax: 08-63 80 388
J98. 2
800-729-9288

The mark shows major revised points.

Readers This manual has been prepared for user engineers who want to understand the
functions of the µPD78058F and 78058FY Subseries and design and develop its
application systems and programs.
Affected versions are each of the versions in the following Subseries.
Purpose This manual is intended for users to understand the functions described in the
Organization below.
Organization The µPD78058F, 78058FY Subseries manual is organized by two volumes: this
manual and the instruction edition (common to the 78K/0 Series).
µPD78058F, 78058FY 78K/0 Series Subseries User’s Manual User’s Manual Instructions (This Manual)
Pin functions CPU functions
Internal block functions Instruction set
Interrupt Explanation of each instruction
Other on-chip peripheral functions

How to Read This Manual Before reading this manual, you should have general knowledge of electric and logic
circuits and microcontrollers.
For persons who use this manual as the manual for the µPD78058F(A) and
→ The µPD78058F and 78058FY differ from the µPD78058F(A) and 78058FY(A)
only in their quality grades. For products with (A), please change the readings
for the product name as follows.
µPD78058F → µPD78058F(A)
µPD78058FY → µPD78058FY(A)
When you want to understand the functions in general:
→Read this manual in the order of the contents.
To know the µPD78058F and 78058FY Subseries instruction function in detail:
→ Refer to the 78K/0 Series User's Manual: Instructions (U12326E)
How to interpret the register format:
→ For the circled bit number, the bit name is defined as a reserved word in
RA78K/0, and in CC78K/0, already defined in the header file named sfrbit.h.
To learn the function of a register whose register name is known:
→ Refer to APPENDIX D REGISTER INDEX.
To know the electrical specifications of the µPD78058F and 78058FY Subseries:
→ Refer to separately available Data Sheet.
To know the details regarding the functions of the µPD78058F and 78058FY
Subseries:
→ Refer to separately available Application Notes.
quality grade products for general electronic equipment. If the
examples of use in this manual are utilized in applications where a
“Special” product quality grade is required, please study concern-
ing the quality grade of each part and each circuit that will actually
be used.

Chapter Organization This manual divides the descriptions for the µPD78058F and 78058FY Subseries into
different chapters as shown below. Read only the chapters related to the device you use.

Differences between µPD78058F and µPD78058FY Subseries:
The µPD78058F and µPD78058FY Subseries are different in the following functions
of the serial interface channel 0.
Decimal ... ××××
Hexadecimal ... ××××H

Related Documents The related documents indicated in this publication may include preliminary
versions. However, preliminary versions are not marked as such.
Related Documents for µPD78058F Subseries
Related Documents for µPD78058FY Subseries
document for designing.

document for designing.

Document Name Document No.
78K/0 Series Real-Time OS Basics U11537J U11537E
OS for 78K/0 Series MX78K0 Basics U12257J U12257E
Document Name Document No.
Semiconductor Device Mounting Technology Manual C10535J C10535E
Quality Grade on NEC Semiconductor Devices C11531J C11531E
Reliability Quality Control on NEC Semiconductor Devices C10983J C10983E
Guide to Prevent Damage for Semiconductor Devices by Electrostatic Discharge (ESD) C11892J C11892E
Guide to Quality Assurance for Semiconductor Devices — MEI-1202
Microcontroller Related Product Guide — Third Party Manufacturers U11416J —
document for designing.
Japanese English · Installation U11536J U11536E · Japanese English
![Page 14 of the NEC PD78056F user manual — [MEMO]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-14.webp?w=400)

CHAPTER 1 OUTLINE ( µ PD78058F SUBSERIES) ............................................................................. 35
1.1 Features 35 1.2 Applications 36 1.3 Ordering Information 36 1.4 Quality Grade 37 1.5 Pin Configuration (Top View) 38 1.6 78K/0 Series Expansion 41 1.7 Block Diagram 43 1.8 Outline of Function 44 1.9 Differences Between the µPD78058F and µPD78058F(A) 45 1.10 Mask Options 46
2.1 Features 47 2.2 Applications 48 2.3 Ordering Information 48 2.4 Quality Grade 49 2.5 Pin Configuration (Top View) 50 2.6 78K/0 Series Expansion 53 2.7 Block Diagram 55 2.8 Outline of Function 56 2.9 Differences Between the µPD78058FY and µPD78058FY(A) 57 2.10 Mask Options 58
3.1 Pin Function List .................................................................................................................... 59
3.1.1 Normal operating mode pins 59
3.1.2 PROM programming mode pins (PROM versions only) 64 3.2 Description of Pin Functions 65
3.2.1 P00 to P07 (Port 0) 65
3.2.2 P10 to P17 (Port 1) 66
3.2.3 P20 to P27 (Port 2) 66
3.2.4 P30 to P37 (Port 3) 67
3.2.5 P40 to P47 (Port 4) 68
3.2.6 P50 to P57 (Port 5) 68
3.2.7 P60 to P67 (Port 6) 68
3.2.8 P70 to P72 (Port 7) 69
3.2.9 P120 to P127 (Port 12) 70
3.2.10 P130 and P131 (Port 13) 70
3.2.12 AV REF1 ........................................................................................................................................... 70
3.2.13 AV DD ............................................................................................................................................. 71

3.2.15 RESET ......................................................................................................................................... 71
3.2.16 X1 and X2 71
3.2.17 XT1 and XT2 71
3.2.19 V SS ................................................................................................................................................ 71
3.2.20 VPP (PROM versions only) 71
3.2.21 IC (Mask ROM version only) 72 3.3 Input/output Circuits and Recommended Connection of Unused Pins 73
4.1 Pin Function List .................................................................................................................... 77
4.1.1 Normal operating mode pins 77
4.1.2 PROM programming mode pins (PROM versions only) 82 4.2 Description of Pin Functions 83
4.2.1 P00 to P07 (Port 0) 83
4.2.2 P10 to P17 (Port 1) 84
4.2.3 P20 to P27 (Port 2) 84
4.2.4 P30 to P37 (Port 3) 85
4.2.5 P40 to P47 (Port 4) 86
4.2.6 P50 to P57 (Port 5) 86
4.2.7 P60 to P67 (Port 6) 86
4.2.8 P70 to P72 (Port 7) 87
4.2.9 P120 to P127 (Port 12) 88
4.2.10 P130 and P131 (Port 13) 88
4.2.12 AV REF1 ........................................................................................................................................... 88
4.2.13 AV DD ............................................................................................................................................. 89
4.2.14 AV SS .............................................................................................................................................. 89
4.2.15 RESET ......................................................................................................................................... 89
4.2.16 X1 and X2 89
4.2.17 XT1 and XT2 89
4.2.19 V SS ................................................................................................................................................ 89
4.2.20 VPP (PROM versions only) 89
4.2.21 IC (Mask ROM version only) 90 4.3 Input/output Circuits and Recommended Connection of Unused Pins 91
5.1 Memory Spaces...................................................................................................................... 95
5.1.1 Internal program memory space 98
5.1.2 Internal data memory space 99
5.1.3 Special Function Register (SFR) area 99
5.1.4 External memory space 99

5.2.1 Control registers 103
5.2.2 General registers 106
5.2.3 Special Function Register (SFR) 108 5.3 Instruction Address Addressing 112
5.3.1 Relative addressing 112
5.3.2 Immediate addressing 113
5.3.3 Table indirect addressing 114
5.4.1 Implied addressing 116
5.4.2 Register addressing 117
5.4.3 Direct addressing 118
5.4.4 Short direct addressing 119
5.4.5 Special-Function Register (SFR) addressing 121
5.4.6 Register indirect addressing 122
5.4.7 Based addressing 123
5.4.8 Based indexed addressing 124
5.4.9 Stack addressing 124
6.1 Port Functions........................................................................................................................ 125 6.2 Port Configuration ................................................................................................................. 130
6.2.1 Port 0 130
6.2.2 Port 1 132
6.2.3 Port 2 (µPD78058F Subseries) 133
6.2.4 Port 2 (µPD78058FY Subseries) 135
6.2.5 Port 3 137
6.2.6 Port 4 138
6.2.7 Port 5 139
6.2.8 Port 6 140
6.2.9 Port 7 142
6.2.10 Port 12 144
6.2.11 Port 13 145 6.3 Port Function Control Registers 146 6.4 Port Function Operations 152
6.4.1 Writing to input/output port 152
6.4.2 Reading from input/output port 152
6.4.3 Operations on input/output port 153 6.5 Selection of Mask Option 153
7.1 Clock Generator Functions 155 7.2 Clock Generator Configuration 155 7.3 Clock Generator Control Register 157 7.4 System Clock Oscillator 161
7.4.1 Main system clock oscillator 161

7.4.2 Subsystem clock oscillator 162
7.4.3 Scaler 164
7.4.4 When no subsystem clocks are used 164 7.5 Clock Generator Operations 165
7.5.1 Main system clock operations 166
7.5.2 Subsystem clock operations 167 7.6 Changing System Clock and CPU Clock Settings 167
7.6.1 Time required for switchover between system clock and CPU clock 167
7.6.2 System clock and CPU clock switching procedure 169
8.1 Overview of the µPD78058F and 78058FY Subseries On-Chip Timers 171 8.2 16-Bit Timer/Event Counter Functions 173 8.3 16-Bit Timer/Event Counter Configuration 174 8.4 16-Bit Timer/Event Counter Control Registers 178 8.5 16-Bit Timer/Event Counter Operations 187
8.5.1 Interval timer operations 187
8.5.2 PWM output operations 189
8.5.3 PPG output operation 192
8.5.4 Pulse width measurement operations 193
8.5.5 External event counter operation 200
8.5.6 Square-wave output operation 202
8.5.7 One-shot pulse output operation 204 8.6 16-Bit Timer/Event Counter Operating Precautions 208
9.1 8-Bit Timer/Event Counter Function .................................................................................... 211
9.1.1 8-bit timer/event counter mode 211
9.1.2 16-bit timer/event counter mode 214 9.2 8-Bit Timer/Event Counter Configuration 216 9.3 8-Bit Timer/Event Counter Control Registers 220 9.4 8-Bit Timer/Event Counter Operation 225
9.4.1 8-bit timer/event counter mode 225
9.4.2 16-bit timer/event counter mode 230 9.5 Cautions on 8-Bit Timer/Event Counters 236
10.1 Watch Timer Functions 239 10.2 Watch Timer Configuration 240 10.3 Watch Timer Control Registers 240 10.4 Watch Timer Operations 244
10.4.1 Watch timer operation 244
10.4.2 Interval timer operation 244

11.1 Watchdog Timer Functions 245 11.2 Watchdog Timer Configuration 247 11.3 Watchdog Timer Control Registers 248 11.4 Watchdog Timer Operations 251
11.4.1 Watchdog timer operation 251
11.4.2 Interval timer operation 252
12.1 Clock Output Control Circuit Functions 253 12.2 Clock Output Control Circuit Configuration 254 12.3 Clock Output Function Control Registers 254
13.1 Buzzer Output Control Circuit Functions 257 13.2 Buzzer Output Control Circuit Configuration 257 13.3 Buzzer Output Function Control Registers 258
14.1 A/D Converter Functions 261 14.2 A/D Converter Configuration 262 14.3 A/D Converter Control Registers 265 14.4 A/D Converter Operations 269
14.4.1 Basic operations of A/D converter 269
14.4.2 Input voltage and conversion results 271
14.4.3 A/D converter operating mode 272 14.5 A/D Converter Cautions 274
15.1 D/A Converter Functions 279 15.2 D/A Converter Configuration 280 15.3 D/A Converter Control Registers 282 15.4 Operations of D/A Converter 283 15.5 Cautions Related to D/A Converter 284
16.1 Serial Interface Channel 0 Functions 286 16.2 Serial Interface Channel 0 Configuration 288 16.3 Serial Interface Channel 0 Control Registers 292 16.4 Serial Interface Channel 0 Operations 299
16.4.1 Operation stop mode 299
16.4.2 3-wire serial I/O mode operation 300


21.2 Interrupt Sources and Configuration 478 21.3 Interrupt Function Control Registers 482 21.4 Interrupt Servicing Operations 491
21.4.1 Non-maskable interrupt acknowledge operation 491
21.4.2 Maskable Interrupt request reception 494
21.4.3 Software interrupt request acknowledge operation 497
21.4.4 Multiple interrupt servicing 497
21.5.1 Registers controlling the test function 502
21.5.2 Test input signal acknowledge operation 504
22.1 External Device Expansion Functions 505 22.2 External Device Expansion Function Control Register 508 22.3 External Device Expansion Function Timing 510
23.1 Standby Function and Configuration ................................................................................ 515
23.1.1 Standby function 515
23.1.2 Standby function control register 516 23.2 Standby Function Operations 517
23.2.1 HALT mode 517
23.2.2 STOP mode 520
24.1 Reset Function ..................................................................................................................... 523
CHAPTER 25 ROM CORRECTION ...................................................................................................... 527
25.1 ROM Correction Functions 527 25.2 ROM Correction Configuration 527 25.3 ROM Correction Control Registers 529 25.4 ROM Correction Application 530 25.5 ROM Correction Example 533 25.6 Program Execution Flow 534 25.7 Cautions on ROM Correction 536
26.1 Memory Size Switching Register 538 26.2 Internal Expansion RAM Size Switching Register 539 26.3 PROM Programming 540
26.3.1 Operating modes 540
26.3.2 PROM write procedure 542


Figure No. Title Page
3-1 List of Pin Input/Output Circuit 75
4-1 List of Pin Input/Output Circuit 93
5-1 Memory Map (µPD78056F, 78056FY) 95
5-2 Memory Map (µPD78058F, 78058FY) 96
5-3 Memory Map (µPD78P058F, µPD78P058FY) 97
5-4 Data Memory Addressing (µPD78056F, 78056FY) 100
5-5 Data Memory Addressing (µPD78058F, 78058FY) 101
5-6 Data Memory Addressing (µPD78P058F, 78P058FY) 102
5-7 Program Counter Format 103
5-8 Program Status Word Format 103
5-9 Stack Pointer Format 105
5-10 Data to Be Saved to Stack Memory 105
5-11 Data to Be Reset from Stack Memory 105
5-12 General Register Configuration 107
6-1 Port Types 125
6-2 P00 and P07 Block Diagram 131
6-3 P01 to P06 Block Diagram 131
6-4 P10 to P17 Block Diagram 132
6-5 P20, P21, P23 to P26 Block Diagram 133
6-6 P22 and P27 Block Diagram 134
6-7 P20, P21, P23 to P26 Block Diagram 135
6-8 P22 and P27 Block Diagram 136
6-9 P30 to P37 Block Diagram 137
6-10 P40 to P47 Block Diagram 138
6-11 Block Diagram of Falling Edge Detection Circuit 138
6-12 P50 to P57 Block Diagram 139
6-13 P60 to P63 Block Diagram 141
6-14 P64 to P67 Block Diagram 141
6-15 P70 Block Diagram 142
6-16 P71 and P72 Block Diagram 143
6-17 P120 to P127 Block Diagram 144
6-18 P130 and P131 Block Diagram 145
6-19 Port Mode Register Format 148
6-20 Pull-Up Resistor Option Register Format 149
6-21 Memory Expansion Mode Register Format 150
6-22 Key Return Mode Register Format 151
7-1 Block Diagram of Clock Generator 156
7-2 Subsystem Clock Feedback Resistor 157
7-3 Processor Clock Control Register Format 158

Figure No. Title Page
7-4 Oscillation Mode Selection Register Format 159
7-5 Main System Clock Waveform due to Writing to OSMS 160
7-6 External Circuit of Main System Clock Oscillator 161
7-7 External Circuit of Subsystem Clock Oscillator 162
7-8 Examples of Resonator with Incorrect Connection 162
7-9 Main System Clock Stop Function 166
7-10 System Clock and CPU Clock Switching 169
8-1 16-Bit Timer/Event Counter Block Diagram 175
8-2 16-Bit Timer/Event Counter Output Control Circuit Block Diagram 176
8-3 Timer Clock Selection Register 0 Format 179
8-4 16-Bit Timer Mode Control Register Format 181
8-5 Capture/Compare Control Register 0 Format 182
8-6 16-Bit Timer Output Control Register Format 183
8-7 Port Mode Register 3 Format 184
8-8 External Interrupt Mode Register 0 Format 185
8-9 Sampling Clock Select Register Format 186
8-10 Control Register Settings for Interval Timer Operation 187
8-11 Interval Timer Configuration Diagram 188
8-12 Interval Timer Operation Timings 188
8-13 Control Register Settings for PWM Output Operation 190
8-14 Example of D/A Converter Configuration with PWM Output 191
8-15 TV Tuner Application Circuit Example 191
8-16 Control Register Settings for PPG Output Operation 192
8-17 Control Register Settings for Pulse Width Measurement with Free-Running Counter and
One Capture Register 193
8-18 Configuration Diagram for Pulse Width Measurement by Free-Running Counter 194
8-19 Timing of Pulse Width Measurement Operation by Free-Running Counter and One Capture
Register (with Both Edges Specified) 194
8-20 Control Register Settings for Two Pulse Width Measurements with Free-Running Counter 195
8-21 Timing of Pulse Width Measurement Operation with Free-Running Counter
(with Both Edges Specified) 196
8-22 Control Register Settings for Pulse Width Measurement with Free-Running Counter and
Two Capture Registers 197
8-23 Timing of Pulse Width Measurement Operation by Free-Running Counter and Two Capture
Registers (with Rising Edge Specified) 198
8-24 Control Register Settings for Pulse Width Measurement by Means of Restart 199
8-25 Timing of Pulse Width Measurement Operation by Means of Restart
(with Rising Edge Specified) 199
8-26 Control Register Settings in External Event Counter Mode 200
8-27 External Event Counter Configuration Diagram 201
8-28 External Event Counter Operation Timings (with Rising Edge Specified) 201
8-29 Control Register Settings in Square-Wave Output Mode 202
8-30 Square-Wave Output Operation Timing 203

Figure No. Title Page
8-31 Control Register Settings for One-Shot Pulse Output Operation Using Software Trigger 204
8-32 Timing of One-Shot Pulse Output Operation Using Software Trigger 205
8-33 Control Register Settings for One-Shot Pulse Output Operation Using External Trigger 206
8-34 Timing of One-Shot Pulse Output Operation Using External Trigger (with Rising Edge Specified).. 207
8-35 16-Bit Timer Register Start Timing 208
8-36 Timings After Change of Compare Register during Timer Count Operation 208
8-37 Capture Register Data Retention Timing 209
8-38 Operation Timing of OVF0 Flag 210
9-1 8-Bit Timer/Event Counter Block Diagram 217
9-2 Block Diagram of 8-Bit Timer/Event Counter Output Control Circuit 1 218
9-3 Block Diagram of 8-Bit Timer/Event Counter Output Control Circuit 2 218
9-4 Timer Clock Select Register 1 Format 221
9-5 8-Bit Timer Mode Control Register Format 222
9-6 8-Bit Timer Output Control Register Format 223
9-7 Port Mode Register 3 Format 224
9-8 Interval Timer Operation Timings 225
9-9 External Event Counter Operation Timings (with Rising Edge Specified) 228
9-10 Square-Wave Output Operation Timing 230
9-11 Interval Timer Operation Timing 231
9-12 External Event Counter Operation Timings (with Rising Edge Specified) 233
9-13 Square-Wave Output Operation Timing 235
9-14 8-Bit Timer Registers Start Timing 236
9-15 Event Counter Operation Timing 236
9-16 Timing After Compare Register Change During Timer Count Operation 237
10-1 Watch Timer Block Diagram 241
10-2 Timer Clock Select Register 2 Format 242
10-3 Watch Timer Mode Control Register Format 243
11-1 Watchdog Timer Block Diagram 247
11-2 Timer Clock Select Register 2 Format 249
11-3 Watchdog Timer Mode Register Format 250
12-1 Remote Controlled Output Application Example 253
12-2 Clock Output Control Circuit Block Diagram 254
12-3 Timer Clock Select Register 0 Format 255
12-4 Port Mode Register 3 Format 256
13-1 Buzzer Output Control Circuit Block Diagram 257
13-2 Timer Clock Select Register 2 Format 259
13-3 Port Mode Register 3 Format 260

Figure No. Title Page
14-1 A/D Converter Block Diagram 263
14-2 A/D Converter Mode Register Format 266
14-3 A/D Converter Input Select Register Format 267
14-4 External Interrupt Mode Register 1 Format 268
14-5 A/D Converter Basic Operation 270
14-6 Relationship Between Analog Input Voltage and A/D Conversion Result 271
14-7 A/D Conversion by Hardware Start 272
14-8 A/D Conversion by Software Start 273
14-9 Example of Method of Reducing Current Consumption in Standby Mode 274
14-10 Connection of Analog Input Pin 275
14-11 A/D Conversion End Interrupt Request Generation Timing 276
14-12 Connection of AVDD Pin 277
15-1 D/A Converter Block Diagram 280
15-2 D/A Converter Mode Register Format 282
15-3 Use Example of Buffer Amplifier 284
16-1 Serial Bus Interface (SBI) System Configuration Example 287
16-2 Serial Interface Channel 0 Block Diagram 289
16-3 Timer Clock Select Register 3 Format 293
16-4 Serial Operating Mode Register 0 Format 294
16-5 Serial Bus Interface Control Register Format 296
16-6 Interrupt Timing Specify Register Format 298
16-7 3-Wire Serial I/O Mode Timings 303
16-8 RELT and CMDT Operations 303
16-9 Circuit of Switching in Transfer Bit Order 304
16-10 Example of Serial Bus Configuration with SBI 305
16-11 SBI Transfer Timings 307
16-12 Bus Release Signal 308
16-13 Command Signal 308
16-14 Addresses 309
16-15 Slave Selection with Address 309
16-16 Commands 310
16-17 Data 310
16-18 Acknowledge Signal 311
16-19 BUSY and READY Signals 312
16-20 RELT, CMDT, RELD, and CMDD Operations (Master) 317
16-21 RELT and CMDD Operations (Slave) 317
16-22 ACKT Operation 318
16-23 ACKE Operations 319
16-24 ACKD Operations 320
16-25 BSYE Operation 320
16-26 Pin Configuration 323

Figure No. Title Page
16-27 Address Transmission from Master Device to Slave Device (WUP = 1) 325
16-28 Command Transmission from Master Device to Slave Device 326
16-29 Data Transmission from Master Device to Slave Device 327
16-30 Data Transmission from Slave Device to Master Device 328
16-31 Serial Bus Configuration Example Using 2-Wire Serial I/O Mode 331
16-32 2-Wire Serial I/O Mode Timings 334
16-33 RELT and CMDT Operations 335
16-34 SCK0/P27 Pin Configuration 336
17-1 Serial Bus Configuration Example Using I2C Bus 339
17-2 Serial Interface Channel 0 Block Diagram 341
17-3 Timer Clock Select Register 3 Format 346
17-4 Serial Operating Mode Register 0 Format 348
17-5 Serial Bus Interface Control Register Format 349
17-6 Interrupt Timing Specify Register Format 351
17-7 3-Wire Serial I/O Mode Timings 356
17-8 RELT and CMDT Operations 356
17-9 Circuit of Switching in Transfer Bit Order 357
17-10 Serial Bus Configuration Example Using 2-Wire Serial I/O Mode 358
17-11 2-Wire Serial I/O Mode Timings 361
17-12 RELT and CMDT Operations 362
17-13 Example of Serial Bus Configuration Using I2C Bus 363
17-14 I2C Bus Serial Data Transfer Timing 364
17-15 Start Condition 365
17-16 Address 365
17-17 Transfer Direction Specification 365
17-18 Acknowledge Signal 366
17-19 Stop Condition 366
17-20 Wait Signal 367
17-21 Pin Configuration 372
17-22 Data Transmission from Master to Slave (Both Master and Slave Selected 9-Clock Wait) 374
17-23 Data Transmission from Slave to Master (Both Master and Slave Selected 9-Clock Wait) 377
17-24 Start Condition Output 380
17-25 Slave Wait Release (Transmission) 381
17-26 Slave Wait Release (Reception) 382
17-27 SCK0/SCL/P27 Pin Configuration 385
17-28 SCK0/SCL/P27 Pin Configuration 385
17-29 Logic Circuit of SCL Signal 386
18-1 Serial Interface Channel 1 Block Diagram 389
18-2 Timer Clock Select Register 3 Format 392
18-3 Serial Operating Mode Register 1 Format 393
18-4 Automatic Data Transmit/Receive Control Register Format 394

Figure No. Title Page
18-5 Automatic Data Transmit/Receive Interval Specify Register Format 395
18-6 3-Wire Serial I/O Mode Timings 401
18-7 Circuit of Switching in Transfer Bit Order 402
18-8 Basic Transmission/Reception Mode Operation Timings 411
18-9 Basic Transmission/Reception Mode Flowchart 412
18-10 Internal Buffer RAM Operation in 6-Byte Transmission/Reception (in Basic Transmit/Receive
Mode) 413
18-11 Basic Transmission Mode Operation Timings 415
18-12 Basic Transmission Mode Flowchart 416
18-13 Internal Buffer RAM Operation in 6-Byte Transmission (in Basic Transmit Mode) 417
18-14 Repeat Transmission Mode Operation Timing 419
18-15 Repeat Transmission Mode Flowchart 420
18-16 Internal Buffer RAM Operation in 6-Byte Transmission (in Repeat Transmit Mode) 421
18-17 Automatic Transmission/Reception Suspension and Restart 423
18-18 System Configuration When the Busy Control Option Is Used 424
18-19 Operation Timings When Using Busy Control Option (BUSY0 = 0) 425
18-20 Busy Signal and Wait Cancel (When BUSY0 = 0) 426
18-21 Operation Timings When Using Busy & Strobe Control Option (BUSY0 = 0) 427
18-22 Operation Timing of the Bit Slippage Detection Function Through the Busy Signal
(When BUSY0 = 1) 428
18-23 Automatic Transmit/Receive Interval Time 429
18-24 Operation Timing with Automatic Data Transmit/Receive Function Performed by Internal Clock 430
19-1 Serial Interface Channel 2 Block Diagram 435
19-2 Baud Rate Generator Block Diagram 436
19-3 Serial Operating Mode Register 2 Format 438
19-4 Asynchronous Serial Interface Mode Register Format 439
19-5 Asynchronous Serial Interface Status Register Format 441
19-6 Baud Rate Generator Control Register Format 442
19-7 Asynchronous Serial Interface Transmit/Receive Data Format 455
19-8 Asynchronous Serial Interface Transmission Completion Interrupt Request Generation Timing 457
19-9 Asynchronous Serial Interface Reception Completion Interrupt Request Generation Timing 458
19-10 Receive Error Timing 459
19-11 Receive Buffer Register (RXB) Status and Receive Completion Interrupt Request (INTSR)
Generation When Receiving Is Terminated 460
19-12 3-Wire Serial I/O Mode Timing 466
19-13 Circuit of Switching in Transfer Bit Order 467
19-14 Receive Completion Interrupt Request Generation Timing (When ISRM = 1) 468
19-15 Period that Reading Receive Buffer Register Is Prohibited 469
20-1 Real-time Output Port Block Diagram 472
20-2 Real-time Output Buffer Register Configuration 473
20-3 Port Mode Register 12 Format 474

Figure No. Title Page
20-4 Real-time Output Port Mode Register Format 474
20-5 Real-time Output Port Control Register Format 475
21-1 Basic Configuration of Interrupt Function 480
21-2 Interrupt Request Flag Register Format 483
21-3 Interrupt Mask Flag Register Format 484
21-4 Priority Specify Flag Register Format 485
21-5 External Interrupt Mode Register 0 Format 486
21-6 External Interrupt Mode Register 1 Format 487
21-7 Sampling Clock Select Register Format 488
21-8 Noise Elimination Circuit Input/Output Timing (During Rising Edge Detection) 489
21-9 Program Status Word Format 490
21-10 Flowchart from the Time a Non-maskable Interrupt Request Is Generated Until It Is Received 492
21-11 Non-Maskable Interrupt Request Acknowledge Timing 492
21-12 Non-Maskable Interrupt Request Acknowledge Operation 493
21-13 Interrupt Request Acknowledge Processing Algorithm 495
21-14 Interrupt Request Acknowledge Timing (Minimum Time) 496
21-15 Interrupt Request Acknowledge Timing (Maximum Time) 496
21-16 Multiple Interrupt Example 499
21-17 Interrupt Request Hold 501
21-18 Basic Configuration of Test Function 502
21-19 Format of Interrupt Request Flag Register 1L 503
21-20 Format of Interrupt Mask Flag Register 1L 503
21-21 Key Return Mode Register Format 504
22-1 Memory Map When Using External Device Expansion Function 506
22-2 Memory Expansion Mode Register Format 508
22-3 Memory Size Switching Register Format 509
22-4 Instruction Fetch from External Memory 511
22-5 External Memory Read Timing 512
22-6 External Memory Write Timing 513
22-7 External Memory Read Modify Write Timing 514
23-1 Oscillation Stabilization Time Select Register Format 516
23-2 HALT Mode Clear upon Interrupt Request Generation 518
23-3 HALT Mode Release by RESET Input 519
23-4 STOP Mode Release by Interrupt Request Generation 521
23-5 Release by STOP Mode RESET Input 522
24-1 Block Diagram of Reset Function 523
24-2 Timing of Reset Input by RESET Input 524
24-3 Timing of Reset due to Watchdog Timer Overflow 524
24-4 Timing of Reset Input in STOP Mode by RESET Input 524

Figure No. Title Page
25-1 Block Diagram of ROM Correction 527
25-2 Correction Address Registers 0 and 1 Format 528
25-3 Correction Control Register Format 529
25-4 Storing Example to EEPROM (When One Place Is Corrected) 530
25-5 Connecting Example with EEPROM (Using 2-Wire Serial I/O Mode) 530
25-6 Initialization Routine 531
25-7 ROM Correction Operation 532
25-8 ROM Correction Example 533
25-9 Program Transition Diagram (When One Place Is Corrected) 534
25-10 Program Transition Diagram (When Two Places Are Corrected) 535
26-1 Memory Size Switching Register Format 538
26-2 Internal Expansion RAM Size Switching Register Format 539
26-3 Page Program Mode Flowchart 542
26-4 Page Program Mode Timing 543
26-5 Byte Program Mode Flowchart 544
26-6 Byte Program Mode Timing 545
26-7 PROM Read Timing 546
B-1 Development Tool Configuration 568
B-2 EV-9200GC-80 Drawings (For Reference Only) 577
B-3 EV-9200GC-80 Footprints (For Reference Only) 578
B-4 TGK-080SDW Drawings (For Reference) (unit: mm) 579

Table No. Title Page
1-1 Differences Between the µPD78058F and µPD78058F(A) 45
1-2 Mask Options of Mask POM Versions 46
2-1 Differences Between the µPD78058FY and µPD78058FY(A) 57
2-2 Mask Options of Mask ROM Versions 58
3-1 Pin Input/Output Circuit Types 73
4-1 Pin Input/Output Circuit Types 91
5-1 Vector Table 98
5-2 Corresponding of General Register Absolute Address 106
5-3 Special-Function Register List 109
6-1 Port Functions (µPD78058F Subseries) 126
6-2 Port Functions (µPD78058FY Subseries) 128
6-3 Port Configuration 130
6-4 Pull-up Resistor of Port 6 140
6-5 Port Mode Register and Output Latch Settings When Using Alternate Functions 147
6-6 Comparison Between Mask ROM Version and PROM Version 153
7-1 Clock Generator Configuration 155
7-2 Relationship Between CPU Clock and Minimum Instruction Execution Time 159
7-3 Maximum Time Required for CPU Clock Switchover 168
8-1 Timer/Event Counter Operation 172
8-2 16-Bit Timer/Event Counter Interval Times 173
8-3 16-Bit Timer/Event Counter Square-Wave Output Ranges 174
8-4 16-Bit Timer/Event Counter Configuration 174
8-5 INTP0/TI00 Pin Valid Edge and CR00 Capture Trigger Valid Edge 177
8-6 16-Bit Timer/Event Counter Interval Times 189
8-7 16-Bit Timer/Event Count Square-Wave Output Ranges 203
9-1 8-Bit Timer/Event Counter Interval Times 212
9-2 8-Bit Timer/Event Counter Square-Wave Output Ranges 213
9-3 Interval Times When 8-Bit Timer/Event Counters are Used as 16-Bit Timer/Event Counter 214
9-4 Square-Wave Output Ranges When 8-Bit Timer/Event Counters are Used as
16-Bit Timer/Event Counter 215
9-5 8-Bit Timer/Event Counter Configuration 216
9-6 8-Bit Timer/Event Counter 1 Interval Time 226
9-7 8-Bit Timer/Event Counter 2 Interval Time 227
9-8 8-Bit Timer/Event Counter Square-Wave Output Ranges 229
9-9 Interval Times When 2-Channel 8-Bit Timer/Event Counters (TM1 and TM2) are Used
as 16-Bit Timer/Event Counter 232

Table No. Title Page
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 234
10-1 Interval Timer Interval Time 239
10-2 Watch Timer Configuration 240
10-3 Interval Timer Interval Time 244
11-1 Watchdog Timer Runaway Detection Times 245
11-2 Interval Times 246
11-3 Watchdog Timer Configuration 247
11-4 Watchdog Timer Runaway Detection Time 251
11-5 Interval Timer Interval Time 252
12-1 Clock Output Control Circuit Configuration 254
13-1 Buzzer Output Control Circuit Configuration 257
14-1 A/D Converter Configuration 262
15-1 D/A Converter Configuration 280
16-1 Differences Among Channels 0, 1, and 2 285
16-2 Serial Interface Channel 0 Configuration 288
16-3 Various Signals in SBI Mode 321
17-1 Differences Among Channels 0, 1, and 2 337
17-2 Serial Interface Channel 0 Configuration 340
17-3 Serial Interface Channel 0 Interrupt Request Signal Generation 344
17-4 Signals in I2C Bus Mode 371
18-1 Serial Interface Channel 1 Configuration 388
18-2 Interval Timing Through CPU Processing (When the Internal Clock Is Operating) 430
18-3 Interval Timing Through CPU Processing (When the External Clock Is Operating) 431
19-1 Serial Interface Channel 2 Configuration 434
19-2 Serial Interface Channel 2 Operating Mode Settings 440
19-3 Relationship Between Main System Clock and Baud Rate 444
19-4 Relationship Between ASCK Pin Input Frequency and Baud Rate (When BRGC Is Set to 00H) 445
19-5 Relationship Between Main System Clock and Baud Rate 453
19-6 Relationship Between ASCK Pin Input Frequency and Baud Rate (When BRGC Is Set to 00H) 454
19-7 Receive Error Causes 459
20-1 Real-time Output Port Configuration 472

Table No. Title Page
20-2 Operation in Real-time Output Buffer Register Manipulation 473
20-3 Real-time Output Port Operating Mode and Output Trigger 475
21-1 Interrupt Source List 478
21-2 Various Flags Corresponding to Interrupt Request Sources 482
21-3 Times from Maskable Interrupt Request Generation to Interrupt Service 494
21-4 Interrupt Request Enabled for Multiple Interrupt During Interrupt Servicing 498
21-5 Test Input Factors 502
21-6 Flags Corresponding to Test Input Signals 502
22-1 Pin Functions in External Memory Expansion Mode 505
22-2 State of Ports 4 to 6 Pins in External Memory Expansion Mode 505
22-3 Values When the Memory Size Switching Register Is Reset 509
23-1 HALT Mode Operating Status 517
23-2 Operation After HALT Mode Release 519
23-3 STOP Mode Operating Status 520
23-4 Operation After STOP Mode Release 522
24-1 Hardware Status After Reset 525
25-1 ROM Correction Configuration 527
26-1 Differences Between µPD78P058F, 78P058FY and Mask ROM Versions 537
26-2 Examples of Memory Size Switching Register Settings 538
26-3 Value Set to the Internal Expansion RAM Size Switching Register 539
26-4 PROM Programming Operating Modes 540
27-1 Operand Identifiers and Description Methods 550
A-1 Major Differences Among µPD78054, 78058F, and 780058 Subseries 565
B-1 OS for IBM PC 576
B-2 Upgrading Former In-circuit Emulators for 78K/0 Series to IE-78001-R-A 576
![Page 34 of the NEC PD78056F user manual — [MEMO]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-34.webp?w=400)

1.1 Features
Compared to the conventional µPD78054 Subseries, EMI (Electro Magnetic Interference) noise has been
reduced.
On-chip high-capacity ROM and RAM
Internal High-Speed RAM Internal Buffer RAM Internal Expansion RAM
1024 bytes 32 bytes None
60 KbytesNote 1
1024 bytesNote 1 1024 bytesNote 2
memory size switching register (IMS).
size switching register (IXS).
Minimum instruction execution time changeable from high speed (0.4 µs: In main system clock 5.0 MHz operation)
to ultra-low speed (122 µs: In subsystem clock 32.768-kHz operation)
Instruction set suited to system control
22 vectored interrupt sources
Two types of on-chip clock oscillators (main system clock and subsystem clock)

CHAPTER 1 OUTLINE (µPD78058F SUBSERIES)
In the case of the µPD78056F, 78058F and 78P058F,
Cellular phones, pagers, printers, AV equipment, air conditioners, cameras, PPC’s, fuzzy home appliances,
vending machines, etc.
In the case of the µPD78058F (A),
Controllers for car electronics, gas detection and shut-off devices, various safety devices, etc.
Part Number Package Internal ROM
µPD78056FGC-×××-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) Mask ROM
µPD78056FGC-×××-8BT 80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm) Mask ROM
µPD78058FGC-×××-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) Mask ROM
µPD78058FGC-×××-8BT 80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm) Mask ROM
µPD78058FGK-×××-BE9 80-pin plastic TQFP (Fine pitch) (12 × 12 mm) Mask ROM
µPD78058FGC(A)-×××-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) Mask ROM
µPD78P058FGC-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) One-time PROM
µPD78P058FGC-8BT 80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm) One-time PROM
Remark ××× indicates ROM code suffix.

CHAPTER 1 OUTLINE (µPD78058F SUBSERIES)
Part Number Package Quality Grade
µPD78056FGC-×××-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) Standard
µPD78056FGC-×××-8BT 80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm) Standard
µPD78058FGC-×××-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) Standard
µPD78058FGC-×××-8BT 80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm) Standard
µPD78058FGK-×××-BE9 80-pin plastic TQFP (Fine pitch) (12 × 12 mm) Standard
µPD78058FGC(A)-×××-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) Special
µPD78P058FGC-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) Standard
µPD78P058FGC-8BT 80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm) Standard
Remark ××× indicates ROM code suffix.
Please refer to Quality grade on NEC Semiconductor Devices (Document number C11531E) published by
NEC Corporation to know the specification of quality grade on the devices and its recommended applications.

CHAPTER 1 OUTLINE (µPD78058F SUBSERIES)
(1) Normal operating mode
80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm)
µPD78056FGC-×××-3B9, 78058FGC-×××-3B9, 78058FGC(A)-×××-3B9, 78P058FGC-3B9
80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm)
µPD78056FGC-×××-8BT, 78058FGC-×××-8BT, 78P058FGC-8BT
80-pin plastic TQFP (Fine pitch) (12 × 12 mm)
µPD78058FGK-×××-BE9
P00/INTP0/TI00
P14/ANI4
P13/ANI3
P12/ANI2
P11/ANI1
P10/ANI0
P06/INTP6
P05/INTP5
P04/INTP4
P03/INTP3
P02/INTP2
XT1/P07
AV REF0
IC (V PP )
AV DD
XT2
V DD

80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41
RESET P127/RTP7 P126/RTP6 P125/RTP5 P124/RTP4 P123/RTP3 P122/RTP2 P121/RTP1 P120/RTP0 P37 P36/BUZ P35/PCL P34/TI2 P33/TI1 P32/TO2 P31/TO1 P30/TO0 P67/ASTB P66/WAIT P65/WR
AVREF1 P70/SI2/RxD P71/SO2/TxD P72/SCK2/ASCK
P23/STB P24/BUSY P25/SI0/SB0 P26/SO0/SB1
P27/SCK0
P40/AD0 P41/AD1
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
P43/AD3
P44/AD4
P45/AD5
P46/AD6
P47/AD7
P50/A8
P51/A9
P52/A10
P53/A11
P54/A12
P55/A13
P56/A14
P57/A15
P64/RD
this device is used in application fields where reduction of noise generated internally in
the microprocessor is required, please connect to a separate power supply with the same
electrical potential as VDD.
port. If this device is used in application fields where reduction of noise generated
internally in the microprocessor is required, please connect it to a ground line which is
separate from VSS.
Remark Pin connection in parentheses is intended for the µPD78P058F.

CHAPTER 1 OUTLINE (µPD78058F SUBSERIES)

CHAPTER 1 OUTLINE (µPD78058F SUBSERIES)
80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm)
80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm)
(L)
PGM
V SS
V DD
(L)
V PP
(L)
V DD
(L)
A9
80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41
(L)
V SS
(L)
(L)
V DD
D7 D6 D5 D4 D3 D2 D1 D0
(L)
(L)
A0 A1
CE
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
A3
A4
A5
A6
A7
A8
A16
A10
A11
A12
A13
V SS
A14
A15
OE
(L)

CHAPTER 1 OUTLINE (µPD78058F SUBSERIES)
The 78K/0 Series expansion is shown below. The names in frames are subseries.
Products in mass production
Y subseries products are compatible with I2C bus.
µ
EMI-noise reduced version of the PD78078
PD78078Y
Timer was added to the PD78054 and the external interface function was enhanced
ROM-less versions of the PD78078 Serial I/O of the PD78078Y was enhanced and only selected functions are provided
µ
Serial I/O of the PD78054 was enhanced. EMI-noise reduced version EMI-noise reduced version of the PD78054
PD780058Y
PD78058FY
PD78054 PD780034 PD780024 PD780024Y PD78014H PD78018F
PD78054Y
UART and D/A converter were added to the PD78014 and I/O was enhanced A/D converter of the PD780024 was enhanced Serial I/O of the PD78018F was enhanced EMI-noise reduced version of the PD78018F
µ
PD78018FY
Low-voltage (1.8 V) operation versions of the PD78014 with choice of several ROM and RAM capacities A/D converter and 16-bit timer were added to the PD78002 A/D converter was added to the PD78002
PD78014Y
PD78002
PD78002Y
Basic subseries for control
On-chip UART, capable of operation at a low voltage (1.8 V)
The inverter control, timer, and SIO of the PD780964 were enhanced. ROM size and RAM size were expanded
PD780924 64-pin A/D converter of the PD780924 was enhanced On-chip inverter control circuit and UART. EMI-noise reduced version
µ
I/O and FIP C/D of the PD78044F were enhanced. Display output total: 53 I/O and FIP C/D of the PD78044H were enhanced. Display output total: 48
N-ch open-drain I/O was added to the PD78044F. Display output total: 34
PD78044F 80-pin Basic subseries for driving FIP. Display output total: 34
PD780308Y
SIO of the PD78064 was enhanced. ROM size and RAM size were expanded EMI-noise reduced version of the PD78064
Subseries for driving LCDs. On-chip UART
PD78064Y
PD78098B
EMI-noise reduced version of the PD78098
PD78098 80-pin IEBus controller was added to the PD78054
On-chip controller/driver for driving automobile meters PD780973 80-pin Meter control

CHAPTER 1 OUTLINE (µPD78058F SUBSERIES)
The differences between the major functions of each subseries are shown below.
Function ROM Timer 8-bit 10-bit 8-bit Serial Interface I/O VDD External
Subseries Capacity 8-bit 16-bit Watch WDT A/D A/D D/A MIN. value extension
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
µPD780058 24 K to 60 K 2 ch 3 ch (time-division 68 1.8 V
µPD78058F 48 K to 60 K 3 ch (UART: 1 ch) 69 2.7 V
µPD78054 16 K to 60 K 2.0 V
µPD780034 8 K to 32 K — 8 ch — 3 ch (UART: 1 ch, time 51 1.8 V
µPD780024 8 ch — -division 3-wire: 1 ch)
µPD78014H 2 ch 53
µPD78018F 8 K to 60 K
µPD78014 8 K to 32 K 2.7 V
µPD780001 8 K — — 1 ch 39 —
µPD78002 8 K to 16 K 1 ch — 53 √
µPD78083 — 8 ch 1 ch (UART: 1 ch) 33 1.8 V —
Inverter µPD780988 32 K to 60 K 3 ch Note 1 — 1 ch — 8 ch — 3 ch (UART: 2 ch) 47 4.0 V √
control µPD780964 8 K to 32 K Note 2 2 ch (UART: 2 ch) 2.7 V
µPD780924 8 ch —
FIP µPD780208 32 K to 60 K 2 ch 1 ch 1 ch 1 ch 8 ch — — 2 ch 74 2.7 V —
drive µPD780228 48 K to 60 K 3 ch — — 1 ch 72 4.5 V
µPD78044H 32 K to 48 K 2 ch 1 ch 1 ch 68 2.7 V
µPD78044F 16 K to 40 K 2 ch
LCD µPD780308 48 K to 60 K 2 ch 1 ch 1 ch 1 ch 8 ch — — 3 ch (time-division 57 2.0 V —
µPD78064B 32 K 2 ch (UART: 1 ch)
µPD78064 16 K to 32 K
IEBUS µPD78098B 40 K to 60 K 2 ch 1 ch 1 ch 1 ch 8 ch — 2 ch 3 ch (UART: 1 ch) 69 2.7 V √
support µPD78098 32 K to 60 K
Meter µPD780973 24 K to 32 K 3 ch 1 ch 1 ch 1 ch 5 ch — — 2 ch (UART: 1 ch) 56 4.5 V —
control

CHAPTER 1 OUTLINE (µPD78058F SUBSERIES)
P00 P01 to P06 P07
PORT 0
TI00/INTP0/P00
16-bit TIMER/ EVENT COUNTER
PORT 1
TO1/P31
8-bit TIMER/ EVENT COUNTER 1
PORT 2
TO2/P32
8-bit TIMER/ EVENT COUNTER 2
PORT 3
WATCHDOG TIMER
PORT 4
WATCH TIMER
SI0/SB0/P25
PORT 5
SERIAL INTERFACE 0
SO0/SB1/P26
SCK0/P27
78K/0 CPU CORE ROM
PORT 6
SI1/P20 SO1/P21 SCK1/P22
SERIAL INTERFACE 1
PORT 7
STB/P23 BUSY/P24
PORT 12
SERIAL INTERFACE 2
SCK2/ASCK/P72
PORT 13
P130, P131
RAM
ANI7/P17
REAL-TIME OUTPUT PORT
A/D CONVERTER
AV REF0
AD0/P40 to AD7/P47 A8/P50 to A15/P57
ANO1/P131
D/A CONVERTER
EXTERNAL ACCESS
RD/P64
AV REF1
WR/P65
WAIT/P66
ASTB/P67
INTERRUPT CONTROL
INTP6/P06
RESET
BUZ/P36
BUZZER OUTPUT
SYSTEM CONTROL
PCL/P35 AV DD AV SS
CLOCK OUTPUT CONTROL
V DD V SS IC (V PP )
XT1/P07
XT2
Remarks 1. The internal ROM and RAM capacities depend on the product.

CHAPTER 1 OUTLINE (µPD78058F SUBSERIES)
µPD78056F µPD78058F µPD78P058F
ROM Mask ROM PROM
48 Kbytes 60 Kbytes 60 KbytesNote 1
High-speed RAM 1024 bytes 1024 bytesNote 1
Buffer RAM 32 bytes
Expansion RAM None 1024 bytes 1024 bytesNote 2
Memory space 64 Kbytes
General register 8 bits × 8 × 4 banks
Minimum instruction execution time
With main system clock selected 0.4 µs/0.8 µs/1.6 µs/3.2 µs/6.4 µs/12.8 µs (at 5.0-MHz operation)
With subsystem clock selected 122 µs (at 32.768-kHz operation)
Instruction set • 16-bit operation
A/D converter 8-bit resolution × 8 channels
D/A converter 8-bit resolution × 2 channels
Serial interface • 3-wire serial I/O/SBI/2-wire serial I/O mode selection possible : 1 channel
Clock output 19.5 kHz, 39.1 kHz, 78.1 kHz, 156 kHz, 313 kHz, 625 kHz, 1.25 MHz,
2.5 MHz, 5.0 MHz (at 5.0-MHz operation with main system clock)
32.768 kHz (at 32.768-kHz operation with subsystem clock)
memory size switching register (IMS).
switching register (IXS).
Part Number · Item · Internal memory

CHAPTER 1 OUTLINE (µPD78058F SUBSERIES)
µPD78056F µPD78058F µPD78P058F
Buzzer output 1.2 kHz, 2.4 kHz, 4.9 KHz, 9.8 kHz (main system clock at 5.0-MHz
Supply voltage VDD = 2.7 to 6.0 V
Operating ambient temperature TA = –40 to +85 °C
Package • 80-pin plastic QFP (14 × 14 mm, Resin thickness : 2.7 mm)
Table 1-1. Differences Between the µPD78058F and µPD78058F(A)
µPD78058F µPD78058F(A)
Quality grade Standard Special
(14 × 14 mm, Resin thickness: 2.7 mm) (14 × 14 mm, Resin thickness: 2.7 mm)
(14 × 14 mm, Resin thickness: 1.4 mm)
(12 × 12 mm)

CHAPTER 1 OUTLINE (µPD78058F SUBSERIES)
There are mask options in the mask ROM versions (µPD78056F, 78058F). By specifying the mask option when
ordering, you can have the pull-up resistors shown in Table 1-2 incorporated on-chip. If a mask option is used when
pull-up resistors are required, the number of parts can be reduced and package area can be shrunk.
The mask option provided for the µPD78058F Subseries is shown in Table 1-2.
Pin Names Mask Options
P60 to P63 Pull-up resistors can be incorporated in 1-bit units.

2.1 Features
Compared to the conventional µPD78054Y Subseries, EMI (Electro Magnetic Interference) noise has been
reduced.
On-chip high-capacity ROM and RAM
Internal High-Speed RAM Internal Buffer RAM Internal Expansion RAM
1024 bytes 32 bytes None
60 KbytesNote 1
1024 bytesNote 1 1024 byesNote 2
memory size switching register (IMS).
size switching register (IXS).
Minimum instruction execution time changeable from high speed (0.4 µs: In main system clock 5.0 MHz operation)
to ultra-low speed (122 µs: In subsystem clock 32.768 kHz operation)
Instruction set suited to system control
Two types of on-chip clock oscillators (main system clock and subsystem clock)

CHAPTER 2 OUTLINE (µPD78058FY SUBSERIES)
In the case of the µPD78056FY, 78058FY and 78P058FY,
Cellular phones, pagers, printers, AV equipment, air conditioners, cameras, PPCs, fuzzy home appliances, vending
machines, etc.
In the case of the µPD78058FY (A),
Controllers for car electronics, gas detection and shut-off devices, various safety devices, etc.
Part Number Package Internal ROM
µPD78056FYGC-×××-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) Mask ROM
µPD78056FYGC-×××-8BT 80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm) Mask ROM
µPD78058FYGC-×××-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) Mask ROM
µPD78058FYGC-×××-8BT 80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm) Mask ROM
µPD78058FYGK-×××-BE9 80-pin plastic TQFP (Fine pitch) (12 × 12 mm) Mask ROM
µPD78058FYGC(A)-×××-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) Mask ROM
µPD78P058FYGC-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) One-time PROM
µPD78P058FYGC-8BTNote 80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm) One-time PROM
Remark ××× indicates ROM code suffix.

CHAPTER 2 OUTLINE (µPD78058FY SUBSERIES)
Part Number Package Quality Grade
µPD78056FYGC-×××-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) Standard
µPD78056FYGC-×××-8BT 80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm) Standard
µPD78058FYGC-×××-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) Standard
µPD78058FYGC-×××-8BT 80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm) Standard
µPD78058FYGK-×××-BE9 80-pin plastic TQFP (Fine pitch)(12 × 12 mm) Standard
µPD78058FYGC(A)-×××-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) Special
µPD78P058FYGC-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) Standard
µPD78P058FYGC-8BTNote 80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm) Standard
Remark ××× indicates ROM code suffix.
Please refer to Quality grade on NEC Semiconductor Devices (Document number C11531E) published by
NEC Corporation to know the specification of quality grade on the devices and its recommended applications.

CHAPTER 2 OUTLINE (µPD78058FY SUBSERIES)
(1) Normal operating mode
80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm)
µPD78056FYGC-×××-3B9, 78058FYGC-×××-3B9, 78058FYGC(A)-×××-3B9, µPD78P058FYGC-3B9
80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm)
µPD78056FYGC-×××-8BT, 78058FYGC-×××-8BT, 78P058FYGC-8BTNote
80-pin plastic TQFP (Fine pitch) (12 × 12 mm)
µPD78058FYGK-×××-BE9
P00/INTP0/TI00
P14/ANI4
P13/ANI3
P12/ANI2
P11/ANI1
P10/ANI0
P06/INTP6
P05/INTP5
P04/INTP4
P03/INTP3
P02/INTP2
XT1/P07
AV REF0
IC (V PP )
AV DD
XT2
V DD

80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41
RESET P127/RTP7 P126/RTP6 P125/RTP5 P124/RTP4 P123/RTP3 P122/RTP2 P121/RTP1 P120/RTP0 P37 P36/BUZ P35/PCL P34/TI2 P33/TI1 P32/TO2 P31/TO1 P30/TO0 P67/ASTB P66/WAIT P65/WR
AVREF1 P70/SI2/RxD P71/SO2/TxD P72/SCK2/ASCK
P23/STB P24/BUSY P25/SI0/SB0/SDA0 P26/SO0/SB1/SDA1
P27/SCK0/SCL
P40/AD0 P41/AD1
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
P43/AD3
P44/AD4
P45/AD5
P46/AD6
P47/AD7
P50/A8
P51/A9
P52/A10
P53/A11
P54/A12
P55/A13
P56/A14
P57/A15
P64/RD
this device is used in application fields where reduction of noise generated internally in
the microprocessor is required, please connect to a separate power supply with the same
electrical potential as VDD.
port. If this device is used in application fields where reduction of noise generated
internally in the microprocessor is required, please connect it to a ground line which is
separate from VSS.
Remark Pin connection in parentheses is intended for the µPD78P058FY.

CHAPTER 2 OUTLINE (µPD78058FY SUBSERIES)
RD ; Read Strobe

CHAPTER 2 OUTLINE (µPD78058FY SUBSERIES)
80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm)
80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm)
(L)
PGM
V SS
V DD
(L)
V PP
(L)
V DD
(L)
A9
80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41
(L)
V SS
(L)
(L)
V DD
D7 D6 D5 D4 D3 D2 D1 D0
(L)
(L)
A0 A1
CE
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
A3
A4
A5
A6
A7
A8
A16
A10
A11
A12
A13
V SS
A14
A15
OE
(L)

CHAPTER 2 OUTLINE (µPD78058FY SUBSERIES)
The 78K/0 Series expansion is shown below. The names in frames are subseries.
Products in mass production
Y subseries products are compatible with I2C bus.
µ
EMI-noise reduced version of the PD78078
PD78078Y
Timer was added to the PD78054 and the external interface function was enhanced
ROM-less versions of the PD78078 Serial I/O of the PD78078Y was enhanced and only selected functions are provided
µ
PD780058Y
Serial I/O of the PD78054 was enhanced. EMI-noise reduced version EMI-noise reduced version of the PD78054
PD78058FY
PD78054 PD780034 PD780024 PD780024Y PD78014H PD78018F
PD78054Y
UART and D/A converter were added to the PD78014 and I/O was enhanced A/D converter of the PD780024 was enhanced Serial I/O of the PD78018F was enhanced EMI-noise reduced version of the PD78018F
µ
PD78018FY
Low-voltage (1.8 V) operation versions of the PD78014 with choice of several ROM and RAM capacities A/D converter and 16-bit timer were added to the PD78002 A/D converter was added to the PD78002
PD78014Y
PD78002
PD78002Y
Basic subseries for control
On-chip UART, capable of operation at a low voltage (1.8 V)
The inverter control, timer, and SIO of the PD780964 were enhanced. ROM size and RAM size were expanded
PD780924 64-pin A/D converter of the PD780924 was enhanced On-chip inverter control circuit and UART. EMI noise reduced version
FIP drive 78K/0 Series
µ
The I/O and FIP C/D of the PD78044F were enhanced. Display output total: 53 The I/O and FIP C/D of the PD78044H were enhanced. Display output total: 48
N-ch open-drain I/O was added to the PD78044F. Display output total: 34
PD78044F 80-pin Basic subseries for driving FIP. Display output total: 34
PD780308Y
SIO of the PD78064 was enhanced. ROM size and RAM size were expanded EMI-noise reduced version of the PD78064
PD78064
PD78064Y
Subseries for driving LCDs. On-chip UART
EMI-noise reduced version of the PD78098
PD78098 80-pin IEBus controller was added to the PD78054
On-chip controller/driver for driving automobile meters PD780973 80-pin Meter control

CHAPTER 2 OUTLINE (µPD78058FY SUBSERIES)
The differences between the major functions of each subseries are shown below.
Function ROM Serial Interface I/O VDD Subseries Capacity MIN. Value
Control µPD78078Y 48 K to 60 K 3-wire/2-wire/I2C : 1 ch 88 1.8 V
µPD78070AY — 3-wire with automatic send/receive function. : 1 ch 61 2.7 V
µPD780018AY 48 K to 60 K 3-wire with automatic send/receive function. : 1 ch 88
I2C Bus (Multi Master compatible) : 1 ch
µPD780058Y 24 K to 60 K 3-wire/2-wire/I2C : 1 ch 68 1.8 V
3-wire with automatic send/receive function. : 1 ch
µPD78058FY 48 K to 60 K 3-wire/2-wire/I2C : 1 ch 69 2.7 V
µPD78054Y 16 K to 60 K 3-wire with automatic send/receive function. : 1 ch
µPD780034Y 8 K to 32 K UART : 1 ch 51 1.8 V
I2C Bus (Multi Master compatible) : 1 ch
µPD78018FY 8 K to 60 K 3-wire/2-wire/I2C : 1 ch 53
3-wire with automatic send/receive function. : 1 ch
µPD78014Y 8 K to 32 K 3-wire/2-wire/SBI/I2C : 1 ch 2.7 V
3-wire with automatic send/receive function. : 1 ch
µPD78002Y 8 K to 16 K 3-wire/2-wire/SBI/I2C : 1 ch
LCD µPD780308Y 48 K to 60 K 3-wire/2-wire/I2C : 1 ch 57 2.0 V
µPD78064Y 16 K to 32 K 3-wire/2-wire/I2C : 1 ch
Remark Functions other than the serial interface are common with Subseries without the Y.
µPD780024Y

CHAPTER 2 OUTLINE (µPD78058FY SUBSERIES)
P00 P01 to P06 P07
16-bit TIMER/ EVENT COUNTER
TI00/INTP0/P00
TI01/INTP1/P01
PORT 1
TO1/P31
8-bit TIMER/ EVENT COUNTER 1
TO2/P32
PORT 2
8-bit TIMER/ EVENT COUNTER 2
PORT 3
WATCHDOG TIMER
PORT 4
WATCH TIMER
SI0/SB0/SDA0/P25
PORT 5
SO0/SB1/SDA1/P26
SERIAL INTERFACE 0
SCK0/SCL/P27
78K/0 CPU CORE ROM
PORT 6
SI1/P20 SO1/P21 SCK1/P22
SERIAL INTERFACE 1
PORT 7
STB/P23 BUSY/P24
PORT 12
SERIAL INTERFACE 2
SCK2/ASCK/P72
RAM
PORT 13
P130, P131
ANI7/P17
REAL-TIME OUTPUT PORT
A/D CONVERTER
AV REF0
AD0/P40 to AD7/P47 A8/P50 to A15/P57
ANO1/P131
EXTERNAL ACCESS
AV SS
D/A CONVERTER
RD/P64
AV REF1
WR/P65
WAIT/P66
INTERRUPT CONTROL
ASTB/P67
INTP6/P06
RESET
BUZ/P36
BUZZER OUTPUT
SYSTEM CONTROL
XT1/P07
PCL/P35 AV DD AV SS
CLOCK OUTPUT CONTROL
V DD V SS IC (V PP )
XT2
Remarks 1. The internal ROM and RAM capacities depend on the product.

CHAPTER 2 OUTLINE (µPD78058FY SUBSERIES)
µPD78056FY µPD78058FY µPD78P058FY Item
ROM Mask ROM PROM
48 Kbytes 60 Kbytes 60 KbytesNote 1
High-speed RAM 1024 bytes 1024 bytesNote 1
Buffer RAM 32 bytes
Expansion RAM None 1024 bytes 1024 bytesNote 2
Memory space 64 Kbytes
General register 8 bits × 8 × 4 banks
Minimum instruction execution time
With main system clock selected 0.4 µs/0.8 µs/1.6 µs/3.2 µs/6.4 µs/12.8 µs (at 5.0-MHz operation)
With subsystem clock selected 122 µs (at 32.768-kHz operation)
Instruction set • 16-bit operation
A/D converter 8-bit resolution × 8 channels
D/A converter 8-bit resolution × 2 channels
Serial interface • 3-wire serial I/O/2-wire serial I/O/I2C bus mode selection possible : 1 channel
Clock output 19.5 kHz, 39.1 kHz, 78.1 kHz, 156 kHz, 313 kHz, 625 kHz, 1.25 MHz,
2.5 MHz, 5.0 MHz (at 5.0-MHz operation with main system clock)
32.768 kHz (at 32.768-kHz operation with subsystem clock)
Buzzer output 1.2 kHz, 2.4 kHz, 4.9 kHz, 9.8 kHz (at 5.0-MHz operation with main system clock)
memory switching register (IMS).
switching register (IXS).
Part Number · Internal memory

CHAPTER 2 OUTLINE (µPD78058FY SUBSERIES)
µPD78056FY µPD78058FY µPD78P058FY
Supply voltage VDD = 2.7 to 6.0 V
Operating ambient temperature TA = –40 to +85°C
Package • 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm)
Table 2-1. Differences Between the µPD78058FY and µPD78058FY(A)
µPD78058FY µPD78P058FY(A)
Quality grade Standard Special
(14 × 14 mm, Resin thickness: 2.7 mm) (14 × 14 mm, Resin thickness: 2.7 mm)
(14 × 14 mm, Resin thickness: 1.4 mm)
(12 × 12 mm)

CHAPTER 2 OUTLINE (µPD78058FY SUBSERIES)
The mask ROM versions (µPD78056FY, 78058FY) 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 µPD78058FY Subseries are shown in Table 2-2.
Pin Names Mask Options
P60 to P63 Pull-up resistor connection can be specified in 1-bit units.

3.1 Pin Function List
3.1.1 Normal operating mode pins
(1) Port pins (1/3)
Pin Name Input/Output Function After Reset Alternate Function
P00 Input Port 0. Input only Input INTP0/TI00
P01 Input/ 8-bit input/output port. Input/output mode can be specified Input INTP1/TI01
P02 output bit-wise. INTP2
P03 If used as an input port, an on-chip INTP3
P04 pull-up resistor can be used by INTP4
P05 software. INTP5
P07Note 1 Input Input only Input XT1
P10 to P17 Input/ Port 1. Input ANI0 to ANI7
output 8-bit input/output port.
Input/output mode can be specified bit-wise.
If used as input port, an on-chip pull-up resistor can be used by
softwareNote 2.
P20 Input/ Port 2. Input SI1
P21 output 8-bit input/output port. SO1
P22 Input/output mode can be specified bit-wise. SCK1
P23 If used as an input port, an on-chip pull-up resistor can be used by STB
P24 software. BUSY
P26 SO0/SB1
P27 SCK0
(PCC) to 1 (do not use the feedback resistor internal to the subsystem clock oscillator).
mode. The on-chip pull-up resistor will be automatically disabled.

CHAPTER 3 PIN FUNCTION (µPD78058F SUBSERIES)
Pin Name Input/Output Function After Reset Alternate Function
P30 Input/ Port 3. Input TO0
P31 output 8-bit input/output port. TO1
P32 Input/output mode can be specified bit-wise. TO2
P33 If used as an input port, an on-chip pull-up resistor can be used by TI1
P34 software. TI2
P36 BUZ
P37 —
P40 to P47 Input/ Port 4. Input AD0 to AD7
output 8-bit input/output port.
Input/output mode can be specified in 8-bit units.
If used as an input port, an on-chip pull-up resistor can be used by
software.
Test input flag (KRIF) is set to 1 by falling edge detection.
P50 to P57 Input/ Port 5. Input A8 to A15
output 8-bit input/output port.
LED can be driven directly.
Input/output mode can be specified bit-wise.
If used as an input port, an on-chip pull-up resistor can be used by software.
P60 Input/ Port 6. Input —
N-ch open-drain input/output port. On-chip pull-up resistor can be specified by mask option (Mask ROM version only). LEDs can be driven directly.
P61 output 8-bit input/output port.
P62 Input/output mode can be
P63 specified bit-wise.
P64 If used as an input port, an on-chip RD
P65 pull-up resistor can be used by WR
P66 software. WAIT
Input/ Port 7.
output 3-bit input/output port.
Input/output mode can be specified bit-wise.
If used as an input port, an on-chip pull-up resistor can be used by software.
P70 Input SI2/RxD · P71 SO2/TxD

CHAPTER 3 PIN FUNCTION (µPD78058F SUBSERIES)
Pin Name Input/Output Function After Reset Alternate Function
P120 to P127 Input/ Port 12. Input RTP0 to RTP7
output 8-bit input/output port.
Input/output mode can be specified bit-wise.
If used as an input port, an on-chip pull-up resistor can be used by software.
P130, P131 Input/ Port 13. Input ANO0 to ANO1
2-bit input/output port.
Input/output mode can be specified bit-wise.
If used as an input port, an on-chip pull-up resistor can be used by software.
be maintained during A/D conversion.
<1> If it is used as a port, rewriting the output latch of its output.
<2> Even if it is not used as a port, changing the output level of pins used as outputs.
output

CHAPTER 3 PIN FUNCTION (µPD78058F SUBSERIES)
Pin Name Input/Output Function After Reset Alternate Function
INTP0 Input External interrupt request inputs with specifiable valid edges (rising Input P00/TI00
INTP1 edge, falling edge, both rising and falling edges). P01/TI01
INTP3 P03
INTP4 P04
INTP5 P05
INTP6 P06
SI0 Input Serial interface serial data input Input P25/SB0
SO0 Output Serial interface serial data output Input P26/SB1
SB0 Input/ Serial interface serial data input/output Input P25/SI0
SCK0 Input/ Serial interface serial clock input/output Input P27
STB Output Serial interface automatic transmit/receive strobe output Input P23
BUSY Input Serial interface automatic transmit/receive busy input Input P24
RxD Input Asynchronous serial interface serial data input Input P70/SI2
TxD Output Asynchronous serial interface serial data output Input P71/SO2
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
TI1 External count clock input to 8-bit timer (TM1) P33
TI2 External count clock input to 8-bit timer (TM2) P34
TO0 Output 16-bit timer (TM0) output (also used for 14-bit PWM output) Input P30
TO1 8-bit timer (TM1) output P31
TO2 8-bit timer (TM2) output P32
PCL Output Clock output (for main system clock and subsystem clock trimming) Input P35
BUZ Output Buzzer output Input P36
RTP0 to RTP7 Output Real-time output port outputting data in synchronization with trigger Input P120 to P127

CHAPTER 3 PIN FUNCTION (µPD78058F SUBSERIES)
Pin Name Input/Output Function After Reset Alternate Function
AD0 to AD7 Input/Output Low-order address/data bus when expanding external memory Input P40 to P47
A8 to A15 Output High-order address bus when expanding external memory Input P50 to P57
RD Strobe signal output for read operation from external memory P64
WR Strobe signal output for write operation to external memory P65
WAIT Input Wait insertion when accessing external memory Input P66
ASTB Output Input P67
Strobe output externally latching address information output to ports 4,
5 to access external memory
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 — —
AVREF1 Input D/A converter reference voltage input — —
AVDD — A/D converter analog power supply. (Common with the port power supply) — —
AVSS — Ground potential (common with the port’s ground potential) of the A/D — —
converter and D/A converter.
RESET Input System reset input — —
X1 Input Crystal connection for main system clock oscillation — —
XT1 Input Crystal connection for subsystem clock osicllation Input P07
VDD — Positive power supply (Except the port) — —
VPP — High-voltage application for program write/verify. — — Connect directly to VSS in the normal operation mode.
VSS — Ground potential (Except the port) — —
IC — Internally connected. Connect directly to VSS. — —
this device is used in application fields where reduction of noise generated internally in
the microprocessor is required, please connect to a separate power supply with the same
electrical potential as VDD.
and also as the ground potential for the ports. If this device is used in application fields
connect it to a ground line which is separate from VSS.
Output Input

CHAPTER 3 PIN FUNCTION (µPD78058F SUBSERIES)
Pin Name Input/Output Function
RESET Input PROM programming mode setting.
When +5 V or +12.5 V is applied to the VPP pin or a low level voltage is applied to the RESET pin,
the PROM programming mode is set.
VPP Input High-voltage application for PROM programming mode setting and program write/verify.
A0 to A16 Input Address bus
D0 to D7 Input/output Data bus
CE Input PROM enable input/program pulse input
OE Input Read strobe input to PROM
PGM Input Program/program inhibit input in PROM programming mode
VDD — Positive power supply
VSS — Ground potential

CHAPTER 3 PIN FUNCTION (µPD78058F SUBSERIES)
3.2.1 P00 to P07 (Port 0)
These are 8-bit input/output ports. Besides serving as input/output ports, they function as an external interrupt
request input, an external count clock input to the timer, a capture trigger signal input, and crystal connection for
subsystem oscillation.
The following operating modes can be specified bit-wise.
P00 and P07 function as input-only ports and P01 to P06 function as input/output ports.
P01 to P06 can be specified for input or output ports bit-wise with a port mode register 0 (PM0). When they
are used as input ports, on-chip pull-up resistors can be used to them by defining the pull-up resistor option
register L (PUOL).
In this mode, these ports function as an external interrupt request input, an external count clock input to the
timer, and crystal connection for subsystem clock oscillation.
INTP0 to INTP6 are external interrupt request input pins which can specify valid edges (rising edge, falling
edge, and both rising and falling edges). INTP0 or INTP1 becomes a 16-bit timer/event counter capture
trigger signal input pin with a valid edge input.
Pin for external count clock input to 16-bit timer/event counter
Pin for capture trigger signal to capture register (CR00) of 16-bit timer/event counter
Crystal connect pin for subsystem clock oscillation

CHAPTER 3 PIN FUNCTION (µPD78058F SUBSERIES)
These are 8-bit input/output ports. Besides serving as input/output ports, they function as an A/D converter analog
input.
The following operating modes can be specified bit-wise.
These ports function as 8-bit input/output ports. They can be specified bit-wise as input or output ports with
a port mode register 1 (PM1). If used as input ports, on-chip pull-up resistors can be used to these ports by
defining the pull-up resistor option register L (PUOL).
These ports function as A/D converter analog input pins (ANI0 to ANI7). The on-chip pull-up resistor is
automatically disabled when the pins specified for analog input.
These are 8-bit input/output ports. Besides serving as input/output ports, they function as data input/output to/
from the serial interface, clock input/output, automatic transmit/receive busy input, and strobe output functions.
The following operating modes can be specified bit-wise.
These ports function as 8-bit input/output ports. They can be specified bit-wise as input or output ports with
port mode register 2 (PM2). When they are used as input ports, on-chip pull-up resistors can be used to them
by defining the pull-up resistor option register L (PUOL).
These ports function as serial interface data input/output, clock input/output, automatic transmit/receive busy
input, and strobe output functions.
Serial interface serial data input/output pins
Serial interface serial clock input/output pins
NEC standard serial bus interface input/output pins

CHAPTER 3 PIN FUNCTION (µPD78058F SUBSERIES)
Serial interface automatic transmit/receive busy input pins
Serial interface automatic transmit/receive strobe output pins
according to the function the user requires. For the setting, refer to Figure 16-4 “Serial
1 Format.”
3.2.4 P30 to P37 (Port 3)
These are 8-bit input/output ports. Beside serving as input/output ports, they function as timer input/output, clock
output and buzzer output.
The following operating modes can be specified bit-wise.
These ports function as 8-bit input/output ports. They can be specified bit-wise as input or output ports with
port mode register 3 (PM3). When they are used as input ports, on-chip pull-up resistors can be used by
defining the pull-up resistor option register L (PUOL).
These ports function as timer input/output, clock output, and buzzer output.
Pin for external count clock input to the 8-bit timer/event counter.
Timer output pins.
Clock output pin.
Buzzer output pin.

CHAPTER 3 PIN FUNCTION (µPD78058F SUBSERIES)
These are 8-bit input/output ports. Besides serving as input/output ports, they function as an address/data bus.
The test input flag (KRIF) can be set to 1 by detecting a falling edge.
The following operating mode can be specified in 8-bit units.
These ports function as 8-bit input/output ports. They can be specified in 8-bit units for input or output ports
by using the memory expansion mode register (MM). When they are used as input ports, on-chip pull-up
resistors can be used by defining the pull-up resistor option register L (PUOL).
These ports function as low-order address/data bus pins (AD0 to AD7) in external memory expansion mode.
When pins are used as an address/data bus, the on-chip pull-up resistor is automatically disabled.
These are 8-bit input/output ports. Besides serving as input/output ports, they function as an address bus.
Port 5 can drive LEDs directly.
The following operating modes can be specified bit-wise.
These ports function as 8-bit input/output ports. They can be specified bit-wise as input/output ports with port
mode register 5 (PM5). When they are used as input ports, on-chip pull-up resistors can be used by defining
the pull-up resistor option register L (PUOL).
These ports function as high-order address bus pins (A8 to A15) in external memory expansion mode. When
pins are used as an address bus, the on-chip pull-up resistor is automatically disabled.
These are 8-bit input/output ports. Besides serving as input/output ports, they are used for control in external
memory expansion mode. P60 to P63 can drive LEDs directly.
The following operating modes can be specified bit-wise.

CHAPTER 3 PIN FUNCTION (µPD78058F SUBSERIES)
These ports function as 8-bit input/output ports. They can be specified bit-wise as input or output ports with
port mode register 6 (PM6).
P60 to P63 are N-ch open drain outputs. Mask ROM version can contain pull-up resistors with the mask option.
When P64 to P67 are used as input ports, on-chip pull-up resistors can be used by defining the pull-up resistor
option register L (PUOL).
These ports function as control signal output pins (RD, WR, WAIT, ASTB) in external memory expansion mode.
When a pin is used as a control signal output, the on-chip pull-up resistor is automatically disabled.
input/output port.
This is a 3-bit input/output port. In addition to its use as an input/output port, it also has serial interface data input/
output and clock input/output functions.
The following operating modes can be specified bit-wise.
Port 7 functions as a 3-bit input/output port. Bit-wise specification as an input port or output port is possible
by means of port mode register 7 (PM7). When used as input ports, on-chip pull-up resistors can be used
by defining the pull-up resistor option register L (PUOL).
Port 7 functions as serial interface data input/output and clock input/output.
Serial interface serial data input/output pins
Serial interface serial clock input/output pin.
Asynchronous serial interface serial data input/output pins.
Asynchronous serial interface serial clock input/output pin.
according to the function the user requires.
For the setting, refer to Table 19-2 “Serial Interface Channel 2 Operating Mode Settings of
List”.

CHAPTER 3 PIN FUNCTION (µPD78058F SUBSERIES)
These are 8-bit input/output ports. Besides serving as input/output ports, they function as a real-time output port.
The following operating modes can be specified bit-wise.
These ports function as 8-bit input/output ports. They can be specified bit-wise as input or output ports with
port mode register 12 (PM12). When they are used as input ports, on-chip pull-up resistors can be used by
defining the pull-up resistor option register H (PUOH).
These ports function as real-time output ports (RTP0 to RTP7) outputting data in synchronization with a
trigger.
These are 2-bit input/output ports. Besides serving as input/output ports, they are used for D/A converter analog
output.
The following operating modes can be specified bit-wise.
These ports function as 2-bit input/output ports. They can be specified bit-wise as input or output ports with
port mode register 13 (PM13). When they are used as input ports, on-chip pull-up resistors can be used by
defining the pull-up resistor option register H (PUOH).
These ports allow D/A converter analog output (ANO0 and ANO1).
to VSS.
to 0, to output low level from the pin.
A/D converter reference voltage input pin.
When A/D converter is not used, connect this pin to VSS.
D/A converter reference voltage input pin.
When D/A converter is not used, connect this pin to VDD.

CHAPTER 3 PIN FUNCTION (µPD78058F SUBSERIES)
This is the analog power supply pin of the A/D converter and the port’s power supply pin. Always use the same
voltage as that of the VDD pin even when the A/D converter is not used.
This is the ground potential pin for the A/D converter and D/A converter, and the ground potential pin for the port.
Even when the A/D converter and D/A converter are not used, always use the same potential as that of the VSS pin.
This is a low-level active system reset input pin.
Crystal resonator connect pins for main system clock oscillation.
For external clock supply, input it to X1 and its inverted signal to X2.
Crystal resonator connect pins for subsystem clock oscillation.
For external clock supply, input it to XT1 and its inverted signal to XT2.
Positive power supply pin (Except the port)
Ground potential pin (Except the port)
High-voltage apply pin for PROM programming mode setting and program write/verify. When in the normal
operating mode, connect directly to VSS.

CHAPTER 3 PIN FUNCTION (µPD78058F SUBSERIES)
The IC (Internally Connected) pin is provided to set the test mode to check the µPD78058F Subseries at delivery.
Connect it directly to the VSS with the shortest possible wire in the normal operating mode.
When a voltage difference is produced between the IC pin and VSS pin because the wiring between those two pins
is too long or an external noise is input to the IC pin, the user's program may not run normally.
Connect IC pins to VSS pins directly.
As short as possible

CHAPTER 3 PIN FUNCTION (µPD78058F SUBSERIES)
Table 3-1 shows the input/output circuit types of pins and the recommended conditions for unused pins.
Refer to Figure 3-1 for the configuration of the input/output circuit of each type.
Pin Name Input/Output Input/Output Recommended Connection of Unused Pins Circuit Type
P00/INTP0/TI00 2 Input Connect to VSS.
P01/INTP1/TI01 8-D Input/output Connect independently via a resistor to VSS.
P03/INTP3
P04/INTP4
P05/INTP5
P06/INTP6
P07/XT1 16 Input Connect to VDD.
P10/ANI0 to P17/ANI7 11-C Input/output Connect independently via a resistor
P20/SI1 8-D Input/output to VDD or VSS.
P22/SCK1 8-D
P23/STB 5-J
P24/BUSY 8-D
P25/SI0/SB0
P26/SO0/SB1 10-C
P27/SCK0
P31/TO1
P32/TO2
P33/TI1 8-D
P34/TI2
P35/PCL 5-J
P36/BUZ
P37
P40/AD0 to P47/AD7 5-O Input/output Connect independently via a
resistor to VDD.
P50/A8 to P57/A15 5-J Input/output Connect independently via a resistor to VDD or VSS.
P30/TO0 5-J Input/output

CHAPTER 3 PIN FUNCTION (µPD78058F SUBSERIES)
Input/Output Recommended Connection of Unused Pins Circuit Type
P60 to P63 (Mask ROM version) 13-I Input/output Connect independently via a resistor to VDD.
P60 to P63 (PROM version) 13-H
P64/RD 5-D Input/output Connect independently via a resistor to VDD or VSS.
P66/WAIT
P67/ASTB
P72/SCK2/ASCK 8-D
P120/RTP0 to P127/RTP7 5-J
P130/ANO0, P131/ANO1 12-B Input/output Connect independently via a resistor to VSS.
RESET 2 Input —
XT2 16 — Leave open.
Connect to VSS.
AVREF1 Connect to VDD.
Connect to a separate power supply with
the same potential as VDD.
Connect to a separate ground with the
same potential as VSS.
IC (Mask ROM version) Connect directly to VSS.
VPP (PROM version)

CHAPTER 3 PIN FUNCTION (µPD78058F SUBSERIES)


CHAPTER 3 PIN FUNCTION (µPD78058F SUBSERIES)


4.1 Pin Function List
4.1.1 Normal operating mode pins
(1) Port pins (1/3)
Pin Name Input/Output Function After Reset Alternate Function
P00 Input Port 0. Input only Input INTP0/TI00
P01 Input/ 8-bit input/output port. Input/output mode can be specified Input INTP1/TI01
P02 output bit-wise. INTP2
P03 If used as an input port, an on-chip INTP3
P04 pull-up resistor can be used by INTP4
P05 software. INTP5
P07Note 1 Input Input only Input XT1
P10 to P17 Input/ Port 1. Input ANI0 to ANI7
output 8-bit input/output port.
Input/output mode can be specified bit-wise.
If used as input port, an on-chip pull-up resistor can be used by
softwareNote 2.
P20 Input/ Port 2. Input SI1
P21 output 8-bit input/output port. SO1
P22 Input/output mode can be specified bit-wise. SCK1
P23 If used as an input port, an on-chip pull-up resistor can be used by STB
P24 software. BUSY
P26 SO0/SB1/SDA1
P27 SCK0/SCL
(PCC) to 1 (do not use the feedback resistor internal to the subsystem clock oscillator).
mode. The on-chip pull-up resistor will be automatically disabled.

CHAPTER 4 PIN FUNCTION (µPD78058FY SUBSERIES)
Pin Name Input/Output Function After Reset Alternate Function
P30 Input/ Port 3. Input TO0
P31 output 8-bit input/output port. TO1
P32 Input/output mode can be specified bit-wise. TO2
P33 If used as an input port, an on-chip pull-up resistor can be used by TI1
P34 software. TI2
P36 BUZ
P37 —
P40 to P47 Input/ Port 4. Input AD0 to AD7
output 8-bit input/output port.
Input/output mode can be specified in 8-bit units.
If used as an input port, an on-chip pull-up resistor can be used by
software.
Test input flag (KRIF) is set to 1 by falling edge detection.
P50 to P57 Input/ Port 5. Input A8 to A15
output 8-bit input/output port.
LED can be driven directly.
Input/output mode can be specified bit-wise.
If used as an input port, an on-chip pull-up resistor can be used by software.
P60 Input/ Port 6. Input —
N-ch open drain input/output port. On-chip pull-up resistor can be specified by mask option. (Mask ROM version only). LEDs can be driven directly.
P61 output 8-bit input/output port.
P62 Input/output mode can be
P63 specified bit-wise.
P64 If used as an input port, an on-chip RD
P65 pull-up resistor can be used by WR
P66 software. WAIT
P70 Input/ Port 7. Input SI2/RxD
P71 output 3-bit input/output port. SO2/TxD
P72 Input/output mode can be specified bit-wise. SCK2/ASCK
If used as an input port, an on-chip pull-up resistor can be used by software.

CHAPTER 4 PIN FUNCTION (µPD78058FY SUBSERIES)
Pin Name Input/Output Function After Reset Alternate Function
P120 to P127 Input/ Port 12. Input RTP0 to RTP7
output 8-bit input/output port.
Input/output mode can be specified bit-wise.
If used as an input port, an on-chip pull-up resistor can be used by software.
P130 to P131 Input/ Port 13. Input ANO0 to ANO1
output 2-bit input/output port.
Input/output mode can be specified bit-wise.
If used as an input port, an on-chip pull-up resistor can be used by software.
be maintained during A/D conversion.
<1> If it is used as a port, rewriting the output latch of its output.
<2> Even if it is not used as a port, changing the output level of pins used as outputs.

CHAPTER 4 PIN FUNCTION (µPD78058FY SUBSERIES)
Pin Name Input/Output Function After Reset Alternate Function
INTP0 Input External interrupt request inputs with specifiable valid edges (rising Input P00/TI00
INTP1 edge, falling edge, both rising and falling edges). P01/TI01
INTP3 P03
INTP4 P04
INTP5 P05
INTP6 P06
SI0 Input Serial interface serial data input Input P25/SB0/SDA0
SO0 Output Serial interface serial data output Input P26/SB1/SDA1
SB0 Input/ Serial interface serial data input/output Input P25/SI0/SDA0
SDA1 P26/SO0/SB1
SCK0 Input/ Serial interface serial clock input/output Input P27/SCL
SCL P27/SCK0
STB Output Serial interface automatic transmit/receive strobe output Input P23
BUSY Input Serial interface automatic transmit/receive busy input Input P24
RxD Input Asynchronous serial interface serial data input Input P70/SI2
TxD Output Asynchronous serial interface serial data output Input P71/SO2
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
TI1 External count clock input to 8-bit timer (TM1) P33
TI2 External count clock input to 8-bit timer (TM2) P34
TO0 Output 16-bit timer (TM0) output (also used for 14-bit PWM output) Input P30
TO1 8-bit timer (TM1) output P31
TO2 8-bit timer (TM2) output P32
PCL Output Clock output (for main system clock and subsystem clock trimming) Input P35
BUZ Output Buzzer output Input P36
RTP0 to RTP7 Output Real-time output port outputting data in synchronization with trigger Input P120 to P127

CHAPTER 4 PIN FUNCTION (µPD78058FY SUBSERIES)
Pin Name Input/Output Function After Reset Alternate Function
AD0 to AD7 Input/Output Low-order address/data bus when expanding external memory Input P40 to P47
A8 to A15 Output High-order address bus when expanding external memory Input P50 to P57
RD Output Strobe signal output for read operation from external memory Input P64
WR Strobe signal output for write operation to external memory P65
WAIT Input Wait insertion when accessing external memory Input P66
ASTB Output Strobe output externally latching address information output to ports 4, Input P67
5 to access external memory
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 — —
AVREF1 Input D/A converter reference voltage input — —
AVDD — A/D converter analog power supply. (Common with the port power supply) — —
AVSS — Ground potential (common with the port’s ground potential) of the A/D — —
converter and D/A converter.
RESET Input System reset input — —
X1 Input Crystal connection for main system clock oscillation — —
XT1 Input Crystal connection for subsystem clock oscillation Input P07
VDD — Positive power supply (Except the port) — —
VPP — High-voltage application for program write/verify. Connect directly to — —
VSS in the normal operating mode.
VSS — Ground potential (Except the port) — —
IC — Internally connected. Connect directly to VSS. — —
If this device is used in application fields where reduction of noise generated internally
in the microprocessor is required, please connect to a separate power supply with the
same electrical potential as VDD.
D/A convertor, and as the ground potential for the ports. If this device is used in
is required, please connect it to a ground line which is separate from VSS.

CHAPTER 4 PIN FUNCTION (µPD78058FY SUBSERIES)
Pin Name Input/Output Function
RESET Input PROM programming mode setting.
When +5 V or +12.5 V is applied to the VPP pin or a low level voltage is applied to the RESET pin,
the PROM programming mode is set.
VPP Input High-voltage application for PROM programming mode setting and program write/verify.
A0 to A16 Input Address bus
D0 to D7 Input/output Data bus
CE Input PROM enable input/program pulse input
OE Input Read strobe input to PROM
PGM Input Program/program inhibit input in PROM programming mode
VDD — Positive power supply
VSS — Ground potential

CHAPTER 4 PIN FUNCTION (µPD78058FY SUBSERIES)
4.2.1 P00 to P07 (Port 0)
These are 8-bit input/output ports. Besides serving as input/output ports, they function as an external interrupt
request input, an external count clock input to the timer, a capture trigger signal input, and crystal connection for
subsystem oscillation.
The following operating modes can be specified bit-wise.
P00 and P07 function as input-only ports and P01 to P06 function as input/output ports.
P01 to P06 can be specified for input or output ports bit-wise with a port mode register 0 (PM0). When they
are used as input ports, on-chip pull-up resistors can be used to them by defining the pull-up resistor option
register L (PUOL).
In this mode, these ports function as an external interrupt request input, an external count clock input to the
timer, and crystal connection for subsystem clock oscillation.
INTP0 to INTP6 are external interrupt request input pins which can specify valid edges (rising edge, falling
edge, and both rising and falling edges). INTP0 or INTP1 becomes a 16-bit timer/event counter capture
trigger signal input pin with a valid edge input.
Pin for external count clock input to 16-bit timer/event counter
Pin for capture trigger signal to capture register (CR00) of 16-bit timer/event counter
Crystal connect pin for subsystem clock oscillation

CHAPTER 4 PIN FUNCTION (µPD78058FY SUBSERIES)
These are 8-bit input/output ports. Besides serving as input/output ports, they function as an A/D converter analog
input.
The following operating modes can be specified bit-wise.
These ports function as 8-bit input/output ports. They can be specified bit-wise as input or output ports with
a port mode register 1 (PM1). If used as input ports, on-chip pull-up resistors can be used to these ports by
defining the pull-up resistor option register L (PUOL).
These ports function as A/D converter analog input pins (ANI0 to ANI7). The on-chip pull-up resistor is
automatically disabled when the pins specified for analog input.
These are 8-bit input/output ports. Besides serving as input/output ports, they function as data input/output to/
from the serial interface, clock input/output, automatic transmit/receive busy input, and strobe output functions.
The following operating modes can be specified bit-wise.
These ports function as 8-bit input/output ports. They can be specified bit-wise as input or output ports with
port mode register 2 (PM2). When they are used as input ports, on-chip pull-up resistors can be used to them
by defining the pull-up resistor option register L (PUOL).
These ports function as serial interface data input/output, clock input/output, automatic transmit/receive busy
input, and strobe output functions.
Serial interface serial data input/output pins
Serial interface serial clock input/output pins
Serial interface automatic transmit/receive busy input pins
Serial interface automatic transmit/receive strobe output pins
according to the function the user requires. For the setting, refer to Figure 17-4 “Serial
1 Format.”

CHAPTER 4 PIN FUNCTION (µPD78058FY SUBSERIES)
These are 8-bit input/output ports. Beside serving as input/output ports, they function as timer input/output, clock
output, and buzzer output.
The following operating modes can be specified bit-wise.
These ports function as 8-bit input/output ports. They can be specified bit-wise as input or output ports with
port mode register 3 (PM3). When they are used as input ports, on-chip pull-up resistors can be used by
defining the pull-up resistor option register L (PUOL).
These ports function as timer input/output, clock output, and buzzer output.
Pin for external count clock input to the 8-bit timer/event counter.
Timer output pins.
Clock output pin.
Buzzer output pin.

CHAPTER 4 PIN FUNCTION (µPD78058FY SUBSERIES)
These are 8-bit input/output ports. Besides serving as input/output ports, they function as an address/data bus.
The test input flag (KRIF) can be set to 1 by detecting a falling edge.
The following operating mode can be specified in 8-bit units.
These ports function as 8-bit input/output ports. They can be specified in 8-bit units for input or output ports
by using the memory expansion mode register (MM). When they are used as input ports, on-chip pull-up
resistors can be used by defining the pull-up resistor option register L (PUOL).
These ports function as low-order address/data bus pins (AD0 to AD7) in external memory expansion mode.
When pins are used as an address/data bus, the on-chip pull-up resistor is automatically disabled.
These are 8-bit input/output ports. Besides serving as input/output ports, they function as an address bus.
Port 5 can drive LEDs directly.
The following operating modes can be specified bit-wise.
These ports function as 8-bit input/output ports. They can be specified bit-wise as input/output ports with port
mode register 5 (PM5). When they are used as input ports, on-chip pull-up resistors can be used by defining
the pull-up resistor option register L (PUOL).
These ports function as high-order address bus pins (A8 to A15) in external memory expansion mode. When
pins are used as an address bus, the on-chip pull-up resistor is automatically disabled.
These are 8-bit input/output ports. Besides serving as input/output ports, they are used for control in external
memory expansion mode. P60 to P63 can drive LEDs directly.
The following operating modes can be specified bit-wise.
These ports function as 8-bit input/output ports. They can be specified bit-wise as input or output ports with
port mode register 6 (PM6).
P60 to P63 are N-ch open drain outputs. Mask ROM version can contain pull-up resistors with the mask option.
When P64 to P67 are used as input ports, on-chip pull-up resistors can be used by defining the pull-up resistor
option register L (PUOL).
These ports function as control signal output pins (RD, WR, WAIT, ASTB) in external memory expansion mode.
When a pin is used as a control signal output, the on-chip pull-up resistor is automatically disabled.
input/output port.

CHAPTER 4 PIN FUNCTION (µPD78058FY SUBSERIES)
This is a 3-bit input/output port. In addition to its use as an input/output port, it also has serial interface data input/
output and clock input/output functions.
The following operating modes can be specified bit-wise.
Port 7 functions as a 3-bit input/output port. Bit-wise specification as an input port or output port is possible
by means of port mode register 7 (PM7). When used as input ports, on-chip pull-up resistors can be used
by defining the pull-up resistor option register L (PUOL).
Port 7 functions as serial interface data input/output and clock input/output.
Serial interface serial data input/output pins
Serial interface serial clock input/output pin.
Asynchronous serial interface serial data input/output pins.
Asynchronous serial interface serial clock input/output pin.
according to the function the user requires.
For the setting, refer to Table 19-2 “Serial Interface Channel 2 Operating Mode Settings of

CHAPTER 4 PIN FUNCTION (µPD78058FY SUBSERIES)
These are 8-bit input/output ports. Besides serving as input/output ports, they function as a real-time output port.
The following operating modes can be specified bit-wise.
These ports function as 8-bit input/output ports. They can be specified bit-wise as input or output ports with
port mode register 12 (PM12). When they are used as input ports, on-chip pull-up resistors can be used by
defining the pull-up resistor option register H (PUOH).
These ports function as real-time output ports (RTP0 to RTP7) outputting data in synchronization with a trigger.
These are 2-bit input/output ports. Besides serving as input/output ports, they are used for D/A converter analog
output.
The following operating modes can be specified bit-wise.
These ports function as 2-bit input/output ports. They can be specified bit-wise as input or output ports with
port mode register 13 (PM13). When they are used as input ports, on-chip pull-up resistors can be used by
defining the pull-up resistor option register H (PUOH).
These ports allow D/A converter analog output (ANO0 and ANO1).
to VSS.
to 0, to output low level from the pin.
A/D converter reference voltage input pin.
When A/D converter is not used, connect this pin to VSS.
D/A converter reference voltage input pin.
When D/A converter is not used, connect this pin to VDD.

CHAPTER 4 PIN FUNCTION (µPD78058FY SUBSERIES)
This is the analog power supply pin of the A/D converter and the port’s power supply pin. Always use the same
voltage as that of the VDD pin even when the A/D converter is not used.
This is the ground potential pin for the A/D converter and D/A converter, and the ground potential pin for the port.
Even when the A/D converter and D/A converter are not used, always use the same potential as that of the VSS pin.
This is a low-level active system reset input pin.
Crystal resonator connect pins for main system clock oscillation.
For external clock supply, input it to X1 and its inverted signal to X2.
Crystal resonator connect pins for subsystem clock oscillation.
For external clock supply, input it to XT1 and its inverted signal to XT2.
Positive power supply pin (Except the port)
Ground potential pin (Except the port)
High-voltage apply pin for PROM programming mode setting and program write/verify. Connect directly to VSS
in normal operating mode.
When in the normal operating mode, connect directly to VSS.

CHAPTER 4 PIN FUNCTION (µPD78058FY SUBSERIES)
The IC (Internally Connected) pin is provided to set the test mode to check the µPD78058FY Subseries at delivery.
Connect it directly to the VSS with the shortest possible wire in the normal operating mode.
When a voltage difference is produced between the IC pin and VSS pin because the wiring between those two pins
is too long or an external noise is input to the IC pin, the user's program may not run normally.
Connect IC pins to VSS pins directly.
As short as possible

CHAPTER 4 PIN FUNCTION (µPD78058FY SUBSERIES)
Table 4-1 shows the input/output circuit types of pins and the recommended connection for unused pins.
Refer to Figure 4-1 for the configuration of the input/output circuit of each type.
Pin Name Input/Output Input/Output Recommended Connection of Unused Pins Circuit Type
P00/INTP0/TI00 2 Input Connect to VSS.
P01/INTP1/TI01 8-D Input/output Connect independently via a resistor to VSS.
P03/INTP3
P04/INTP4
P05/INTP5
P06/INTP6
P07/XT1 16 Input Connect to VDD
P10/ANI0 to P17/ANI7 11-C Input/output Connect independently via a resistor
P20/SI1 8-D Input/output to VDD or VSS.
P22/SCK1 8-D
P23/STB 5-J
P24/BUSY 8-D
P25/SI0/SB0/SDA0 10-C
P26/SO0/SB1/SDA1
P27/SCK0/SCL
P31/TO1
P32/TO2
P33/TI1 8-D
P34/TI2
P35/PCL 5-J
P36/BUZ
P37
P40/AD0 to P47/AD7 5-O Input/output Connect independently via a resistor to VDD.
P50/A8 to P57/A15 5-J Input/output Connect independently via a resistor to VDD or VSS.
P30/TO0 5-J Input/output

CHAPTER 4 PIN FUNCTION (µPD78058FY SUBSERIES)
Pin Name Input/Output Input/Output Recommended Connection of Unused Pins Circuit Type
P60 to P63 (Mask ROM version) 13-I Input/output Connect independently via a resistor to VDD.
P60 to P63 (PROM version) 13-H Input/output Connect independently via a resistor to VDD or VSS.
P65/WR
P66/WAIT
P67/ASTB
P72/SCK2/ASCK 8-D
P120/RTP0 to P127/RTP7 5-J
P130/ANO0 to P131/ANO1 12-B Input/output Connect independently via a resistor to VSS.
RESET 2 Input —
XT2 16 — Leave open.
AVREF0 — Connect to VSS.
AVREF1 Connect to VDD.
AVDD Connect to a separate power supply with
the same potential as VDD.
AVSS Connect to a separate ground with the
same potential as VSS.
IC (Mask ROM version) Connect directly to VSS.
VPP (PROM version)
P70/SI2/RxD 8-D · P71/SO2/TxD 5-J

CHAPTER 4 PIN FUNCTION (µPD78058FY SUBSERIES)


CHAPTER 4 PIN FUNCTION (µPD78058FY SUBSERIES)


5.1 Memory Spaces
64-Kbyte memory spaces can be accessed in the µPD78058F, 78058FY Subseries.
Figures 5-1 to 5-3 show memory maps.
Figure 5-1. Memory Map (µPD78056F, 78056FY)
Special Function Registers (SFRs)
256 × 8 bits
32 × 8 bits
1024 × 8 bits
FAE0H FADFH
BFFFH
Program Area Internal Buffer RAM
32 × 8 bits
1000H 0FFFH
FA80H FA7FH
0800H 07FFH
14976 × 8 bits
C000H BFFFH
0040H 003FH
Internal ROM 49152 × 8 bits
0000H

Figure 5-2. Memory Map (µPD78058F, 78058FY)
Special Function Registers (SFRs)
256 × 8 bits
FEE0H FEDFH
32 × 8 bits
1024 × 8 bits
FAE0H FADFH
EFFFH
Program Area Internal Buffer RAM
32 × 8 bits
1000H 0FFFH
F800H F7FFH
0800H 07FFH
1024 × 8 bits
F000H EFFFH
Internal ROM 61440 × 8 bits
0000H
0000H
can be used as external memory by setting the internal ROM size to less than 56 Kbytes by the
memory size switching register (IMS).

Figure 5-3. Memory Map (µPD78P058F, µPD78P058FY)
Special Function Registers (SFRs)
256 × 8 bits
FEE0H FEDFH
32 × 8 bits
1024 × 8 bits
FAE0H FADFH
EFFFH
Program Area Internal Buffer RAM
32 × 8 bits
1000H 0FFFH
F800H F7FFH
0800H 07FFH
1024 × 8 bits
0080H 007FH
0040H 003FH
61440 × 8 bits
0000H
can be used as external memory by setting the internal PROM size to less than 56 Kbytes by the
memory size switching register (IMS).

5.1.1 Internal program memory space
The µPD78056F and µPD78056FY are Mask ROM with a 49152 x 8 bit configuration, the µPD78058F and
µPD78058FY are Mask ROM with a 61440 x 8 bit configuration and the µPD78P058F and µPD78P058FY are PROM
with a 61440 x 8 bit configuration. They store program and table data, etc. Normally, they are addressed by the
program counter (PC).
The areas shown below are allocated to the internal program memory space.
The 64-byte area 0000H to 003FH is reserved as a vector table area. The RESET input and program start
addresses for branch upon generation of each interrupt request are stored in the vector table area. Of the
16-bit address, low-order 8 bits are stored at even addresses and high-order 8 bits are stored at odd addresses.
Vector Table Address Interrupt Sources
0006H INTP0
0008H INTP1
000AH INTP2
000CH INTP3
000EH INTP4
0010H INTP5
0012H INTP6
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
0000H RESET input

(2) CALLT instruction table area
The 64-byte area 0040H to 007FH can store the subroutine entry address of a 1-byte call instruction (CALLT).
The area 0800H to 0FFFH can perform a direct subroutine call with a 2-byte call instruction (CALLF).
The µPD78058F and 78058FY Subseries units incorporate the following RAMs.
This RAM has a 1024 x 8 bit configuration. In this area, four banks of general registers, each bank consisting
of eight 8-bit registers, are allocated in the 32-byte area FEE0H to FEFFH.
The internal high-speed RAM can also be used as a stack memory.
Internal buffer RAM is allocated to the 32-byte area from FAC0H to FADFH. The internal buffer RAM is used
to store transmit/receive data of serial interface channel 1 (in 3-wire serial I/O mode with automatic transfer/
receive function). If the 3-wire serial I/O mode with automatic transfer/receive function is not used, the internal
buffer RAM can also be used as normal RAM. Internal buffer RAM can also be used as normal RAM.
Internal expansion RAM is allocated to the 1024-byte area from F400H to F7FFH.
An on-chip peripheral hardware special-function register (SFR) is allocated in the area FF00H to FFFFH. (Refer
to Table 5-3. Special-Function Register List in Section 5.2.3 Special Function Register (SFR)).
The external memory space is accessible by setting the memory expansion mode register (MM). External memory
space can store program, table data, etc. and allocate peripheral devices.

5.1.5 Data memory addressing
The method to specify the address of the instruction to be executed next, or the address of a register or memory
to be manipulated when an instruction is executed is called addressing.
The address of the instruction to be executed next is addressed by the program counter PC (for details, refer to
Section 5.3 Instruction Address Addressing).
On the other hand, concerning addressing of memory which is the object of operations during execution of a
command, in the µPD78058F and µPD78058FY Subseries, abundant addressing modes have been provided in
consideration of operability, etc. Particularly in areas (FB00H to FFFFH) where data memory is incorporated special
addressing which matches the respective functions of the special function register (SFR), general purpose register,
etc., is possible. Figure 5-4 to 5-6 show the data memory addressing modes. For details of each addressing, refer
to Section 5.4 Operand Address Addressing.
Figure 5-4. Data Memory Addressing (µPD78056F, 78056FY)
Special Function Registers (SFRs)
256 × 8 bits SFR Addressing
FF00H FEFFH
FEE0H FEDFH
32 × 8 bits
1024 × 8 bits
FB00H FAFFH
FAE0H FADFH
32 × 8 bits
FA80H FA7FH
14976 × 8 bits
Internal ROM 49152 × 8 bits

Figure 5-5. Data Memory Addressing (µPD78058F, 78058FY)
Special Function Registers (SFRs)
256 × 8 bits
FF00H FEFFH
32 × 8 bits
1024 × 8 bits
FB00H FAFFH
FAE0H FADFH
32 × 8 bits
F800H F7FFH
1024 × 8 bits
Internal ROM 61440 × 8 bits
can be used as external memory by setting the internal ROM size to less than 56 Kbytes by the
memory size switching register.

Figure 5-6. Data Memory Addressing (µPD78P058F, 78P058FY)
Special Function Registers (SFRs)
256 × 8 bits
FF00H FEFFH
32 × 8 bits
1024 × 8 bits
FB00H FAFFH
FAE0H FADFH
32 × 8 bits
F800H F7FFH
1024 × 8 bits
61440 × 8 bits
can be used as external memory by setting the internal PROM size to less than 56 Kbytes by the
memory size switching register (IMS).

5.2 Processor Registers
The µPD78058F and 78058FY Subseries units incorporate the following processor registers.
The control registers control the program sequence, statuses and stack memory. The control registers consist
of a program counter (PC), a program status word (PSW) and a stack pointer (SP).
The program counter is a 16-bit register which holds the address information of the next program to be
executed.
In normal operation, the PC is automatically incremented according to the number of bytes of the instruction
to be fetched. When a branch instruction is executed, immediate data and register contents are set.
RESET input sets the reset vector table values at addresses 0000H and 0001H to the program counter.
PC15 PC PC14 PC13 PC12 PC11 PC10 PC9 PC8 PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0
The program status word is an 8-bit register consisting of various flags to be set/reset by instruction execution.
Program status word contents are automatically stacked upon interrupt request generation or PUSH PSW
instruction execution and are automatically reset upon execution of the RETB, RETI and POP PSW instructions.
RESET input sets the PSW to 02H.
IE PSW Z RBS1 AC RBS0 0 ISP CY

(a) Interrupt enable flag (IE)
This flag controls the interrupt request acknowledge operations of the CPU.
When IE = 0, all interrupts except non-maskable interrupt requests are disabled (DI status).
When IE = 1, interrupts are enabled (EI status). At this time, acknowledgment of interrupts is controlled
with an inservice priority flag (ISP), an interrupt mask flag for various interrupt sources, and a priority
specify flag.
This flag is reset (0) when the DI command is executed or when an interrupt request is acknowledged
and is set (1) when the EI command is executed.
When the operation result is zero, this flag is set (1). It is reset (0) in all other cases.
These are 2-bit flags to select one of the four register banks.
In these flags, the 2-bit information which indicates the register bank selected by SEL RBn instruction
execution is stored.
If the operation result has a carry from bit 3 or a borrow at bit 3, this flag is set (1). It is reset (0) in all
other cases.
This flag manages the priority of acknowledgeable maskable vectored interrupts. When ISP = 0,
acknowledgment of a vector interrupt request specified to be low by the priority order instruction flag
register (PR0L, PR0H, PR1L) (See 21.3 (3), Priority specify flag registers (PR0L, PR0H, PR1L)) is
prohibited. Furthermore, whether or not an interrupt request can actually be acknowledged or not is
controlled by the status of the interrupt enable (IE) flag.
This flag stores overflow and underflow upon add/subtract instruction execution. It stores the shift-out
value upon rotate instruction execution and functions as a bit accumulator during bit manipulation
instruction execution.

(3) Stack pointer (SP)
This is a 16-bit register to hold the start address of the memory stack area. Only the internal high-speed RAM
area (FB00H to FEFFH) can be set as the stack area.
SP15 SP 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-10 and 5-11.
instruction execution.
Interrupt and BRK Instruction
CALL, CALLF, and CALLT Instruction PUSH rp Instruction
SP SP _ 2
SP SP _ 2
PC7-PC0 SP _ 3
SP _ 2
SP _ 2
SP _ 2
PC7-PC0 Register Pair Lower
SP _ 1
SP _ 1
PC15-PC8
SP _ 1
PSW
SP
SP
SP
Figure 5-11. Data to Be Reset from Stack Memory
RETI and RETB Instruction
RET Instruction POP rp Instruction
PC7-PC0 Register Pair Lower
SP
PC7-PC0
SP + 1
SP + 1
SP + 1
PC15-PC8 PC15-PC8
SP SP + 2
SP SP + 2
SP + 2
PSW
SP SP + 3
Register Pair Upper · Register Pair Upper

5.2.2 General registers
A general register is mapped at particular addresses (FEE0H to FEFFH) of the data memory. It consists of 4 banks,
each bank consisting of eight 8-bit registers (X, A, C, B, E, D, L and H).
Each register can also be used as an 8-bit register. Two 8-bit registers can be used in pairs as a 16-bit register
(AX, BC, DE and HL).
They can be described in terms of function names (X, A, C, B, E, D, L, H, AX, BC, DE and HL) and absolute names
(R0 to R7 and RP0 to RP3).
Register banks to be used for instruction execution are set with the CPU control instruction (SEL RBn). Because
of the 4-register bank configuration, an efficient program can be created by switching between a register for normal
processing and a register for interruption for each bank.
Bank Name Absolute Address Bank Name Absolute Address
Function Absolute Function Absolute
Name
BANK0 H R7 F E F F H BANK2 H R7 F E E F H
L R6 F E E E H L R6 F E E E H
D R5 F E E D H D R5 F E E D H
E R4 F E F C H E R4 F E E C H
B R3 F E F B H B R3 F E E B H
C R2 F E F A H C R2 F E E A H
A R1 F E F 9 H A R1 F E E 9 H
X R0 F E F 8 H X R0 F E E 8 H
BANK1 H R7 F E F 7 H BANK3 H R7 F E E 7 H
L R6 F E F 6 H L R6 F E E 6 H
D R5 F E F 5 H D R5 F E E 5 H
E R4 F E F 4 H E R4 F E E 4 H
B R3 F E F 3 H B R3 F E E 3 H
C R2 F E F 2 H C R2 F E E 2 H
A R1 F E F 1 H A R1 F E E 1 H
X R0 F E F 0 H X R0 F E E 0 H
Register Register

Figure 5-12. General Register Configuration
(a) Absolute Name
16-Bit Processing 8-Bit Processing
R7
BANK0
RP3
R6
FEF8H FEF7H
R5
BANK1
RP2
R4
FEE0H FEEFH
R3
BANK2
RP1
R2
FEE8H FEE7H
R1
BANK3
RP0
R0
FEE0H
15 0 7 0
16-Bit Processing 8-Bit Processing
H
BANK0
HL
FEF8H FEF7H
D
BANK1
DE
E
FEF0H FEEFH
B
BANK2
BC
FEE8H FEE7H
A
BANK3
AX
FEE0H
15 0 7 0

5.2.3 Special Function Register (SFR)
Unlike a general register, each special-function register has special functions.
It is allocated in the FF00H to FFFFH area.
The special-function register can be manipulated like the general register, with the operation, transfer and bit
manipulation instructions. Manipulatable bit units, 1, 8 and 16, depend on the special-function register type.
Each manipulation bit unit can be specified as follows.
Describe the symbol reserved with assembler for the 1-bit manipulation instruction operand (sfr.bit).
This manipulation can also be specified with an address.
Describe the symbol reserved with assembler for the 8-bit manipulation instruction operand (sfr).
This manipulation can also be specified with an address.
Describe the symbol reserved with assembler for the 16-bit manipulation instruction operand (sfrp).
When addressing an address, describe an even address.
Table 5-3 gives a list of special-function registers. The meaning of items in the table is as follows.
Symbols indicating the addresses of special function register. These symbols are reserved words for the RA78K/
0 and defined by header file sfrbit.h for the CC78K/0, and can be used as the operands of instructions when
the RA78K/0, ID78K0-NS, ID78K0, and SM78K0 are used.
Indicates whether the corresponding special-function register can be read or written.
√ indicates 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.
Indicates each register status upon RESET input.

Table 5-3. Special-Function Register List (1/3)
Address Special-Function Register (SFR) Name Symbol R/W After Reset
8 bits 1 bit 16 bits
FF00H Port0 P0 R/W √ √ — 00H
FF01H Port1 P1 √ √ —
FF02H Port2 P2 √ √ —
FF03H Port3 P3 √ √ —
FF04H Port4 P4 √ √ — Undefined
FF05H Port5 P5 √ √ —
FF06H Port6 P6 √ √ —
FF07H Port7 P7 √ √ — 00H
FF0CH Port12 P12 √ √ —
FF0DH Port13 P13 √ √ —
CR00 — — √ Undefined
FF10H Capture/compare register 00
FF12H
Capture/compare register 01 CR01 — — √
FF14H
16-bit timer register TM0 R — — √ 0000H
FF16H Compare register 10 CR10 R/W — √ — Undefined
FF17H Compare register 20 CR20 — √ —
FF18H 8-bit timer register 1 TM1 — √
FF19H 8-bit timer register 2 TM2 — √
FF1AH Serial I/O shift register 0 SIO0 — √ —
FF1BH Serial I/O shift register 1 SIO1 — √ —
FF1FH A/D conversion result register ADCR R — √ —
FF20H Port mode register 0 PM0 R/W √ √ — FFH
FF21H Port mode register 1 PM1 √ √ —
FF22H Port mode register 2 PM2 √ √ —
FF23H Port mode register 3 PM3 √ √ —
FF25H Port mode register 5 PM5 √ √ —
FF26H Port mode register 6 PM6 √ √ —
FF27H Port mode register 7 PM7 √ √ —
FF2CH Port mode register 12 PM12 √ √ —
FF2DH Port mode register 13 PM13 √ √ —
FF30H Real-time output buffer register L RTBL — √ — 00H
FF31H Real-time output buffer register H RTBH — √ —
FF34H Real-time output port mode register RTPM √ √ —
FF36H Real-time output port control register RTPC √ √ —
Manipulatable Bit Unit · R/W Undefined

Table 5-3. Special-Function Register List (2/3)
Address Special-Function Register (SFR) Name Symbol R/W After Reset
8 bits 1 bit 16 bits
FF38H Correction address register 0Note CORAD0 R/W — — √ 0000H FF39H
FF3AH Correction address register 1Note
FF40H Timer clock select register 0 TCL0 √ √ — 00H
FF41H Timer clock select register 1 TCL1 — √ —
FF42H Timer clock select register 2 TCL2 — √ —
FF43H Timer clock select register 3 TCL3 — √ — 88H
FF47H Sampling clock select register SCS — √ — 00H
FF48H 16-bit timer mode control register TMC0 √ √ —
FF49H 8-bit timer mode control register 1 TMC1 √ √ —
FF4AH Watch timer mode control register TMC2 √ √ —
FF4CH Capture/compare control register 0 CRC0 √ √ — 04H
FF4EH 16-bit timer output control register TOC0 √ √ — 00H
FF4FH 8-bit timer output control register TOC1 √ √ —
FF60H Serial operating mode register 0 CSIM0 √ √ —
FF61H Serial bus interface control register SBIC √ √ —
FF62H Slave address register SVA — √ — Undefined
FF63H Interrupt timing specify register SINT √ √ — 00H
FF68H Serial operating mode register 1 CSIM1 √ √ —
FF69H Automatic data transmit/receive control register ADTC √ √ —
FF6AH Automatic data transmit/receive address pointer ADTP — √ —
FF6BH Automatic data transmit/receive interval specify register ADTI √ √ —
FF70H Asynchronous serial interface mode register ASIM √ √ —
FF71H Asynchronous serial interface status register ASIS R — √ —
FF72H Serial operating mode register 2 CSIM2 RW √ √ —
FF73H Baud rate generator control register BRGC — √ —
FF74H Transmit shift register TXS SIO2 W
Receive buffer register RXB R
FF80H A/D converter mode register ADM R/W √ √ — 01H
FF84H A/D converter input select register ADIS — √ — 00H
FF8AH Correction control registerNote CORCN √ √ —
FF90H D/A conversion value set register 0 DACS0 — √ —
FF91H D/A conversion value set register 1 DACS1 — √ —
FF98H D/A converter mode register DAM √ √ —
Manipulatable Bit Unit · — √ —

Table 5-3. Special-Function Register List (3/3)
Address Special-Function Register (SFR) Name Symbol R/W After Reset
8 bits 1 bit 16 bits
FFD0H to External access areaNote 1 R/W √ √ — Undefined
FFE0H Interrupt request flag register 0L √ √
IF0L
00H
FFE1H Interrupt request flag register 0H √ √
FFE2H Interrupt request flag register 1L IF1L √ √ —
FFE4H Interrupt mask flag register 0L √ √
MK0L
FFH
FFE5H Interrupt mask flag register 0H √ √
FFE6H Interrupt mask flag register 1L MK1L √ √ —
FFE8H Priority order specify flag register 0L √ √
PR0L
FFE9H Priority order specify flag register 0H √ √
FFEAH Priority order specify flag register 1L PR1L √ √ —
FFECH External interrupt mode register 0 INTM0 — √ —
FFEDH External interrupt mode register 1 INTM1 — √ —
FFF0H Memory size switching register IMS — √ — Note 2
FFF2H Oscillation mode selection register OSMS W — √ — 00H
FFF3H Pull-up resistor option register H PUOH R/W √ √ —
FFF4H Internal expansion RAM size IXS W — √ — 0AH
switching registerNote 3
FFF6H Key return mode register KRM R/W √ √ — 02H
FFF7H Pull-up resistor option register L PUOL √ √ — 00H
FFF8H Memory expansion mode register MM √ √ — 10H
FFF9H Watchdog timer mode register WDTM √ √ — 00H
FFFAH Oscillation stabilization time select register OSTS — √ — 04H
FFFBH Processor clock control register PCC √ √ —
addressing.
Manipulatable Bit Unit · √ · √

5.3 Instruction Address Addressing
An instruction address is determined by program counter (PC) contents. The contents of 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 Series User’s
Manual – Instruction (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.
PC indicates the start address of the instruction after the BR instruction.
15 0 8 7 6
PC
When S = 0, all bits of α are 0. When S = 1, all bits of α are 1.
+ · α · jdisp8

5.3.2 Immediate addressing
[Function]
Immediate data in the instruction word is transferred to the program counter (PC) and branched.
This function is carried out when the CALL !addr16 or BR !addr16 or CALLF !addr11 instruction is executed.
The CALL !addr16 and BR !addr16 instruction can branch in the entire memory space. The CALLF !addr11
instruction branches to an area of addresses 0800H through 0FFFH.
In the case of CALL !addr16 and BR !addr16 instructions
Low Addr.
High Addr.
In the case of CALLF !addr11 instruction
PC
0 1
CALL or BR · fa10–8 · fa7–0

5.3.3 Table indirect addressing
[Function]
Table contents (branch destination address) of the particular location to be addressed by bits 1 to 5 of the
immediate data of an operation code are transferred to the program counter (PC) and branched.
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 through 7FH, and can branch in the entire
memory space.
7 6 5 1 0
ta4–0 Operation Code
Effective Address 0 1 0
Low Addr.
High Addr.
Memory (Table) · Effective Address+1
![Page 115 of the NEC PD78056F user manual — [Illustration]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-115.webp?w=400)
5.3.4 Register addressing
[Function]
Register pair (AX) contents to be specified with an instruction word are transferred to the program counter (PC)
and branched.
This function is carried out when the BR AX instruction is executed.
A X
PC
rp
![Page 116 of the NEC PD78056F user manual — [Description example]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-116.webp?w=400)
5.4 Operand Address Addressing
The following various 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 register is automatically (illicitly)
addressed.
Of the µPD78058F and 78058FY Subseries instruction words, the following instructions employ implied
addressing.
Instruction Register to be Specified by Implied Addressing
MULU A register for multiplicand and AX register for product storage
DIVUW AX register for dividend and quotient storage
ADJBA/ADJBS A register for storage of numeric values which become decimal correction targets
ROR4/ROL4 A register for storage of digit data which undergoes digit rotation
Because implied addressing can be automatically employed with an instruction, no particular operand format is
necessary.
In the case of MULU X
With an 8-bit × 8-bit multiply instruction, the product of A register and X register is stored in AX. In this example,
the A and AX registers are specified by implied addressing.
![Page 117 of the NEC PD78056F user manual — [Description example]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-117.webp?w=400)
5.4.2 Register addressing
[Function]
This addressing accesses a general register as an operand. The general register accessed is specified by the
register bank select flags (RBS0 and RBS1) and register specify 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 with 3 bits in the operation code.
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).
MOV A, C; when selecting C register as r
Operation code 0 1 1 0 0 0 1 0
INCW DE; when selecting DE register pair as rp
Operation code 1 0 1 0 0
Identifier Description · Register specify code · Register specify code
![Page 118 of the NEC PD78056F user manual — [Illustration]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-118.webp?w=400)
5.4.3 Direct addressing
[Function]
This addressing directly addresses the memory indicated by the immediate data in an instruction word.
addr16 Label or 16-bit immediate data
MOV A, !0FE00H; when setting !addr16 to FE00H
Operation code 1 0 0 0 1 1 1 0 OP code
00H
1 0 FEH
![Page 119 of the NEC PD78056F user manual — [Operand format]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-119.webp?w=400)
5.4.4 Short direct addressing
[Function]
The memory to be manipulated in the fixed space is directly addressed with 8-bit data in an instruction word.
The fixed space to which this address is applied is a 256-byte space of addresses FE20H through FF1FH. An
internal RAM and a special-function register (SFR) are mapped at FE20H to FEFFH and FF00H to FF1FH,
respectively.
The SFR area (FF00H through FF1FH) to which short direct addressing is applied is a part of the entire SFR
area. To this area, ports frequently accessed by the program, and the compare registers and capture registers
of timer/event counters are mapped. These SFRs can be manipulated with a short byte length and a 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. Refer to [Illustration] on next page.
saddr Label of FE20H to FF1FH immediate data
saddrp Label of FE20H to FF1FH immediate data (even address only)
Identifier Description
![Page 120 of the NEC PD78056F user manual — [Illustration]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-120.webp?w=400)
[Description example]
MOV 0FE30H, #50H; when setting saddr to FE30H and immediate data to 50H
Operation code 0 0 0 1 0 0 0 1 OP code
0 0 1 1 0 30H (saddr-offset)
0 1 0 1 0 50H (immediate data)
15 0 Short Direct Memory
Effective Address 1
When 8-bit immediate data is 20H to FFH, α = 0
When 8-bit immediate data is 00H to 1FH, α = 1
OP code · saddr-offset · α
![Page 121 of the NEC PD78056F user manual — [Illustration]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-121.webp?w=400)
5.4.5 Special-Function Register (SFR) addressing
[Function]
The memory-mapped special-function register (SFR) is addressed with 8-bit immediate data in an instruction
word.
This addressing is applied to the 240-byte spaces FF00H to FFCFH and FFE0H to FFFFH. However, the SFR
mapped at FF00H to FF1FH can be accessed with short direct addressing.
sfr Special-function register name
sfrp 16-bit manipulatable special-function register name (even address only)
MOV PM0, A; when selecting PM0 (FF20H) as sfr
Operation code 1 0 1 1 0 OP code
0 0 1 0 20H (sfr-offset)
15 0 SFR
Effective Address 1
Identifier Description · OP code · sfr-offset

5.4.6 Register indirect addressing
[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 specify code
in an instruction code. This addressing can be carried out for all the memory spaces.
— [DE], [HL]
[Description example]
MOV A, [DE]; when selecting [DE] as register pair
Operation code 1 0 1 0 1
DE
D
E
Memory address specified by register pair DE
Contents of addressed memory are transferred.
Identifier Description · Memory
![Page 123 of the NEC PD78056F user manual — [Description example]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-123.webp?w=400)
5.4.7 Based addressing
[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 offset data is first
expanded as a positive number to 16 bits and then added. A carry from the 16th bit is ignored. This addressing
can be carried out for all the memory spaces.
— [HL + byte]
MOV A, [HL + 10H]; when setting byte to 10H
Operation code 1 0 1 0 1 1 1 0
0 0 0 1 0
Identifier Description
![Page 124 of the NEC PD78056F user manual — [Description example]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-124.webp?w=400)
5.4.8 Based indexed addressing
[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 contents of the B register or C register are expanded to 16 bits as a positive number,
and then added. A carry from the 16th bit is ignored. This addressing can be carried out for all the memory spaces.
— [HL + B], [HL + C]
[Description example]
In the case of MOV A, [HL + B]
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 enables to address the internal high-speed RAM area only.
In the case of PUSH DE
Operation code 1 0 1 1 0 1 0 1
Identifier Description

6.1 Port Functions
The µPD78058F and 78058FY Subseries units incorporate two input ports and sixty-seven input/output ports.
Figure 6-1 shows the port configuration. Every port is capable of 1-bit and 8-bit manipulations and can carry out
considerably varied control operations. Besides port functions, the ports can also serve as on-chip hardware input/
output pins.


Table 6-1. Port Functions (µPD78058F Subseries) (1/2)
Pin Name Function Alternate Function
P00 Port 0. Input only INTP0/TI00
P01 8-bit input/output port. Input/output mode can be specified INTP1/TI01
P02 bit-wise. INTP2
P03 If used as an input port, an on-chip pull-up INTP3
P04 resistor can be used by software. INTP4
P06 INTP6
P07 Input only XT1
P10 to P17 Port 1. ANI0 to ANI7
8-bit input/output port.
Input/output mode can be specified bit-wise.
If used as an input port, an on-chip pull-up resistor can be used by software.
P20 Port 2. SI1
P21 8-bit input/output port. SO1
P22 Input/output mode can be specified bit-wise. SCK1
P23 If used as an input port, an on-chip pull-up resistor can be used by software. STB
P25 SI0/SB0
P26 SO0/SB1
P27 SCK0
P30 Port 3. TO0
P31 8-bit input/output port. TO1
P32 Input/output mode can be specified bit-wise. TO2
P33 If used as an input port, an on-chip pull-up resistor can be used by software. TI1
P35 PCL
P36 BUZ
P37 —
P40 to P47 Port 4. AD0 to AD7
8-bit input/output port.
Input/output mode can be specified in 8-bit units.
If used as an input port, an on-chip pull-up resistor can be used by software.
Test input flag (KRIF) is set to 1 by falling edge detection.
P50 to P57 Port 5. A8 to A15
8-bit input/output port.
LED can be driven directly.
Input/output mode can be specified bit-wise.
If used as an input port, an on-chip pull-up resistor can be used by software.

Table 6-1. Port Functions (µPD78058F Subseries) (2/2)
Pin Name Function Alternate Function
P60 Port 6. N-ch open-drain input/output port. —
P61 8-bit input/output port. On-chip pull-up resistor can be specified by
P62 Input/output mode can be specified mask option. (Mask ROM version only).
P63 bit-wise. LEDs can be driven directly.
P64 If used as an input port, an on-chip pull-up RD
P65 resistor can be used by software. WR
P67 ASTB
Port 7.
3-bit input/output port.
Input/output mode can be specified bit-wise.
If used as an input port, an on-chip pull-up resistor can be used by software.
P120 to P127 RTP0 to RTP7
Port 12.
8-bit input/output port.
Input/output mode can be specified bit-wise.
If used as an input port, on-chip pull-up resistor can be used by software.
P130 and P131 ANO0, ANO1
Port 13.
2-bit input/output port.
Input/output mode can be specified bit-wise.
If used as an input port, on-chip pull-up resistor can be used by software.
(1) Port Pins), do not execute the following operations during A/D conversion. If performed,
then the general error standards cannot be maintained during A/D conversion.
<1> If it is used as a port, rewriting the output latch of its output.
<2> Even if it is not used as a port, changing the output level of pins used as outputs.
P70 SI2/RxD · P71 SO2/TxD

Table 6-2. Port Functions (µPD78058FY Subseries) (1/2)
Pin Name Function Alternate Function
P00 Port 0. Input only INTP0/TI00
P01 8-bit input/output port. Input/output mode can be specified INTP1/TI01
P02 bit-wise. INTP2
P03 If used as an input port, an on-chip pull-up INTP3
P04 resistor can be used by software. INTP4
P06 INTP6
P07 Input only XT1
P10 to P17 Port 1. ANI0 to ANI7
8-bit input/output port.
Input/output mode can be specified bit-wise.
If used as an input port, an on-chip pull-up resistor can be used by software.
P20 Port 2. SI1
P21 8-bit input/output port. SO1
P22 Input/output mode can be specified bit-wise. SCK1
P23 If used as an input port, an on-chip pull-up resistor can be used by software. STB
P25 SI0/SB0/SDA0
P26 SO0/SB1/SDA1
P27 SCK0/SCL
P30 Port 3. TO0
P31 8-bit input/output port. TO1
P32 Input/output mode can be specified bit-wise. TO2
P33 If used as an input port, an on-chip pull-up resistor can be used by software. TI1
P35 PCL
P36 BUZ
P37 —
P40 to P47 Port 4. AD0 to AD7
8-bit input/output port.
Input/output mode can be specified in 8-bit units.
If used as an input port, an on-chip pull-up resistor can be used by software.
Test input flag (KRIF) is set to 1 by falling edge detection.
P50 to P57 Port 5. A8 to A15
8-bit input/output port.
LED can be driven directly.
Input/output mode can be specified bit-wise.
If used as an input port, an on-chip pull-up resistor can be used by software.

Table 6-2. Port Functions (µPD78058FY Subseries) (2/2)
Pin Name Function Alternate Function
P60 Port 6. N-ch open drain input/output port. —
P61 8-bit input/output port. On-chip pull-up resistor can be specified by
P62 Input/output mode can be specified mask option. (Mask ROM version only).
P63 bit-wise. LEDs can be driven directly.
P64 If used as an input port, an on-chip pull-up RD
P65 resistor can be used by software. WR
P67 ASTB
Port 7.
3-bit input/output port.
Input/output mode can be specified bit-wise.
If used as an input port, an on-chip pull-up resistor can be used by software.
P120 to P127 RTP0 to RTP7
Port 12.
8-bit input/output port.
Input/output mode can be specified bit-wise.
If used as an input port, on-chip pull-up resistor can be used by software.
P130 and P131 ANO0, ANO1
Port 13.
2-bit input/output port.
Input/output mode can be specified bit-wise.
If used as an input port, on-chip pull-up resistor can be used by software.
(1) Port Pins), do not execute the following operations during A/D conversion. If performed,
then the general error standards cannot be maintained during A/D conversion.
<1> If it is used as a port, rewriting the output latch of its output.
<2> Even if it is not used as a port, changing the output level of pins used as outputs.
P70 SI2/RxD · P71 SO2/TxD

6.2 Port Configuration
A port consists of the following hardware:
Pull-up resistor option register (PUOH, PUOL)
Memory expansion mode register (MM)Note
Key return mode register (KRM)
Pull-up resistor • Mask ROM version
Port 0 is an 8-bit input/output port with output latch. P01 to P06 pins can specify the input mode/output mode in
1-bit units with the port mode register 0 (PM0). P00 and P07 pins are input-only ports. When P01 to P06 pins are
used as input ports, an on-chip pull-up resistor can be used to them in 6-bit units with a pull-up resistor option register
L (PUOL).
Alternate functions include external interrupt request input, external count clock input to the timer and crystal
connec-tion for subsystem clock oscillation.
RESET input sets port 0 to input mode.
Figures 6-2 and 6-3 show block diagrams of port 0.
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.
Item Configuration · Control register

Figure 6-2. P00 and P07 Block Diagram
RD
P00/INTP0/TI00, P07/XT1
Figure 6-3. P01 to P06 Block Diagram
AV DD
WR PUO
PUO0
RD
WR PORT
P01/INTP1/TI01. P02/INTP2 to P06/INTP6
Output Latch (P01 to P06)

6.2.2 Port 1
Port 1 is an 8-bit input/output port with output latch. It can specify the input mode/output mode in 1-bit units with
a port mode register 1 (PM1). When P10 to P17 pins are used as input ports, an on-chip pull-up resistor can be used
to them in 8-bit units with a pull-up resistor option register L (PUOL).
Alternate function includes an A/D converter analog input.
RESET input sets port 1 to input mode.
Figure 6-4 shows a block diagram of port 1.
AV DD
WR PUO
PUO1
RD
WR PORT
Output Latch (P10 to P17)

6.2.3 Port 2 (µPD78058F Subseries)
Port 2 is an 8-bit input/output port with output latch. P20 to P27 pins can specify the input mode/output mode in
1-bit units with the port mode register 2 (PM2). When P20 to P27 pins are used as input ports, an on-chip pull-up
resistor can be used to them in 8-bit units with a pull-up resistor option register L (PUOL).
Alternate functions include serial interface data input/output, clock input/output, automatic transmit/receive busy
input, and strobe output.
RESET input sets port 2 to input mode.
Figures 6-5 and 6-6 show block diagrams of port 2.
functions. For the setting method, refer to Figure 16-4 Serial Operating Mode Register 0
Format and Figure 18-3 Serial Operating Mode Register 1 Format.
Figure 6-5. P20, P21, P23 to P26 Block Diagram
AV DD
WR PUO
PUO2
RD
WR PORT
P20/SI1, P21/SO1, P23/STB, P24/BUSY, P25/SI0/SB0, P26/SO0/SB1
Output Latch (P20, P21, P23 to P26)
PM20, PM21 PM23 to PM26

Figure 6-6. P22 and P27 Block Diagram
AV DD
WR PUO
PUO2
RD
WR PORT
Output Latch (P22, P27)
WR PM
PM22, PM27

6.2.4 Port 2 (µPD78058FY Subseries)
Port 2 is an 8-bit input/output port with output latch. P20 to P27 pins can specify the input mode/output mode in
1-bit units with the port mode register 2 (PM2). When P20 to P27 pins are used as input ports, an on-chip pull-up
resistor can be used to them in 8-bit units with a pull-up resistor option register L (PUOL).
Alternate functions include serial interface data input/output, clock input/output, automatic transmit/receive busy
input, and strobe output.
RESET input sets port 2 to input mode.
Figures 6-7 and 6-8 show block diagrams of port 2.
functions. For the setting method, refer to Figure 17-4 Serial Operating Mode Register 0 Format
and Figure 18-3 Serial Operating Mode Register 1 Format.
AV DD
WR PUO
PUO2
RD
WR PORT
Output Latch (P20, P21, P23 to P26)
WR PM
PM20, PM21 PM23 to PM26

Figure 6-8. P22 and P27 Block Diagram
AV DD
WR PUO
PUO2
RD
WR PORT
Output Latch (P22 and P27)
WR PM
PM22, PM27

6.2.5 Port 3
Port 3 is an 8-bit input/output port with output latch. P30 to P37 pins can specify the input mode/output mode in
1-bit units with the port mode register 3 (PM3). When P30 to P37 pins are used as input ports, an on-chip pull-up
resistor can be used to them in 8-bit units with a pull-up resistor option register L (PUOL).
Alternate functions include timer input/output, clock output, and buzzer output.
RESET input sets port 3 to input mode.
Figure 6-9 shows a block diagram of port 3.
AV DD
WR PUO
PUO3
RD
WR PORT
P30/TO0 to P32/TO2, P33/TI1, P34/TI2, P35/PCL, P36/BUZ, P37
Output Latch (P30 to P37)

6.2.6 Port 4
Port 4 is an 8-bit input/output port with output latch. P40 to P47 pins can specify the input mode/output mode in
8-bit units with the memory expansion mode register (MM). When P40 to P47 pins are used as input ports, an on-
chip pull-up resistor can be used to them in 8-bit units with pull-up resistor option register L (PUOL).
The test input flag (KRIF) can be set to 1 by detecting falling edges.
Alternate functions include 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 block diagram of falling edge detection circuit,
respectively.
AV DD
WR PUO
PUO4
RD
WR PORT
Output Latch (P40 to P47)
MM
P40
P41
P42
Falling Edge Detection Circuit
P44
P45
P46
KRMK
P47

6.2.7 Port 5
Port 5 is an 8-bit input/output port with output latch. P50 to P57 pins can specify the input mode/output mode in
1-bit units with the port mode register 5 (PM5). When P50 to P57 pins are used as input ports, an on-chip pull-up
resistor can be used to them in 8-bit units with a pull-up resistor option register L (PUOL).
Port 5 can drive LEDs directly.
Alternate function includes 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.
AV DD
WR PUO
PUO5
RD
WR PORT
Output Latch (P50 to P57)

6.2.8 Port 6
Port 6 is an 8-bit input/output port with output latch. P60 to P67 pins can specify the input mode/output mode in
1-bit units with the port mode register 6 (PM6).
This port has functions related to pull-up resistors as shown below. These functions depending on whether the
higher 4 bits or lower 4 bits of a port are used, and whether the mask ROM model or PROM model is used.
Higher 4 Bits (P64 through P67 pins) Lower 4 bits (P60 through P63 pins)
Pull-up resistor can be connected in 1-bit units by
On-chip pull-up resistor can be connected in 4-bit
Pull-up resistor is not connected
Pins P60 to P63 can drive LEDs directly.
Pins P64 to P67 also serve as the control signal output in external memory expansion mode.
RESET input sets port 6 to input mode.
Figures 6-13 and 6-14 show block diagrams of port 6.
input/output port.
[Mask ROM version]
· For duration of 1.5 clock (no wait) when instruction to read port 6 (P6) and port mode
· Other than above: –3 µ A (MAX.)
[PROM version]

Figure 6-13. P60 to P63 Block Diagram
AV DD
RD
Mask ROM products only. PROM versions have no pull-up resistor.
Output Latch (P60 to P63)
AV DD
WR PUO
PUO6
RD
WR PORT
P64/RD, P65/WR, P66/WAIT, P67/ASTB
Output Latch (P64 to P67)

6.2.9 Port 7
This is a 3-bit input/output port with output latches. Input mode/output mode can be specified bit-wise by means
of port mode register 7 (PM7). When pins P70 to P72 are used as input port pins, an on-chip pull-up resistor can
be used as a 3-bit unit by means of pull-up resistor option register L (PUOL).
Alternate functions include serial interface channel 2 data input/output and clock input/output.
RESET input sets the input mode.
Figures 6-15 and 6-16 show block diagrams of port 7.
functions. For the setting method, refer to Table 19-2 Serial Interface Channel 2 Operating Mode
Settings of List.
AV DD
WR PUO
PUO7
RD
WR PORT
(P70)
WR PM
PM70

Figure 6-16. P71 and P72 Block Diagram
AV DD
WR PUO
PUO7
RD
WR PORT
Output Latch (P71 and P72)
PM71, PM72

6.2.10 Port 12
This is an 8-bit input/output port with output latches. Input mode/output mode can be specified bit-wise by means
of port mode register 12 (PM12). When pins P120 to P127 are used as input port pins, an on-chip pull-up resistor
can be used as an 8-bit unit by means of pull-up resistor option register H (PUOH).
Alternate function includes real-time output.
RESET input sets the input mode.
Figure 6-17 shows a block diagram of port 12.
AV DD
WR PUO
PUO12
RD
WR PORT
Output Latch (P120 to P127)

6.2.11 Port 13
This is a 2-bit input/output port with output latches. Input mode/output mode can be specified bit-wise by means
of port mode register 13 (PM13). When pins P130 and P131 are used as input port pins, an on-chip pull-up resistor
can be used as a 2-bit unit by means of pull-up resistor option register H (PUOH).
Alternate function includes D/A converter analog output.
RESET input sets the input mode.
Figure 6-18 shows a block diagram of port 13.
to VSS.
to 0, to output low level from the pin.
AV DD
WR PUO
PUO13
RD
WR PORT
Output Latch (P130 and P131)
WR PM
PM130, PM131
P-ch · Selector · Internal bus

6.3 Port Function Control Registers
The following four types of registers control the ports.
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
RESET input sets registers to FFH.
When port pins are used as the dual-function pins, set the port mode register and output latch according to
Table 6-5.
output mode is specified and the output level is changed, the interrupt request flag is
set. When the output mode is used, therefore, the interrupt mask flag should be set to
1 beforehand.
(MM).
instruction

Table 6-5. Port Mode Register and Output Latch Settings When Using Alternate Functions
P×× PM×× Input/Output Pin Name
INTP0 Input 1 (Fixed) None
TI00 Input 1 (Fixed) None
INTP1 Input 1 ×
TI01 Input 1 ×
P02 to P06 INTP2 to INTP6 Input 1 ×
P07Note 1 XT1 Input 1 (Fixed) None
P10 to P17Note 1 ANI0 to ANI7 Input 1 ×
P30 to P32 TO0 to TO2 Output 0 0
P33, P34 TI1, TI2 Input 1 ×
P35 PCL Output 0 0
P36 BUZ Output 0 0
P40 to P47 AD0 to AD7 Input/Output ×Note 2
P50 to P57 A8 to A15 Output ×Note 2
P64 RD Output ×Note 2
P65 WR Output ×Note 2
P66 WAIT Input ×Note 2
P67 ASTB Output ×Note 2
P120 to P127 RTP0 to RTP7 Output 0 desired value
P130, P131Note 1 ANO0, ANO1 Output 1 ×
are read.
the function by the memory expansion mode register (MM).
as an I/O port.
be set according to its function. For the setting methods, see Figure 16-4 “Serial
Format,” Figure 18-3 “Serial Operating Mode Register 1 Format”, and Table 19-2 “Serial
Interface Channel 2 Operating Mode Settings of List”.
Alternate Functions · Name

Figure 6-19. Port Mode Register Format
7 6 5 4 3 2 1 0 Symbol
1 PM06 PM03 PM02 PM01 1
PM05 PM04
FF20H
FFH
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
PM7
1 1 1 1 1 PM72 PM71 PM70
FF27H
FFH
R/W
PM12
PM125 PM124 PM123 PM127 PM126
PM122 PM121PM120
FF2CH
FFH
R/W
PM13
1 1 1 1 1 1 PM131 PM130
FF2DH
FFH
R/W
PMmn Pmn Pin Input/Output Mode Selection (m=0 to 3, 5 to 7, 12, 13 : n=0 to 7)
Output mode (output buffer ON)
Input mode (output buffer OFF)
After Reset R/W · Address

(2) Pull-up resistor option register (PUOH, PUOL)
This register is used to set whether to use an internal pull-up resistor at each port or not. A pull-up resistor
is internally used at bits which are set to the input mode at a port where on-chip pull-up resistor use has been
specified with PUOH, PUOL. No on-chip pull-up resistors can be used to the bits set to the output mode or
to the bits used as an analog input pin, irrespective of PUOH or PUOL setting.
PUOH and PUOL are set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets this register to 00H.
up resistor cannot be used even if 1 is set in PUOm bit of PUOH, PUOL (m = 1, 4 to 6).
ROM version.
7 6 5 4 Symbol Address
7 6 3 2 0 1
0 0 PUO13PUO12 0 0 0 PUOH FFF3H 00H R/W
7 6 5 4
7 6 3 2 0 1
PUO3
FFF7H 00H R/W
PUOm Pm On-chip Pull-up Resistor Selection
(m=0 to 7, 12, 13)
On-chip pull-up resistor not used
On-chip pull-up resistor used
After Reset R/W

(3) Memory expansion mode register (MM)
This register is used to set input/output of port 4.
MM is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets this register to 10H.
After Reset R/W 1
7 6 5 4 3 2 Symbol Address
PW0 MM2 MM1 MM0
Single-chip/Memory Expansion Mode Selection
P40 to P47, P50 to P57, P64 to P67 Pin State
P50 to P53 P54, P55
P56, P57 P64 to P67
P65=WR
P66=WAIT
P67=ASTB
A12, A13
Full address modeNote
Other than above Setting prohibited
Wait (one wait state insertion)
Wait control by external wait pin
except the internal ROM, RAM, SFR, and use-prohibited areas.
Remarks 1. P60 to P63 pins enter the port mode in both the single-chip mode and memory expansion mode.

(4) Key return mode register (KRM)
This register sets enabling/disabling of standby function release by a key return signal (falling edge detection
of port 4).
KRM is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets KRM to 02H.
7 6 5 4 3 2 Symbol 1
0 KRMK KRIF
02H R/W
KRIF Key Return Signal Detection Flag
Detected (Falling edge detection of port 4)
KRMK Standby Mode Control by Key Return Signal
Standby mode release enabled
Standby mode release disabled
automatically).
After Reset R/W · Address · Not Detected

6.4 Port Function Operations
Port operations differ depending on whether the input or output mode is set, as shown below.
(1) Output mode
A value is written to the output latch by a transfer instruction, and the output latch contents are output from
the pin.
Once data is written to the output latch, it is retained until data is written to the output latch again.
A value is written to the output latch by a transfer instruction, but since the output buffer is OFF, the pin status
does not change.
Once data is written to the output latch, it is retained until data is written to the output latch again.
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 except for the
manipulated bit.
(1) Output mode
The output latch contents are read by a transfer instruction. The output latch contents do not change.
The pin status is read by a transfer instruction. The output latch contents do not change.

6.4.3 Operations on input/output port
(1) Output mode
An operation is performed on the output latch contents, and the result is written to the output latch. The output
latch contents are output from the pins.
Once data is written to the output latch, it is retained until data is written to the output latch again.
The output latch contents are undefined, but since the output buffer is OFF, the pin status does not change.
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 version. The PROM versions have no mask options.
Pin Name Mask ROM Version PROM Version
Mask option for pins P60 to P63 Bit-wise-selectable on-chip pull-up resistors No on-chip pull-up resistor
![Page 154 of the NEC PD78056F user manual — [MEMO]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-154.webp?w=400)

7.1 Clock Generator Functions
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.
This circuit oscillates at frequencies of 1 to 5.0 MHz. Oscillation can be stopped by executing the STOP
instruction or setting the processor clock control register (PCC).
The circuit oscillates at a frequency of 32.768 kHz. Oscillation cannot be stopped. If the subsystem clock
oscillator is not used, not using the internal feedback resistor can be set by the processor clock control register
(PCC). This enables to decrease power consumption in the STOP mode.
The clock generator consists of the following hardware.
Control register Processor clock control register (PCC)
Oscillation mode selection register (OSMS)
Oscillator Main system clock oscillator
Item Configuration · Subsystem clock oscillator

Figure 7-1. Block Diagram of Clock Generator
FRC
XT1/P07
Watch Timer, Clock Output Function
Clock to Peripheral Hardware
Main System Clock Oscillator X2
fXX 24
fXX 23
CPU Clock (fCPU)
2 fXX 22
To INTP0 Sampling Clock
MCS
MCC FRC CLS CSS PCC2 PCC1
PCC0
Oscillation Mode Selection Register
Processor Clock Control Register

7.3 Clock Generator Control Register
The clock generator is controlled by the following two registers:
The PCC sets whether to use CPU clock selection, the ratio of division, main system clock oscillator operation/
stop and subsystem clock oscillator internal feedback resistor.
The PCC is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets the PCC to 04H.
FRC
XT1 XT2
P-ch · Feedback resistor

Figure 7-3. Processor Clock Control Register Format
7 6 5 4 Symbol Address
7 6 3 2 0 1
FFFBH 04H R/WNote 1
PCC2 CPU CIock Selection (fCPU) PCC1 PCC0
CSS
MCS = 1 MCS = 0
0 fXX/2
fXX/22
fx/22
fx/23
fXX/23
fx/23
fx/24
Setting prohibited Other than above
CLS
R/W
FRC
Subsystem Clock Feedback Resistor Selection
Internal feedback resistor used
Internal feedback resistor not used
MCC
Main System Clock Oscillation Control
system clock oscillation. A STOP instruction should not be used.

The fastest instruction of the µPD78075F and 78075FY Subseries can be executed in two clocks of the CPU clock.
The relationship between the CPU clock (fCPU) and the minimum instruction execution time is shown in Table 7-2.
CPU Clock (fCPU) Minimum Instruction Execution Time: 2/fCPU
fX 0.4 µs
fX/2 0.8 µs
fX/22 1.6 µs
fX/23 3.2 µs
fX/24 6.4 µs
fX/25 12.8 µs
fXT/2 122 µs
fX = 5.0 MHz, fXT = 32.768 kHz
This register specifies whether the clock output from the main system clock oscillator without passing through
the scaler is used as the main system clock, or the clock output via the scaler is used as the main system
clock.
OSMS is set with 8-bit memory manipulation instruction.
RESET input sets OSMS to 00H.
7 6 5 4 3 2 Symbol 1
0 MCS
00H W 0
MCS Main System Clock Scaler Control
peripheral hardware operation starts. As shown in Figure 7-5 below, writing data (including
same data as previous) to OSMS cause delay of main system clock cycle up to 2/fx during
the write operation. Therefore, if this register is written during the operation, in peripheral
hardware which operates with the main system clock, a temporary error occurs in the count
clock cycle of timer, etc. Also, when switching the oscillation mode, the clock supplied to
the CPU is switched as well as the clock supplied to the peripheral hardware. Therefore, it
is recommended that the instruction for writing to OSMS be executed only once after
releasing the reset and before operating the peripheral hardware.

Figure 7-5. Main System Clock Waveform due to Writing to OSMS
(MCS 0)
Max. 2/fX
Operating at fXX = fX/2 (MCS = 0) Operating at fXX = fX/2 (MCS = 0)
Write to OSMS · fXX

7.4 System Clock Oscillator
7.4.1 Main system clock oscillator
The main system clock oscillator oscillates with a crystal resonator or a ceramic resonator (standard: 5.0 MHz)
connected to the X1 and X2 pins.
External clocks can be input to the main system clock oscillator. In this case, input a clock signal to the X1 pin
and an antiphase clock signal to the X2 pin.
Figure 7-6 shows an external circuit of the main system clock oscillator.
(a) Crystal and ceramic oscillation (b) External clock
Crystal or Ceramic Resonator
processor clock control register (PCC)) to 1. If the STOP instruction is executed or MCC is set
to 1, the main system clock will stop operating so that pin X2 can be pulled up to VDD.
External Clock · X1 PD74HCU04 µ

7.4.2 Subsystem clock oscillator
The subsystem clock oscillator oscillates with a crystal resonator (standard: 32.768 kHz) connected to the XT1
and XT2 pins.
External clocks can be input to the main system clock oscillator. In this case, input a clock signal to the XT1 pin
and an antiphase clock signal to the XT2 pin.
Figure 7-7 shows an external circuit of the subsystem clock oscillator.
(a) Crystal oscillation (b) External clock
XT2
XT2
32.768 kHz
XT1
in the broken line area in Figures 7-6 and 7-7 to prevent any effects from wiring capacities.
G Minimize the wiring length.
G Do not allow wiring to intersect with other signal lines. Do not allow wiring to come near
changing high current.
G Set the potential of the grounding position of the oscillator capacitor to that of VSS. Do
not ground to any ground pattern where high current is present.
G Do not fetch signals from the oscillator.
Take special note of the fact that the subsystem clock oscillator is a circuit with low-level
amplification so that current consumption is maintained at low levels.
Figure 7-8 shows examples of resonator having incorrect connection.
(a) Wiring of connection (b) Signal lines intersect each other
circuits is too long
PORTn (n = 0 to 7, 12, 13)
Remark When using a subsystem clock, replace X1 and X2 with XT1 and XT2, respectively. Further, insert
resistors in series on the side of XT2.
External Clock · PD74HCU04 µ

Figure 7-8. Examples of Resonator with Incorrect Connection (2/2)
(c) Changing high current is too near a (d) Current flows through the grounding line
and C fluctuate)
AV DD
X2 IC X1 X2 IC X1
A B C
(e) Signals are fetched
X2 IC X1
Remark When using a subsystem clock, replace X1 and X2 with XT1 and XT2, respectively. Also, insert resistors
in series on the XT2 side.
and cause malfunctions. To prevent that from occurring, it is recommended to wire XT2
and X1 so that they are not in parallel, and to correct the IC pin between XT2 and X1 directly
to VSS.
Pnm · High Current · High Current

7.4.3 Scaler
The scaler divides the main system clock oscillator output (fXX) and generates various clocks.
If it is not necessary to use subsystem clocks for low power consumption operations and clock operations,
connect the XT1 and XT2 pins as follows.
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 using the bit 6 (FRC) of the processor clock control register (PCC). In this case also, connect the XT1 and XT2
pins as described above.

7.5 Clock Generator Operations
The clock generator generates the following various types of clocks and controls the CPU operating mode
including the standby mode.
The following clock generator functions and operations are determined with the processor clock control register
(PCC) and the oscillation mode selection register (OSMS).
(a) Upon generation of 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 low level is
applied to RESET pin.
(b) With the main system clock selected, one of the six CPU clock types (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.
(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 bit 6 (FRC) of the PCC not to use the feedback resistor.
(d) The PCC can be used to select the subsystem clock and to operate the system with low current consumption
(122 µs when operated at 32.768 kHz).
(e) With the subsystem clock selected, main system clock oscillation can be stopped with the PCC. The HALT
mode can be used. However, the STOP mode cannot be used. (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 16-bit timer/event counter, the watch timer, and clock output functions only. Thus, 16-bit timer/event counter
(when selecting watch timer output for count clock operating with 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 with the main system clock, the peripheral hardware also stops if the main system clock
is stopped. (Except external input clock operation)

7.5.1 Main system clock operations
When operated with the main system clock (with bit 5 (CLS) of the processor clock control register (PCC) set to
0), the following operations are carried out by PCC setting.
(a) Because the operation guarantee 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.
(b) If bit 7 (MCC) of the PCC is set to 1 when operated with the main system clock, the main system clock oscillation
does not stop. When bit 4 (CSS) of the PCC is set to 1 and the operation is switched to subsystem clock
operation (CLS = 1) after that, the main system clock oscillation stops (see Figure 7-9).
(a) Operation when MCC is set after setting CSS with main system clock operation
CSS
CLS
Main System Clock Oscillation
(b) Operation when MCC is set in case of main system clock operation
CSS
CLS
Oscillation does not stop.
Main System Clock Oscillation

Figure 7-9. Main System Clock Stop Function (2/2)
(c) Operation when CSS is set after setting MCC with main system clock operation
CSS
CLS
Main System Clock Oscillation
When operated with the subsystem clock (with bit 5 (CLS) of the processor clock control register (PCC) set to 1),
the following operations are carried out.
(a) The minimum instruction execution time remains constant (122 µs when operated at 32.768 kHz) irrespective
of bits 0 to 2 (PCC0 to PCC2) of the PCC.
(b) Watchdog timer counting stops.
7.6.1 Time required for switchover between system clock and CPU clock
The system clock and CPU clock can be switched over by means of 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, but operation continues on the
pre-switchover clock for several instructions (see Table 7-3).
Whether the system is operating on the main system clock or the subsystem clock can be determined with bit 5
(CLS) of the PCC register.
Subsystem Clock Oscillation · CPU Clock

PCC0 PCC1 PCC2
fX/16fXT instruction
fX/32fXT instruction
fX/64fXT instruction
fX/4fXT instruction
fX/8fXT instruction
MSC = 1 MSC = 0 Set Values After Switchover Set Values before
0 ×
× 1 0 0 0 1 1 0 0 1 0 0 0 1 0 0 0
PCC0 PCC1 PCC2 PCC1 PCC2 PCC0 PCC1 PCC2 PCC0 PCC1 PCC2 PCC0 PCC1 PCC2 PCC0 PCC1 PCC2 PCC0
fX/16fXT instruction
fX/32fXT instruction
fX/2fXT instruction
fX/4fXT instruction
fX/8fXT instruction
Simultaneous setting is possible, however, for selection of the CPU clock cycle scaling factor (PCC0 to
PCC2) and switchover from the subsystem clock to the main system clock (changing CSS from 1 to 0).
clock to the subsystem clock (changing CSS from 0 to 1) should not be performed simultaneously.
16 instructions 16 instructions 16 instructions
8 instructions 8 instructions
4 instructions 4 instructions
Remarks 1. One instruction is the minimum instruction execution time with the pre-switchover CPU clock.
1 instruction 1 instruction 1 instruction
1 instruction 1 instruction
4 instructions 4 instructions

7.6.2 System clock and CPU clock switching procedure
This section describes switching procedure between system clock and CPU clock.
V DD
RESET
fXX fXX fXT fXX
(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, main system clock starts oscillation. At this time, 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, 0 is set to the bit 7 (MCC) of PCC and
oscillation of the main system clock is started. After the lapse of time required for stabilization of oscillation,
the PCC and OSMS are rewritten and the maximum-speed operation is resumed.
the main system clock is made again, be sure to switch after securing oscillation stable time by
software.
![Page 170 of the NEC PD78056F user manual — [MEMO]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-170.webp?w=400)

8.1 Overview of the µ PD78058F and 78058FY Subseries On-Chip Timers
This chapter describes the 16-bit timer/event counter and begins with an overview of the on-chip timers and
related devices of the µPD78058F and 78058FY Subseries.
The TM0 can be used for an interval timer, PWM output, pulse widths measurement (infrared ray remote control
receive function), external event counter, square wave output of any frequency or one-shot pulse output.
TM1 and TM2 can be used to serve as an interval timer and an external event counter and to output square
waves with any selected frequency. Two 8-bit timer/event counters can be used as one 16-bit timer/event
counter (See CHAPTER 9 8-BIT TIMER/EVENT COUNTER).
This timer can set a flag every 0.5 sec. and simultaneously generates interrupts request at the preset time
intervals (See CHAPTER 10 WATCH TIMER).
WDTM can perform the watchdog timer function or generate non-maskable interrupts, maskable interrupts
request and RESET at the preset time intervals (See CHAPTER 11 WATCHDOG TIMER).
This circuit supplies other devices with the divided main system clock and the subsystem clock (See CHAPTER
12 CLOCK OUTPUT CONTROL CIRCUIT).
This circuit outputs the buzzer frequency obtained by dividing the main system clock (See CHAPTER 13
BUZZER OUTPUT CONTROL CIRCUIT).

Table 8-1. Timer/Event Counter Operation
Watch Timer Watchdog Timer 16-bit Timer/ 8-bit Timer/event
event Counter Counters 1 and 2
Interval timer 2 channelsNote 3 2 channels 1 channelNote 1 1 channelNote 2
External event counter √ √ — —
Timer output √ √ — —
PWM output √ — — —
Pulse width measurement √ — — —
Square-wave output √ √ — —
One-shot pulse output √ — — —
Interrupt request √
Test input — — √ —
Operation · mode · Function

8.2 16-Bit Timer/Event Counter Functions
The 16-bit timer/event counter (TM0) has the following functions.
PWM output and pulse width measurement can be used at the same time.
TM0 generates interrupts request at the preset time interval.
Minimum Interval Time Maximum Interval Time Resolution
MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 0
2 × TI00 input cycle 216 × TI00 input cycle TI00 input edge cycle
— 2 × 1/fX — 216 × 1/fX — 1/fX
(400 ns) (13.1 ms) (200 ns)
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)
22 × 1/fX 23 × 1/fX 217 × 1/fX 218 × 1/fX 2 × 1/fX 22 × 1/fX
(800 ns) (1.6 µs) (26.2 ms) (52.4 ms) (400 ns) (800 ns)
23 × 1/fX 24 × 1/fX 218 × 1/fX 219 × 1/fX 22 × 1/fX 23 × 1/fX
(1.6 µs) (3.2 µs) (52.4 ms) (104.9 ms) (800 ns) (1.6 µs)
2 × watch timer output cycle 216 × watch timer output cycle Watch timer output edge cycle
TM0 can generate 14-bit resolution PWM output.
TM0 can measure the pulse width of an externally input signal.
TM0 can measure the number of pulses of an externally input signal.

(5) Square-wave output
TM0 can output a square wave with any selected frequency.
Minimum Pulse Width Maximum Pulse Width Resolution
MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 0
2 × TI00 input cycle 216 × TI00 input cycle TI00 input edge cycle
2 × 1/fX 216 × 1/fX 1/fX
(400 ns) (13.1 ms) (200 ns)
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)
22 × 1/fX 23 × 1/fX 217 × 1/fX 218 × 1/fX 2 × 1/fX 22 × 1/fX
(800 ns) (1.6 µs) (26.2 ms) (52.4 ms) (400 ns) (800 ns)
23 × 1/fX 24 × 1/fX 218 × 1/fX 219 × 1/fX 22 × 1/fX 23 × 1/fX
(1.6 µs) (3.2 µs) (52.4 ms) (104.9 ms) (800 ns) (1.6 µs)
2 × watch timer output cycle 216 × watch timer output cycle Watch timer output edge cycle
TM0 is able to output one-shot pulse which can set any width of output pulse.
The 16-bit timer/event counter consists of the following hardware.
Timer register 16 bits × 1 (TM0)
Timer output 1 (TO0)
Control register Timer clock select register 0 (TCL0)
16-bit timer mode control register (TMC0)
Capture/compare control register 0 (CRC0)
16-bit timer output control register (TOC0)
Port mode register 3 (PM3)
External interrupt mode register 0 (INTM0)
Sampling clock select register (SCS)Note
Item Configuration

Figure 8-1. 16-Bit Timer/Event Counter Block Diagram
Capture/Compare Control Register 0
INTP1
TI01/ P01/INTP1
16-Bit Capture/Compare Register 00 (CR00)
PWM Pulse Output Controller
2fXX fXX fXX/2 fXX/22
16-Bit Timer/Event Counter Output Control Circuit
16-Bit Timer Register (TM0)
INTTM01
INTP0
TCL06 TCL05 TCL04
16-Bit Capture/Compare Register 01 (CR01)
CRC02
16-Bit Timer Mode Control Register 16-Bit Timer Output Control Register

Figure 8-2. 16-Bit Timer/Event Counter Output Control Circuit Block Diagram
PWM Pulse Output Control
CRC00 INTTM00
INV
S
Q
TO0/P30
TI00/P00/
INTP0
One-Shot Pulse Output Control Circuit
TMC03 TMC02 TMC01 P30 Output Latch PM30
OSPT
OSPE TOC04 LVS0 LVR0 TOC01 TOE0
External Interrupt Mode Register 0
16-Bit Timer Output Control Register
16-Bit Timer Mode Control Register
Port Mode Register 3
Remark The circuitry enclosed by the dotted line is the output control circuit.

(1) Capture/compare register 00 (CR00)
CR00 is a 16-bit register which has the functions of both a capture register and a compare register. Whether
it is used as a capture register or as a compare register is set by bit 0 (CRC00) of capture/compare control
register 0.
When CR00 is used as a compare register, the value set in CR00 is constantly compared with the 16-bit timer
register (TM0) count value, and an interrupt request (INTTM00) is generated if they match. It can also be
used as the register which holds the interval time when TM0 is set to interval timer operation, and as the register
which sets the pulse width when TM0 is set to PWM operating mode.
When CR00 is used as a capture register, it is possible to select the valid edge of the INTP0/TI00 pin or the
INTP1/TI01 pin as the capture trigger. The valid edge of INTP0/TI00 and INTP1/TI01 are set by external
interrupt mode register 0 (INTM0).
If CR00 is specified as a capture register and capture trigger is specified to be the valid edge of the INTP0/
TI00 pin, the situation is as shown in the following table.
ES11 ES10 INTP0/TI00 Pin Valid Edge CR00 Capture Trigger Valid Edge
0 0 Falling edge Rising edge
0 1 Rising edge Falling edge
1 0 Setting prohibited
1 1 Both rising and falling edges No capture operation
CR00 is set by a 16-bit memory manipulation instruction.
After RESET input, the value of CR00 is undefined.
2 bits to 00.
one pulse cannot be counted.
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.
CR01 is a 16-bit register which has the functions of both a capture register and a compare register. Whether
it is used as a capture register or a compare register is set by bit 2 (CRC02) of capture/compare control register
When CR01 is used as a compare register, the value set in the CR01 is constantly compared with the 16-
bit timer register (TM0) count value, and an interrupt request (INTTM01) is generated if they match.
When CR01 is used as a capture register, it is possible to select the valid edge of the INTP0/TI00 pin as the
capture trigger. The valid edge of INTP0/TI00 is set by interrupt mode register 0 (INTM0).
CR01 is set with a 16-bit memory manipulation instruction.
After RESET input, the value of CR01 is undefined.

capture operation and retains the current data. However, the interrupt request flag (PIF0)
is set.
TM0 is a 16-bit register which counts the count pulses.
TM0 is read by a 16-bit memory manipulation instruction. When TM0 is read, capture/compare register (CR01)
should first be set as a capture register.
RESET input sets TM0 to 0000H.
lost.
The following seven types of registers are used to control the 16-bit timer/event counter.
This register is used to set the count clock of the 16-bit timer register.
TCL0 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets TCL0 value to 00H.
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.

Figure 8-3. Timer Clock Selection Register 0 Format
Address After Reset R/W
7 6 5 4 3 2 1 0 Symbol
CLOE TCL06 TCL05 TCL04 TCL03 TCL02 TCL01 TCL00
FF40H 00H R/W
PCL Output Clock Selection
MCS = 1
MCS = 0
0 fXT (32.768 kHz)
0 1 0 1 fXX fX (5.0 MHz) fX/2 (2.5 MHz)
2 (1.25 MHz)
0 1 1 0 fXX/2 fX/2 (2.5 MHz) fX/2
2 fX/2
2 (1.25 MHz) fX/2
0 1 1 1 fXX/2
1 0 0 0 fXX/2
3 fX/2
3(625 kHz) fX/2
1 0 0 1 fXX/2
4 fX/2
4(313 kHz) fX/2
6 (78.1 kHz)
1 0 1 0 fXX/2
5 fX/2
5(156 kHz) fX/2
7 (39.1 kHz)
1 0 1 1 fXX/2
6 fX/2
6(78.1 kHz) fX/2
8 (19.5 kHz)
1 1 0 0 fXX/2
7 fX/2
7(39.1 kHz) fX/2
Other than above Setting prohibited
16-Bit Timer Register Count Clock Selection
MCS = 1
MCS = 0
0 0 0 TI00 (Valid edge specifiable)
0 0 1 2fXX Setting prohibited fX (5.0 MHz)
0 1 0 fXX fX (5.0 MHz) fX/2 (2.5 MHz)
0 1 1 fXX/2 fX/2 (2.5 MHz) fX/2
2 (1.25 MHz)
1 0 0 fXX/2
2 fX/2
2 (1.25 MHz) fX/2
1 1 1 Watch timer output (INTTM 3)
Other than above Setting prohibited
the frequency of the sampling clock is selected with the sampling clock selection register
(SCS).
manipulation instruction.
should be read from TM0, not from 16-bit capture/compare register 01 (CR01).

This register sets the 16-bit timer operating mode, the 16-bit timer register clear mode and output timing, and
detects an overflow.
TMC0 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets TMC0 value to 00H.
stop mode) is set in TMC01 to TMC03, respectively. Set 0, 0, 0 in TMC01 to TMC03 to stop
the operation.

Figure 8-4. 16-Bit Timer Mode Control Register Format
Address After Reset R/W
7 6 5 4 3 2 1 0 Symbol
0 0 0 0 TMC03 TMC02 TMC01 OVF0
OVF0 16-Bit Timer Register Overflow Detection
0 Overflow not detected
TMC03 TMC02 TMC01 Operating Mode Clear Mode Selection
TO0 Output Timing Selection Interrupt Generation
0 0 0 Operation stop (TM0 cleared to 0)
No change Not Generated
0 0 1 PWM mode (free running)
Generated on match between TM0 and CR00, and match between TM0 and CR01
Free running mode Match between TM0 and CR00 or match between TM0 and CR01
Match between TM0 and CR00, match between TM0 and CR01 or TI00 valid edge
Clear & start on TI00 valid edge
Match between TM0 and CR00 or match between TM0 and CR01
Match between TM0 and CR00, match between TM0 and CR01 or TI00 valid edge
Match between TM0 and CR00 or match between TM0 and CR01
Clear & start on match between TM0 and CR00
Match between TM0 and CR00, match between TM0 and CR01 or TI00 valid edge
(by setting TMC01 to TMC03 to 0, 0, 0).
the frequency of the sampling clock is selected with the sampling clock selection
register (SCS).
of CR00 is FFFFH and the TM0 value changes from FFFFH to 0000H, OVF0 flag is set
to 1.
1 Overflow detected · PWM pulse output

(3) Capture/compare control register 0 (CRC0)
This register controls the operation of the capture/compare registers 00, 01 (CR00, CR01).
CRC0 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets CRC0 value to 04H.
7 6 5 4 3 2 1 0 Symbol
Address After Reset R/W
0 0 0 0 0 CRC02 CRC01 CRC00
CRC00 CR00 Operating Mode Selection
0 Operates as compare register
1 Operates as capture register
CRC01 CR00 Capture Trigger Selection
Captures on valid edge of TI01
Captures on valid edge of TI00
CRC02 CR01 Operating Mode Selection
Operates as compare register
Operates as capture register
bit timer mode control register (TMC0), CR00 should not be specified as a capture
register.
This register controls the operation of the 16-bit timer/event counter output control circuit. It sets R-S type
flip-flop (LV0) setting/resetting, the active level in PWM mode, inversion enabling/disabling in modes other
than PWM mode, 16-bit timer/event counter timer output enabling/disabling, one-shot pulse output operation
enabling/disabling, and output trigger for a one-shop pulse by software.
TOC0 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets TOC0 value to 00H.

Figure 8-6. 16-Bit Timer Output Control Register Format
7 6 5 4 3 2 1 0 Symbol
Address After Reset R/W
0 OSPT OSPE TOC04 LVS0 LVR0 TOC01 TOE0
TOE0 16-Bit Timer/Event Counter Output Control
0 Output disabled (Port mode)
In PWM Mode In Other Modes
Timer output F/F control by match of CR00 and TM0
LVS0 LVR0 16-Bit Timer/Event Counter Timer Output F/F Status Setting
0 0 No change
0 1 Timer output F/F reset (0)
1 0 Timer output F/F set (1)
1 1 Setting prohibited
TOC04 Timer output F/F control by match of CR01 and TM0
0 Inversion operation disabled
1 Inversion operation enabled
OSPE One-Shot Pulse Output Control
0 Continuous pulse output
1 One-shot pulse output
OSPT Control of One-Shot Pulse Output Trigger by Software
0 One-shot pulse trigger not used
1 One -shot pulse trigger used

(5) Port mode register 3 (PM3)
This register sets port 3 input/output in 1-bit units.
When using the P30/TO0 pin for timer output, set PM30 and output latch of P30 to 0.
PM3 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets PM3 value to FFH.
Address After Reset R/W
7 6 5 4 3 2 1 0 Symbol
PM37 PM36 PM35 PM34 PM33 PM32 PM31 PM30
PM3n P3n Pin Input/Output Mode Selection (n = 0 to 7)
0 Output mode (output buffer ON)
1 Input mode (output buffer OFF)

(6) External interrupt mode register 0 (INTM0)
This register is used to set INTP0 to INTP2 valid edges.
INTM0 is set with an 8-bit memory manipulation instruction.
RESET input sets INTM0 value to 00H.
Address After Reset R/W
7 6 5 4 3 2 1 0 Symbol
ES31 ES30 ES21 ES20 ES11 ES10 0 0
ES11 INTP0 Valid Edge Selection ES10
0 Falling edge 0
0 Rising edge 1
1 Setting prohibited 0
1 Both falling and rising edges 1
ES21 INTP1 Valid Edge Selection ES20
0 Falling edge 0
0 Rising edge 1
1 Setting prohibited 0
1 Both falling and rising edges 1
ES31 INTP2 Valid Edge Selection ES30
0 Falling edge 0
0 Rising edge 1
1 Setting prohibited 0
1 Both falling and rising edges 1
1 through 3 (TMC01 through TMC03) of the 16-bit timer mode control register (TMC0) to 0, 0, 0.

(7) Sampling clock select register (SCS)
This register sets clocks which undergo clock sampling of valid edges to be input to INTP0. When remote
controlled reception is carried out using INTP0, digital noise is removed with sampling clock.
SCS is set with an 8-bit memory manipulation instruction.
RESET input sets SCS value to 00H.
7 6 5 4 3 2 1 0 Symbol
Address After Reset R/W
0 0 0 0 0 0 SCS1 SCS0
INTP0 Sampling Clock Selection
MCS = 1 MCS = 0
N
7 (39.1 kHz) fXX/2
7 fX/2
8 (19.5 kHz)
5 (156.3 kHz) fXX/2
5 fX/2
6 (78.1 kHz)
6 (78.1 kHz) fXX/2
6 fX/2
7 (39.1 kHz)
peripheral hardware. fXX/2N is stopped in HALT mode.
Remarks 1. N : Value set in bits 0 to 2 (PCC0 to PCC2) of the processor clock control register (PCC)
(N= 0 to 4)

8.5 16-Bit Timer/Event Counter Operations
8.5.1 Interval timer operations
Setting the 16-bit timer mode control register (TMC0) and capture/compare control register 0 (CRC0) as shown
in Figure 8-10 allows operation as an interval timer. Interrupt requests are generated repeatedly using the count value
set in 16-bit capture/compare register 00 (CR00) beforehand as the interval.
When the count value of the 16-bit timer register (TM0) matches the value set to CR00, counting continues with
the TM0 value cleared to 0 and the interrupt request signal (INTTM00) is generated.
Count clock of the 16-bit timer/event counter can be selected with bits 4 to 6 (TCL04 to TCL06) of the timer clock
select register 0 (TCL0).
For the operation when the value of the compare register has been changed during timer count operation, refer
to section 8.6 (3) Operation after compare register change during timer count operation.
(a) 16-bit timer mode control register (TMC0)
TMC03 TMC02 TMC01 OVF0
TMC0
0 1 1 0/1 0
Clear & start on match TM0 and CR00
CRC02 CRC01 CRC00
0/1 0/1 0
CR00 set as compare register
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.

Figure 8-11. Interval Timer Configuration Diagram
16-Bit Capture/Compare Register 00 (CR00)
INTTM00
fXX 2fXX
2 fXX/2
16-Bit Timer Register (TM0)
TI00/P00/INTP0
Figure 8-12. Interval Timer Operation Timings
0000 0001 N 0000 0001 N 0000 0001 N
Count Start Clear Clear
N N N N
INTTM00
Interrupt Request Acknowledge Interrupt Request Acknowledge
Interval Time Interval Time Interval Time
Remark Interval time = (N + 1) × t : N = 0001H to FFFFH.

Table 8-6. 16-Bit Timer/Event Counter Interval Times
Minimum Interval Time Maximum Interval Time Resolution
MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 0
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)
0 1 1 22 × 1/fX 23 × 1/fX 217 × 1/fX 218 × 1/fX 2 × 1/fX 22 × 1/fX (800 ns) (1.6 µs) (26.2 ms) (52.4 ms) (400 ns) (800 ns)
1 0 0 23 × 1/fX 24 × 1/fX 218 × 1/fX 219 × 1/fX 22 × 1/fX 23 × 1/fX (1.6 µs) (3.2 µs) (52.4 ms) (104.9 ms) (800 ns) (1.6 µs)
1 1 1 2 × watch timer output cycle 216 × watch timer output cycle Watch timer output edge cycle
Other than above Setting prohibited
Setting the 16-bit timer mode control register (TMC0), capture/compare control register 0 (CRC0), and the 16-bit
timer output control register (TOC0) as shown in Figure 8-13 allows operation as PWM output. Pulses with the duty
rate determined by the value set in 16-bit capture/compare register 00 (CR00) beforehand are output from the TO0/
P30 pin.
Set the active level width of the PWM pulse to the high-order 14 bits of CR00. Select the active level with bit 1
(TOC01) of the 16- bit timer output control register (TOC0).
This PWM pulse has a 14-bit resolution. The pulse can be converted to an analog voltage by integrating it with
an external low-pass filter (LPF). The PWM pulse is formed by a combination of the basic cycle determined by 28/
Φ and the sub-cycle determined by 214/Φ so that the time constant of the external LPF can be shortened. Count clock
Φ can be selected with bits 4 to 6 (TCL04 to TCL06) of the timer clock select register 0 (TCL0).
PWM output enable/disable can be selected with bit 0 (TOE0) of TOC0.

Figure 8-13. Control Register Settings for PWM Output Operation
(a) 16-bit timer mode control register (TMC0)
OVF0 TMC01 TMC02 TMC03
TMC0 0 1 0
CRC00 CRC01 CRC02
CRC0 0 0/1 0/1 0
CR00 set as compare register
TOE0 TOC01 LVR0 LVS0 TOC04 OSPE OSPT
TOC0 1 0/1 × 0
Remarks 1. 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.
PWM mode · TO0 Output Enabled · Specifies Active Level

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.
capture/compare register 00 (CR00) value
V REF
Low-Pass Filter Analog Output (VAN)
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
47 kΩ 47 kΩ 47 kΩ
0.22 F µ 0.22 F µ 0.22 F µ Electronic
8.2 kΩ
8.2 kΩ
GND

8.5.3 PPG output operations
Setting the 16-bit timer mode control register (TMC0) and capture/compare control register 0 (CRC0) as shown
in Figure 8-16 allows operation as PPG (Programmable Pulse Generator) output.
In the PPG output operation, square waves are output from the TO0/P30 pin with the pulse width and the cycle
that correspond to the count values set beforehand in 16-bit capture/compare register 01 (CR01) and in 16-bit capture/
compare register 00 (CR00), respectively.
(a) 16-bit timer mode control register (TMC0)
OVF0 TMC01 TMC02 TMC03
TMC0 0 0 1 1 0
Clear & start on match of TM0 and CR00
CRC00 CRC01 CRC02
CRC0 0 x 0
CR00 set as compare register
CR01 set as compare register
TOC04 OSPE OSPT
TOE0 TOC01 LVR0 LVS0
TOC0 1 1 0/1 0/1 1 0 0 0
Inversion of output on match of TM0 and CR00
Specified TO0 output F/F initial value
Inversion of output on match of TM0 and CR01 One-shot pulse output disabled
TO0 Output Enabled

8.5.4 Pulse width measurement operations
It is possible to measure the pulse width of the signals input to the TI00/P00 pin and TI01/P01 pin using the
16-bit timer register (TM0).
restarting the timer in synchronization with the edge of the signal input to the TI00/P00 pin.
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 valid edge specifications can be selected – rising, falling, or both edges – by means of bits 2
and 3 (ES10 and ES11) of INTM0.
For valid edge detection, sampling is performed at the interval selected by means of the sampling clock
selection register (SCS), and a capture operation is only performed when a valid level is detected twice, thus
eliminating noise with a short pulse width.
Free-Running Counter and One Capture Register
(a) 16-bit timer mode control register (TMC0)
OVF0 TMC01 TMC02 TMC03
TMC0 0 0/1 1 0
CRC00 CRC01 CRC02
CRC0 0 0/1 1 0
CR00 set as compare register
CR01 set as capture register
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.
Free-Running Mode

Figure 8-18. Configuration Diagram for Pulse Width Measurement by Free-Running Counter
INTTM3
16-Bit Timer Register (TM0)
TI00/P00/INTP00
16-Bit Capture/Compare Register 01 (CR01)
Figure 8-19. Timing of Pulse Width Measurement Operation by Free-Running Counter
and One Capture Register (with Both Edges Specified)
0000 0001 D0 D1 FFFF 0000 D2 D3
D0 D1 D2 D3
INTP0
OVF0
(D1 – D0) × t (10000H – D1 + D2) × t (D3 – D2) × t

(2) Measurement of two pulse widths with free-running counter
When the 16-bit timer register (TM0) is operated in free-running mode (see register settings in Figure 8-20),
it is possible to simultaneously measure the pulse widths of the two signals input to the TI00/P00 pin and the
TI01/P01 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, when the edge specified by bits 4 and 5 (ES20 and ES21) of INTM0 is input to the TI01/P01 pin, the
value of TM0 is taken into 16-bit capture/compare register 00 (CR00) and an external interrupt request signal
(INTP1) is set.
Any of three edge specifications can be selected – rising, falling, or both edges – as the valid edge for the
TI00/P00 pin and the TI01/P01 pin by means of bits 2 and 3 (ES01 and ES11) and bits 4 and 5 (ES20 and
ES21) of INTM0, respectively.
For TI00/P00 pin valid edge detection, sampling is performed at the interval selected by means of the sampling
clock selection 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-20. Control Register Settings for Two Pulse Width Measurements with Free-Running Counter
OVF0 TMC01 TMC02 TMC03
TMC0 0 0/1 1 0
CRC00 CRC01 CRC02
CRC0 1 0 1 0
CR00 set as capture register
Captured in CR00 on valid edge of TI01/P01 Pin
CR01 set as capture register
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.
Free-Running Mode

Figure 8-21. Timing of Pulse Width Measurement Operation with
Free-Running Counter (with Both Edges Specified)
0000 0001 D0 D1 0000 D3 D2 FFFF
D0 D1 D3 D2
INTP0
D1
INTP1
OVF0
(D1 – D0) × t (10000H – D1 + D2) × t
(D3 – D2) × t
(10000H – D1 + (D2 + 1)) × t

(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 inverse edge input of 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 means of bits 2 and 3 (ES10 and ES11) of INTM0.
For TI00/P00 pin valid edge detection, sampling is performed at the interval selected by means of the sampling
clock selection register (SCS), and a capture operation is only performed when a valid level is detected twice,
thus eliminating noise with a short pulse width.
register 00 (CR00) cannot perform the capture operation.
Free-Running Counter and Two Capture Registers
(a) 16-bit timer mode control register (TMC0)
OVF0 TMC01 TMC02 TMC03
TMC0 0 0/1 1 0
CRC00 CRC01 CRC02
CRC0 1 1 1 0
CR00 set as capture register
Captured in CR00 on invalid edge of TI00/P00 Pin
CR01 set as capture register
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.
Free-Running Mode

Figure 8-23. Timing of Pulse Width Measurement Operation by Free-Running
Counter and Two Capture Registers (with Rising Edge Specified)
D3 D2 0000 FFFF D1 D0 0000 0001
D0 D2
D1 D3
INTP0
OVF0
(D1-D0) × t (10000H-D1 + D2) × t (D3-D2) × t

(4) Pulse width measurement by means of restart
When input of a valid edge to the TI00/P00 pin is detected, the count value of the 16-bit timer register (TM0)
is taken into 16-bit capture/compare register 01 (CR01), and then the pulse width of the signal input to the
TI00/P00 pin is measured by clearing TM0 and restarting the count (see register settings in Figure 8-24).
The edge specification can be selected from two types, rising and falling edges by external interrupt mode
register 0 (INTM0) bits 2 and 3 (ES10 and ES11).
In a valid edge detection, the sampling is performed by a cycle selected by the sampling clock selection register
(SCS), and a capture operation is only performed when a valid level is detected twice, thus eliminating noise
with a short pulse width.
compare register 00 (CR00) cannot perform the capture operation.
Figure 8-24. Control Register Settings for Pulse Width Measurement by Means of Restart
OVF0 TMC01 TMC02 TMC03
TMC0 0 0/1 0 1 0
Clear & start with valid edge of TI00/P00 pin
CRC00 CRC01 CRC02
CRC0 1 1 1 0
CR00 set as capture register
Captured in CR00 on invalid edge of TI00/P00 Pin
CR01 set as capture register
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.
Means of Restart (with Rising Edge Specified)
0000 0001 D0 0000 0001 D1 0001 0000 D2
D1
INTP0

8.5.5 External event counter operation
The external event counter counts the number of external clock pulses to be input to the TI00/P00 pin with the
16-bit timer register (TM0).
TM0 is incremented each time the valid edge specified with the external interrupt mode register 0 (INTM0) is input.
When the TM0 counted value matches the 16-bit capture/compare register 00 (CR00) value, TM0 is cleared to
0 and the interrupt request signal (INTTM00) is generated.
Set a value for CR00 other than 0000H (1-pulse count operation is not possible).
The rising edge, the falling edge or both edges can be selected with bits 2 and 3 (ES10 and ES11) of INTM0.
Because operation is carried out only after the valid edge is detected twice by sampling at the interval selected
with the sampling clock select register (SCS), noise with short pulse widths can be removed.
(a) 16-bit timer mode control register (TMC0)
OVF0 TMC01 TMC02 TMC03
TMC0 0 0/1 1 1 0
Clear & start with match of TM0 and CR00
CRC00 CRC01 CRC02
CRC0 0 0/1 0/1 0
CR00 set as compare register
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.

Figure 8-27. External Event Counter Configuration Diagram
16-Bit Capture/Compare Register 00 (CR00)
TI00 Valid Edge OVF0
16-Bit Timer Register (TM0)
16-Bit Capture/Compare Register 01 (CR01)
0000 0001 0002 0003 0004 0005 N-1 N 0000 0001 0002 0003
N
INTTM0

8.5.6 Square-wave output operation
Operates as a square wave output at the desired frequency with the count value set previously in the 16 bit capture/
conveyor register 00 (CR00) as the interval.
The TO0/P30 pin output status is reversed at intervals of the count value preset to CR00 by setting bit 0 (TOE0)
and bit 1 (TOC01) of the 16-bit timer output control register (TOC0) to 1. This enables a square wave with any selected
frequency to be output.
(a) 16-bit timer mode control register (TMC0)
OVF0 TMC01 TMC02 TMC03
TMC0 0 0/1 1 1 0
Clear & start on match of TM0 and CR00
CRC00 CRC01 CRC02
CRC0 0 0/1 0/1 0
CR00 set as compare register
TOE0 TOC01 LVR0 OSPT OSPE TOC04 LVS0
TOC0 1 1 0/1 0/1 0
TO0 Output Enabled Inversion of output on match of TM0 and CR00 Specified TO0 output F/F initial value No inversion of output on match of TM0 and CR01 One-shot pulse output disabled
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.

Figure 8-30. Square-Wave Output Operation Timing
0000 0001 0002 N-1 N 0000 0001 0002 N-1 N 0000
N
INTTM00
Table 8-7. 16-Bit Timer/Event Count Square-Wave Output Ranges
Minimum Pulse Width Maximum Pulse Width Resolution
MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 0
2 × TI00 input cycle 216 × TI00 input cycle TI00 input edge cycle
2 × 1/fX 216 × 1/fX 1/fX
(400 ns) (13.1 ms) (200 ns)
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)
22 × 1/fX 23 × 1/fX 217 × 1/fX 218 × 1/fX 2 × 1/fX 22 × 1/fX
(800 ns) (1.6 µs) (26.2 ms) (52.4 ms) (400 ns) (800 ns)
23 × 1/fX 24 × 1/fX 218 × 1/fX 219 × 1/fX 22 × 1/fX 23 × 1/fX
(1.6 µs) (3.2 µs) (52.4 ms) (104.9 ms) (800 ns) (1.6 µs)
2 × watch timer output cycle 216 × watch timer output cycle Watch timer output edge cycle
Count Clock · TM0 Count Value · TO0 Pin Output

8.5.7 One-shot pulse output operation
It is possible to output one-shot pulses synchronized with a software trigger or an external trigger (TI00/P00 pin
input).
If the 16-bit timer mode control register (TMC0), capture/compare control register 0 (CRC0), and the 16-bit
timer output control register (TOC0) are set as shown in Figure 8-31, and 1 is set in bit 6 (OSPT) of TOC0
by software, a one-shot pulse is output from the TO0/P30 pin.
By setting 1 in OSPT, the 16-bit timer/event counter is cleared and started, and output is activated by the count
value set beforehand in 16-bit capture/compare register 01 (CR01). Thereafter, output is inactivated by the
count value set beforehand in 16-bit capture/compare register 00 (CR00).
TM0 continues to operate after one-shot pulse is output. To stop TM0, 00H must be set to TMC0.
again, execute after INTTM00 (interrupt match signal with CR00) is generated.
Figure 8-31. Control Register Settings for One-Shot Pulse Output Operation Using Software Trigger
OVF0 TMC01 TMC02 TMC03
TMC0 0 0 1 1 0
Clear & start with match of TM0 and CR00
CRC00 CRC01 CRC02
CRC0 0 0/1 0
CR00 set as compare register
CR01 set as compare register
TOE0 TOC01 LVR0 OSPT OSPE TOC04 LVS0
TOC0 1 1 0/1 0/1 1 1 0 0
TO0 Output Enabled Inversion of output on match of TM0 and CR00 Specified TO0 output F/F initial value
Inversion of output on match of TM0 and CR01
One-shot pulse output mode
Set 1 in case of output
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-32. Timing of One-Shot Pulse Output Operation Using Software Trigger
Set 0CH to TMC0 (TM0 count start)
0000 0001 N N+1 0000 N-1 N M-1 M 0000 0001 0002
N
N
N
M
M
M
M
OSPT
INTTM01
INTTM00
stop mode) is set to TMC01 to TMC03, respectively.

(2) One-shot pulse output using external trigger
If the 16-bit timer mode control register (TMC0), capture/compare control register 0 (CRC0), and the 16-bit
timer output control register (TOC0) are set as shown in Figure 8-33, a one-shot pulse is output from the TO0/
P30 pin with a TI00/P00 valid edge as an external trigger.
Any of three edge specifications can be selected – rising, falling, or both edges – as the valid edges for the
TI00/P00 pin by means of bits 2 and 3 (ES10 and ES11) of external interrupt mode register 0 (INTM0).
When a valid edge is input to the TI00/P00 pin, the 16-bit timer/event counter is cleared and started, and output
is activated by the count values set beforehand in 16-bit capture/compare register 01 (CR01). Thereafter,
output is inactivated by the count value set beforehand in 16-bit capture/compare register 00 (CR00).
Figure 8-33. Control Register Settings for One-Shot Pulse Output Operation Using External Trigger
OVF0 TMC01 TMC02 TMC03
TMC0 1 0
Clear & start with valid edge of TI00/P00 pin
CRC00 CRC01 CRC02
CRC0 0 0/1 0
CR00 set as compare register
CR01 set as compare register
TOE0 TOC01 LVR0 LVS0 OSPT OSPE TOC04
TOC0 1 1 0/1 0/1 1 1 0 0
Inversion of output on match of TM0 and CR00
Specified TO0 output F/F initial value
Inversion of output on match of TM0 and CR01
One-shot pulse output 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.
TO0 Output Enabled

Figure 8-34. Timing of One-Shot Pulse Output Operation Using
External Trigger (with Rising Edge Specified)
Set 08H to TMC0 (TM0 count start)
0000 0001 0000 N N+1 N+2 M–2 M–1 M M+1 M+2 M+3
N
N
N
M
M
M
M
INTTM01
INTTM00
stop mode) is set to TMC01 to TMC03, respectively.

8.6 16-Bit Timer/Event Counter Operating Precautions
(1) Timer start errors
An error with a maximum of one clock may occur concerning the time required for a match signal to be
generated after timer start. This is because the 16-bit timer register (TM0) is started asynchronously with the
count pulse.
TM0 Count Value 0000H 0001H 0002H 0003H 0004H
Set a value other than 0000H to the 16-bit capture/compare register 00 (CR00).
Thus, when using the 16-bit capture/compare register as event counter, one-pulse count operation cannot
be carried out.
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 (M)
after CR00 change is smaller than that (N) before change, it is necessary to restart the timer after changing
CR00.
CR00
M N
TM0 Count Value X-1 X FFFFH 0000H 0001H 0002H
Remark N > X > M
Count Pulse · Timer Start · Count Pulse

(4) Capture register data retention timings
If the valid edge of the TI00/P00 pin is input during 16-bit capture/compare register 01 (CR01) read, CR01
holds data without carrying out capture operation. However, the interrupt request flag (PIF0) is set upon
detection of the valid edge.
N N+1 N+2 M M+1 M+2
X N+1
(5) Valid edge setting
Set the valid edge of the TI00/P00/INTP0 pin after setting bits 1 to 3 (TMC01 to TMC03) of the 16-bit timer
mode control register (TMC0) to 0, 0, 0, respectively, and then stopping timer operation.
Valid edge setting is carried out with bits 2 and 3 (ES10 and ES11) of external interrupt mode register 0 (INTM0).
(a) One-shot pulse output using software
When outputting one-shot pulse, do not set bit 6 (OSPT) of the 16-bit timer output control register (TOC0).
When outputting one-shot pulse again, wait for interrupt INTTM00, which coincides with CR00, to be
generated first.
When outputting one-shot pulses, external trigger is ignored if generated again.

(7) Operation of OVF0 flag
OFV0 flag is set to 1 in the following case.
The clear & start mode on match between TM0 and CR00 is selected.
CR00 is set to FFFFH.
When TM0 is counted up from FFFFH to 0000H.
CR00
FFFFH
TM0
FFFEH FFFFH 0000H 0001H
OVF0
INTTM00
Count Pulse

9.1 8-Bit Timer/Event Counter Function
The on-chip 8-bit timer/event counters of the µPD78058F, 78058FY Subseries have two modes: a mode in which
the two 8-bit timer/event counter channels are separately used (8-bit timer/event counter mode), and a mode in which
the two 8-bit timer/event counter channels are used combined as a 16-bit timer/event counter (16-bit timer/event
counter mode).
The 8-bit timer/event counters 1 and 2 (TM1 and TM2) have the following functions.

(1) 8-bit interval timer
Interrupt requests are generated at the preset time intervals.
Minimum Interval Time Maximum Interval Time Resolution
MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 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)
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)
23 × 1/fX 24 × 1/fX 211 × 1/fX 212 × 1/fX 23 × 1/fX 24 × 1/fX
(1.6 µs) (3.2 µs) (409.6 µs) (819.2 µs) (1.6 µs) (3.2 µs)
24 × 1/fX 25 × 1/fX 212 × 1/fX 213 × 1/fX 24 × 1/fX 25 × 1/fX
(3.2 µs) (6.4 µs) (819.2 µs) (1.64 ms) (3.2 µs) (6.4 µs)
25 × 1/fX 26 × 1/fX 213 × 1/fX 214 × 1/fX 25 × 1/fX 26 × 1/fX
(6.4 µs) (12.8 µs) (1.64 ms) (3.28 ms) (6.4 µs) (12.8 µs)
26 × 1/fX 27 × 1/fX 214 × 1/fX 215 × 1/fX 26 × 1/fX 27 × 1/fX
(12.8 µs) (25.6 µs) (3.28 ms) (6.55 ms) (12.8 µs) (25.6 µs)
27 × 1/fX 28 × 1/fX 215 × 1/fX 216 × 1/fX 27 × 1/fX 28 × 1/fX
(25.6 µs) (51.2 µs) (6.55 ms) (13.1 ms) (25.6 µs) (51.2 µs)
28 × 1/fX 29 × 1/fX 216 × 1/fX 217 × 1/fX 28 × 1/fX 29 × 1/fX
(51.2 µs) (102.4 µs) (13.1 ms) (26.2 ms) (51.2 µs) (102.4 µ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)

(2) External event counter
The number of pulses of an externally input signal can be measured.
A square wave with any selected frequency can be output.
Minimum Pulse Width Maximum Pulse Width Resolution
MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 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)
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)
23 × 1/fX 24 × 1/fX 211 × 1/fX 212 × 1/fX 23 × 1/fX 24 × 1/fX
(1.6 µs) (3.2 µs) (409.6 µs) (819.2 µs) (1.6 µs) (3.2 µs)
24 × 1/fX 25 × 1/fX 212 × 1/fX 213 × 1/fX 24 × 1/fX 25 × 1/fX
(3.2 µs) (6.4 µs) (819.2 µs) (1.64 ms) (3.2 µs) (6.4 µs)
25 × 1/fX 26 × 1/fX 213 × 1/fX 214 × 1/fX 25 × 1/fX 26 × 1/fX
(6.4 µs) (12.8 µs) (1.64 ms) (3.28 ms) (6.4 µs) (12.8 µs)
26 × 1/fX 27 × 1/fX 214 × 1/fX 215 × 1/fX 26 × 1/fX 27 × 1/fX
(12.8 µs) (25.6 µs) (3.28 ms) (6.55 ms) (12.8 µs) (25.6 µs)
27 × 1/fX 28 × 1/fX 215 × 1/fX 216 × 1/fX 27 × 1/fX 28 × 1/fX
(25.6 µs) (51.2 µs) (6.55 ms) (13.1 ms) (25.6 µs) (51.2 µs)
28 × 1/fX 29 × 1/fX 216 × 1/fX 217 × 1/fX 28 × 1/fX 29 × 1/fX
(51.2 µs) (102.4 µs) (13.1 ms) (26.2 ms) (51.2 µs) (102.4 µ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)

9.1.2 16-bit timer/event counter mode
(1) 16-bit interval timer
Interrupt requests can be generated at the preset time intervals.
are Used as 16-Bit Timer/Event Counter
Minimum Interval Time Maximum Interval Time Resolution
MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 0
2 × 1/fX 22 × 1/fX 217 × 1/fX 218 × 1/fX 2 × 1/fX 22 × 1/fX
(400 ns) (800 ns) (26.2 ms) (52.4 ms) (400 ns) (800 ns)
22 × 1/fX 23 × 1/fX 218 × 1/fX 219 × 1/fX 22 × 1/fX 23 × 1/fX
(800 ns) (1.6 µs) (52.4 ms) (104.9 ms) (800 ns) (1.6 µs)
23 × 1/fX 24 × 1/fX 219 × 1/fX 220 × 1/fX 23 × 1/fX 24 × 1/fX
(1.6 µs) (3.2 µs) (104.9 ms) (209.7 ms) (1.6 µs) (3.2 µs)
24 × 1/fX 25 × 1/fX 220 × 1/fX 221 × 1/fX 24 × 1/fX 25 × 1/fX
(3.2 µs) (6.4 µs) (209.7 ms) (419.4 ms) (3.2 µs) (6.4 µs)
25 × 1/fX 26 × 1/fX 221 × 1/fX 222 × 1/fX 25 × 1/fX 26 × 1/fX
(6.4 µs) (12.8 µs) (419.4 ms) (838.9 ms) (6.4 µs) (12.8 µs)
26 × 1/fX 27 × 1/fX 222 × 1/fX 223 × 1/fX 26 × 1/fX 27 × 1/fX
(12.8 µs) (25.6 µs) (838.9 ms) (1.7 s) (12.8 µs) (25.6 µs)
27 × 1/fX 28 × 1/fX 223 × 1/fX 224 × 1/fX 27 × 1/fX 28 × 1/fX
(25.6 µs) (51.2 µs) (1.7 s) (3.4 s) (25.6 µs) (51.2 µs)
28 × 1/fX 29 × 1/fX 224 × 1/fX 225 × 1/fX 28 × 1/fX 29 × 1/fX
(51.2 µs) (102.4 µs) (3.4 s) (6.7 s) (51.2 µs) (102.4 µ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)

(2) External event counter
The number of pulses of an externally input signal can be measured.
A square wave with any selected frequency can be output.
Counters are Used as 16-Bit Timer/Event Counter
Minimum Pulse Width Maximum Pulse Width Resolution
MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 0
2 × 1/fX 22 × 1/fX 217 × 1/fX 218 × 1/fX 2 × 1/fX 22 × 1/fX
(400 ns) (800 ns) (26.2 ms) (52.4 ms) (400 ns) (800 ns)
22 × 1/fX 23 × 1/fX 218 × 1/fX 219 × 1/fX 22 × 1/fX 23 × 1/fX
(800 ns) (1.6 µs) (52.4 ms) (104.9 ms) (800 ns) (1.6 µs)
23 × 1/fX 24 × 1/fX 219 × 1/fX 220 × 1/fX 23 × 1/fX 24 × 1/fX
(1.6 µs) (3.2 µs) (104.9 ms) (209.7 ms) (1.6 µs) (3.2 µs)
24 × 1/fX 25 × 1/fX 220 × 1/fX 221 × 1/fX 24 × 1/fX 25 × 1/fX
(3.2 µs) (6.4 µs) (209.7 ms) (419.4 ms) (3.2 µs) (6.4 µs)
25 × 1/fX 26 × 1/fX 221 × 1/fX 222 × 1/fX 25 × 1/fX 26 × 1/fX
(6.4 µs) (12.8 µs) (419.4 ms) (838.9 ms) (6.4 µs) (12.8 µs)
26 × 1/fX 27 × 1/fX 222 × 1/fX 223 × 1/fX 26 × 1/fX 27 × 1/fX
(12.8 µs) (25.6 µs) (838.9 ms) (1.7 s) (12.8 µs) (25.6 µs)
27 × 1/fX 28 × 1/fX 223 × 1/fX 224 × 1/fX 27 × 1/fX 28 × 1/fX
(25.6 µs) (51.2 µs) (1.7 s) (3.4 s) (25.6 µs) (51.2 µs)
28 × 1/fX 29 × 1/fX 224 × 1/fX 225 × 1/fX 28 × 1/fX 29 × 1/fX
(51.2 µs) (102.4 µs) (3.4 s) (6.7 s) (51.2 µs) (102.4 µ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)

9.2 8-Bit Timer/Event Counter Configuration
The 8-bit timer/event counters 1 and 2 consist of the following hardware.
Timer register 8 bits × 2 (TM1, TM2)
Timer output 2 (TO1, TO2)
Timer clock select register 1 (TCL1)
8-bit timer mode control register 1 (TMC1)
8-bit timer output control register (TOC1)
Port mode register 3 (PM3)Note
Item Configuration · Control register

Figure 9-1. 8-Bit Timer/Event Counter Block Diagram
INTTM1
8-Bit Compare Register 20 (CR20)
8-Bit Compare Register 10 (CR10)
8-Bit Timer/ Event Counter Output Control
fXX/2-fXX/2
8-Bit Timer Register 1 (TM1)
8-Bit Timer Register 2 (TM2)
INTTM2
fXX/2-fXX/2
8-Bit Timer/ Event Counter Output Control Circuit 1
TCL
17 TCL
16 TCL
15 TCL
14 TCL
13 TCL
12 TCL
11 TCL
LVS2 LVR2 TOC
15 TOE2LVS1 LVR1 TOC
TMC12 TCE2 TCE1
11 TOE1
Timer Clock Select Register 1
8-Bit Timer Mode Control Register
8-Bit Timer Output Control Register
2, respectively.

Figure 9-2. Block Diagram of 8-Bit Timer/Event Counter Output Control Circuit 1
(LV1)
LVR1
R
Q
TO1/P31
LVS1
S
TOC11
PM31
INV
INTTM1
TOE1
Remark The section in the broken line is an output control circuit.
(LV2)
LVR2
R
TO2/P32 Q
LVS2
S
PM32
TOC15
INV
INTTM2
TOE2
Remarks 1. The section in the broken line is an output control circuit.

(1) Compare registers 10 and 20 (CR10, CR20)
These are 8-bit registers to compare the value set to CR10 to the 8-bit timer register 1 (TM1) count value,
and the value set to CR20 to the 8-bit timer register 2 (TM2) count value, and, if they match, generate an
interrupt request (INTTM1 and INTTM2, respectively).
CR10 and CR20 are set with an 8-bit memory manipulation instruction. They cannot be set with a 16-bit
memory manipulation instruction. When the compare register is used as 8-bit timer/event counter, the 00H
to FFH values can be set. When the compare register is used as 16-bit timer/event counter, the 0000H to
FFFFH values can be set.
RESET input makes CR10 and CR20 undefined.
operation before setting data.
(TM1 and TM2), TM1 and TM2 continue counting, overflow, and then restart counting from
change, it is necessary to restart the timer after changing CR10 and CR20.
These are 8-bit registers to count count pulses.
When TM1 and TM2 are used in the 8-bit timer × 2-channel mode, they are read with an 8-bit memory manip-
ulation instruction. When TM1 and TM2 are used as 16-bit timer × 1-channel mode, 16-bit timer register (TMS)
is read with a 16-bit memory manipulation instruction.
RESET input sets TM1 and TM2 to 00H.

9.3 8-Bit Timer/Event Counter Control Registers
The following four types of registers are used to control the 8-bit timer/event counter.
This register sets count clocks of 8-bit timer registers 1 and 2.
TCL1 is set with an 8-bit memory manipulation instruction.
RESET input sets TCL1 to 00H.

Figure 9-4. Timer Clock Select Register 1 Format
7 6 5 4 3 2 1 0 Symbol
Address After Reset R/W
TCL17 TCL16 TCL15 TCL14 TCL13 TCL12 TCL11 TCL10
8-Bit Timer Register 1 Count Clock Selection
MCS = 1
MCS = 0
0 TI1 falling edge
0 0 0 1 TI1 rising edge
0 1 1 0
fXX/2 fX/2 (2.5 MHz) fX/2
2 (1.25 MHz)
0 1 1 1
2 fX/2
2 (1.25 MHz) fX/2
1 0 0 0
3 fX/2
3 (625 kHz) fX/2
4 fX/2
4 (313 kHz) fX/2
1 0 0 1
1 0 1 0
5 fX/2
5 (156 kHz) fX/2
6 (78.1 kHz)
1 0 1 1
6 fX/2
6 (78.1 kHz) fX/2
7 (39.1 kHz)
1 1 0 0
7 fX/2
7 (39.1 kHz) fX/2
8 (19.5 kHz)
8 fX/2
8 (19.5 kHz) fX/2
9 (9.8 kHz)
1 1 0 1
9 fX/2
9 (9.8 kHz) fX/2
10 (4.9 kHz)
1 1 1 0
11 (2.4 kHz) fX/2
1
11 fX/2
12 (1.2 kHz)
Other than above Setting prohibited
8-Bit Timer Register 2 Count Clock Selection
MCS = 1
MCS = 0
0 TI2 falling edge
0 0 0 1 TI2 rising edge
0 1 1 0
fXX/2 fX/2 (2.5 MHz) fX/2
2 (1.25 MHz)
0 1 1 1
2 fX/2
2 (1.25 MHz) fX/2
1 0 0 0
3 fX/2
3 (625 kHz) fX/2
4 fX/2
4 (313 kHz) fX/2
1 0 0 1
1 0 1 0
5 fX/2
5 (156 kHz) fX/2
6 (78.1 kHz)
1 0 1 1
6 fX/2
6 (78.1 kHz) fX/2
7 (39.1 kHz)
1 1 0 0
7 fX/2
7 (39.1 kHz) fX/2
8 (19.5 kHz)
8 fX/2
8 (19.5 kHz) fX/2
9 (9.8 kHz)
1 1 0 1
9 fX/2
9 (9.8 kHz) fX/2
10 (4.9 kHz)
1 1 1 0
11 (2.4 kHz) fX/2
1
11 fX/2
12 (1.2 kHz)
Other than above Setting prohibited
Remarks 1. fXX : Main system clock frequency (fX or fX/2) 2. fX : Main system clock oscillation frequency 3. TI1 : 8-bit timer register 1 input pin 4. TI2 : 8-bit timer register 2 input pin 5. MCS : Bit 0 of oscillation mode selection register (OSMS) 6. Figures in parentheses apply to operation with fX = 5.0 MHz

(2) 8-bit timer mode control register (TMC1)
This register enables/stops operation of 8-bit timer registers 1 and 2 and sets the operating mode of 8-bit timer
register 1 and 2.
TMC1 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets TMC1 to 00H.
0 1 2 3 4 5 6 7 Symbol
Address After Reset R/W
TCE1 FF49H 00H R/W
TCE1 8-Bit Timer Register 1 Operation Control
0 Operation stop (TM1 clear to 0)
TCE2 8-Bit Timer Register 2 Operation Control
Operation stop (TM2 clear to 0)
TMC12 Operating Mode Selection
8-Bit timer register × 2 channel mode (TM1, TM2)
16-Bit timer register × 1 channel mode (TMS)
should be set with TCE1.
1 Operation enable · Operation enable

(3) 8-bit timer output control register (TOC1)
This register controls operation of 8-bit timer/event counter output control circuits 1 and 2.
It sets/resets the R-S flip-flops (LV1 and LV2) and enables/disables inversion and 8-bit timer output of 8-bit
timer registers 1 and 2.
TOC1 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets TOC1 to 00H.
0 1 2 3 4 5 6 7 Symbol
Address After Reset R/W
TOE1 TOC11 LVR1 LVS1 TOE2 TOC15 LVR2 LVS2 TOC1 FF4FH 00H R/W
TOE1 8-Bit Timer/Event Counter 1 Outptut Control
0 Output disable (port mode)
TOC11 8-Bit Timer/Event Counter 1 Timer Output F/F Control
0 Inverted operation disable
1 Inverted operation enable
LVS1 LVR1 8-Bit Timer/Event Counter 1 Timer Output F/F Status Set
0 1 Timer output F/F reset (0)
1 0 Timer output F/F set (1)
1 1 Setting prohibited
TOE2 8-Bit Timer/Event Counter 2 Output Control
0 Output disable (port mode)
TOC15 8-Bit Timer/Event Counter 2 Timer Output F/F Control
0 Inverted operation disable
1 Inverted operation enable
LVS2 LVR2 8-Bit Timer/Event Counter 2 Timer Output F/F Status Set
0 1 Timer output F/F reset (0)
1 0 Timer output F/F set (1)
1 1 Setting prohibited

(4) Port mode register 3 (PM3)
This register sets port 3 input/output in 1-bit units.
When using the P31/TO1 and P32/TO2 pins for timer output, set PM31, PM32, and output latches of P31 and
P32 to 0.
PM3 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets PM3 to FFH.
0 1 2 3 4 5 6 7 Symbol
Address After Reset R/W
PM30 FF23H FFH R/W
PM3n P3n Pin Input/Output Mode Selection (n=0 to 7)
0 Output mode (output buffer ON)
1 Input mode (output buffer OFF)

9.4 8-Bit Timer/Event Counter Operation
9.4.1 8-bit timer/event counter mode
(1) Interval timer operations
Operates as an interval timer which generates interrupt requests repeatedly with the count values set
previously in the 8 bit conveyor registers 10 and 20 (CR10, CR20) as the interval.
When the count values of the 8-bit timer registers 1 and 2 (TM1 and TM2) match the values set to CR10 and
CR20, counting continues with the TM1 and TM2 values cleared to 0 and the interrupt request signals (INTTM1
and INTTM2) are generated.
Count clock of TM1 can be selected with bits 0 to 3 (TCL10 to TCL13) of the timer clock select register 1 (TCL1).
Count clock of TM2 can be selected with bits 4 to 7 (TCL14 to TCL17) of the timer clock select register 1 (TCL1).
For the operation when the value of the compare register has been changed during timer count operation,
refer to section 9.5 (3) Operation after compare register change during timer count operation.
00 01 N 00 01 N 00 01 N
Count Start Clear Clear
N N N N
INTTM1
Interrupt Request Acknowledge Interrupt Request Acknowledge
Interval Time Interval Time Interval Time
Remark Interval time = (N + 1) × t : N = 00H to FFH
t · Count Clock · TM1 Count Value

Table 9-6. 8-Bit Timer/Event Counter 1 Interval Time
Minimum Interval Time Maximum Interval Time Resolution
MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 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
2 × 1/fX 22 × 1/fX 29 × 1/fX 210 × 1/fX 2 × 1/fX 22 × 1/fX
0 1 1 0
(400 ns) (800 ns) (102.4 µs) (204.8 µs) (400 ns) (800 ns)
22 × 1/fX 23 × 1/fX 210 × 1/fX 211 × 1/fX 22 × 1/fX 23 × 1/fX
0 1 1 1
(800 ns) (1.6 µs) (204.8 µs) (409.6 µs) (800 ns) (1.6 µs)
23 × 1/fX 24 × 1/fX 211 × 1/fX 212 × 1/fX 23 × 1/fX 24 × 1/fX
1 0 0 0
(1.6 µs) (3.2 µs) (409.6 µs) (819.2 µs) (1.6 µs) (3.2 µs)
24 × 1/fX 25 × 1/fX 212 × 1/fX 213 × 1/fX 24 × 1/fX 25 × 1/fX
1 0 0 1
(3.2 µs) (6.4 µs) (819.2 µs) (1.64 ms) (3.2 µs) (6.4 µs)
25 × 1/fX 26 × 1/fX 213 × 1/fX 214 × 1/fX 25 × 1/fX 26 × 1/fX
1 0 1 0
(6.4 µs) (12.8 µs) (1.64 ms) (3.28 ms) (6.4 µs) (12.8 µs)
26 × 1/fX 27 × 1/fX 214 × 1/fX 215 × 1/fX 26 × 1/fX 27 × 1/fX
1 0 1 1
(12.8 µs) (25.6 µs) (3.28 ms) (6.55 ms) (12.8 µs) (25.6 µs)
27 × 1/fX 28 × 1/fX 215 × 1/fX 216 × 1/fX 27 × 1/fX 28 × 1/fX
1 1 0 0
(25.6 µs) (51.2 µs) (6.55 ms) (13.1 ms) (25.6 µs) (51.2 µs)
28 × 1/fX 29 × 1/fX 216 × 1/fX 217 × 1/fX 28 × 1/fX 29 × 1/fX
1 1 0 1
(51.2 µs) (102.4 µs) (13.1 ms) (26.2 ms) (51.2 µs) (102.4 µs)
29 × 1/fX 210 × 1/fX 217 × 1/fX 218 × 1/fX 29 × 1/fX 210 × 1/fX
1 1 1 0
(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
1
(409.6 µs) (819.2 µs) (104.9 ms) (209.7 ms) (409.6 µs) (819.2 µs)
Other than above Setting prohibited

Table 9-7. 8-Bit Timer/Event Counter 2 Interval Time
Minimum Interval Time Maximum Interval Time Resolution
MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 0
0 TI2 input cycle 28 × TI2 input cycle TI2 input edge cycle
0 0 0 1 TI2 input cycle 28 × TI2 input cycle TI2 input edge cycle
2 × 1/fX 22 × 1/fX 29 × 1/fX 210 × 1/fX 2 × 1/fX 22 × 1/fX
0 1 1 0
(400 ns) (800 ns) (102.4 µs) (204.8 µs) (400 ns) (800 ns)
22 × 1/fX 23 × 1/fX 210 × 1/fX 211 × 1/fX 22 × 1/fX 23 × 1/fX
0 1 1 1
(800 ns) (1.6 µs) (204.8 µs) (409.6 µs) (800 ns) (1.6 µs)
23 × 1/fX 24 × 1/fX 211 × 1/fX 212 × 1/fX 23 × 1/fX 24 × 1/fX
1 0 0 0
(1.6 µs) (3.2 µs) (409.6 µs) (819.2 µs) (1.6 µs) (3.2 µs)
24 × 1/fX 25 × 1/fX 212 × 1/fX 213 × 1/fX 24 × 1/fX 25 × 1/fX
1 0 0 1
(3.2 µs) (6.4 µs) (819.2 µs) (1.64 ms) (3.2 µs) (6.4 µs)
25 × 1/fX 26 × 1/fX 213 × 1/fX 214 × 1/fX 25 × 1/fX 26 × 1/fX
1 0 1 0
(6.4 µs) (12.8 µs) (1.64 ms) (3.28 ms) (6.4 µs) (12.8 µs)
26 × 1/fX 27 × 1/fX 214 × 1/fX 215 × 1/fX 26 × 1/fX 27 × 1/fX
1 0 1 1
(12.8 µs) (25.6 µs) (3.28 ms) (6.55 ms) (12.8 µs) (25.6 µs)
27 × 1/fX 28 × 1/fX 215 × 1/fX 216 × 1/fX 27 × 1/fX 28 × 1/fX
1 1 0 0
(25.6 µs) (51.2 µs) (6.55 ms) (13.1 ms) (25.6 µs) (51.2 µs)
28 × 1/fX 29 × 1/fX 216 × 1/fX 217 × 1/fX 28 × 1/fX 29 × 1/fX
1 1 0 1
(51.2 µs) (102.4 µs) (13.1 ms) (26.2 ms) (51.2 µs) (102.4 µs)
29 × 1/fX 210 × 1/fX 217 × 1/fX 218 × 1/fX 29 × 1/fX 210 × 1/fX
1 1 1 0
(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
1
(409.6 µs) (819.2 µs) (104.9 ms) (209.7 ms) (409.6 µs) (819.2 µs)
Other than above Setting prohibited

(2) External event counter operation
The external event counter counts the number of external clock pulses to be input to the TI1/P33 and TI2/
P34 pins with 8-bit timer registers 1 and 2 (TM1 and TM2).
TM1 and TM2 are incremented each time the valid edge specified with the timer clock select register (TCL1)
is input. Either the rising or falling edge can be selected.
When the TM1 and TM2 counted values match the values of 8-bit compare registers (CR10 and CR20), TM1
and TM2 are cleared to 0 and the interrupt request signals (INTTM1 and INTTM2) are generated.
00 01 02 03 04 05 N-1 N 00 01 02 03
N
INTTM1
Remark N = 00H to FFH
TI1 Pin Input · TM1 Count Value

(3) Operation as a Square Wave Output
Operates as a square wave output at the desired frequency with the values set previously in the 8 bit conveyor
registers 10 and 20 (CR10, CR20) as the interval.
The TO1/P31 or TO2/P32 pin output status is reversed at intervals of the count value preset to CR10 or CR20
by setting bit 0 (TOE1) or bit 4 (TOE2) of the 8-bit timer output control register (TOC1) to 1. This enables
a square wave with any selected frequency to be output.
Minimum Pulse Width Maximum Pulse Width Resolution
MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 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)
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)
23 × 1/fX 24 × 1/fX 211 × 1/fX 212 × 1/fX 23 × 1/fX 24 × 1/fX
(1.6 µs) (3.2 µs) (409.6 µs) (819.2 µs) (1.6 µs) (3.2 µs)
24 × 1/fX 25 × 1/fX 212 × 1/fX 213 × 1/fX 24 × 1/fX 25 × 1/fX
(3.2 µs) (6.4 µs) (819.2 µs) (1.64 ms) (3.2 µs) (6.4 µs)
25 × 1/fX 26 × 1/fX 213 × 1/fX 214 × 1/fX 25 × 1/fX 26 × 1/fX
(6.4 µs) (12.8 µs) (1.64 ms) (3.28 ms) (6.4 µs) (12.8 µs)
26 × 1/fX 27 × 1/fX 214 × 1/fX 215 × 1/fX 26 × 1/fX 27 × 1/fX
(12.8 µs) (25.6 µs) (3.28 ms) (6.55 ms) (12.8 µs) (25.6 µs)
27 × 1/fX 28 × 1/fX 215 × 1/fX 216 × 1/fX 27 × 1/fX 28 × 1/fX
(25.6 µs) (51.2 µs) (6.55 ms) (13.1 ms) (25.6 µs) (51.2 µs)
28 × 1/fX 29 × 1/fX 216 × 1/fX 217 × 1/fX 28 × 1/fX 29 × 1/fX
(51.2 µs) (102.4 µs) (13.1 ms) (26.2 ms) (51.2 µs) (102.4 µ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)

Figure 9-10. Square-Wave Output Operation Timing
TM1 Count Value 00 01 02 N – 1 N 00 01 02 N – 1 N 00
register (TOC1).
9.4.2 16-bit timer/event counter mode When bit 2 (TMC12) of the 8-bit timer mode control register (TMC1) is set to 1, the 16-bit timer/event counter mode
is entered.
In this mode, the count clock is selected with bits 0 to 3 (TCL10 to TCL13) of the timer clock select register 1 (TCL1).
The overflow signal of the 8-bit timer/event counter 1 (TM1) is used as the count clock of the 8-bit timer/event counter 2 (TM2).
The count operation in this mode is enabled/disabled with bit 0 (TCE1) of TMC1.
The 8-bit timer/event counters 1 and 2 operate as interval timers which generate interrupt requests repeatedly
at intervals of the count value preset in the 2-channel 8-bit compare registers (CR10 and CR20). To set the count value, assign the higher 8 bits of the value to CR20 and the lower 8 bits of the value to CR10. For the
count values (interval times) that can be set, refer to Table 9-9. When the count value of the 8-bit timer register 1 (TM1) matches the value assigned to CR10 and the count
value of the 8-bit timer register 2 (TM2) matches the value assigned to CR20, counting continues after the TM1 and TM2 values are cleared to 0 and the interrupt request signal (INTTM2) is generated. For the operation
timing of the interval timer, refer to Figure 9-11. The count clock is selected with bits 0 to 3 (TCL10 to TCL13) of the timer clock select register 1 (TCL1). The
overflow signal of TM1 is used as the count clock of TM2.
Count Clock · N Count Start · TO1Note

Figure 9-11. Interval Timer Operation Timing
TMS (TM1, TM2) Count Value
0000 0001 N 0000 0001 N 0000 0001 N
Count Start Clear Clear
N N N N
INTTM2
Interrupt Request Acknowledge Interrupt Request Acknowledge
Interval Time Interval Time Interval Time
Remark Interval time = (N + 1) × t : N = 0000H to FFFFH
CR10 value, interrupt request (INTTM1) is generated and the F/F of 8-bit timer/event counter
output control circuit 1 is inverted. Thus, when using 8-bit timer/event counter as 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 the 16-bit memory manipu-
lation instruction.
t · Count Clock

Table 9-9. Interval Times When 2-Channel 8-Bit Timer/Event Counters (TM1 and TM2)
are Used as 16-Bit Timer/Event Counter
Minimum Interval Time Maximum Interval Time Resolution
MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 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
2 × 1/fX 22 × 1/fX 217 × 1/fX 218 × 1/fX 2 × 1/fX 22 × 1/fX
0 1 1 0
(400 ns) (800 ns) (26.2 ms) (52.4 ms) (400 ns) (800 ns)
22 × 1/fX 23 × 1/fX 218 × 1/fX 219 × 1/fX 22 × 1/fX 23 × 1/fX
0 1 1 1
(800 ns) (1.6 µs) (52.4 ms) (104.9 ms) (800 ns) (1.6 µs)
23 × 1/fX 24 × 1/fX 219 × 1/fX 220 × 1/fX 23 × 1/fX 24 × 1/fX
1 0 0 0
(1.6 µs) (3.2 µs) (104.9 ms) (209.7 ms) (1.6 µs) (3.2 µs)
24 × 1/fX 25 × 1/fX 220 × 1/fX 221 × 1/fX 24 × 1/fX 25 × 1/fX
1 0 0 1
(3.2 µs) (6.4 µs) (209.7 ms) (419.4 ms) (3.2 µs) (6.4 µs)
25 × 1/fX 26 × 1/fX 221 × 1/fX 222 × 1/fX 25 × 1/fX 26 × 1/fX
1 0 1 0
(6.4 µs) (12.8 µs) (419.4 ms) (838.9 ms) (6.4 µs) (12.8 µs)
26 × 1/fX 27 × 1/fX 222 × 1/fX 223 × 1/fX 26 × 1/fX 27 × 1/fX
1 0 1 1
(12.8 µs) (25.6 µs) (838.9 ms) (1.7 s) (12.8 µs) (25.6 µs)
27 × 1/fX 28 × 1/fX 223 × 1/fX 224 × 1/fX 27 × 1/fX 28 × 1/fX
1 1 0 0
(25.6 µs) (51.2 µs) (1.7 s) (3.4 s) (25.6 µs) (51.2 µs)
28 × 1/fX 29 × 1/fX 224 × 1/fX 225 × 1/fX 28 × 1/fX 29 × 1/fX
1 1 0 1
(51.2 µs) (102.4 µs) (3.4 s) (6.7 s) (51.2 µs) (102.4 µs)
29 × 1/fX 210 × 1/fX 225 × 1/fX 226 × 1/fX 29 × 1/fX 210 × 1/fX
1 1 1 0
(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
1
(409.6 µs) (819.2 µs) (26.8 s) (53.7 s) (409.6 µs) (819.2 µs)
Other than above Setting prohibited

(2) External event counter operations
The external event counter counts the number of external clock pulses to be input to the TI1/P33 pin with 2-
channel 8-bit timer registers 1 and 2 (TM1 and TM2).
Each time TM1 overflows, the overflow signal is used as a counter clock and TM2 is incremented.
When the TM1 and TM2 counted values match the values of 8-bit compare registers 10 and 20 (CR10 and
CR20), TM1 and TM2 are cleared to 0 and the interrupt request signal (INTTM2) is generated.
TM1, TM2 Count Value
0000 0001 0002 0003 0004 0005 N-1 N 0000 0001 0002 0003
N
INTTM2
CR10 value, interrupt request (INTTM1) is generated and the F/F of 8-bit timer/event counter
output control circuit 1 is inverted. Thus, when using 8-bit timer/event counter as 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 the 16-bit memory manipu-
lation instruction.
TI1 Pin Input

(3) Operation as a Square Wave Output
Operates as a square wave output at the desired frequency with the values set previously in the 8 bit conveyor
registers 10 and 20 (CR10, CR20) as the interval. When setting the count value, the value of the upper 8
bits is set in CR20 and the value of the lower 8 bits is set in CR10.
The TO2/P32 pin output status is reversed at intervals of the count value preset to CR10 and CR20 by setting
bit 4 (TOE2) of the 8-bit timer output control register (TOC1) to 1. This enables a square wave with any selected
frequency to be output.
(TM1 and TM2) are Used as 16-Bit Timer/Event Counter
Minimum Pulse Width Maximum Pulse Width Resolution
MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 0
2 × 1/fX 22 × 1/fX 217 × 1/fX 218 × 1/fX 2 × 1/fX 22 × 1/fX
(400 ns) (800 ns) (26.2 ms) (52.4 ms) (400 ns) (800 ns)
22 × 1/fX 23 × 1/fX 218 × 1/fX 219 × 1/fX 22 × 1/fX 23 × 1/fX
(800 ns) (1.6 µs) (52.4 ms) (104.9 ms) (800 ns) (1.6 µs)
23 × 1/fX 24 × 1/fX 219 × 1/fX 220 × 1/fX 23 × 1/fX 24 × 1/fX
(1.6 µs) (3.2 µs) (104.9 ms) (209.7 ms) (1.6 µs) (3.2 µs)
24 × 1/fX 25 × 1/fX 220 × 1/fX 221 × 1/fX 24 × 1/fX 25 × 1/fX
(3.2 µs) (6.4 µs) (209.7 ms) (419.4 ms) (3.2 µs) (6.4 µs)
25 × 1/fX 26 × 1/fX 221 × 1/fX 222 × 1/fX 25 × 1/fX 26 × 1/fX
(6.4 µs) (12.8 µs) (419.4 ms) (838.9 ms) (6.4 µs) (12.8 µs)
26 × 1/fX 27 × 1/fX 222 × 1/fX 223 × 1/fX 26 × 1/fX 27 × 1/fX
(12.8 µs) (25.6 µs) (838.9 ms) (1.7 s) (12.8 µs) (25.6 µs)
27 × 1/fX 28 × 1/fX 223 × 1/fX 224 × 1/fX 27 × 1/fX 28 × 1/fX
(25.6 µs) (51.2 µs) (1.7 s) (3.4 s) (25.6 µs) (51.2 µs)
28 × 1/fX 29 × 1/fX 224 × 1/fX 225 × 1/fX 28 × 1/fX 29 × 1/fX
(51.2 µs) (102.4 µs) (3.4 s) (6.7 s) (51.2 µs) (102.4 µ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)

Figure 9-13. Square-Wave Output Operation Timing
TM1 00H
00H 01H FFH 00H
01H N N
N + 1
FFH 00H 01H FFH
00H
TM2
00H
01H 02H
M – 1
00H M
CR10
N
CR20
M
TO2
Count Start Level Inversion Counter Clear
Count Clock · Interval Time

9.5 Cautions on 8-Bit Timer/Event Counters
(1) Timer start errors
An error of one clock maximum may occur concerning the time required for a match signal to be generated
after timer start. This is because the 8-bit timer registers 1 and 2 (TM1 and TM2) are started asynchronously
with the count pulse.
TM1, TM2 Count Value 00H 01H 02H 03H 04H
The 8-bit compare registers 10 and 20 (CR10 and CR20) can be set to 00H.
Thus, when these 8-bit compare registers are used as event counters, one-pulse count operation can be
carried out.
When the 8-bit compare register is used as 16-bit timer/event counter, write data to CR10 and CR20 after
setting bit 0 (TCE1) of the 8-bit timer mode control register 1 (TMC1) to 0 and stopping timer operation.
CR10, CR20
00H
TM1, TM2 Count Value
TO1, TO2

(3) Operation after compare register change during timer count operation
If the values after the 8-bit compare registers 10 and 20 (CR10 and CR20) are changed are smaller than those
of 8-bit timer registers (TM1 and TM2), TM1 and TM2 continue counting, overflow and then restart counting
from 0. Thus, if the value (M) after CR10 and CR20 change is smaller than value (N) before the change, it
is necessary to restart the timer after changing CR10 and CR20.
CR10, CR20
M N
TM1, TM2 Count Value X-1 X FFH 00H 01H 02H
Remark N > X > M
Count Pulse
![Page 238 of the NEC PD78056F user manual — [MEMO]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-238.webp?w=400)

10.1 Watch Timer Functions
The watch timer has the following functions.
The watch timer and the interval timer can be used simultaneously.
When the 32.768 kHz subsystem clock is used, a flag (WTIF) is set at 0.5 second or 0.25 second intervals.
When the 4.19 MHz (standard: 4.194304 MHz) main system clock is used, a flag (WTIF) is set at 0.5 second
or 0.25 second intervals.
switch to the 32.768 kHz subsystem clock to generate 0.5-second intervals.
Interrupt requests (INTTM3) are generated at the preset time interval.
When operated at When operated at When operated at fXX = 5.0 MHz fXX = 4.19 MHz fXT = 32.768 kHz
24 × 1/fW 410 µs 488 µs 488 µs
25 × 1/fW 819 µs 977 µs 977 µs
26 × 1/fW 1.64 ms 1.95 ms 1.95 ms
27 × 1/fW 3.28 ms 3.91 ms 3.91 ms
28 × 1/fW 6.55 ms 7.81 ms 7.81 ms
29 × 1/fW 13.1 ms 15.6 ms 15.6 ms
Interval Time

10.2 Watch Timer Configuration
The watch timer consists of the following hardware.
Counter 5 bits × 1
Timer clock select register 2 (TCL2)
Watch timer mode control register (TMC2)
The following two types of registers are used to control the watch timer.
(1) Timer clock select register 2 (TCL2) (Refer to Figure 10-2.)
This register sets the watch timer count clock.
TCL2 is set with an 8-bit memory manipulation instruction.
RESET input sets TCL2 to 00H.
Remark Besides setting the watch timer count clock, TCL2 sets the watchdog timer count clock and buzzer
output frequency.
Item Configuration · Control register

Figure 10-1. Watch Timer Block Diagram
TMC21
f W 214
f W f XX/27
f W 24 f W 25 f W 26 f W 27 f W 28 f W 29
f W 213
To 16-Bit Timer/ Event Counter
TMC26 TMC25 TMC24 TMC23 TMC22 TMC21 TMC20
Watch Timer Mode Control Register
Timer Clock Select Register 2

Figure 10-2. Timer Clock Select Register 2 Format
3 2 1 0
TCL2
TCL27
TCL26
TCL25 TCL24
TCL22 TCL21 TCL20
FF42H
00H
R/W
Watchdog Timer Count Clock Selection
MCS = 0 MCS = 1
fXX/23
fX/23 (625 kHz)
fX/24 (313 kHz)
fXX/24
fX/24 (313 kHz)
fX/25 (156 kHz)
fXX/25
fX/25 (156 kHz)
fX/26 (78.1 kHz)
fXX/26
fX/26 (78.1 kHz)
fX/27 (39.1 kHz)
fXX/27
fX/27 (39.1 kHz)
fX/28 (19.5 kHz)
fXX/28
fX/28 (19.5 kHz)
fX/29 (9.8 kHz)
fXX/29
fX/29 (9.8 kHz)
fX/210 (4.9 kHz)
fXX/211
fX/211 (2.4 kHz)
fX/212 (1.2 kHz)
Watchdog Timer Count Clock Selection
MCS = 1 MCS = 0
fXX/27
fX/27 (39.1 kHz) fX/28 (19.5 kHz)
fXT (32.768 kHz)
Buzzer Output Frequency Selection
MCS = 0 MCS = 1
fXX/29
fX/29 (9.8 kHz)
fX/210 (4.9 kHz)
fXX/210
fX/210 (4.9 kHz)
fX/211 (2.4 kHz)
fXX/211
fX/211 (2.4 kHz)
fX/212 (1.2 kHz)

(2) Watch timer mode control register (TMC2)
This register sets the watch timer operating mode, watch flag set time and prescaler interval time and enables/
disables prescaler and 5-bit counter operations.
TMC2 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets TMC2 to 00H.
3 2 1 0
TMC2
TMC26
TMC25 TMC24
TMC23
TMC22 TMC21 TMC20
FF4AH
00H
R/W
TMC20
Watch Operating Mode Selection
Normal operating mode (flag set at fW/214)
Fast feed operating mode (flag set at fW/25)
Clear after operation stop
5-Bit Counter Operation Control
Clear after operation stop
Watch Flag Set Time Selection
fXX = 5.0 MHz Operation fXX = 4.19 MHz Operation fXT = 32.768 kHz Operation
214/fW (0.4 sec)
214/fW (0.5 sec)
214/fW (0.5 sec)
213/fW (0.2 sec)
213/fW (0.25 sec)
213/fW (0.25 sec)
Prescaler Interval Time Selection
fXX = 5.0 MHz Operation fXX = 4.19 MHz Operation fXT = 32.768 kHz Operation
24/fW (410 s)
24/fW (488 s)
24/fW (488 s)
25/fW (819 s)
25/fW (977 s)
25/fW (977 s)
26/fW (1.64 ms)
26/fW (1.95 ms)
26/fW (1.95 ms)
27/fW (3.28 ms)
27/fW (3.91 ms)
27/fW (3.91 ms)
28/fW (6.55 ms)
28/fW (7.81 ms)
28/fW (7.81 ms)
29/fW (13.1 ms)
29/fW (15.6 ms)
29/fW (15.6 ms)

10.4 Watch Timer Operations
10.4.1 Watch timer operation
When the 32.768-kHz subsystem clock or 4.19-MHz main system clock is used, the timer operates as a watch
timer with a 0.5-second or 0.25-second interval.
The watch timer sets the test input flag (WTIF) to 1 at the constant time interval. The standby state (STOP mode/
HALT mode) can be cleared by setting WTIF to 1.
When bit 2 (TIMC22) of the watch timer mode control register (TMC2) is set to 0, the 5-bit counter is cleared and
the count operation stops.
For simultaneous operation of the interval timer, zero-second start can be achieved by setting TMC22 to 0
(maximum error: 26.2 ms when operated at fXX = 5.0 MHz).
The watch timer operates as interval timer which generates interrupt requests repeatedly at an interval of the preset
count value.
The interval time can be selected with bits 4 to 6 (TMC24 to TMC26) of the watch timer mode control register
(TMC2).
When operated at When operated at When operated at fXX = 5.0 MHz fXX = 4.19 MHz fXT = 32.768 kHz
TMC26 TMC25 TMC24 Interval Time
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
0 1 1 27 × 1/fW 3.28 ms 3.91 ms 3.91 ms
1 0 0 28 × 1/fW 6.55 ms 7.81 ms 7.81 ms
1 0 1 29 × 1/fW 13.1 ms 15.6 ms 15.6 ms
Other than above Setting prohibited

11.1 Watchdog Timer Functions
The watchdog timer has the following functions.
(WDTM) (The watchdog timer and interval timer cannot be used at the same time).
An inadvertent program loop (runaway) is detected. Upon detection of the runaway, a non-maskable interrupt
request or RESET can be generated.
Runaway Detection Time MCS = 1 MCS = 0
211 × 1/fXX 211 × 1/fX (410 µs) 212 × 1/fX (819 µs)
212 × 1/fXX 212 × 1/fX (819 µs) 213 × 1/fX (1.64 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)

(2) Interval timer mode
Interrupt requests are generated at the preset time intervals.
Interval Time MCS = 1 CS = 0
211 × 1/fXX 211 × 1/fX (410 µs) 212 × 1/fX (819 µs)
212 × 1/fXX 212 × 1/fX (819 µs) 213 × 1/fX (1.64 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)

11.2 Watchdog Timer Configuration
The watchdog timer consists of the following hardware.
Timer clock select register 2 (TCL2)
Watchdog timer mode control register (WDTM)
f XX/23
fXX 24 fXX 25 fXX 26 fXX 27 fXX 28 fXX 29
f XX 211
INTWDT Maskable Interrupt Request
INTWDT Non-Maskable Interrupt Request
WDTM4 RUN WDTM3
Timer Clock Select Register 2
Watchdog Timer Mode Register

11.3 Watchdog Timer Control Registers
The following two types of registers are used to control the watchdog timer.
This register sets the watchdog timer count clock.
TCL2 is set with 8-bit memory manipulation instruction.
RESET input sets TCL2 to 00H.
Remark Besides setting the watchdog timer count clock, TCL2 sets the watch timer count clock and buzzer
output frequency.

Figure 11-2. Timer Clock Select Register 2 Format
3 2 1 0
TCL2
TCL27
TCL26
TCL25 TCL24
TCL22 TCL21 TCL20
FF42H
00H
R/W
Watchdog Timer Count Clock Selection
MCS = 1 MCS = 0
fXX/23
fX/23
fX/24
fXX/24
fX/24
fX/25
fXX/25
fX/25
fX/26
(78.1 kHz)
fXX/26
fX/26
(78.1 kHz)
fX/27
(39.1 kHz)
fXX/27
fX/27
(39.1 kHz)
fX/28
(19.5 kHz)
fXX/28
fX/28
fX/29
(19.5 kHz)
(9.8 kHz)
fXX/29
fX/29
(9.8 kHz)
fX/210
(4.9 kHz)
fXX/211
fX/211
(2.4 kHz)
fX/212
(1.2 kHz)
Watch Timer Count Clock Selection
MCS = 1 MCS = 0
fXX/27
fX/27 (39.1 kHz) fX/28 (19.5 kHz)
fXT (32.768 kHz)
Buzzer Output Frequency Selection
MCS = 1 MCS = 0
fXX/29
fX/29 (9.8 kHz)
fX/210 (4.9 kHz)
fXX/210
fX/210 (4.9 kHz)
fX/211 (2.4 kHz)
fXX/211
fX/211 (2.4 kHz)
fX/212 (1.2 kHz)

(2) Watchdog timer mode register (WDTM)
This register sets the watchdog timer operating mode and enables/disables counting.
WDTM is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets WDTM to 00H.
3 2 1 0
RUM
0 WDTM4
WDTM3
FFF9H
00H
R/W
WDTM
WDTM4
WDTM3
Watchdog Timer Operation Mode SelectionNote 1
Interval timer modeNote 2 (Maskable interrupt request occurs upon generation of an overflow.)
Watchdog timer mode 1 (Non-maskable interrupt request occurs upon generation of an overflow.)
Watchdog timer mode 2 (Reset operation is activated upon generation of an overflow.)
Watchdog Timer Operation Mode SelectionNote 3
Counter is cleared and counting starts.
Thus, once counting starts, it can only be stopped by RESET input.
up to 0.5% shorter than the time set by timer clock select register 2 (TCL2).
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.

11.4 Watchdog Timer Operations
11.4.1 Watchdog timer operation
When bit 4 (WDTM4) of the watchdog timer mode register (WDTM) is set to 1, the watchdog timer is operated
to detect any runaway.
The watchdog timer count clock (runaway detection time interval) can be selected with bits 0 to 2 (TCL20 to TCL22)
of the timer clock select register 2 (TCL2).
Watchdog timer starts by setting bit 7 (RUN) of WDTM to 1. After the watchdog timer is started, set RUN to 1
within the set runaway detection time interval. The watchdog timer can be cleared and counting is started by setting
RUN to 1. If RUN is not set to 1 and the runaway detection time is past, system reset or a non-maskable interrupt
request is generated according to the WDTM bit 3 (WDTM3) value.
By setting RUN to 1, the watchdog timer can be cleared.
The watchdog timer continues operating in the HALT mode but it stops in the STOP mode. Thus, set RUN to 1
before the STOP mode is set, clear the watchdog timer and then execute the STOP instruction.
0.5%.
stopped.
TCL22 TCL21 TCL20 Runaway Detection Time MCS = 1 MCS = 0
0 0 0 211 × 1/fXX 211 × 1/fX (410 µs) 212 × 1/fX (819 µs)
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)

11.4.2 Interval timer operation
The watchdog timer operates as an interval timer which generate interrupt request repeatedly at an interval of the
preset count value when bit 4 (WDTM4) of the watchdog timer mode register (WDTM) is set to 0.
A count clock (interval time) can be selected by the bits 0 through 2 (TCL20 through TCL22) of the timer clock
select register 2 (TCL2). By setting the bit 7 (RUN) of WDTM to 1, the watchdog timer starts operating as an interval
timer.
When the watchdog timer operated as interval timer, the interrupt mask flag (TMMK4) and priority specify flag
(TMPR4) are validated and the maskable interrupt request (INTWDT) can be generated. Among maskable interrupt
requests, the INTWDT default has the highest priority.
The interval timer continues operating in the HALT mode but it stops in STOP mode. Thus, set bit 7 (RUN) of
WDTM to 1 before the STOP mode is set, clear the interval timer and then execute the STOP instruction.
timer mode is not set unless RESET input is applied.
of 0.5%.
stopped.
TCL22 TCL21 TCL20 Interval Time MCS = 1 MCS = 0
0 0 0 211 × 1/fXX 211 × 1/fX (410 µs) 212 × 1/fX (819 µs)
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)

12.1 Clock Output Control Circuit Functions
The clock output control circuit is intended for carrier output during remote controlled transmission and clock output
for supply to peripheral LSI. Clocks selected with the timer clock select register 0 (TCL0) are 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) with 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 to 0 (set to output mode).
(4) Set bit 7 (CLOE) of TCL 0 to 1.
Remark When clock output enable/disable is switched, the clock output control circuit does not output pulses
with narrow width (See the portions marked with * in Figure 12-1).
CLOE
* * · PCL/P35 Pin Output

12.2 Clock Output Control Circuit Configuration
The clock output control circuit consists of the following hardware.
Timer clock select register 0 (TCL0)
Port mode register 3 (PM3)
fXX/22
fXX/23
fXX/24
fXX/25
fXX/26
fXX/27
CLOE TCL03 TCL02 TCL01 TCL00 P35 Output Latch
Timer Clock Select Register 0 Port Mode Register 3
The following two types of registers are used to control the clock output function.
This register sets PCL output clock.
TCL0 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets TCL0 to 00H.
Remark Besides setting PCL output clock, TCL0 sets the 16-bit timer register count clock.

Figure 12-3. Timer Clock Select Register 0 Format
3 2 1 0
TCL0
CLOE
TCL06
TCL05 TCL04
TCL03
TCL02 TCL01 TCL00
FF40H
00H
R/W
PCL Output Clock Selection
TCL00
MCS = 1 MCS = 0
fXT (32.768 kHz)
fX (5.0 MHz)
fX/2 (2.5 MHz)
fX/2 (2.5 MHz)
fX/22 (1.25 MHz)
fXX/22
fX/22 (1.25 MHz)
fX/23 (625 kHz)
fXX/23
fX/23 (625 kHz)
fX/24 (313 kHz)
fXX/24
fX/24 (313 kHz)
fX/25 (156 kHz)
fXX/25
fX/25 (156 kHz)
fX/26 (78.1 kHz)
fXX/26
fX/26 (78.1 kHz)
fX/27 (39.1 kHz)
fXX/27
fX/27 (39.1 kHz)
fX/28 (19.5 kHz)
16-Bit Timer Register Count Clock Selection
MCS = 1 MCS = 0
TI00 (Valid edge specifiable)
fX (5.0 MHz)
fX (5.0 MHz)
fX/2 (2.5 MHz)
fX/2 (2.5 MHz)
fX/22 (1.25 MHz)
fXX/22
fX/22 (1.25 MHz)
fX/23 (625 kHz)
Watch Timer Output (INTTM3)
Also, the frequency of the sampling clock is selected with the sampling clock selection
register (SCS).
manipulation instruction.
should be read from TM0, not from 16-bit capture/compare register 01 (CR01).

This register set port 3 input/output in 1-bit units.
When using the P35/PCL pin for clock output function, set PM35 and output latch of P35 to 0.
PM3 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets PM3 to FFH.
3 2 1 0
PM3
PM37
PM36
PM35 PM34
PM33
PM32 PM31 PM30
FF23H
FFH
R/W
P3n Pin Input/Output Mode Selection (n = 0 to 7)
Output mode (output buffer ON)
Input mode (output buffer OFF)

13.1 Buzzer Output Control Circuit Functions
The buzzer output control circuit outputs 1.2 kHz, 2.4 kHz, 4.9 kHz, or 9.8 kHz frequency square waves. The buzzer
frequency selected with 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 with 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 to 0 (Set to output mode).
The buzzer output control circuit consists of the following hardware.
Timer clock select register 2 (TCL2)
Port mode register 3 (PM3)
fXX/29
fXX/210
fXX/211
PM36
Timer Clock Select Register 2 Port Mode Register 3

13.3 Buzzer Output Function Control Registers
The following two types of registers are used to control the buzzer output function.
This register sets the buzzer output frequency.
TCL2 is set with an 8-bit memory manipulation instruction.
RESET input sets TCL2 to 00H.
Remark Besides setting the buzzer output frequency, TCL2 sets the watch timer count clock and the
watchdog timer count clock.

Figure 13-2. Timer Clock Select Register 2 Format
3 2 1 0
TCL2
TCL27
TCL26
TCL25 TCL24
TCL22 TCL21 TCL20
FF42H
00H
R/W
Watchdog Timer Count Clock Selection
MCS = 1 MCS = 0
fXX/23
fX/23
fX/24
fXX/24
fX/24
fX/25
fXX/25
fX/25
fX/26
(78.1 kHz)
fXX/26
fX/26
(78.1 kHz)
fX/27
(39.1 kHz)
fXX/27
fX/27
(39.1 kHz)
fX/28
(19.5 kHz)
fXX/28
fX/28
(19.5 kHz)
fX/29
(9.8 kHz)
fXX/29
fX/29
(9.8 kHz)
fX/210
(4.9 kHz)
fXX/211
fX/211
(2.4 kHz)
fX/212
(1.2 kHz)
Watch Timer Count Clock Selection
MCS = 1 MCS = 0
fXX/27
fX/27 (39.1 kHz) fX/28 (19.5 kHz)
fXT (32.768 kHz)
Buzzer Output Frequency Selection
MCS = 1 MCS = 0
fXX/29
fX/29 (9.8 kHz)
fX/210 (4.9 kHz)
fXX/210
fX/210 (4.9 kHz)
fX/211 (2.4 kHz)
fXX/211
fX/211 (2.4 kHz)
fX/212 (1.2 kHz)

(2) Port mode register 3 (PM3)
This register sets port 3 input/output in 1-bit units.
When using the P36/BUZ pin for buzzer output function, set PM36 and output latch of P36 to 0.
PM3 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets PM3 to FFH.
3 2 1 0
PM3
PM37
PM36
PM35 PM34
PM33
PM32 PM31 PM30
FF23H
FFH
R/W
P3n Pin Input/Output Mode Selection (n = 0 to 7)
Output mode (output buffer ON)
Input mode (output buffer OFF)

14.1 A/D Converter Functions
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).
The following two methods are used for starting an A/D conversion operation.
Conversion is started by trigger input (INTP3).
Conversion is started by setting the A/D converter mode register (ADM).
Select 1 channel from the analog inputs ANI0 to ANI7 and execute A/D conversion. An A/D conversion operation
ends after the A/D conversion operation at hardware start is completed and an interrupt request (INTAD) is generated.
In the case of software start, the A/D conversion operation is repeated. Each time an A/D conversion ends, an interrupt
request (INTAD) is generated.
pins, (1) Port pins), do not execute the following operations during A/D conversion. If
performed, then the general error standards cannot be maintained during A/D conversion.
<1> If it is used as a port, rewriting the output latch of its output.
<2> Even if it is not used as a port, changing the output level of pins used as outputs.

14.2 A/D Converter Configuration
The A/D converter consists of the following hardware.
Analog input 8 Channels (ANI0 to ANI7)
A/D converter mode register (ADM)
Control register A/D converter input select register (ADIS)
External interrupt mode register 1 (INTM1)
Successive approximation register (SAR)
A/D conversion result register (ADCR) Register
Item Configuration

Figure 14-1. A/D Converter Block Diagram
A/D Converter Input Select Register
ADIS2 ADIS1 ADIS0
ANI0/P10 ANI1/P11 ANI2/P12 ANI3/P13 ANI4/P14 ANI5/P15 ANI6/P16 ANI7/P17
AVDD Voltage Comparator
Sample & Hold Circuit
AV SS
Successive Approximation Register (SAR)
INTP3/P03
INTAD
ES40, ES41
TRG FR1 FR0 ADM3 ADM2 ADM1 A/D Conversion Result Register (ADCR)
HSC
A/D Converter Mode Register

(1) Successive approximation register (SAR)
The analog input voltage value and the voltage tap (comparative voltage) value from the serial resistance string
are compared and the results are stored in this register from the most significant bit (MSB).
If values are stored to the least significant bit (LSB) (after A/D conversion), the contents of the SAR are
transferred to the A/D conversion results register (ADCR).
This register holds the A/D conversion result. Each time A/D conversion terminates, the conversion result
is loaded from the successive approximation register (SAR).
ADCR is read with an 8-bit memory manipulation instruction.
RESET input makes ADCR undefined.
The sample & hold circuit samples each analog input signal sequentially applied from the input circuit and
sends it to the voltage comparator. This circuit holds the sampled analog input voltage value during A/D
conversion.
The voltage comparator compares the analog input to the series resistor string output voltage.
The serial resistance string is connected between AVREF0 and AVSS, and generates voltages which are
compared to analog inputs.
These are 8-channel analog input pins to input analog signals to undergo A/D conversion to the A/D converter.
Pins other than those selected as analog input by the A/D converter input select register (ADIS) can be used
as input/output ports.
AVREF0 or lower than AVSS is applied (even if within the absolute maximum ratings),
adversely affect the converted values of other channels.
selected to perform A/D conversion, do not execute an input instruction for port 1 during
conversion, as this could lower the conversion resolution.
Also, if a digital pulse is applied to a pin that is adjacent to a pin for which A/D conversion
is being performed, it is possible that the A/D conversion value will not be as expected
due to coupling noise. Therefore, do no apply a pulse to a pin adjacent to a pin for which
A/D conversion is being performed.

(7) AV REF0 pin
This pin inputs the A/D converter reference voltage.
It converts signals input to ANI0 to ANI7 into digital signals according to the voltage applied between AVREF0
and AVSS.
The current flowing in the series resistor string can be reduced by setting the voltage to be input to the AVREF0
pin to AVSS level in standby mode.
AVSS pin. Therefore, if the output impedance of the reference voltage source is high, this
will result in an active line connected in parallel to the series resistor string between the
AVREF0 pin and the AVSS pin, causing a large reference voltage error.
This is a GND potential pin of the A/D converter. Keep it at the same potential as the VSS pin when not using
the A/D converter.
This is an A/D converter analog power supply pin. Keep it at the same potential as the VDD pin when not using
the A/D converter.
The following three types of registers are used to control the A/D converter.
This register sets the analog input channel for A/D conversion, conversion time, conversion start/stop and
external trigger.
ADM is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets ADM to 01H.

Figure 14-2. A/D Converter Mode Register Format
3 2 1 0
ADM
CS
TRG
FR1 FR0
ADM3
ADM2 ADM1 HSC
FF80H
01H
R/W
ADM3
ADM2
ADM1
Analog Input Channel Selection
ANI1
ANI2
ANI3
ANI4
ANI5
ANI6
ANI7
A/D Conversion Time SelectionNote 1
FR0
HSC
fX = 5.0 MHz Operation fX = 4.19 MHz Operation
MCS = 1 MCS = 1 MCS = 0 MCS = 0
80/fX (Setting prohibited Note 2)
160/fX (32.0 s)
80/fX (19.1 s)
160/fX (38.1 s)
40/fX (Setting prohibited Note 2)
80/fX (Setting prohibitedNote 2)
40/fX (Setting prohibitedNote 2)
80/fX (19.1 s)
50/fX (Setting prohibited Note 2)
50/fX (Setting prohibited Note 2)
100/fX (20.0 s)
100/fX (23.8 s)
100/fX (20.0 s)
200/fX (40.0 s)
200/fX (47.7 s) µ
100/fX (23.8 s)
No external trigger (software starts)
Conversion started by external trigger (hardware starts)
A/D Conversion Operation Control
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.
operation after clearing the interrupt request flag (ADIF) to 0.

(2) A/D converter input select register (ADIS)
This register determines whether the ANI0/P10 to ANI7/P17 pins should be used for analog input channels
or ports. Pins other than those selected as analog input can be used as input/output ports.
ADIS is set with an 8-bit memory manipulation instruction.
RESET input sets ADIS to 00H.
(1) Set the number of analog input channels with ADIS.
(2) Using A/D converter mode register (ADM), select one channel to undergo A/D
conversion from among the channels set for analog input with ADIS.
irrespective of the value of bit 1 (PUO1) of the pull-up resistor option register L (PUOL).
3 2 1 0
ADIS
ADIS3
ADIS2 ADIS1 ADIS0
FF84H
00H
R/W
ADIS3
ADIS2
ADIS1
ADIS0
Number of Analog Input Channel Selection
No analog input channel (P10 to P17)
1 channel (ANI0, P11 to P17)
2 channel (ANI0, ANI1, P12 to P17)
3 channel (ANI0 to ANI2, P13 to P17)
4 channel (ANI0 to ANI3, P14 to P17)
5 channel (ANI0 to ANI4, P15 to P17)
6 channel (ANI0 to ANI5, P16, P17)
7 channel (ANI0 to ANI6, P17)
8 channel (ANI0 to ANI7)

(3) External interrupt mode register 1 (INTM1)
This register sets the valid edge for INTP3 to INTP6.
INTM1 is set with an 8-bit memory manipulation instruction.
RESET input sets INTM1 to 00H.
3 2 1 0
INTM1
ES71
ES70
ES61 ES60
ES51
ES50 ES41 ES40
FFEDH
00H
R/W
ES41
ES40
INTP3 Valid Edge Selection
Both falling and rising edges
ES50
INTP4 Valid Edge Selection
Both falling and rising edges
ES60
INTP5 Valid Edge Selection
Both falling and rising edges
ES70
INTP6 Valid Edge Selection
Both falling and rising edges

14.4 A/D Converter Operations
14.4.1 Basic operations of A/D converter
(1) Set the number of analog input channels with A/D converter input select register (ADIS).
(2) From among the analog input channels set with ADIS, select one channel for A/D conversion with A/D converter
mode register (ADM).
(3) The voltage input to the selected analog input channel is sampled by 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 termination of A/D conversion.
(5) Bit 7 of the sequential conversion register (SAR) is set. The serial resistance string’s voltage tap is set at (1/
(6) The difference in voltages between the serial resistance string’s voltage tap and the analog input is compared
by the voltage comparator. If the analog input is greater than (1/2) AVREF0, the MSB of SAR remains set as
is. Also, if it is less 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.
The voltage tap and analog input voltage are compared and bit 6 of SAR is manipulated with the result as
follows.
(8) Comparison of this sort continues up to bit 0 of SAR.
(9) Upon completion of the comparison of 8 bits, any effective digital resultant value remains in SAR and the
resultant value is transferred to and latched in the A/D conversion result register (ADCR).
At the same time, the A/D conversion termination interrupt request (INTAD) can also be generated.

Figure 14-5. A/D Converter Basic Operation
SAR
ADCR
INTAD
A/D conversion operations are performed continuously until bit 7 (CS) of ADM is reset (0) by software.
If a write to the ADM is performed during an A/D conversion operation, the conversion operation is initialized, and
if the CS bit is set (1), conversion starts again from the beginning.
After RESET input, the value of ADCR is undefined.

14.4.2 Input voltage and conversion results
The relation between the analog input voltage input to the analog input pins (ANI0 to ANI7) and the A/D conversion
result (the value stored in A/D conversion result register (ADCR)) is shown by the following expression.
ADCR = INT ( × 256 + 0.5)
AV REF0
256 AV REF0
(ADCR – 0.5) × ≤ VIN < (ADCR + 0.5) ×
Where, INT( ) : Function which returns integer parts of value in parentheses.
Figure 14-6 shows the relation between the analog input voltage and the A/D conversion result.
A/D Conversion Results (ADCR)
1 512 1 256 3 512 2 256 5 512 3 256 507 512 254 256 509 512 255 256 511 512 1
or · Input Voltage/AVREF0

14.4.3 A/D converter operating mode
Select 1 analog input channel from ANI0-ANI7 by the A/D converter input select register (ADIS) and the A/D
converter mode register (ADM) and begin A/D conversion.
The following two methods are used for starting an A/D conversion operation.
The A/D conversion result is stored in the A/D conversion result register (ADCR) and the interrupt request signal
(INTAD) is simultaneously generated.
When bit 6 (TRG) and bit 7 (CS) of A/D converter mode register (ADM) are set to 1, the A/D conversion standby
state is set. When the external trigger signal (INTP3) is input, the A/D conversion starts on the voltage applied
to the analog input pins specified with bits 1 to 3 (ADM1 to ADM3) of ADM.
Upon termination of the A/D conversion, the conversion result is stored in the A/D conversion result register
(ADCR) and the interrupt request signal (INTAD) is generated. After one A/D conversion operation is started
and terminated, another operation is not started until a new external trigger signal is input.
If data with CS set to 1 is written to ADM again during A/D conversion, the converter suspends its A/D
conversion operation and waits for a new external trigger signal to be input. When the external trigger input
signal is reinput, A/D conversion is carried out from the beginning.
If data with CS set to 0 is written to ADM during A/D conversion, the A/D conversion operation stops
immediately.
INTP3
ADM Rewrite CS=1, TRG=1
ADM Rewrite CS=1, TRG=1
ANIn ANIn Standby State
ANIn ANIn ANIn ANIm ANIm
Remarks 1. n = 0, 1, ... , 7

(2) A/D conversion operation in software start
When bit 6 (TRG) and bit 7 (CS) of A/D converter mode register (ADM) are set to 0 and 1, respectively, the
A/D conversion starts on the voltage applied to the analog input pins specified with bits 1 to 3 (ADM1 to
ADM3) of ADM.
Upon termination of the A/D conversion, the conversion result is stored in the A/D conversion result register
(ADCR) and the interrupt request signal (INTAD) is generated. After one A/D conversion operation is started
and terminated, the next A/D conversion operation starts immediately. The A/D conversion operation con-
tinues repeatedly until new data is written to ADM.
If data with CS set to 1 is written to ADM again during A/D conversion, the converter suspends its A/D
conversion operation and starts A/D conversion on the newly written data.
If data with CS set to 0 is written to ADM during A/D conversion, the A/D conversion operation stops im-
mediately.
ADM Rewrite CS=1, TRG=0
ADM Rewrite CS=0, TRG=0
ANIn ANIm ANIm ANIn ANIn
Conversion suspended Conversion results are not stored
INTAD
Remarks 1. n = 0, 1, ... , 7

14.5 A/D Converter Cautions
(1) Power consumption in standby mode
The A/D converter operates on the main system clock. Therefore, its operation stops in STOP mode or in
HALT mode with the subsystem clock. As a current still flows in the AVREF0 pin at this time, this current must
be cut in order to minimize the overall system power dissipation. In Figure 14-9, the power dissipation can
be reduced by outputting a low-level signal to the output port in standby mode. However, there is no precision
to the actual AVREF0 voltage, and therefore the conversion values themselves lack precision and can only be
used for relative comparison.
AV DD
µ PD78058F, 78058FY AVSS
AV REF0 =V DD
AV SS
(2) Input range of ANI0 to ANI7
The input voltages of ANI0 to ANI7 should be within the specification range. In particular, if a voltage above
AVREF0 or below AVSS is input (even if within the absolute maximum rating range), the conversion value for
that channel will be indeterminate. The conversion values of the other channels may also be affected.
Output Port · Series Resistor String

(3) Noise countermeasures
In order to maintain 8-bit resolution, attention must be paid to noise on pins AVREF0 and ANI0 to ANI7. Since
the effect increases in proportion to the output impedance of the analog input source, it is recommended that
a capacitor be connected externally as shown in Figure 14-10 in order to reduce noise.
If there is possibility that noise whose level is AVREF0 or higher or AVSS or lower may be input, clamp with a diode with a small VF (0.3 V or less).
V DD
C=100 to 1000 pF
AV SS
V SS
grounds to VSS and AVSS.
The analog input pins ANI0 to ANI7 also function as input/output port (PORT1) pins. If one of pins ANI0 to
ANI7 is selected to perform A/D conversion, do not execute an input instruction for port 1 during conversion,
as this could lower 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 obtainable due to coupling noise. Therefore, avoid applying pulses to pins
adjacent to the pin undergoing A/D conversion.
A series resistor string of approximately 10 kΩ is connected between the AVREF0 pin and the AVSS pin.
Therefore, if the output impedance of the reference voltage source is high, this will result in parallel connection
to the series resistor string between the AVREF0 pin and the AVSS pin, and there will be a large reference voltage
error.
Reference Voltage Input · ANI0 to ANI7

(6) Interrupt request flag (ADIF)
The interrupt request flag (ADIF) is not cleared even if the A/D converter mode register (ADM) is changed.
A/D conversion result and ADIF for the analog input before the change may be set just before the ADM rewrite.
If ADIF is read immediately after the ADM rewrite, ADIF will be set regardless of whether A/D conversion of
the analog input after the change has been completed.
When the A/D conversion is stopped and then resumed, clear the ADIF before it is resumed.
ADM Rewrite (Start of ANIm Conversion)
ADIF is set but ANIm conversion has not ended
ADM Rewrite (Start of ANIn Conversion)
ANIn ANIn ANIm ANIm
ANIn ANIn ANIm ANIm
A/D Conversion

(7) AV DD pin
The AVDD pin is the analog circuit power supply pin, and supplies power to the input circuits of ANI0/P10 to
ANI7/P17.
Therefore, be sure to apply the same voltage as VDD to this pin even when the application circuit is designed
so as to switch to a backup battery.
AV REF0
AV DD
AV SS
V SS
grounds to VSS and AVSS.
For pins which have common functions with a port (See 3.1.1 or 4.1.1 Normal operating mode pins, (1)
Port pins), do not execute the following operations during A/D conversion. If performed, then the general
error standards cannot be maintained during A/D conversion.
If it is used as a port, rewriting the output latch of its output.
Even if it is not used as a port, changing the output level of pins used as outputs.
Main power supply · Capacitor for back-up
![Page 278 of the NEC PD78056F user manual — [MEMO]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-278.webp?w=400)

15.1 D/A Converter Functions
The D/A converter converts a digital input into an analog value. It consists of two 8-bit resolution channels of voltage
output type D/A converter.
The conversion method used is the R-2R resistor ladder method.
D/A conversion is started by setting the DACE0 and DACE1 of the D/A converter mode register (DAM).
There are two types of modes for the D/A converter, as follows.
Outputs an analog voltage signal immediately after the D/A conversion.
Outputs an analog voltage signal synchronously with the output trigger after the D/A conversion.
Since a sine wave can be generated in this mode, it is useful for an MSK modem for cordless telephone sets.

15.2 D/A Converter Configuration
The D/A converter consists of the following hardware.
D/A conversion value set register 0 (DACS0)
D/A conversion value set register 1 (DACS1)
Control register D/A converter mode register (DAM)
(DACS1)
(DACS0)
INTTM1
2R
ANO1/P131
AV REF1
2R
R
AV SS
2R
R
2R
2R
ANO0/P130
2R
R
2R
R
2R
DAM5
DAM4 DACE1 DACE0
D/A Converter Mode Register

(1) D/A conversion value set register 0, 1 (DACS0, DACS1)
DACS0 and DACS1 are registers where values are set for determining the analog voltage output respectively
to pins ANO0 and ANO1.
DACS0 and DACS1 are set with 8-bit memory manipulation instructions.
RESET input sets these registers to 00H.
Analog voltage output to the ANO0 and ANO1 pins is determined by the following expression.
ANOn output voltage = AVREF1 ×
where, n = 0, 1
an output trigger is generated, the previous data are read rather than the set data.
trigger and before the next output trigger.
DACSn

15.3 D/A Converter Control Registers
The D/A converter mode register (DAM) controls the D/A converter. This register sets D/A converter operation
enable/stop.
The DAM is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets this register to 00H.
3 2 1 0
DAM
DAM5 DAM4
0 DACE1 DACE0
FF98H
00H
R/W
DACE0
D/A Converter Channel 0 Control
D/A Converter Channel 1 Control
D/A Converter Channel 0 Operating Mode
D/A Converter Channel 1 Operating Mode
a pull-up resistor should be disconnected.
real-time output mode.

15.4 Operations of D/A Converter
(1) Select the operation mode for channel 0 using bit 4 (DAM4) of the D/A converter mode register (DAM), and
select the operation mode for channel 1 using bit 5 (DAM5).
(2) Set data corresponding to the analog voltage values output respectively to pins ANO0/P130 and ANO1/P131
in D/A conversion setting registers 0 and 1 (DACS0 and DACS1).
(3) It is possible to start A/D conversion operation for channels 0 and 1 by setting bits 0 and 1 (DACE0, DACE1)
of DAM.
(4) After D/A conversion, when in the normal mode, analog voltages are output immediately to pins ANO0/P130
and ANO1/P131. When in the real time output mode, analog voltages are output in sync with the output trigger.
(5) In the normal mode, the analog voltage signals to be output are held until new data are set in DACS0 and
DACS1. In the realtime output mode, new data are set in DACS0 and DACS1 and then they are held until
the next trigger is generated.

15.5 Cautions Related to D/A Converter
(1) Output impedance of D/A converter
Because the output impedance of the D/A converter is high, use of current flowing from the ANOn pins
(n = 0,1) is prohibited. If the input impedance of the load for the converter is low, insert a buffer amplifier
between the load and the ANOn pins. In addition, wiring from the ANOn pins to the buffer amplifier or the
load should be as short as possible (because of high output impedance). If the wiring may be long, design
the ground pattern so as to be close to those lines or use some other expedient to achieve shorter wiring.
(a) Inverting amplifier
R 2
R 1
PD78058F, 78058FY
R
R 1 C
Because the output voltage of the converter changes in steps, use the D/A converter output signals in general
by connecting a low-pass filter.
When only either one of the D/A converter channels is used with AVREF1 < VDD, the pin that is not used as
an analog output must be set as follows.
low level from the pin.

The µPD78058F Subseries incorporates three channels of serial interfaces. Differences between channels 0,
1, and 2 are as follows (Refer to CHAPTER 18 SERIAL INTERFACE CHANNEL 1 for details of the serial interface
channel 1. Refer to CHAPTER 19 SERIAL INTERFACE CHANNEL 2 for details of the serial interface channel
2).
Serial Transfer Mode Channel 0
fXX/2, fXX/22, fXX/23,
fXX/2, fXX/22, fXX/23,
fXX/24, fXX/25, fXX/26,
fXX/24, fXX/25, fXX/26,
fXX/27, fXX/28, external
fXX/27, fXX/28, external
as the start bit
as the start bit
as the start bit
(CSIIF1)
(SRIF)
SBI (serial bus interface)

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
Serial interface channel 0 employs the following four modes.
interface channel 0 is enabled. If switching the operation mode, first terminate the serial
operation, then carry out switching.
This mode is used when serial transfer is not carried out. Power consumption can be reduced.
This mode is used for 8-bit data transfer using three lines, one each for serial clock (SCK0), serial output (SO0)
and serial input (SI0). This mode enables simultaneous transmission/reception and therefore reduces the data
transfer processing time.
The start bit of transferred 8-bit data is switchable between MSB and LSB, so that devices can be connected
regardless of their start bit recognition.
This mode should be used when connecting with peripheral I/O devices or display controllers that incorporate
a conventional synchronous clocked serial interface as is the case with the 75X/XL, 78K, and 17K series.
This mode is used for 8-bit data transfer with two or more devices using two lines of serial clock (SCK0) and
serial data bus (SB0 or SB1).
The SBI mode is compatible with the NEC Serial Bus Format and sends and receives data distinguishing
between 3 different types, “Address”, “Command” and “Data”.
In actual transmission, first, the master device outputs the “address” on the serial bus and selects the slave
device which is the target of the transmission from among multiple devices. After that, by transmitting
‘Commands’ and ‘Data’ between the master device and slave device, serial transmission is possible. The
receiving side can determine automatically through its hardware whether transmission data are “address”,
“command” or “data”.
This function enables the input/output ports to be used effectively and the application program serial interface
control portions to be simplified.
In this mode, the wake-up function for handshake and the output function of acknowledge and busy signals
can also be used.

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
This mode is used for 8-bit data transfer using two lines of serial clock (SCK0) and serial data bus (SB0 or
SB1).
This mode enables to cope with any one of the possible data transfer formats by controlling the SCK0 level
and the SB0 or SB1 output level. Thus, the handshake line previously necessary for connection of two or
more devices can be removed, resulting in the increased number of available input/output ports.
AV DD
SCK0
SCK0
SB0
SB0
SCK0
SB0
SCK0
SB0

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
Serial interface channel 0 consists of the following hardware.
Serial I/O shift register 0 (SIO0)
Slave address register (SVA)
Timer clock select register 3 (TCL3)
Serial operating mode register 0 (CSIM0)
Control register Serial bus interface control register (SBIC)
Interrupt timing specify register (SINT)
Port mode register 2 (PM2)Note
Item Configuration · Register

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)

Remark Output Control performs selection between CMOS output and N-ch open-drain output.

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
This is an 8-bit register to carry out parallel/serial conversion and to carry out serial transmission/reception
(shift operation) in synchronization with the serial clock.
SIO0 is set with an 8-bit memory manipulation instruction.
When bit 7 (CSIE0) of serial operating mode register 0 (CSIM0) is 1, writing data to SIO0 starts serial operation.
In transmission, data written to SIO0 is output to the serial output (SO0) or serial data bus (SB0/SB1). In
reception, data is read from the serial input (SI0) or SB0/SB1 to SIO0.
and output. Thus, in the case of a device for reception, write FFH to SIO0 in advance (except when address
reception is carried out by setting bit 5 (WUP) of CSIM0 to 1).
In the SBI mode, the busy state can be cleared by writing data to SIO0. In this case, bit 7 (BSYE) of the serial
bus interface control register (SBIC) is not cleared to 0.
RESET input makes SIO0 undefined.
This is an 8-bit register to set the slave address value for connection of a slave device to the serial bus.
This register is not used in the 3-wire serial I/O mode.
SVA is set with an 8-bit memory manipulation instruction.
The master device outputs a slave address for selection of a particular slave device to the connected slave
device. These two data (the slave address output from the master device and the SVA value) are compared
with an address comparator. If they match, the slave device has been selected. In that case, bit 6 (COI) of
serial operating mode register 0 (CSIM0) becomes 1.
Also, by setting bit 4 (SVAM) of the interrupt timing instruction register (SINT) at (1), the address can be
compared with the higher order 7 bits, with the LSB being masked.
If no match is detected when the address is received, bit 2 (RELD) of the serial bus interface control register
(SBIC) is cleared to 0. Furthermore, when in the SBI mode, the wake up function can be used by setting bit
5 (WUP) of CSIM0 at (1). In this case, the interrupt request signal (INTCSI0) is generated only when the slave
address output by the master coincides with the value of SVA, and it can be learned by this interrupt request
that the master requests for communication. If the bit 5 (SIC) of the interrupt timing specify register (SINT)
is set to 1, the wake-up function cannot be used even if WUP is set to 1 (an interrupt request signal is generated
when bus release is detected). To use the wake-up function, clear SIC to 0.
Further, errors can be detected using the SVA when sending data as a master or slave while in the SBI mode
or the 2-wire serial I/O mode.
RESET input makes SVA undefined.

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
This latch holds the SI0/SB0/P25 and SO0/SB1/P26 pin levels. It can be directly controlled by software. In
the SBI mode, this latch is set upon termination of the 8th serial clock.
This counter counts the serial clocks to be output and input during transmission/reception and to check whether
8-bit data has been transmitted/received.
This circuit controls serial clock supply to the serial I/O shift register 0 (SIO0). When the internal system clock
is used, the circuit also controls clock output to the SCK0/P27 pin.
This circuit controls interrupt request signal generation. It generates the interrupt request signal in the following
cases.
This circuit generates an interrupt request signal every eight serial clocks.
When WUPNote is 0 Generates an interrupt request signal every eight serial clocks.
When WUPNote is 1 Generates an interrupt request signal when the serial I/O shift register 0 (SIO0)
value matches the slave address register (SVA) value after address reception.
use the wake-up function (WUP = 1), clear bit 5 (SIC) of the interrupt timing specify register (SINT)
to 0.
These two circuits output and detect various control signals in the SBI mode.
These do not operate in the 3-wire serial I/O mode and 2-wire serial I/O mode.

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
The following four types of registers are used to control serial interface channel 0.
This register sets the serial clock of serial interface channel 0.
TCL3 is set with an 8-bit memory manipulation instruction.
RESET input sets TCL3 to 88H.

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
TCL3 TCL37 TCL36 TCL35 TCL34 TCL33 TCL32 TCL31 TCL30 FF43H 88H R/W
Serial Interface Channel 0 Serial Clock Selection TCL33 TCL32 TCL31 TCL30
fX/22 (1.25 MHz)
fXX/22
fX/22 (1.25 MHz)
fX/23 (625 kHz)
fXX/23
fX/23 (625 kHz)
fX/24 (313 kHz)
fXX/24
fX/24 (313 kHz)
fX/25 (156 kHz)
fXX/25
fX/25 (156 kHz)
fX/26 (78.1 kHz)
fXX/26
fX/26 (78.1 kHz)
fX/27 (39.1 kHz)
fXX/27
fX/27 (39.1 kHz)
fX/28 (19.5 kHz)
fXX/28
fX/28 (19.5 kHz)
fX/29 (9.8 kHz)
Other than above Setting prohibited
Serial Interface Channel 1 Serial Clock Selection TCL37 TCL36 TCL35 TCL34
fX/22 (1.25 MHz)
fXX/22
fX/22 (1.25 MHz)
fX/23 (625 kHz)
fXX/23
fX/23 (625 kHz)
fX/24 (313 kHz)
fXX/24
fX/24 (313 kHz)
fX/25 (156 kHz)
fXX/25
fX/25 (156 kHz)
fX/26 (78.1 kHz)
fXX/26
fX/26 (78.1 kHz)
fX/27 (39.1 kHz)
fXX/27
fX/27 (39.1 kHz)
fX/28 (19.5 kHz)
fXX/28
fX/28 (19.5 kHz)
fX/29 (9.8 kHz)
Other than above Setting prohibited

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
This register sets serial interface channel 0 serial clock, operating mode, operation enable/stop wake-up
function and displays the address comparator match signal.
CSIM0 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets CSIM0 to 00H.
serial interface channel 0 is enabled. If switching the operation mode, first terminate the
serial operation, then carry out switching.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00
FF60H 00H R/WNote 1
CSIM01
CSIM00
Serial Interface Channel 0 Clock Selection
Input Clock to SCK0 pin from off-chip
8-bit timer register 2 (TM2) output
1 Clock specified with bits 0 to 3 of timer clock select register 3 (TCL3)
CSIM
CSIM
02 PM25 P25 PM26 P26 PM27 P27 Operation
Mode Start Bit SIO/SB0/P25
SCK0/P27
3-wired serial l/O mode
LSB 1 × 0 0 0 1
MSB P25 (CMOS input/output)
SB1 (N-ch open-drain input/output)
SB0 (N-ch open-drain input/output)
2-wired serial l/O mode 0 SCK0 (N-ch
MSB P25 (CMOS input/output)
SB1 (N-ch open-drain input/output)
SB0 (N-ch open-drain input/output)

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
R/W
WUP
Wake-up Function ControlNote 1
Interrupt request signal generation with each serial transfer in any mode
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
COI
Slave Address Comparison Result FlagNote 2
Slave address register (SVA) not equal to serial I/O shift register 0 (SIO0) data
Slave address register (SVA) equal to serial I/O shift register 0 (SIO0) data
CSIE0
Serial Interface Channel 0 Operation ControlNote 3
(SINT) to 0.
clearing WUP to “0”. If WUP is not “0”, P25 is fixed at high level, and it is not possible to use it
as a normal port.
Operation stopped · Operation enable

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
This register sets serial bus interface operation and displays statuses.
SBIC is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets SBIC to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
SBIC BSYE ACKD ACKE ACKT CMDD RELD CMDT RELT
FF61H 00H R/WNote
Used for bus release signal output. When RELT = 1, SO0 Iatch is set to 1. After SO0 latch setting, automatically cleared to 0. Also cleared to 0 when CSIE0 = 0.
R/W
Used for command signal output. When CMDT = 1, SO0 Iatch is cleared to (0). After SO0 latch clearance, automatically cleared to 0. Also cleared to 0 when CSIE0 = 0.
R RELD Bus Release Detection
Set Conditions (RELD =1) Clear Conditions (RELD = 0)
R CMDD Command Detection
Clear Conditions (CMDD = 0)
Set Conditions (CMDD = 1)
Acknowledge signal is output in synchronization with the falling edge clock of SCK0 just after execution of the instruction to be set to 1, and after acknowledge signal output, automatically cleared to 0. Used as ACKE=0. Also cleared to 0 upon start of serial interface transfer or when CSIE0 = 0.
Remarks 1. Bits 0, 1, and 4 (RELD, CMDT, and ACKT) are 0 when read after data setting.

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
R/W
ACKE Acknowledge Signal Automatic Output Control
0 Acknowledge signal automatic output disable (output with ACKT enable)
Acknowledge signal is output in synchronization with the 9th clock falling edge of SCK0 (automatically output when ACKE = 1). Before completion of transfer
Acknowledge signal is output in synchronization with the falling edge of SCK0 just after execution of the instruction to be set to 1 (automatically output when ACKE = 1). However, not automatically cleared to 0 after acknowledge signal output.
After completion of transfer
R ACKD Acknowledge Detection
Clear Conditions (ACKD = 0)
Set Conditions (ACKD = 1)
BSYE Synchronizing Busy Signal Output Control
0 Disables busy signal which is output in synchronization with the falling edge of SCK0 clock just after execution of the instruction to be cleared to 0.
1 Outputs busy signal at the falling edge of SCK0 clock following the acknowledge signal.
not cleared to 0.
R/W Note

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
This register sets the bus release interrupt and address mask functions and displays the SCK0/P27 pin level
status.
SINT is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets SINT to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
SINT 0 CLD SIC SVAM 0 FF63H 00H R/WNote 1
SVAM
SVA Bit to be Used as Slave Address
Bits 0 to 7
Bits 1 to 7
SIC
INTCSI0 Interrupt Source SelectionNote 2
CSIIF0 is set upon termination of serial interface channel 0 transfer
CSIIF0 is set upon bus release detection or termination of serial interface channel 0 transfer
CLD
SCK0/P27 Pin LevelNote 3
Low level · High level

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
The following four operating modes are available to the serial interface channel 0.
Serial transfer is not carried out in the operation stop mode. Thus, power consumption can be reduced. The serial
I/O shift register 0 (SIO0) does not carry out shift operation either and thus it can be used as ordinary 8-bit register.
In the operation stop mode, the P25/SI0/SB0, P26/SO0/SB1 and P27/SCK0 pins can be used as ordinary input/
output ports.
The operation stop mode is set with serial operating mode register 0 (CSIM0).
CSIM0 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets CSIM0 to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00 FF60H 00H R/W
CSIE0
Serial Interface Channel 0 Operation Control
Operation stopped · Operation enabled

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
The 3-wire serial I/O mode is valid for connection of peripheral I/O units and display controllers which incorporate
a conventional synchronous clocked serial interface as is the case with the 75X/XL, 78K, and 17K Series.
Communication is carried out with three lines of serial clock (SCK0), serial output (SO0), and serial input (SI0).
The 3-wire serial I/O mode is set with serial operating mode register 0 (CSIM0) and the serial bus interface
control register (SBIC).
CSIM0 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets CSIM0 to 00H.

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00
FF60H 00H R/W Note 1
CSIM01
CSIM00
Serial Interface Channel 0 Clock Selection
Input Clock to SCK0 pin from off-chip
8-bit timer register 2 (TM2) output
1 Clock specified with bits 0 to 3 of timer clock select register 3 (TCL3)
CSIM
CSIM
02 PM25 P25 PM26 P26 PM27 P27 Operation
Mode Start Bit SIO/SB0/P25
SCK0/P27
3-wire serial l/O mode
LSB 1 × 0 0 0 1
SBI mode (see section 16.4.3 SBI mode operation.)
2-wire serial I/O mode (see section 16.4.4 2-wire serial I/O mode operation.) 1 1
WUP
Wake-up Function ControlNote 3
Interrupt request signal generation with each serial transfer in any mode
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
CSIE0
Serial Interface Channel 0 Operation Control

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
SBIC is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets SBIC to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
SBIC BSYE ACKD ACKE ACKT CMDD RELD CMDT RELT
RELT When RELT = 1, SO0 Iatch is set to 1. After SO0 Iatch setting, automatically cleared to 0. Also cleared to 0 when CSIE0 = 0. R/W
CMDT When CMDT = 1, SO0 Iatch is cleared to 0. After SO0 latch clearance, automatically cleared to 0. Also cleared to 0 when CSIE0 = 0. R/W

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
The 3-wire serial I/O mode is used for data transmission/reception in 8-bit units. Bit-wise data transmission/
reception is carried out in synchronization with the serial clock.
Shift operation of the serial I/O shift register 0 (SIO0) is carried out at the falling edge of the serial clock (SCK0).
The transmitted data is held in the SO0 latch and is output from the SO0 pin. The received data input to the
SI0 pin is latched in SIO0 at the rising edge of SCK0.
Upon termination of 8-bit transfer, SIO0 operation stops automatically and the interrupt request flag (CSIIF0)
is set.
SCK0 1 2 3 4 5 6 7 8
DI7 DI6 DI5 DI4 DI3 DI2 DI1 DI0
SO0 DO7 DO6 DO5 DO4 DO3 DO2 DO1 DO0
Transfer Start at the Falling Edge of SCK0
The SO0 pin is a CMOS output pin and outputs current SO0 latch statuses. Thus, the SO0 pin output status
can be manipulated by setting bit 0 (RELT) and bit 1 (CMDT) of 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 (refer to 16.4.5 SCK0/P27 pin output manipulation).
Figure 16-8 shows RELT and CMDT operations.
RELT
CMDT
End of Transfer · SO0 latch

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
The 3-wire serial I/O mode enables to select transfer to start from MSB or LSB.
Figure 16-9 shows the configuration of the serial I/O shift register 0 (SIO0) and internal bus. As shown in the
figure, MSB/LSB can be read/written in reverse form.
MSB/LSB switching as the start bit can be specified with bit 2 (CSIM02) of the serial operating mode register
0 (CSIM0).
SI0 Serial I/O Shift Register 0 (SIO0)
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.
Serial transfer is started by setting transfer data to the serial I/O shift register 0 (SIO0) when the following two
conditions are satisfied.
Upon termination of 8-bit transfer, serial transfer automatically stops and the interrupt request flag (CSIIF0)
is set.

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
SBI (Serial Bus Interface) is a high-speed serial interface in compliance with the NEC serial bus format.
SBI uses a single master device and employs the clocked serial I/O format with the addition of a bus configuration
function. This function enables devices to communicate using only two lines. Thus, when making up a serial bus
with two or more microcontrollers and peripheral ICs, the number of ports to be used and the number of wires on
the board can be decreased.
The master device outputs three kinds of data to slave devices on the serial data bus: “addresses” to select a device
to be communicated with, “commands” to instruct the selected device, and “data” which is actually required.
The slave device can identify the received data into “address”, “command”, or “data”, by hardware. Through this
function, the application program which controls serial interface channel 0 can be simplified.
The SBI function is incorporated into various devices including 75X/XL-Series and 78K-Series.
Figure 16-10 shows a serial bus configuration example when a CPU having a serial interface compliant with SBI
and peripheral ICs are used.
In SBI, the SB0 (SB1) serial data bus pin is an open-drain output pin and therefore the serial data bus line behaves
in the same way as the wired-OR configuration. In addition, a pull-up resistor must be connected to the serial data
bus line.
When the SBI mode is used, refer to (11) SBI mode precautions (d) described later.
AV DD
SCK0
SCK0
SB0 (SB1)
SB0 (SB1)
SCK0
SB0 (SB1)
SCK0
SB0 (SB1)
line (SCK0) as well because serial clock line (SCK0) input/output switching is carried out
asynchronously between the master and slave CPUs.

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
In the conventional serial I/O format, when a serial bus is configured by connecting two or more devices, many
ports and wiring are necessary, to provide chip select signal to identify command and data, and to judge the
busy state, because only the data transfer function is available. If these operations are to be controlled by
software, the software must be heavily loaded.
In SBI, a serial bus can be configured with two signal lines of serial clock SCK0 and serial data bus SB0 (SB1).
Thus, use of SBI leads to reduction in the number of microcontroller ports and that of wiring and routing on
the board.
The SBI functions are described below.
Serial data is distinguished into addresses, commands, and data.
The master executes slave chip selection by address transmission.
The slave can easily judge address reception (chip select judgement) with the wake-up function (which
can be set or cleared by the software).
When the wake-up function is set, the interrupt request signal (INTCSI0) is generated upon reception of
a match address.
Thus, when communication is executed with two or more devices, the CPU except the selected slave
devices can operate regardless of underway serial communications.
The acknowledge signal to check serial data reception is controlled.
The busy signal to report the slave busy state is controlled.

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
The SBI serial data format and the signals to be used are defined as follows.
Serial data to be transferred with SBI consists of three kinds of data: “address”, “command”, and “data”.
Figure 16-11 shows the address, command, and data transfer timings.
SCK0
SB0 (SB1)
A7 A0 ACK BUSY
SCK0
SB0 (SB1)
C7 C0 ACK BUSY READY
SCK0
SB0 (SB1)
D7 D0 ACK BUSY READY
Remark The dotted line indicates READY status.
The bus release signal and the command signal are output by the master device. BUSY is output by the slave
signal. 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.

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
The bus release signal is a signal with the SB0 (SB1) line which has changed from the low level to the
high level when the SCK0 line is at the high level (without serial clock output).
This signal is output by the master device.
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.
this is recognized as a bus release signal. Therefore, if there are shifts in the bus change
timing due to influences such as the board capacity, this may be judged to be a bus
release signal even though data is being sent. Thus, much care is requiring in wiring.
The command signal is a signal with the SB0 (SB1) line which has changed from the high level to the
low level when the SCK0 line is at the high level (without serial clock output). This signal is output by
the master device.
SCK0 "H"
SB0 (SB1)
The command signal indicates that from this point, the master will send a command to the slave (however,
command signals following bus release signals indicate that an address will be sent).
The slave has incorporated the hardware for detecting command signals.
this is recognized as a command signal. Therefore, if there are shifts in the bus change
timing due to influences such as the board capacity, this may be judged to be a command
signal even though data is being sent. Thus, much care is requiring in wiring.

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
An address is 8-bit data which the master device outputs to the slave device connected to the bus line
in order to select a particular slave device.
1 2 3 4 5 6 7 8
SB0 (SB1)
A7 A6 A5 A4 A3 A2 A1 A0
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.
Master Slave 1 Not Selected
Slave 2 Address Transmission
Slave 3 Not Selected
Slave 4 Not Selected

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
The master device transmits commands to, and transmits/receives data to/from the slave device selected
by address transmission.
SCK0
1 2 3 4 5 6 7 8
C7 C6 C5 C4 C3 C2 C1 C0
Figure 16-17. Data
SCK0
1 2 3 4 5 6 7 8
D7 D6 D5 D4 D3 D2 D1 D0
8-bit data following a command signal is defined as “command” data. 8-bit data without command signal
is defined as “data”. Command and data operation procedures are allowed to determine by user according
to communications specifications.
Command Command Signal · Data

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
The acknowledge signal is used to check serial data reception between transmitter and receiver.
[When output in synchronization with 11th clock SCK0]
SCK0
8 9 10 11
ACK
[When output in synchronization with 9th clock SCK0]
SCK0
SB0 (SB1)
ACK
Remark The dotted line indicates READY status.
The acknowledge signal is one-shot pulse to be generated at the falling edge of SCK0 after 8-bit data
transfer. It can be positioned anywhere and can be synchronized with any clock SCK0.
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.

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
The BUSY signal is intended to report to the master device that the slave device is preparing for data
transmission/reception.
The READY signal is intended to report to the master device that the slave device is ready for data
transmission/reception.
SCK0
SB0 (SB1) BUSY
READY ACK
In SBI, the slave device notifies the master device of the busy state by setting SB0 (SB1) line to the low
level.
The BUSY signal output follows the 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 SCK0 serial clock.
When the BUSY signal is reset and the READY signal is set, the master device can start the next transfer.
serial clock. If WUP = 1 is set during this interval by mistake, it will be impossible to
reset BUSY. Therefore, after resetting the BUSY signal, confirm that the level of the SB0
(SB1) pin has gone high before setting WUP to “1”.
The SBI mode is set with serial operating mode register 0 (CSIM0), the serial bus interface control register
(SBIC), and the interrupt timing specify register (SINT).
CSIM0 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets CSIM0 to 00H.

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00
FF60H 00H R/WNote 1
CSIM01
CSIM00
Serial Interface Channel 0 Clock Selection
Input Clock to SCK0 pin from off-chip
8-bit timer register 2 (TM2) output
1 Clock specified with bits 0 to 3 of timer clock select register 3 (TCL3)
CSIM
CSIM
02 PM25 P25 PM26 P26 PM27 P27 Operation
Mode Start Bit SI0/SB0/P25
3-wired serial I/O mode (16.4.2, 3-wire serial I/O mode operation.)
SB1 (N-ch open-drain input/output)
SB0 (N-ch open-drain input/output)
2-wired serial I/O mode (see section 16.4.4, 2-wire serial I/O mode operation.)
WUP
Interrupt request signal generation with each serial transfer in any mode
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
COI
Slave Address Comparison Result Flag
Slave address register (SVA) not equal to serial I/O shift register (SIO0) 0 data
Slave address register (SVA) equal to serial I/O shift register (SIO0) 0 data
CSIE0
Serial Interface Channel 0 Operation Control
register (SINT) to 0.
cleared to “0”. If WUP is not cleared to “0”, P25 is fixed to high-level, and it may become
impossible to use it as a normal port.

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
SBIC is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets SBIC to 00H.
The shaded area is used in the SBI mode.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
SBIC BSYE ACKD ACKE ACKT CMDD RELD CMDT RELT
FF61H 00H R/WNote
Used for bus release signal output. When RELT = 1, SO0 Iatch is set to (1). After SO0 latch setting, automatically cleared to (0). Also cleared to 0 when CSIE0 = 0.
R/W
Used for command signal output. When CMDT = 1, SO0 Iatch is cleared to (0). After SO0 latch clearance, automatically cleared to (0). Also cleared to 0 when CSIE0 = 0.
R RELD Bus Release Detection
Set Conditions (RELD = 1) Clear Conditions (RELD = 0)
R CMDD Command Detection
Clear Conditions (CMDD = 0)
Set Conditions (CMDD = 1)
Acknowledge signal is output in synchronization with the falling edge clock of SCK0 just after execution of the instruction to be set to (1) and, after acknowledge signal output, automatically cleared to (0). Used as ACKE=0. Also cleared to (0) upon start of serial interface transfer or when CSIE0 = 0.
R/W
ACKE Acknowledge Signal Automatic Output Control
0 Acknowledge signal automatic output disable (output with ACKT enable)
Acknowledge signal is output in synchronization with the 9th clock falling edge of SCK0 (automatically output when ACKE = 1). Before completion of transfer
Acknowledge signal is output in synchronization with falling edge clock of SCK0 just after execution of the instruction to be set to 1 (automatically output when ACKE = 1). However, not automatically cleared to 0 after acknowledge signal output.
After completion of transfer
Remarks 1. Bits 0, 1, and 4 (RELD, CMDT, and ACKT) are 0 when read after data setting.
(Continued)

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
R ACKD Acknowledge Detection
Clear Conditions (ACKD = 0)
Set Conditions (ACKD = 1)
rising edge of SCK0 clock after completion of transfer
BSYE Synchronizing Busy Signal Output Control
0 Disables busy signal which is output in synchronization with the falling edge of SCK0 clock just after execution of the instruction to be cleared to (0) (sets READY status).
1 Outputs busy signal at the falling edge of SCK0 clock following the acknowledge signal.
R/W Note

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
SINT is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets SINT to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
SINT 0 CLD SIC SVAM 0 FF63H 00H R/WNote 1
SVAM
SVA Bit to be Used as Slave Address
Bits 0 to 7
Bits 1 to 7
SIC
INTCSI0 Interrupt Source SelectionNote 2
CSIIF0 is set upon termination of serial interface channel 0 transfer
CSIIF0 is set upon bus release detection or termination of serial interface channel 0 transfer
CLD
SCK0/P27 Pin LevelNote 3
Low level · High level

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
Figures 16-20 to 16-25 show various signals and flag operations in SBI. Table 16-3 lists various signals in
SBI.
Slave address write to SIO0 (Transfer Start Instruction)
SCK0
SB0 (SB1)
RELT
CMDT
RELD
CMDD
Figure 16-21. RELT and CMDD Operations (Slave)
Write FFH to SIO0 (Transfer Start Instruction)
A7 A6 A1 A0
SCK0
1 2 7 8 9
SB0 (SB1)
A7 A6 A1 A0 ACK
Slave Address When Addresses Match
When Addresses do not Match
Transfer Start Instruction

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
SCK0 6
SB0 (SB1)
D2 D1 D0 ACK
ACK signal is output for a period of one clock just after setting
When set during · this period

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
(a) When ACKE = 1 upon completion of transfer
SCK0
1 2 7 8 9
D7 D6 D2 D1 D0 ACK
ACK signal is output at 9th clock
When ACKE = 1 at this point
SCK0
SB0 (SB1)
D2
D1 D0 ACK
ACK signal is output for a period of one clock just after setting
If set during this period and ACKE = 1 at the falling edge of the next SCK0
SCK0
1 2 7 8 9
D7 D6 D2 D1 D0
ACK signal is not output
When ACKE = 0 at this point
SCK0
SB0 (SB1)
ACK signal is not output D2 D1 D0
If set and cleared during this period and ACKE = 0 at the falling edge of SCK0

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
(a) When ACK signal is output at 9th clock of SCK0
SIO0
SCK0
SB0 (SB1)
D2
D1 D0 ACK
ACKD
(b) When ACK signal is output after 9th clock of SCK0
SIO0
SCK0
SB0 (SB1)
D2 D0
D1
ACK
ACKD
(c) Clear timing when transfer start is instructed in BUSY
SIO0
SCK0
SB0 (SB1)
D2 D0 D6 D7 BUSY
D1
ACK
ACKD
Figure 16-25. BSYE Operation
SCK0
SB0 (SB1)
D2 D1 D0
ACK
BUSY
BSYE
When BSYE = 1 at this point
If reset during this period and BSYE = 0 at the falling edge of SCK0

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
i) Transmit data is an
(BUSY) • BSYE = 1 — Serial receive disable
Condition Effects on Flag Meaning of Signal
CMD signal is output
ii) REL signal is not
— Serial receive enable Slave Ready signal
transmit data is an
signal output.
mit data is an
ACKT set • ACKD set Completion of
command.
address.
<1> BSYE = 0
Table 16-3. Various Signals in SBI Mode (1/2)
D0 READY SB0 (SB1)
D0 READY SB0 (SB1)
BUSY ACK
ACK BUSY
Timing Chart Definition Signal Name Output
"H"
SB0 (SB1)
SCK0
SB0 (SB1)
SCK0
output to SB0 (SB1) during
output to SB0 (SB1) before
one-clock period of SCK0
after completion of serial
after completion of serial
SB0 (SB1) rising edge
SB0 (SB1) falling edge
serial transfer start and
Low-level signal to be
Low-level signal to be
High-level signal to be
output to SB0 (SB1)
when SCK0 = 1 Master Bus release
when SCK0 = 1
(REL)
(CMD)
(ACK)

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
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
Numeric values to be
Condition Effects on Flag Meaning of Signal
output to serial data
slave device on the
edge of 9th clock
of SCK0)Note 1
When CSIE0 = 1,
1 2 7 8 9 10
1 2 7 8
1 2 7 8
1 2 7 8
Timing Chart Definition Signal Name Output
CMD
not coincide with the value of SVA, RELD is cleared).
SB0 (SB1)
SCK0
SB0 (SB1)
SCK0
SB0 (SB1)
SCK0
SB0 (SB1)
data, ACK signal, synchro-
8-bit data to be transferred in synchronization with
8-bit data to be transferred in synchronization with
8-bit data to be transferred in synchronization with
eight synchronous clocks.
SCK0 after output of REL
SCK0 after output of only
CMD signal without REL
nous BUSY signal, etc.
transferred with the first
SCK0 without output of
REL and CMD signals

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
The serial clock pin SCK0 and serial data bus pin SB0 (SB1) have the following configurations.
Master.. CMOS and push-pull output
Slave Schmitt input
Both master and slave devices have an N-ch open drain output and a Schmitt input.
Because the serial data bus line has an N-ch open-drain output, an external pull-up resistor is necessary.
SCK0 SCK0
AV DD
R L
SB0 (SB1) SB0 (SB1) N-ch Open-Drain N-ch Open-Drain
SO0
AV SS AV SS
SI0
SI0
state, so please write FFH in serial I/O shift register 0 (SIO0) in advance. This will keep it
in the high impedance state at all times during transmission. However, in the case of the
wake up function instruction bit (WUP) = 1, the N-ch open drain output is always in the high
impedance state, so it is not necessary to write FFH in SIO0 before reception.

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
In the SBI mode, the master transmits a slave address to select a specific slave device.
Coincidence of the addresses can be automatically detected by hardware. CSIIF0 is set only when the slave
address transmitted by the master coincides with the address set to SVA when the wake-up function specify
bit (WUP) = 1.
If the bit 5 (SIC) of the interrupt timing specify register (SINT) is set, the wake-up function cannot be used
even if WUP is set (an interrupt request signal is generated when bus release is detected). To use the wake-
up function, clear SIC to 0.
bus release (RELD = 1).
For this match detection, match interrupt request (INTCSI0) of the address to be
detection by slave address when WUP = 1.
WUP = 0, do so by means of transmission/reception of the command preset by program
instead of using the address match detection method.
In the SBI mode, the serial bus SB0 (SB1) status being transmitted is fetched into the destination device, that
is, the serial I/O shift register 0 (SIO0). Thus, transmit errors can be detected in the following way.
In this case, if two data differ from each other, a transmit error is judged to have occurred.
Transmit data is set to both SIO0 and SVA and is transmitted. After termination of transmission, COI bit
(match signal coming from the address comparator) of the serial operating mode register 0 (CSIM0) is
tested. If “1”, normal transmission is judged to have been carried out. If “0”, a transmit error is judged
to have occurred.
In the SBI mode, the master device selects normally one slave device as communication target from among
two or more devices by outputting an “address” to the serial bus.
After the communication target device has been determined, commands and data are transmitted/received
and serial communication is realized between the master and slave devices.
Figures 16-27 to 16-30 show data communication timing charts.
Shift operation of the serial I/O shift register 0 (SIO0) is carried out at the falling edge of serial clock (SCK0).
Transmit data is latched into the SO0 latch and is output with MSB set as the first bit from the SB0/P25 or
SB1/P26 pin. Receive data input to the SB0 (or SB1) pin at the rising edge of SCK0 is latched into the SIO0.

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
BUSY
BUSY
A7 A6 A5 A4 A3 A2 A1 A0 ACK BUSY SB0 (SB1) Pin
(Preparation for the Next Serial Transfer)
to SIO0 Interrupt Servicing
(When SVA = SIO0)
Figure 16-27. Address Transmission from Master Device to Slave Device (WUP = 1)
1 2 3 4 5 6 7 8 9 SCK0 Pin
RELD
CMDD
CMDT
Master Device Processing (Transmitter)
Slave Device Processing (Receiver)

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
BUSY
BUSY
C7 C6 C5 C4 C3 C2 C1 C0 ACK BUSY SB0 (SB1) Pin
(Preparation for the Next Serial Transfer)
Set Serial Reception BUSY
to SIO0 Interrupt Servicing
INTCSI0
1 2 3 4 5 6 7 8 9 SCK0 Pin
CMDT
Master Device Processing (Transmitter)
Slave Device Processing (Receiver)

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
BUSY
BUSY
(Preparation for the Next Serial Transfer)
D7 D6 D5 D4 D3 D2 D1 D0 ACK BUSY SB0 (SB1) Pin
to SIO0 Interrupt Servicing
Figure 16-29. Data Transmission from Master Device to Slave Device
INTCSI0
1 2 3 4 5 6 7 8 9 SCK0 Pin
Master Device Processing (Transmitter)
Slave Device Processing (Receiver)

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
Read Receive data processing FFH Write
BUSY
D7 D6 D5 D4 D3 D2 D1 D0 ACK BUSY SB0 (SB1) Pin
Figure 16-30. Data Transmission from Slave Device to Master Device
INTCSI0
1 2 3 4 5 6 7 8 9 SCK0 Pin
BUSY
Slave Device processing (Transmitter)
Master Device Processing (Receiver)

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
Serial transfer is started by setting transfer data to the serial I/O shift register 0 (SIO0) when the following two
conditions are satisfied.
impedance state, so please write FFH in SIO0 in advance. However, in the case of the
wake up function instruction bit (WUP) = 1, the N-ch open drain output is always in the
high impedance state, so it is not necessary to write FFH in SIO0 before reception.
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.
Furthermore, after inputting RESET in the pin used as the data input and output (SB0 or SB1), be sure to make
the following settings before serial transmission of the first byte of data.
Set 1 to the P25 and P26 output latches.
Set 1 to bit 0 (RELT) of the serial bus interface control register (SBIC).
Set 0 to the P25 and P26 output latches to swhich 1 was set.

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
When a device is in the master mode, use the following procedure to determine if the slave is in the busy state
or not.
Detect the generation of an acknowledge signal (ACK) or interrupt request signal.
Set the port mode register PM25 (or PM26) of pin SB0/P25 (or SB1/P26) in the input mode.
Read the terminal’s status (the pin is in the ready state if it is in the high level).
After detecting the ready state, set 0 in the port mode register 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, match interrupt (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 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 SBI, after specifying reset of BUSY, the BUSY signal is output until the fall of the next serial clock. If
WUP = 1 is set during this interval by mistake, it will be impossible to reset BUSY. Therefore, after resetting
the BUSY signal, confirm that the level of the SB0 (SB1) pin has gone high before setting WUP to “1”.
(d) For pins that are to be used for data input/output, be sure to carry out the following settings before serial
transfer of the 1st byte after RESET input.
Set the P25 and P26 output latches to 1.
Set bit 0 (RELT) of the serial bus interface control register (SBIC) to 1.
Reset the P25 and P26 output latches from 1 to 0.
(e) When the SCK0 line is high level and the SB0 (SB1) line changes from low level to high level, or from
high level to low level, this is recognized as a bus release signal or command signal. Therefore, if there
are shifts in the bus change timing due to influences such as the board capacity, this may be judged to
be a bus release signal (or command signal) even though data is being sent. Thus, much care should
be taken in wiring.

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
The 2-wire serial I/O mode can cope with any communication format by program.
Communication is basically carried out with two lines of serial clock (SCK0) and serial data input/output (SB0 or
SB1).
AV DD AV DD
SCK0
SCK0
SB0 (SB1)
SB0 (SB1)
(1) Register setting
The 2-wire serial I/O mode is set with the serial operating mode register 0 (CSIM0), serial bus interface control
register (SBIC), and interrupt timing specify register (SINT).
CSIM0 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets CSIM0 to 00H.
Master · Slave

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00
FF60H 00H R/WNote 1
CSIM01
CSIM00
Serial Interface Channel 0 Clock Selection
Input Clock to SCK0 pin from off-chip
8-bit timer register 2 (TM2) output
1 Clock specified with bits 0 to 3 of timer clock select register 3 (TCL3)
CSIM
CSIM
02 PM25 P25 PM26 P26 PM27 P27 Operation
Mode Start Bit SIO/SB0/P25
3-wire Serial I/O mode (see section 16.4.2 3-wire serial I/O mode operation.)
SBI mode (see section 16.4.3 SBI mode operation.)
SB1 (N-ch open-drain input/output)
2-wire serial l/O mode
SB0 (N-ch open-drain input/output)
WUP
Interrupt request signal generation with each serial transfer in any mode
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
COI
Slave Address Comparison Result Flag Note 4
Slave address register (SVA) not equal to serial I/O shift register 0 (STO0) data
Slave address register (SVA) equal to serial I/O shift register 0 (STO0) data
CSIE0
Serial Interface Channel 0 Operation Control

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
SBIC is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets SBIC to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
SBIC BSYE ACKD ACKE ACKT CMDD RELD CMDT RELT
RELT When RELT = 1, SO0 Iatch is set to 1. After SO0 Iatch setting, automatically cleared to 0. Also cleared to 0 when CSIE0 = 0. R/W
CMDT When CMDT = 1, SO0 Iatch is cleared to 0. After SO0 latch clearance, automatically cleared to 0. Also cleared to 0 when CSIE0 = 0. R/W
SINT is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets SINT to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
SINT 0 CLD SIC 0 FF63H 00H R/WNote 1
R/W
SIC
INTCSI0 Interrupt Source Selection
CSIIF0 is set upon termination of serial interface channel 0 transfer
CSIIF0 is set upon bus release detection or termination of serial interface channel 0 transfer
CLD
SCK0/P27 Pin LevelNote 2
Low level · High level

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
The 2-wire serial I/O mode is used for data transmission/reception in 8-bit units. Data transmission/reception
is carried out bit-wise in synchronization with the serial clock.
Shift operation of the serial I/O shift register 0 (SIO0) is carried out in synchronization with the falling edge
of the serial clock (SCK0). The transmit data is held in the SO0 latch and is output from the SB0/P25 (or SB1/
P26) pin on an MSB-first basis. The receive data input from the SB0 (or SB1) pin is latched into the shift register
at the rising edge of SCK0.
Upon termination of 8-bit transfer, the shift register operation stops automatically and the interrupt request
flag (CSIIF0) is set.
1 2 3 4 5 6 7 8 SCK0
D7 D6 D5 D4 D3 D2 D1 D0 SB0 (SB1)
Transfer Start at the Falling Edge of SCK0
Since the SB0 (SB1) pin specified in the serial data bus is an N-ch open-drain input output, it is necessary
for it to be pulled up externally. Also, it is necessary for the N-ch open-drain output to be set in the high
impedance state when receiving data, so write FFH in 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 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 (refer to 16.4.5 SCK0/P27 pin output manipulation).
End of Transfer

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
Figure 16-33 shows RELT and CMDT operations.
RELT
CMDT
(4) Transfer start
Serial transfer is started by setting transfer data to the serial I/O shift register 0 (SIO0) when the following two
conditions are satisfied.
receiving data, so write FFH in SIO0 in advance.
Upon termination of 8-bit transfer, serial transfer automatically stops and the interrupt request flag (CSIIF0)
is set.
In the 2-wire serial I/O mode, the serial bus SB0 (SB1) status being transmitted is fetched into the destination
device, that is, serial I/O shift register 0 (SIO0). Thus, transmit error can be detected in the following way.
In this case, if two data differ from each other, a transmit error is judged to have occurred.
Transmit data is set to both SIO0 and SVA and is transmitted. After termination of transmission, COI bit
(match signal coming from the address comparator) of the serial operating mode register 0 (CSIM0) is
tested. If “1”, normal transmission is judged to have been carried out. If “0”, a transmit error is judged
to have occurred.
SO0 Latch

CHAPTER 16 SERIAL INTERFACE CHANNEL 0 (µPD78058F SUBSERIES)
Because the SCK0/P27 pin incorporates an output latch, static output is also possible by software in addition to
normal serial clock output.
P27 output latch manipulation enables any value of SCK0 to be set by software. (SI0/SB0 and SO0/SB1 pin to
be controlled with the RELT and CMDT bits of serial bus interface control register (SBIC).)
SCK0/P27 pin output manipulating procedure is described below.
Set the serial operating mode register 0 (CSIM0) (SCK0 pin enabled for serial operation in the output mode).
SCK0 = 1 with serial transfer suspended.
Manipulate the P27 output latch with a bit manipulation instruction.
Manipulated by bit manipulation instruction
To Internal Circuit SCK0/P27 P27 Output
SCK0 (1 while transfer is stopped) From Serial Clock Control Circuit
When CSIE0 = 1
and CSIM01 and CSIM00 are 1 and 0, or 1 and 1.
Latch

The µPD78058FY Subseries incorporates three channels of serial interfaces. Differences between channels
0, 1, and 2 are as follows (Refer to CHAPTER 18 SERIAL INTERFACE CHANNEL 1 for details of the serial interface
channel 1. Refer to CHAPTER 19 SERIAL INTERFACE CHANNEL 2 for details of the serial interface channel
2).
Serial Transfer Mode Channel 0
fXX/2, fXX/22, fXX/23,
fXX/2, fXX/22, fXX/23,
fXX/24, fXX/25, fXX/26,
fXX/24, fXX/25, fXX/26,
fXX/27, fXX/28, external
fXX/27, fXX/28, external
as the start bit
as the start bit
as the start bit
(CSIIF1)
(SRIF)
I2C bus (Inter IC Bus)

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
Serial interface channel 0 employs the following four modes.
serial interface channel 0 is enabled. The operation mode should be switched after stopping the
serial operation.
This mode is used when serial transfer is not carried out. Power consumption can be reduced.
This mode is used for 8-bit data transfer using three lines, one each for serial clock (SCK0), serial output (SO0)
and serial input (SI0). This mode enables simultaneous transmission/reception and therefore reduces the data
transfer processing time.
The start bit of transferred 8-bit data is switchable between MSB and LSB, so that devices can be connected
regardless of their start bit recognition.
This mode should be used when connecting with peripheral I/O devices or display controllers which incorporate
a conventional synchronous clocked serial interface as is the case with the 75X/XL, 78K, and 17K series.
This mode is used for 8-bit data transfer using two lines of serial clock (SCK0) and serial data bus (SB0 or
SB1).
This mode enables to cope with any one of the possible data transfer formats by controlling the SCK0 level
and the SB0 or SB1 output level. Thus, the handshake line previously necessary for connection of two or
more devices can be removed, resulting in the increased number of available input/output ports.

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
This mode is used for 8-bit data transfer with two or more devices using two lines of serial clock (SCL) and
serial data bus (SDA0 or SDA1).
This mode is in compliance with the I2C bus format. In this mode, the transmitter outputs three kinds of data
receiver automatically distinguishes the received data into “start condition”, “data”, or “stop condition”, by
hardware.
AV DD AV DD
SCL
SCL
SDA0 (SDA1)
SDA0 (SDA1)
SCL
SDA0 (SDA1)
SCL
SDA0 (SDA1)

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
Serial interface channel 0 consists of the following hardware.
Serial I/O shift register 0 (SIO0)
Slave address register (SVA)
Timer clock select register 3 (TCL3)
Serial operating mode register 0 (CSIM0)
Control register Serial bus interface control register (SBIC)
Interrupt timing specify register (SINT)
Port mode register 2 (PM2)Note
Item Configuration · Register

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)

Remark Output Control performs selection between CMOS output and N-ch open-drain output.

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
This is an 8-bit register to carry out parallel-serial conversion and to carry out serial transmission/reception
(shift operation) in synchronization with the serial clock.
SIO0 is set with an 8-bit memory manipulation instruction.
When bit 7 (CSIE0) of serial operating mode register 0 (CSIM0) is 1, writing data to SIO0 starts serial operation.
In transmission, data written to SIO0 is output to the serial output (SO0) or serial data bus (SB0/SB1). In
reception, data is read from the serial input (SI0) or SB0/SB1 to SIO0.
input and output. Therefore, the transmission N-ch open-drain output of the device which will start reception
of data must be turned off beforehand. Consequently, write FFH to SIO0 in advance.
In the I2C bus mode, set SIO0 to FFH with bit 7 (BSYE) of the serial bus interface control register (SBIC) set
to 0.
RESET input makes SIO0 undefined.
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, refer to 17.4.4 (1) (c) Wake-up function.
This is an 8-bit register to set the slave address value for connection of a slave device to the serial bus.
This register is not used in the 3-wire serial I/O mode.
SVA is set with an 8-bit memory manipulation instruction.
The master device outputs a slave address for selection of a particular slave device to the connected slave
device. These two data (the slave address output from the master device and the SVA value) are compared
with an address comparator. If they match, the slave device has been selected. In that case, bit 6 (COI) of
serial operating mode register 0 (CSIM0) becomes 1.
Also, by setting bit 4 (SVAM) of the interrupt timing instruction register (SINT) at (1), the address can be
compared with the higher order 7 bits, with the LSB being masked.
If a match is not detected during address reception, bit 2 (RELD) of the serial bus interface control register
(SBIC) is cleared to 0. Furthermore, when in the I2C bus mode, the wake up function can be used by setting
bit 5 (WUP) of CSIM0 at (1). In this case, the interrupt request signal (INTCSI0) is generated when the slave
address output by the master coincides with the value of SVA (the interrupt request signal is also generated
when the stop condition is detected), and it can be learned by this interrupt request that the master requests
for communication. To use the wake-up function, set SIC to 1.
Further, when in the 2-wire serial I/O mode or in the I2C bus mode, when sending as a master or as a slave,
SVA can be used to detect errors.
RESET input makes SVA undefined.

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
This latch holds SI0/SB0/SDA0/P25 and SO0/SB1/SDA1/P26 pin levels. It can be directly controlled by
software.
This counter counts the serial clocks to be output and input during transmission/reception and to check whether
8-bit data has been transmitted/received.
This circuit controls serial clock supply to the serial I/O shift register 0 (SIO0). When the internal system clock
is used, the circuit also controls clock output to the SCK0/SCL/P27 pin.
This circuit controls interrupt request signal generation. It generates interrupt request signals according to
the settings of interrupt timing specification register (SINT) bits 0 and 1 (WAT0, WAT1) and serial operation
mode register 0 (CSIM0) bit 5 (WUP), as shown in Table 17-3.
These two circuits output and detect various control signals in the I2C mode.
These do not operate in the 3-wire serial I/O mode and 2-wire serial I/O mode.

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
Serial Transfer mode BSYE WUP WAT1 WAT0 ACKE Description
3-wire or 2-wire serial I/O 0 An interrupt request signal is generated each
mode time 8 serial clocks are counted.
Other than above Setting prohibited
I2C bus mode (transmit) 0 0 1 0 0 An interrupt request signal is generated each
time 8 serial clocks are counted (8-clock wait).
Normally, during transmission the settings WAT21,
WAT0 = 1, 0, are not used. They are used only
when wanting to coordinate receive time and
processing systematically using software. ACK
information is generated by the receiving side,
thus ACKE should be set to 0 (disable).
1 1 0 An interrupt request signal is generated each
time 9 serial clocks are counted (9-clock wait).
ACK information is generated by the receiving
side, thus ACKE should be set to 0 (disable).
Other than above Setting prohibited
I2C bus mode (receive) 1 0 1 0 0 An interrupt request signal is generated each
time 8 serial clocks are counted (8-clock wait).
ACK information is output by manipulating
ACKT by software after an interrupt request is
generated.
1 1 0/1 An interrupt request signal is generated each
time 9 serial clocks are counted (9-clock wait).
To automatically generate ACK information,
preset ACKE to 1 before transfer start. However,
in the case of the master, set ACKE to 0
(disable) before receiving the last data.
1 After address is received, if the values of the
serial I/O shift register 0 (SI00) and the slave
address register (SVA) match, and if the stop
condition is detected, an interrupt request signal
is generated.
To automatically generate ACK information,
preset ACKE to 1 (enable) before transfer start.
Other than above Setting prohibited

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
The following four types of registers are used to control serial interface channel 0.
This register sets the serial clock of serial interface channel 0.
TCL3 is set with an 8-bit memory manipulation instruction.
RESET input sets TCL3 to 88H.

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
TCL3 TCL37 TCL36 TCL35 TCL34 TCL33 TCL32 TCL31 TCL30 FF43H 88H R/W
Serial Interface Channel 0 Serial Clock Selection
Serial Clock in I2C Bus Mode Serial Clock in 2-Wire or 3-Wire
MCS = 0
MCS = 1
MCS = 0
fXX/25
fX/26 (78.1 kHz)
fX/22 (1.25 MHz)
fXX/26
fX/26 (78.1 kHz)
fX/27 (39.1 kHz)
fXX/22
fX/22 (1.25 MHz)
fX/23 (625 kHz)
fXX/27
fX/27 (39.1 kHz)
fX/23 (625 kHz)
fX/28 (19.5 kHz)
fXX/23
fX/24 (313 kHz)
fXX/28
fX/28 (19.5 kHz)
fX/29 (9.77 kHz)
fXX/24
fX/24 (313 kHz)
fX/25 (156 kHz)
fXX/29
fX/29 (9.77 kHz)
fX/210 (4.88 kHz)
fXX/25
fX/25 (156 kHz)
fX/26 (78.1 kHz)
fXX/210
fX/210 (4.88 kHz)
fX/211 (2.44 kHz)
fXX/26
fX/26 (78.1 kHz)
fX/27 (39.1 kHz)
fXX/211
fX/211 (2.44 kHz)
fX/212 (1.22 kHz)
fXX/27
fX/27 (39.1 kHz)
fX/28 (19.5 kHz)
fXX/212
fX/212 (1.22 kHz)
fX/213 (0.61 kHz)
fXX/28
fX/28 (19.5 kHz)
fX/29 (9.8 kHz)
Other than above Setting prohibited
Serial Interface Channel 1 Serial Clock Selection
MCS = 1
MCS = 0
fX/22 (1.25 MHz)
fXX/22
fX/22 (1.25 MHz)
fX/23 (625 kHz)
fXX/23
fX/23 (625 kHz)
fX/24 (313 kHz)
fXX/24
fX/24 (313 kHz)
fX/25 (156 kHz)
fXX/25
fX/25 (156 kHz)
fX/26 (78.1 kHz)
fXX/26
fX/26 (78.1 kHz)
fX/27 (39.1 kHz)
fXX/27
fX/27 (39.1 kHz)
fX/28 (19.5 kHz)
fXX/28
fX/28 (19.5 kHz)
fX/29 (9.8 kHz)
Other than above Setting prohibited

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
This register sets serial interface channel 0 serial clock, operating mode, operation enable/stop wake-up
function and displays the address comparator match signal.
CSIM0 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets CSIM0 to 00H.
of serial interface channel 0 is enabled. The operation mode should be switched after
stopping the serial operation.

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00
FF60H 00H R/WNote 1
CSIM01
CSIM00
Serial Interface Channel 0 Clock Selection
Input Clock to SCK0/SCL pin from off-chip
8-bit timer register 2 (TM2) output
1 Clock specified with bits 0 to 3 of timer clock select register 3 (TCL3)
CSIM
CSIM
02 PM25 P25 PM26 P26 PM27 P27 Operation
Mode Start Bit SI0/SB0/SDA0/
SCK0/SCL/P27
LSB 1 × 0 0 0 1
0 SCK0/SCL (N-ch open-
2-wire serial l/O mode
MSB P25 (CMOS input/output)
or I2C Bus Mode
WUP
Interrupt request signal generation with each serial transfer in any mode
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
COI
Slave Address Comparison Result Flag
Slave address register (SVA) not equal to serial I/O shift register (SIO0) 0 data
Slave address register (SVA) equal to serial I/O shift register (SIO0) 0 data
CSIE0
Serial Interface Channel 0 Operation Control
2. I2C bus mode, the clock frequency becomes 1/16 of that output from TO2. 3. Can be used as P25 (CMOS input/output) when used only for transmission. 4. Can be used freely as port function. 5. To use the wake-up function (WUP = 1), set the bit 5 (SIC) of the interrupt timing specify register (SINT) to 1. Do not execute an instruction that writes the serial I/O shift register 0 (SIO0) while WUP = 1. 6. When CSIE0 = 0, COI becomes 0.

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
This register sets serial bus interface operation and displays statuses.
SBIC is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets SBIC to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
SBIC BSYE ACKD ACKE ACKT CMDD RELD CMDT RELT
FF61H 00H R/WNote
Used for stop condition signal output. When RELT = 1, SO0 Iatch is set to 1. After SO0 latch setting, automatically cleared to 0. Also cleared to 0 when CSIE0 = 0.
R/W
Used for start condition signal output. When CMDT = 1, SO0 Iatch is cleared to (0). After SO0 latch clearance, automatically cleared to 0. Also cleared to 0 when CSIE0 = 0.
R RELD Stop Condition Detection
Set Conditions (RELD = 1) Clear Conditions (RELD = 0)
R CMDD Start Condition Detection
Clear Conditions (CMDD = 0)
Set Conditions (CMDD = 1)
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. Also cleared to 0 upon start of serial interface transfer or when CSIE0 = 0.

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
ACKE Acknowledge Signal Output Control
0 Disables acknowledge signal automatic output. (However, output with ACKT is enabled) Used for reception when 8-clock wait mode is selected or for transmission. Note 2
Enables acknowledge signal automatic output. Outputs acknowledge signal in synchronization with the falling edge of the 9th SCL clock cycle (automatically output when ACKE = 1). However, not automatically cleared to 0 after acknowledge signal output. Used in reception with 9-clock wait mode selected.
R ACKD Acknowledge Detection
Clear Conditions (ACKD = 0)
Set Conditions (ACKD = 1)
BSYE Control of N-ch Open-Drain Output for Transmission in I2C Bus Mode
0 Output enabled (transmission)
1 Output disabled (reception)
ACKT.
However, the BSYE flag is not cleared to 0.
R/W Note3

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
This register sets the bus release interrupt and address mask functions and displays the SCK0/SCL pin level
status. SINT is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets SINT to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
SINT 0 CLD SIC SVAM CLC WREL WAT1 WAT0 FF63H 00H R/WNote 1
WAT1
Wait and Interrupt Control
Generates interrupt service request at rising edge of 8th SCK0 clock cycle. (keeping clock output in high impedance)
0 Setting prohibited 1
0 Used in I2C bus mode. (8-clock wait) Generates interrupt service request at rising edge of 8th SCK0 clock cycle. (In the case of master device, makes SCL output low to enter wait state after 8 clock pulses are output. In the case of slave device, makes SCL output low to request wait state after 8 clock pulses are input.)
1 1 Used in I2C bus mode. (9-clock wait) Generates interrupt service request at rising edge of 9th SCK0 clock cycle. (In the case of master device, makes SCL output low to enter wait state after 9 clock pulses are output. In the case of slave device, makes SCL output low to request wait state after 9 clock pulses are input.)
WREL
Wait Sate Cancellation Control
0 Wait state has been cancelled.
Cancels wait state. Automatically cleared to 0 when the state is cancelled. (Used to cancel wait state by means of WAT0 and WAT1.)
Used in I2C bus mode. Make output level of SCL pin low unless serial transfer is being performed.
Used in I2C bus mode. Make SCL pin enter high-impedance state unless serial transfer is being performed. (except for clock line which is kept high) Used to enable master device to generate start condition and stop condition signals.
Clock Level Control

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
R/W
SVAM
SVA Bit to be Used as Slave Address
Bits 0 to 7
Bits 1 to 7
SIC
INTCSI0 Interrupt Source Selection
CSIIF0 is set to 1 upon termination of serial interface channel 0 transfer
CSIIF0 is set to 1 upon stop condition detection or termination of serial interface channel 0 transfer
CLD
SCK0/SCL Pin LevelNote 2
Low level · High level

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
The following four operating modes are available to the serial interface channel 0.
Serial transfer is not carried out in the operation stop mode. Thus, power consumption can be reduced. The serial
I/O shift register 0 (SIO0) does not carry out shift operation either and thus it can be used as ordinary 8-bit register.
In the operation stop mode, the P25/SI0/SB0/SDA0, P26/SO0/SB1/SDA1 and P27/SCK0/SCL pins can be used
as general input/output ports.
The operation stop mode is set with the serial operating mode register 0 (CSIM0).
CSIM0 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets CSIM0 to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00 FF60H 00H R/W
CSIE0
Serial Interface Channel 0 Operation Control
Operation stopped · Operation enabled

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
The 3-wire serial I/O mode is valid for connection of peripheral I/O units and display controllers which incorporate
a conventional synchronous clocked serial interface as is the case with the 75X/XL, 78K, and 17K Series.
Communication is carried out with three lines of serial clock (SCK0), serial output (SO0), and serial input (SI0).
The 3-wire serial I/O mode is set with the serial operating mode register 0 (CSIM0) and serial bus interface
control register (SBIC).
CSIM0 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets CSIM0 to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00
FF60H 00H R/WNote 1
CSIM01
CSIM00
Serial Interface Channel 0 Clock Selection
Input Clock to SCK0 pin from off-chip
8-bit timer register 2 (TM2) output
1 Clock specified with bits 0 to 3 of timer clock select register 3 (TCL3)
CSIM
CSIM
02 PM25 P25 PM26 P26 PM27 P27 Operation
Mode Start Bit SIO/SB0/SDA0
SCK0/SCL/P27
LSB 1 × 0 0 0 1
3-wire serial l/O mode
2-wired serial I/O mode (see the section 17.4.3 2-wire serial I/O mode operation.)
2C bus mode (see the section 17.4.4 I 2C bus mode operation.)
Wake-up Function ControlNote 3
WUP
Interrupt request signal generation with each serial transfer in any mode
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
CSIE0
Serial Interface Channel 0 Operation Control

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
SBIC is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets SBIC to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
SBIC BSYE ACKD ACKE ACKT CMDD RELD CMDT RELT
RELT When RELT = 1, SO0 Iatch is set to 1. After SO0 Iatch setting, automatically cleared to 0. Also cleared to 0 when CSIE0 = 0. R/W
CMDT When CMDT = 1, SO0 Iatch is cleared to 0. After SO0 latch clearance, automatically cleared to 0. Also cleared to 0 when CSIE0 = 0. R/W

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
The 3-wire serial I/O mode is used for data transmission/reception in 8-bit units. Bit-wise data transmission/
reception is carried out in synchronization with the serial clock.
Shift operation of the serial I/O shift register 0 (SIO0) is carried out at the falling edge of the serial clock (SCK0).
The transmitted data is held in the SO0 latch and is output from the SO0 pin. The received data input to the
SI0 pin is latched in SIO0 at the rising edge of SCK0.
Upon termination of 8-bit transfer, SIO0 operation stops automatically and the interrupt request flag (CSIIF0)
is set.
SCK0 1 2 3 4 5 6 7 8
DI7 DI6 DI5 DI4 DI3 DI2 DI1 DI0
SO0 DO7 DO6 DO5 DO4 DO3 DO2 DO1 DO0
Transfer Start at the Falling Edge of SCK0
The SO0 pin is a CMOS output pin and outputs current SO0 latch statuses. Thus, the SO0 pin output status
can be manipulated by setting bit 0 (RELT) and bit 1 (CMDT) of 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 (refer to 17.4.7 SCK0/SCL/P27 pin output manipulation).
Figure 17-8 shows RELT and CMDT operations.
RELT
CMDT
End of Transfer · SO0 latch

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
The 3-wire serial I/O mode enables to select transfer to start from MSB or LSB.
Figure 17-9 shows the configuration of the serial I/O shift register 0 (SIO0) and internal bus. As shown in the
figure, MSB/LSB can be read/written in reverse form.
MSB/LSB switching as the start bit can be specified with bit 2 (CSIM02) of the serial operating mode register
0 (CSIM0).
SI0 Serial I/O Shift Register 0 (SIO0)
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 the shift register.
Serial transfer is started by setting transfer data to the serial I/O shift register 0 (SIO0) when the following two
conditions are satisfied.
Upon termination of 8-bit transfer, serial transfer automatically stops and the interrupt request flag (CSIIF0)
is set.

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
The 2-wire serial I/O mode can cope with any communication format by program.
Communication is basically carried out with two lines of serial clock (SCK0) and serial data input/output (SB0 or
SB1).
AV DD AV DD
SCK0
SCK0
SB0 (SB1)
SB0 (SB1)
(1) Register setting
The 2-wire serial I/O mode is set with the serial operating mode register 0 (CSIM0), serial bus interface control
register (SBIC), and interrupt timing specify register (SINT).
Master · Slave

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
CSIM0 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets CSIM0 to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00
FF60H 00H R/W Note 1
Serial Interface Channel 0 Clock Selection
CSIM00
Input Clock to SCK0 pin from off-chip
8-bit timer register 2 (TM2) output
1 Clock specified with bits 0 to 3 of timer clock select register 3 (TCL3)
CSIM
CSIM
02 PM25 P25 PM26 P26 PM27 P27 Operation
Mode Start Bit SIO/SB0/SDA0
SCK0/SCL/P27
3-wired serial I/O mode (see section 17.4.2 3-wire serial I/O mode operation.)
2-wire serial l/O mode
or I2C bus mode
WUP
Wake-up Function ControlNote 3
Interrupt request signal generation with each serial transfer in any mode
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
COI
Slave Address Comparison Result FlagNote 4
Slave address register (SVA) not equal to serial I/O shift register 0 (SIO0) data
Slave address register (SVA) equal to serial I/O shift register 0 (SIO0) data
CSIE0
Serial Interface Channel 0 Operation Control

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
SBIC is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets SBIC to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
SBIC BSYE ACKD ACKE ACKT CMDD RELD CMDT RELT
RELT When RELT = 1, SO0 Iatch is set to 1. After SO0 Iatch setting, automatically cleared to 0. Also cleared to 0 when CSIE0 = 0. R/W
CMDT When CMDT = 1, SO0 Iatch is cleared to 0. After SO0 latch clearance, automatically cleared to 0. Also cleared to 0 when CSIE0 = 0. R/W
SINT is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets SINT to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
SINT 0 CLD SIC CLC WREL WAT1 WAT0 FF63H 00H R/WNote 1
R/W
SIC
INTCSI0 Interrupt Source Selection
CSIIF0 is set upon termination of serial interface channel 0 transfer
CSIIF0 is set upon bus release detection or termination of serial interface channel 0 transfer
SCK0 Pin LevelNote 2
CLD
Low level · High level

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
The 2-wire serial I/O mode is used for data transmission/reception in 8-bit units. Data transmission/reception
is carried out bit-wise in synchronization with the serial clock.
Shift operation of the serial I/O shift register 0 (SIO0) is carried out in synchronization with the falling edge
of the serial clock (SCK0). The transmit data is held in the SO0 latch and is output from the SB0/SDA0/P25
(or SB1/SDA1/P26) pin on an MSB-first basis. The receive data input from the SB0 (or SB1) pin is latched
into the shift register at the rising edge of SCK0.
Upon termination of 8-bit transfer, the shift register operation stops automatically and the interrupt request
flag (CSIIF0) is set.
1 2 3 4 5 6 7 8 SCK0
D7 D6 D5 D4 D3 D2 D1 D0 SB0 (SB1)
Transfer Start at the Falling Edge of SCK0
Pin SB0 (or SB1) specified in the serial data bus is an N-ch open-drain input and output, so it is necessary
to pull it up externally. It is also necessary to set the N-ch open-drain output in the high impedance state when
receiving data, so write FFH in 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 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 (refer to 17.4.7 SCK0/SCL/P27 pin output manipulation).
End of Transfer

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
Figure 17-12 shows RELT and CMDT operations.
RELT
CMDT
(4) Transfer start
Serial transfer is started by setting transfer data to the serial I/O shift register 0 (SIO0) when the following two
conditions are satisfied.
receiving data, so write FFH in SIO0 in advance.
Upon termination of 8-bit transfer, serial transfer automatically stops and the interrupt request flag (CSIIF0)
is set.
In the 2-wire serial I/O mode, the serial bus SB0 (SB1) status being transmitted is fetched into the destination
device, that is, serial I/O shift register 0 (SIO0). Thus, transmit error can be detected in the following way.
In this case, if two data differ from each other, a transmit error is judged to have occurred.
Transmit data is set to both SIO0 and SVA and is transmitted. After termination of transmission, COI bit
(match signal coming from the address comparator) of the serial operating mode register 0 (CSIM0) is
tested. If “1”, normal transmission is judged to have been carried out. If “0”, a transmit error is judged
to have occurred.
SO0 Latch

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
The I2C bus mode is provided for when communication operations are performed between a single master device
and multiple slave devices. This mode configures a serial bus that includes only a single master device, and is
based on the clocked serial I/O format with the addition of bus configuration functions, which allows the master
device to communicate with a number of (slave) devices using only two lines: serial clock (SCL) line and serial data
bus (SDA0 or SDA1) line. Consequently, when the user plans to configure a serial bus which includes multiple
microcontrollers and peripheral devices, using this configuration results in reduction of the required number of port
pins and on-board wires.
In the I2C bus specification, the master sends start condition, data, and stop condition signals to slave devices
through the serial data bus, while slave devices automatically detect and distinguish the type of signals due to the
signal detection function incorporated as hardware. This simplifies the application program controlling the I2C bus.
An example of a serial bus configuration is shown in Figure 17-13. This system below is composed of CPUs and
peripheral ICs having serial interface hardware that complies with the I2C bus specification.
drain buffers are used for the serial clock pin (SCL) and the serial data bus pin (SDA0 or SDA1) on the I2C bus.
The signals used in the I2C bus mode are described in Table 17-4.
AV DD
AV DD
Slave CPU1 Master CPU
SCL
SDA0(SDA1)
SDA0(SDA1)
SCL
SDA0(SDA1)
SCL
SDA

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
In the I2C bus mode, the following functions are available.
Slave devices automatically detect and identifies start condition, data, and stop condition signals sent in
series through the serial data bus.
The master device can select a specific slave device connected to the I2C bus and communicate with it
by sending in advance the address data corresponding to the destination device.
During a slave operation, if the received address matches the value in the slave address register (SVA),
an interrupt request is generated (an interrupt request is generated even when the stop condition is
detected). Therefore, CPUs other than the selected slave device on the I2C bus can perform independ-
ent operations during the serial communication.
The master device and a slave device send and receive acknowledge signals to confirm that the serial
communication has been executed normally.
When a slave device is preparing for data transmission or reception and requires more waiting time, the
slave device outputs a wait signal on the bus to inform the master device of the wait status.
This section describes the format of serial data communications and functions of the signals used in the
I2C bus mode.
First, the transfer timings of the start condition, data, and stop condition signals, which are output onto the
signal data bus of the I2C bus, are shown in Figure 17-14.
SCL
1-7 8 9 1-7 8 9 1-7 8 9
Address R/W ACK Data ACK Data ACK
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.
Start Condition · Stop Condition

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
When the SDA0 (SDA1) pin level is changed from high to low while the SCL pin is high, this transition is
recognized as the start condition signal. This start condition signal, which is created using the SCL and
SDA0 (or SDA1) pins, is output from the master device to slave devices to initiate a serial transfer. See
section 17.4.5 Cautions on use of I2C bus mode for details of the start condition output.
The start condition signal is detected by hardware incorporated in slave devices.
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
SDA0(SDA1)
(c) Transfer direction specification
The 1 bit that follows the 7-bit address data will be sent from the master device, and it is defined as the
transfer direction specification bit. If this bit is 0, it is the master device which will send data to the slave.
If it is 1, it is the slave device which will send data to the master.
SCL 8 1
2 3 4 5 6 7
A6 A5 A4 A3 A2 A1 A0 R/W
Address · Transfer direction · specification

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
The acknowledge signal indicates that the transferred serial data has definitely been received. This
signal is used between the sending side and receiving side devices for confirmation of correct data
transfer. In principle, the receiving side device returns an acknowledge signal to the sending device
each time it receives 8-bit data. The only exception is when the receiving side is the master device and
the 8-bit data is the last transfer data; the master device outputs no acknowledge signal in this case.
The sending side that has tranferred 8-bit data waits for the acknowledge signal which will be sent from
the receiving side. If the sending side device receives the acknowledge signal, which means a success-
ful data transfer, it proceeds to the next processing. If this signal is not sent back from the slave device,
this means that the data sent has not been received by the slave device, and therefore the master
device outputs a stop condition signal to terminate subsequent transmissions.
SCL
1 2 3 4 5 6 7
ACK
SDA0 (SDA1)
(e) Stop condition
If the SDA0 (SDA1) pin level changes from low to high while the SCL pin is high, this transition is defined
as a stop condition signal.
The stop condition signal is output from the master to the slave device to terminate a serial transfer.
The stop condition signal is detected by hardware incorporated in the slave device.
H SCL
SDA0(SDA1)

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
The wait signal is output by a slave device to inform the master device that the slave device is in wait
state due to preparing for transmitting or receiving data.
During the wait state, the slave device continues to output the wait signal by keeping the SCL pin low to
delay subsequent transfers. When the wait state is released, the master device can start the next trans-
fer. For the releasing operation of slave devices, see section 17.4.5, "Cautions on Use of I2C Bus
Mode."
(a) Wait of 8 Clock Cycles
Set low because slave device drives low, though master device returns to Hi-Z state.
No wait is inserted after 9th clock cycle. (and before master device starts next transfer.)
SCL of Master Device
6 7 8 9 1 3 2 4
SCL of Slave Device
SDA0(SDA1)
D2 D1 D0 ACK D7
D6 D5 D4
Output by manipulating ACKT
Set low because slave device drives low, though master device returns to Hi-Z state.
SCL of Master Device
6 7 8 9 2 3
SCL of Slave Device
D2 D1 D0 ACK D7
D6 D5
SDA0(SDA1)
Output based on the value set in ACKE in advance

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
The I2C bus mode is set by the serial operating mode register 0 (CSIM0), serial bus interface control
register (SBIC), and interrupt timing specify register (SINT).
CSIM0 is set by a 1-bit or 8-bit memory manipulation instruction.
RESET input sets 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00
R/W CSIM01 CSIM00 Serial Interface Channel 0 Clock Selection 0 × Input clock from off-chip to SCL pin 1 0 8-bit timer register 2 (TM2) outputNote 2
1 1 Clock specified with bits 0 to 3 of timer clock select register 3 (TCL3)
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 section 17.4.2 3-wire serial I/O mode operation.) 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
R/W WUP Wake-up Function ControlNote 4
0 Interrupt request signal generation with each serial transfer in any mode 1 In I2C bus mode, interrupt request signal is generated when the address data received after start condition detection (when CMDD = 1) matches data in slave address (SVA) register.
R COI Slave Address Comparison Result FlagNote 5
0 Slave address register (SVA) not equal to data in serial I/O shift register 0 (SIO0) 1 Slave address register (SVA) equal to data in serial I/O shift register 0 (SIO0)
R/W CSIE0 Serial Interface Channel 0 Operation Control 0 Stops operation. 1 Enables operation.
to 1. Do not execute an instruction that writes the serial I/O shift register 0 (SIO0) while WUP = 1.

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
SBIC is set by a 1-bit or 8-bit memory manipulation instruction.
RESET input sets SBIC to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
ACKT CMDD RELD CMDT RELT
R/W RELT Use for stop condition output. When RELT = 1, SO0 latch is set to 1. After SO0 latch setting, automati- cally cleared to 0. Also cleared to 0 when CSIE0 = 0.
R/W CMDT Use for start condition output. When CMDT = 1, SO0 latch is cleared to 0. After clearing SO0 latch, automatically cleared to 0. Also cleared to 0 when CSIE0 = 0.
R RELD Stop Condition Detection
Clear Conditions (RELD = 0) Setting Condition (RELD = 1)
R CMDD Start Condition Detection Clear Conditions (CMDD = 0) Setting Condition (CMDD = 1)
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 CSIE = 0 when a transfer by the serial interface is started.
R/W ACKE Acknowledge Signal Automatic Output ControlNote 2
0 Disabled (with ACKT enabled). Used when receiving data in the 8-clock wait mode or when transmitting data.Note 3
1 Enabled. After completion of transfer, acknowledge signal is output in synchronization with the 9th falling edge of SCL clock (automatically output when ACKE = 1). However, not automatically cleared to 0 after acknowl- edge signal output. Used for reception when the 9-clock wait mode is selected.
R/W BSYE Control of N-ch Open-Drain Output for Transmission in I2C Bus ModeNote 5 Note 4
0 Output enabled (transmission) 1 Output disabled (reception)
signal. However, the BSYE flag is not cleared.

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
SINT is set by the 1-bit or 8-bit memory manipulation instruction.
RESET input sets SINT to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
SVAM CLC WREL WAT1 WAT0
R/W WAT1 WAT0 Interrupt Control by WaitNote 2
0 0 Interrupt service request is generated on rise of 8th SCK0 clock cycle (clock output is high impedance).
0 1 Setting prohibited
1 0 Used in I2C bus mode (8-clock wait) Generates an interrupt service request on rise of 8th SCL clock cycle. (In case of master device, SCL pin is driven low after output of 8 clock cycles, to enter the wait state. In case of slave device, SCL pin is driven low after input of 8 clock cycles, to require the wait state.)
1 1 Used in I2C bus mode (9-clock wait) Generates an interrupt service request on rise of 9th SCL clock cycle. (In case of master device, SCL pin is driven low after output of 9 clock cycles, to enter the wait state. In case of slave device, SCL pin is driven low after input of 9 clock cycles, to require the wait state.)
R/W WREL Wait Release Control
0 Indicates that the wait state has been released.
1 Releases the wait state. Automatically cleared to 0 after releasing the wait state. This bit is used to release the wait state set by means of WAT0 and WAT1.
R/W CLC Clock Level Control
0 Used in I2C bus mode. In cases other than serial transfer, SCL pin output is driven low.
1 Used in I2C bus mode. In cases other than serial transfer, SCL pin output is set to high impedance. (Clock line is held high.) Used by master device to generate the start condition and stop condition signals.
R/W SVAM SVA Bits Used as Slave Address
0 Bits 0 to 7
1 Bits 1 to 7
R/W SIC INTCSI0 Interrupt Source SelectionNote 3
0 CSIIF0 is set to 1 after end of serial interface channel 0 transfer.
1 CSIIF0 is set to 1 after end of serial interface channel 0 transfer or when stop condition is detected.
R CLD SCL Pin LevelNote 4
0 Low level · 1 High level

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
A list of signals in the I2C bus mode is given in Table 17-4.
Function : Indicates that serial communication starts and subsequent data are address data.
Signaled when : CMDT is set.
Function : Indicates end of serial transmission.
Signaled when : RELT is set.
Function : Indicates completion of reception of 1 byte.
Signaled when : ACKT is set with ACKE = 1.
Function : Indicates state in which serial reception is not possible.
Signaled when : WAT1, WAT0 = 1×.
Function : Serial communication synchronization signal.
Signaled when : See Note 2 below.
Affected flag(s) : CSIIF0. Also see Note 3 below.
Function : Indicates address value for specification of slave on serial bus.
Signaled when : See Note 2 below.
Affected flag(s) : CSIIF0. Also see Note 3 below.
Function : Indicates whether data transmission or reception is to be performed.
Signaled when : See Note 2 below.
Affected flag(s) : CSIIF0. Also see Note 3 below.
Function : Contains data actually to be sent.
Signaled when : See Note 2 below.
Affected flag(s) : CSIIF0. Also see Note 3 below.
wait state, the serial transfer operation will be started after the wait state is released.
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 coincides with the value of
the slave address register (SVA) when WUP = 1, or if the stop condition is detected.
Signal Name Description

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
The configurations of the serial clock pin SCL and the serial data bus pins SDA0 (SDA1) are shown below.
Pin for serial clock input/output dual-function pin.
Master N-ch open-drain output
Slave Schmitt input
Serial data input/output dual-function pin.
Uses N-ch open-drain output and Schmitt-input buffers for both master and slave devices.
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.
AV DD
SCL
SCL
AV DD
AV SS
AV SS
SDA0(SDA1)
SDA0(SDA1)
AV SS AV SS
receiving data, so set 1 in bit 7 (BSYE) of the serial bus interface control register (SBIC)
in advance and write FFH in serial I/O shift register 0 (SIO0).
However, when the wake up function is used (when bit 5 (WUP) of serial operation mode
register 0 (CSIM0) is set), do not write FFH in SIO0 before reception. Even if FFH is not
written in SIO0, the N-ch open-drain output is always in the high impedance state.
In the I2C mode, the master can select a specific slave device by sending slave address data.
CSIIF0 is set if the slave address transmitted by the master coincides with the value set to the slave
address register (SVA) when a slave device address has a slave register (SVA), and the wake-up function
specify bit (WUP) = 1 (CSIIF0 is also set when the stop condition is detected).
When using the wake-up function, set SIC to 1.
devices. Each slave device recognizes whether the slave device is selected or not by
master device by comparing the content of the SVA register (which is in each slave device)
and the slave address data, which is sent by master device immediately after the start
condition signal. Only if the WUP bit has been set to 1 when they match, the slave device
generates INTCSI0 signal.

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
In the I2C bus mode, transmission error detection can be performed by the following methods because the
serial bus SDA0 (SDA1) status during transmission is also taken into the serial I/O shift register 0 (SIO0)
register of the transmitting device.
In this case, a transmission error is judged to have occurred if the two data values are different.
Transmit data is set in SIO0 and SVA before transmission is performed. After transmission, the COI bit
(match signal from the address comparator) of serial operating mode register 0 (CSIM0) is tested: "1"
indicates normal transmission, and "0" indicates a transmission error.
In the I2C bus mode, the master selects the slave device to be communicated with from among multiple
devices by outputting address data onto the serial bus.
After the slave address data, the master sends the R/W bit which indicates the data transfer direction, and
starts serial communication with the selected slave device.
Data communication timing charts are shown in Figures 17-22 and 17-23.
In the transmitting device, the serial I/O shift register 0 (SIO0) shifts transmission data to the SO latch in
synchronization with the falling edge of the serial clock (SCL), the SO0 latch outputs the data on an MSB-
first basis from the SDA0 or SDA1 pin to the receiving device.
In the receiving device, the data input from the SDA0 or SDA1 pin is taken into the SIO0 in synchroniza-
tion with the rising edge of SCL.
A serial transfer is started by setting transfer data in serial I/O shift register 0 (SIO0) if the following two
conditions have been satisfied:
data in SIO0 does not initiate transfer operation.
receiving data, so set 1 in bit 7 (BSYE) of the serial bus interface control register (SBIC)
in advance and write FFH in serial I/O shift register 0 (SIO0).
However, when the wake up function is used (when bit 5 (WUP) of serial operation mode
register 0 (CSIM0) is set), do not write FFH in SIO0 before reception. Even if FFH is not
written in SIO0, the N-ch open drain output is always in the high impedance state.
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.

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
(Both Master and Slave Selected 9-Clock Wait) (1/3)
(a) Start Condition to Address
COI
ACKD
CMDD
RELD
CLD
P27
H
WUP
BSYE
ACKE
CMDT
RELT
WREL
SIC
INTCSI0
SCL
2 3 4 5 6 7 8
1 2 3 4 5 9
A5 A4 A3 A2 A1 A0 W ACK A6
SIO0 ← FFH
COI
ACKD
CMDD
RELD
CLD
P27 WUP
BSYE
H H
ACKE
CMDT
RELT
WREL
H
SIC
INTCSI0
CSIE0
H
P25
PM25
PM27

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
(Both Master and Slave Selected 9-Clock Wait) (2/3)
(b) Data
COI
ACKD
CMDD
RELD
CLD
P27
H
WUP
BSYE
ACKE
CMDT
RELT
WREL
SIC
INTCSI0
SCL
2 3 4 5 6 7 8
1 2 3 4 5 9
D5 D4 D3 D2 D1 D0 ACK D6 D7
SIO0 ← FFH SIO0 ← FFH
COI
ACKD
CMDD
RELD
CLD
P27 WUP
BSYE
H H
ACKE
CMDT
RELT
WREL
SIC
H
INTCSI0
CSIE0
H
P25
PM25
PM27

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
(Both Master and Slave Selected 9-Clock Wait) (3/3)
(c) Stop Condition
COI
ACKD
CMDD
RELD
CLD
P27
H
WUP
BSYE
ACKE
CMDT
RELT
WREL
SIC
INTCSI0
SCL
2 3 4 5 6 7 8
1 2 3 4 9
D5 D4 D3 D2 D1 D0 ACK D6 D7
SDA0
SIO0 ← FFH
SIO0 ← FFH
COI
ACKD
CMDD
RELD
CLD
P27 WUP
BSYE
H H
ACKE
CMDT
RELT
WREL
SIC
H
INTCSI0
CSIE0
P25
PM25
PM27

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
(Both Master and Slave Selected 9-Clock Wait) (1/3)
(a) Start Condition to Address
SIO0 ← FFH
COI
ACKD
CMDD
RELD
CLD
P27
H
WUP
BSYE
ACKE
CMDT
RELT
WREL
SIC
INTCSI0
SCL
2 3 4 5 6 7 8
2 1 3 4 5 9
A0 A1 A2 A3 A4 A5 A6 R ACK
COI
ACKD
CMDD
RELD
CLD
P27 WUP
BSYE
ACKE
CMDT
RELT
WREL
SIC
H
INTCSI0
CSIE0
H
P25
PM25
PM27

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
(Both Master and Slave Selected 9-Clock Wait) (2/3)
(b) Data
SIO0 ← FFH
SIO0 ← FFH
COI
ACKD
CMDD
RELD
CLD
P27
H
WUP
BSYE
L H H
ACKE
CMDT
RELT
WREL
SIC
INTCSI0
SCL
2 3 4 5 6 7 8
2 1 3 4 5 9
D1 D0 D2 D3 D4 D5 D6 D7 ACK
SIO0 ← Data SIO0 ← Data
ACKD
CMDD
RELD
CLD
P27 WUP
BSYE
ACKE
CMDT
RELT
WREL
SIC
H
INTCSI0
CSIE0
H
P25
PM25
PM27

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
(Both Master and Slave Selected 9-Clock Wait) (3/3)
(c) Stop Condition
SIO0 ← FFH
COI
ACKD
CMDD
RELD
CLD
P27
H
WUP
BSYE
ACKE
CMDT
RELT
WREL
SIC
INTCSI0
SCL
2 3 4 5 6 7 8
1 2 3 4 9
D1 D0 D2 D3 D4 D5 D6 D7 NAK
COI
ACKD
CMDD
RELD
CLD
P27 WUP
BSYE
ACKE
CMDT
RELT
WREL
SIC
H
INTCSI0
CSIE0
H
P25
PM25
PM27

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
(1) Start condition output (master)
The SCL pin normally outputs a low-level signal when no serial clock is output. It is necessary to change
the SCL pin to high in order to output a start condition signal. To set pin SCL to high level, set bit 3 (CLC)
of the interrupt timing specification register (SINT) to 1.
After setting CLC, clear CLC to 0 and return the SCL pin to low. If CLC remains 1, no serial clock is
output.
To output the start condition or stop condition from the master, set CLC to “1”, then make sure that bit 6
(CLD) of SINT is “1”. This procedure must be followed because there is a possibility that the slave has set
SCL to low level (wait status).
SCL
SDA0(SDA1)
CMDT
CLD

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
Slave wait status is released by WREL flag (bit 2 of interrupt timing specify register (SINT)) setting or
execution of an serial I/O shift register 0 (SIO0) write instruction.
If the slave sends data, the wait is immediately released by execution of an SIO0 write instruction and the
clock rises without the start transmission bit being output in the data line. Therefore, as shown in Figure
17-25, data should be transmitted by manipulating the P27 output latch through the program. At this time,
control the low-level width ("a" in Figure 17-25) of the first serial clock at the timing used for setting the
P27 output latch to 1 after execution of an SIO0 write instruction.
In addition, if the acknowledge signal from the master is not output (if data transmission from the slave is
completed), set 1 in the WREL flag of SINT and release the wait.
For these timings, see Figure 17-23.
Setting CSIIF0 Setting ACKD Serial Reception
9 a 2 3
A0 R ACK D7 D6 D5
P27 output latch 0
P27 output latch 1
Setting CSIIF0 ACK output Serial Transmission

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
The slave is released from the wait status when the WREL flag (bit 2 of the interrupt timing specify register
(SINT)) is set or when an instruction that writes data to the serial I/O shift register 0 (SIO0) is executed.
When the slave receives data, the first bit of the data sent from the master may not be received if the SCL
line immediately goes into a high-impedance state after an instruction that writes data to SIO has been
executed.
This is because SIO0 does not start operating if the SCL line is in the high-impedance state while the
instruction that writes data to SIO0 is executed (until the next instruction is executed).
Therefore, receive the data by manipulating the output latch of P27 by program, as shown in Figure 17-26.
For this timing, refer to Figure 17-22.
SIO0
SCL
SDA0 (SDA1)
A0 ACK D7 D6 D5
W
P27 output latch 0
P27 output latch 1
Setting CSIIF0 ACK Output Serial Reception

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
In the reception completion processing of the slave, check the bit 3 (CMDD) of the serial bus interface
control register (SBIC) and bit 6 (COI) of the serial operation mode register 0 (CSIM0) (when CMDD = 1).
This is to avoid the situation where the slave cannot judge which of the start condition and data comes first
and therefore, the wake-up condition cannot be used when the slave receives the undefined number of
data from the master.
The following restrictions are applied to the µPD78058FY Subseries.
Description: If the wake-up function is executed (by setting the bit 5 of the serial operating mode
register 0 (CSIM0) to 1) in the serial transfer statusNote, the µPD78058FY subseries
checks the address of the data between the other slave and master. If that data hap-
pens to coincide with the slave address of the µPD78058FY subseries, the µPD78058FY
subseries takes part in communication, destroying the communication data.
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 wake-up function, execute the following program that clears the
serial transfer status. When executing the wake-up function, do not execute an instruc-
tion that writes data to SIO0. Even if such an instruction is not executed, data can be
received while the wake-up function is executed.
This program releases the serial transfer status. To release the serial transfer status,
the serial interface channel 0 must be once disabled (by clearing the CSIE0 flag (bit 7 of
the serial operating mode register (CSIM0) to 0). If the serial interface channel 0 is
disabled in the I2C bus mode, however, the SCL pin outputs a high level, and 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 pre-
vent the I2C bus from being affected.
In this example, the SDA0 (/P25) pin is used as a serial data input/output pin. When the
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, refer to Figure 17-22.

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
SET1 PM2.5; <2>
SET1 PM2.7; <3>
CLR1 CSIE0; <4>
SET1 CSIE0; <5>
SET1 RELT; <6>
CLR1 PM2.7; <7>
CLR1 P2.5; <8>
CLR1 PM2.5; <9>
<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 influ-
ence 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 set 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.

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
The SCK0/SCL/P27 pin can execute static output via software, in addition to outputting the normal serial clock.
The value of serial clocks can also be arbitrarily set by software (the SI0/SB0/SDA0 and SO0/SB1/SDA1 pins are
controlled with the RELT and CMDT bits of serial bus interface control register (SBIC)).
The SCK0/SCL/P27 pin output should be manipulated as described below.
The output level of the SCK0/SCL/P27 pin is manipulated by the P27 output latch.
<1> Set the serial operating mode register 0 (CSIM0) (SCK0 pin is set in the output mode and serial opera-
tion is enabled). SCK0 = 1 while serial transfer is stopped.
<2> Manipulate the content of the P27 output latch by executing the bit manipulation instruction.
Manipulated by bit manipulation instruction
SCK0/SCL/P27 To Internal Logic P27 output latch
SCK0 (1 while transfer is stopped)
From serial clock controller
CSIE0 = 1 and CSIM01, CSIM00 are 1, 0 or 1, 1, respectively
The output level of the SCK0/SCL/P27 pin is manipulated by bit 3 (CLC) of the interrupt timing specify
register (SINT).
<1> Set the serial operating mode register 0 (CSIM0) (SCL pin is set in the output mode and serial opera-
tion is enabled). Set 1 to the P27 output latch. SCL = 0 while serial transfer is stopped.
<2> Manipulate the CLC bit of SINT by executing the bit manipulation instruction.
SCK0/SCL/P27 To Internal Logic P27 output latch
From serial clock controller
CSIE0 = 1 and CSIM01 and CSIM00 are 1, 0 or 1, 1, respectively
Set 1

CHAPTER 17 SERIAL INTERFACE CHANNEL 0 (µPD78058FY SUBSERIES)
CLC (manipulated by bit manipulation instruction)
Wait request signal Serial clock (low while transfer is stopped) SCL
Remarks 1. This figure indicates the relation of the signals and does not indicate the internal circuit.

18.1 Serial Interface Channel 1 Functions
Serial interface channel 1 employs the following three modes.
This mode is used when serial transfer is not carried out to reduce power consumption.
This mode is used for 8-bit data transfer using three lines, each for serial clock (SCK1), serial output (SO1)
and serial input (SI1).
The 3-wire serial I/O mode enables simultaneous transmission/reception and so decreases the data transfer
processing time.
Since the start bit of 8-bit data to undergo serial transfer is switchable between MSB and LSB, connection
is enabled with either start bit device.
The 3-wire serial I/O mode is valid for connection of peripheral I/O units and display controllers which
incorporate a conventional synchronous serial interface such as the 75X/XL, 78K and 17K Series.
This is the mode that an automatic transmit/receive function is appended to the above mode, (2) 3-wire serial
I/O mode.
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 the software load can be alleviated.

18.2 Serial Interface Channel 1 Configuration
Serial interface channel 1 consists of the following hardware.
Register Serial I/O shift register 1 (SIO1)
Automatic data transmit/receive address pointer (ADTP)
Timer clock select register 3 (TCL3)
Serial operating mode register 1 (CSIM1)
Control register Automatic data transmit/receive control register (ADTC)
Automatic data transmit/receive interval specify register (ADTI)
Port mode register 2 (PM2)Note
P22 and P27 Block Diagram.
Item Configuration

Figure 18-1. Serial Interface Channel 1 Block Diagram


(1) Serial I/O shift register 1 (SIO1)
This is an 8-bit register to carry out parallel/serial conversion and to carry out serial transmission/reception
(shift operation) in synchronization with the serial clock.
SIO1 is set with an 8-bit memory manipulation instruction.
When the value in bit 7 (CSIE1) of serial operating mode register 1 (CSIM1) is 1, writing data to SIO1 starts
serial operation.
In transmission, data written to SIO1 is output to the serial output (SO1). In reception, data is read from the
serial input (SI1) to SIO1.
RESET input makes SIO1 undefined.
This register stores value of (the number of transmit data bytes-1) while the automatic transmit/receive function
is activated. As data is transferred/received, it is automatically decremented.
ADTP is set with an 8-bit memory manipulation instruction. The high-order 3 bits must be set to 0.
RESET input sets ADTP to 00H.
This counter counts the serial clocks to be output and input during transmission/reception to check whether
8-bit data has been transmitted/received.

18.3 Serial Interface Channel 1 Control Registers
The following four types of registers are used to control serial interface channel 1.
This register sets the serial clock of serial interface channel 1.
TCL3 is set with an 8-bit memory manipulation instruction.
RESET input sets TCL3 to 88H.
Remark Besides setting the serial clock of serial interface channel 1, TCL3 sets the serial clock of serial
interface channel 0.

Figure 18-2. Timer Clock Select Register 3 Format
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
TCL3 TCL37 TCL36 TCL35 TCL34 TCL33 TCL32 TCL31 TCL30 FF43H 88H R/W
Serial Interface Channel 1 Serial Clock Selection TCL37 TCL36 TCL35 TCL34
fX/22 (1.25 MHz)
fXX/22
fX/22 (1.25 MHz)
fX/23 (625 kHz)
fXX/23
fX/23 (625 kHz)
fX/24 (313 kHz)
fXX/24
fX/24 (313 kHz)
fX/25 (156 kHz)
fXX/25
fX/25 (156 kHz)
fX/26 (78.1 kHz)
fXX/26
fX/26 (78.1 kHz)
fX/27 (39.1 kHz)
fXX/27
fX/27 (39.1 kHz)
fX/28 (19.5 kHz)
fXX/28
fX/28 (19.5 kHz)
fX/29 (9.8 kHz)
Other than above Setting prohibited
fXX/2 · Setting prohibited

(2) Serial operating mode register 1 (CSIM1)
This register sets serial interface channel 1 serial clock, operating mode, operation enable/stop and automatic
transmit/receive operation enable/stop.
CSIM1 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets CSIM1 to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
CSIM1 CSIE1 DIR ATE 0 0 0 CSIM11 CSIM10
Serial Interface Channel 1 Clock Selection
CSIM10
Clock externally input to SCK1 pinNote 1
8-bit timer register 2 (TM2) output
1 Clock specified with bits 4 to 7 of timer clock select register 3 (TCL3)
Serial Interface Channel 1 Operating Mode Selection
3-wire serial I/O mode
3-wire serial I/O mode with automatic transmit/receive function
MSB
SI1/P20
LSB
1 Operation Serial Clock Counter
CSIM11 P20 PM21 P21 PM22
P22
× Operation
Clear P20 (CMOS input/output)
of the automatic data transmit/receive control register (ADTC) to 0, 0.

(3) Automatic data transmit/receive control register (ADTC)
This register sets automatic receive enable/disable, the operating mode, strobe output enable/disable, busy
input enable/disable, error check enable/disable and displays automatic transmit/receive execution and error
detection.
ADTC is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets ADTC to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
ADTC RE ARLD ERCE ERR TRF STRB BUSY1 BUSY0 FF69H 00H R/WNote 1
BUSY1
BUSY0
Not using busy input
Busy input enable (active high)
Busy input enable (active low)
STRB
R
TRF
Status of Automatic Transmit/Receive FunctionNote 2
Detection of termination of automatic transmission/ reception (This bit is set to 0 upon suspension of automatic transmission/reception or when ARLD = 0.)
During automatic transmission/reception (This bit is set to 1 when data is written to SIO1.)
ERR
Error Detection of Automatic Transmit/Receive Function
No error (This bit is set to 0 when data is written to SIO1)
ERCE
Error Check Control of Automatic Transmit/ Receive Function
Error check enable (only when BUSY1 = 1)
ARLD
Operating Mode Selection of Automatic Transmit/ Receive Function
RE
Receive Control of Automatic Transmit/Receive Function
1 (CSIM1) set to 0, set STRB and BUSY1 of ADTC to 0, 0 (handshake control cannot be executed
when the external clock is input).

(4) Automatic data transmit/receive interval specify register (ADTI)
This register sets the automatic data transmit/receive function data transfer interval.
ADTI is set by a 1-bit or 8-bit memory manipulation instruction.
RESET input sets ADTI to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
ADTI ADTI7 0 0 ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 FF6BH 00H R/W
Data Transfer Interval Control
No control of interval by ADTINote 1
Control of interval by ADTI (ADTI0 to ADTI4) 1
Data Transfer Interval Specification (fXX = 5.0 MHz Operation) ADTI4 ADTI3 ADTI2 ADTI1
18.4 s + 0.5/fSCK
20.0 s + 1.5/fSCK
31.2 s + 0.5/fSCK
32.8 s + 1.5/fSCK
44.0 s + 0.5/fSCK
45.6 s + 1.5/fSCK
56.8 s + 0.5/fSCK
58.4 s + 1.5/fSCK
69.6 s + 0.5/fSCK
71.2 s + 1.5/fSCK
82.4 s + 0.5/fSCK
84.0 s + 1.5/fSCK
95.2 s + 0.5/fSCK
96.8 s + 1.5/fSCK
108.0 s + 0.5/fSCK
109.6 s + 1.5/fSCK
120.8 s + 0.5/fSCK
122.4 s + 1.5/fSCK
133.6 s + 0.5/fSCK
135.2 s + 1.5/fSCK
146.4 s + 0.5/fSCK
148.0 s + 1.5/fSCK
159.2 s + 0.5/fSCK
160.8 s + 1.5/fSCK
172.0 s + 0.5/fSCK
173.6 s + 1.5/fSCK
184.8 s + 0.5/fSCK
186.4 s + 1.5/fSCK
197.6 s + 0.5/fSCK
199.2 s + 1.5/fSCK
210.4 s + 0.5/fSCK
212.0 s + 1.5/fSCK
found from the following expressions (n: Value set in ADTI0 to ADTI4). However, if a minimum which
is calculated by the following expressions is smaller than 2/fSCK, the minimum interval time is 2/fSCK.
26 28 0.5 fXX fXX fSCK
26 fXX
1.5 fSCK
Minimum = (n+1) × + + , Maximum = (n+1) × + +
control becomes invalid (see 18.4.3 (4) (a) Busy control option).

Figure 18-5. Automatic Data Transmit/Receive Interval Specify Register Format (2/4)
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
ADTI ADTI7 0 0 ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 FF6BH 00H R/W
Data Transfer Interval Specification (fXX = 5.0 MHz Operation) ADTI4 ADTI3 ADTI2 ADTI1
223.2 s + 0.5/fSCK
224.8 s + 1.5/fSCK
236.0 s + 0.5/fSCK
237.6 s + 1.5/fSCK
248.8 s + 0.5/fSCK
250.4 s + 1.5/fSCK
261.6 s + 0.5/fSCK
263.2 s + 1.5/fSCK
274.4 s + 0.5/fSCK
276.0 s + 1.5/fSCK
287.2 s + 0.5/fSCK
288.8 s + 1.5/fSCK
300.0 s + 0.5/fSCK
301.6 s + 1.5/fSCK
312.8 s + 0.5/fSCK
314.4 s + 1.5/fSCK
325.6 s + 0.5/fSCK
327.2 s + 1.5/fSCK
338.4 s + 0.5/fSCK
340.0 s + 1.5/fSCK
351.2 s + 0.5/fSCK
352.8 s + 1.5/fSCK
364.0 s + 0.5/fSCK
365.6 s + 1.5/fSCK
376.8 s + 0.5/fSCK
378.4 s + 1.5/fSCK
389.6 s + 0.5/fSCK
391.2 s + 1.5/fSCK
402.4 s + 0.5/fSCK
404.0 s + 1.5/fSCK
415.2 s + 0.5/fSCK
416.8 s + 1.5/fSCK
are found from the following expressions (n: Value set in ADTI0 to ADTI4). However, if a minimum
which is calculated by the following expressions is smaller than 2/fSCK, the minimum interval time
is 2/fSCK.
26 28 0.5 fXX fXX fSCK
Minimum = (n+1) × + +
Maximum = (n+1) × + +
26 36 1.5 fXX fXX fSCK
busy control becomes invalid (see 18.4.3 (4) (a) Busy control option).

Figure 18-5. Automatic Data Transmit/Receive Interval Specify Register Format (3/4)
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
ADTI ADTI7 0 0 ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 FF6BH 00H R/W
Data Transfer Interval Control
No control of interval by ADTINote 1
Control of interval by ADTI (ADTI0 to ADTI4) 1
Data Transfer Interval Specification (fXX = 2.5 MHz Operation) ADTI4 ADTI3 ADTI2 ADTI1
36.8 s + 0.5/fSCK
40.0 s + 1.5/fSCK
62.4 s + 0.5/fSCK
65.6 s + 1.5/fSCK
88.0 s + 0.5/fSCK
91.2 s + 1.5/fSCK
113.6 s + 0.5/fSCK
116.8 s + 1.5/fSCK
139.2 s + 0.5/fSCK
142.4 s + 1.5/fSCK
164.8 s + 0.5/fSCK
168.0 s + 1.5/fSCK
190.4 s + 0.5/fSCK
193.6 s + 1.5/fSCK
216.0 s + 0.5/fSCK
219.2 s + 1.5/fSCK
241.6 s + 0.5/fSCK
244.8 s + 1.5/fSCK
267.2 s + 0.5/fSCK
270.4 s + 1.5/fSCK
292.8 s + 0.5/fSCK
296.0 s + 1.5/fSCK
318.4 s + 0.5/fSCK
321.6 s + 1.5/fSCK
344.0 s + 0.5/fSCK
347.2 s + 1.5/fSCK
369.6 s + 0.5/fSCK
372.8 s + 1.5/fSCK
395.2 s + 0.5/fSCK
398.4 s + 1.5/fSCK
420.8 s + 0.5/fSCK
424.0 s + 1.5/fSCK
are found from the following expressions (n: Value set in ADTI0 to ADTI4). However, if a
minimum which is calculated by the following expressions is smaller than 2/fSCK, the minimum
interval time is 2/fSCK.
26 28 fXX fXX
0.5 fSCK
Minimum = (n+1) × + +
26 36 fXX fXX
1.5 fSCK
Maximum = (n+1) × + +
busy control becomes invalid (see 18.4.3 (4) (a) Busy control option).

Figure 18-5. Automatic Data Transmit/Receive Interval Specify Register Format (4/4)
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
ADTI ADTI7 0 0 ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 FF6BH 00H R/W
Data Transfer Interval Specification (fXX = 2.5 MHz Operation) ADTI4 ADTI3 ADTI2 ADTI1
446.4 s + 0.5/fSCK
449.6 s + 1.5/fSCK
472.0 s + 0.5/fSCK
475.2 s + 1.5/fSCK
497.6 s + 0.5/fSCK
500.8 s + 1.5/fSCK
523.2 s + 0.5/fSCK
526.4 s + 1.5/fSCK
548.8 s + 0.5/fSCK
552.0 s + 1.5/fSCK
574.4 s + 0.5/fSCK
577.6 s + 1.5/fSCK
600.0 s + 0.5/fSCK
603.2 s + 1.5/fSCK
625.6 s + 0.5/fSCK
628.8 s + 1.5/fSCK
651.2 s + 0.5/fSCK
654.4 s + 1.5/fSCK
676.8 s + 0.5/fSCK
680.0 s + 1.5/fSCK
702.4 s + 0.5/fSCK
705.6 s + 1.5/fSCK
728.0 s + 0.5/fSCK
731.2 s + 1.5/fSCK
753.6 s + 0.5/fSCK
756.8 s + 1.5/fSCK
779.2 s + 0.5/fSCK
782.4 s + 1.5/fSCK
804.8 s + 0.5/fSCK
808.0 s + 1.5/fSCK
830.4 s + 0.5/fSCK
833.6 s + 1.5/fSCK
are found from the following expressions (n: Value set in ADTI0 to ADTI4). However, if a minimum
which is calculated by the following expressions is smaller than 2/fSCK, the minimum interval time
is 2/fSCK.
26 28 0.5 fXX fXX fSCK
Minimum = (n+1) × + +
26 36 1.5 fXX fXX fSCK
Maximum = (n+1) × + +
busy control becomes invalid (see 18.4.3 (4) (a) Busy control option).

18.4 Serial Interface Channel 1 Operations
The following three operating modes are available to the serial interface channel 1.
Serial transfer is not carried out in the operation stop mode. Thus, power consumption can be reduced. The serial
I/O shift register 1 (SIO1) does not carry out shift operation either, and thus it can be used as an ordinary 8-bit register.
In the operation stop mode, the P20/SI1, P21/SO1, P22/SCK1, P23/STB and P24/BUSY pins can be used as
ordinary input/output ports.
The operation stop mode is set with the serial operating mode register 1 (CSIM1).
CSIM1 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets CSIM1 to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
CSIM1 CSIE1 DIR ATE 0 0 0 CSIM11 CSIM10
1 Operation Serial Clock Counter
CSIM11 P20 PM21 P21 PM22
P22
P22 (CMOS input/output) ×
× Operation
Clear P20 (CMOS input/output)
automatic data transmit/receive control register (ADTC) to 0).

18.4.2 3-wire serial I/O mode operation
The 3-wire serial I/O mode is valid for connection of peripheral I/O units and display controllers that incorporate
a conventional synchronous serial interface such as the 75X/XL, 78K and 17K Series.
Communication is carried out with three lines of serial clock (SCK1), serial output (SO1) and serial input (SI1).
The 3-wire serial I/O mode is set with the serial operating mode register 1 (CSIM1).
CSIM1 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets CSIM1 to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
CSIM1 CSIE1 DIR ATE 0 0 0 CSIM11 CSIM10
CSIM11
CSIM10
Serial Interface Channel 1 Clock Selection
Clock externally input to SCK1 pinNote 1
8-bit timer register 2 (TM2) output
1 Clock specified with bits 4 to 7 of timer clock select register 3 (TCL3)
Serial Interface Channel 1 Operating Mode Selection
3-wire serial I/O mode
3-wire serial I/O mode with automatic transmit/receive function
MSB
SI1/P20
SO1
LSB
SCK1/P22
CSIE1
CSIM11 P20 PM21 P21 PM22
P22
P22 (CMOS input/output) ×
× Operation
Clear P20 (CMOS input/output)
of the automatic data transmit/receive control register (ADTC) to 0, 0.
to 0).

(2) Communication operation
The 3-wire serial I/O mode is used for data transmission/reception in 8-bit units. Bit-wise data transmission/
reception is carried out in synchronization with the serial clock.
Shift operation of the serial I/O shift register 1 (SIO1) is carried out at the falling edge of the serial clock SCK1.
The transmit data is held in the SO1 latch and is output from the SO1 pin. The receive data input to the SI1
pin is latched into SIO1 at the rising edge of SCK1.
Upon termination of 8-bit transfer, the SIO1 operation stops automatically and the interrupt request flag
(CSIIF1) is set.
SCK1 1 2 3 4 5 6 7 8
DI7 DI6 DI5 DI4 DI3 DI2 DI1 DI0
SO1 DO7 DO6 DO5 DO4 DO3 DO2 DO1 DO0
Transfer Start at the Falling Edge of SCK1
The 3-wire serial I/O mode enables to select transfer to start from MSB or LSB.
Figure 18-7 shows the configuration of the serial I/O shift register 1 (SIO1) and internal bus. As shown in the
figure, MSB/LSB can be read/written in reverse form.
MSB/LSB switching as the start bit can be specified with bit 6 (DIR) of the serial operating mode register 1
(CSIM1).
End of Transfer · SIO1 Write

Figure 18-7. Circuit of Switching in Transfer Bit Order
SI1 Serial I/O Shift Register 1 (SIO1)
SO1
SCK1
Start bit switching is realized by switching the bit order write to SIO1. The SIO1 shift order remains unchanged.
Thus, switching between MSB-first and LSB-first must be performed before writing data to SIO1.
Serial transfer is started by setting transfer data to the serial I/O shift register 1 (SIO1) when the following two
conditions are satisfied.
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-byte data without the use of
software. Once transfer is started, the data prestored in the RAM can be transmitted by the set number of bytes,
and data can be received and stored in the RAM by the set number of bytes.
Handshake signals (STB and BUSY) are supported by hardware to transmit/receive data continuously. OSD (On
Screen Display) LSI and peripheral LSI including LCD controller/driver can be connected without difficulty.
The 3-wire serial I/O mode with automatic transmit/receive function is set with the serial operating mode
register 1 (CSIM1), automatic data transmit/receive control register (ADTC), and automatic data transmit/
receive interval specify register (ADTI).
CSIM1 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets CSIM1 to 00H.

6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
CSIM1 CSIE1 DIR ATE 0 0 0 CSIM11 CSIM10
CSIM11
CSIM10
Serial Interface Channel 1 Clock Selection
Clock externally input to SCK1 pinNote 1
8-bit timer register 2 (TM2) output
1 Clock specified with bits 4 to 7 of timer clock select register 3 (TCL3)
Serial Interface Channel 1 Operating Mode Selection
3-wired serial I/O mode
1 3-wired serial I/O mode with automatic transmit/receive function
MSB
SI1/P20
LSB
CSIM11 P20 PM21 P21 PM22
P22
CSIE1
× Operation
Clear P20 (CMOS input/output)
2 (STRB) of the automatic data transmit/receive control register (ADTC) to 0, 0.
ADTC to 0).

(b) Automatic data transmit/receive control register (ADTC)
ADTC is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets ADTC to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
ADTC RE ARLD ERCE ERR TRF STRB BUSY1 BUSY0 FF69H 00H R/WNote 1
BUSY1
BUSY0
Not using busy input
Busy input enable (active high)
Busy input enable (active low)
STRB
R
TRF
Status of Automatic Transmit/Receive FunctionNote 2
Detection of termination of automatic transmission/ reception (This bit is set to 0 upon suspension of automatic transmission/reception or when ARLD = 0.)
During automatic transmission/reception (This bit is set to 1 when data is written to SIO1.)
ERR
Error Detection of Automatic Transmit/Receive Function
No error (This bit is set to 0 when data is written to SIO1)
ERCE
Error Check Control of Automatic Transmit/ Receive Function
Error check enable (only when BUSY1 = 1)
ARLD
Operating Mode Selection of Automatic Transmit/ Receive Function
RE
Receive Control of Automatic Transmit/Receive Function
mode register 1 (CSIM1) set to 0, set STRB and BUSY1 of ADTC to 0, 0 (handshake
control cannot be executed when the external clock is input).

(c) Automatic data transmit/receive interval specify register (ADTI)
This register sets the automatic data transmit/receive function data transfer interval.
ADTI is set with a 1-bit or 8-bit memory manipulation instruction. RESET input sets ADTI to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
ADTI ADTI7 0 0 ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 FF6BH 00H R/W
Data Transfer Interval Control
No control of interval by ADTINote 1
Control of interval by ADTI (ADTI0 to ADTI4) 1
Data Transfer Interval Specification (fXX = 5.0 MHz Operation) ADTI4 ADTI3 ADTI2 ADTI1
18.4 s + 0.5/fSCK
20.0 s + 1.5/fSCK
31.2 s + 0.5/fSCK
32.8 s + 1.5/fSCK
44.0 s + 0.5/fSCK
45.6 s + 1.5/fSCK
56.8 s + 0.5/fSCK
58.4 s + 1.5/fSCK
69.6 s + 0.5/fSCK
71.2 s + 1.5/fSCK
82.4 s + 0.5/fSCK
84.0 s + 1.5/fSCK
95.2 s + 0.5/fSCK
96.8 s + 1.5/fSCK
108.0 s + 0.5/fSCK
109.6 s + 1.5/fSCK
120.8 s + 0.5/fSCK
122.4 s + 1.5/fSCK
133.6 s + 0.5/fSCK
135.2 s + 1.5/fSCK
146.4 s + 0.5/fSCK
148.0 s + 1.5/fSCK
159.2 s + 0.5/fSCK
160.8 s + 1.5/fSCK
172.0 s + 0.5/fSCK
173.6 s + 1.5/fSCK
184.8 s + 0.5/fSCK
186.4 s + 1.5/fSCK
197.6 s + 0.5/fSCK
199.2 s + 1.5/fSCK
210.4 s + 0.5/fSCK
212.0 s + 1.5/fSCK
intervals are found from the following expressions (n: Value set in ADTI0 to ADTI4).
However, if a minimum which is calculated by the following expressions is smaller than 2/
fSCK, the minimum interval time is 2/fSCK.
Minimum = (n+1) × + + , Maximum = (n+1) × + +
26 fXX fSCK 28 0.5 fXX fSCK 36 1.5 fXX
busy control becomes invalid (see 18.4.3 (4) (a) Busy control option).

6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
ADTI ADTI7 0 0 ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 FF6BH 00H R/W
Data Transfer Interval Specification (fXX = 5.0 MHz Operation) ADTI4 ADTI3 ADTI2 ADTI1
223.2 s + 0.5/fSCK
224.8 s + 1.5/fSCK
236.0 s + 0.5/fSCK
237.6 s + 1.5/fSCK
248.8 s + 0.5/fSCK
250.4 s + 1.5/fSCK
261.6 s + 0.5/fSCK
263.2 s + 1.5/fSCK
274.4 s + 0.5/fSCK
276.0 s + 1.5/fSCK
287.2 s + 0.5/fSCK
288.8 s + 1.5/fSCK
300.0 s + 0.5/fSCK
301.6 s + 1.5/fSCK
312.8 s + 0.5/fSCK
314.4 s + 1.5/fSCK
325.6 s + 0.5/fSCK
327.2 s + 1.5/fSCK
338.4 s + 0.5/fSCK
340.0 s + 1.5/fSCK
351.2 s + 0.5/fSCK
352.8 s + 1.5/fSCK
364.0 s + 0.5/fSCK
365.6 s + 1.5/fSCK
376.8 s + 0.5/fSCK
378.4 s + 1.5/fSCK
389.6 s + 0.5/fSCK
391.2 s + 1.5/fSCK
402.4 s + 0.5/fSCK
404.0 s + 1.5/fSCK
415.2 s + 0.5/fSCK
416.8 s + 1.5/fSCK
are found from the following expressions (n: Value set in ADTI0 to ADTI4). However, if a minimum
which is calculated by the following expressions is smaller than 2/fSCK, the minimum interval time
is 2/fSCK.
Minimum = (n+1) × + +
26 fXX
28 0.5 fXX fSCK
26 fXX
Maximum = (n+1) × + +
36 1.5 fXX fSCK
busy control becomes invalid (see 18.4.3 (4) (a) Busy control option).

6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
ADTI ADTI7 0 0 ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 FF6BH 00H R/W
Data Transfer Interval Control
No control of interval by ADTINote 1
Control of interval by ADTI (ADTI0 to ADTI4) 1
Data Transfer Interval Specification (fXX = 2.5 MHz Operation) ADTI4 ADTI3 ADTI2 ADTI1
36.8 s + 0.5/fSCK
40.0 s + 1.5/fSCK
62.4 s + 0.5/fSCK
65.6 s + 1.5/fSCK
88.0 s + 0.5/fSCK
91.2 s + 1.5/fSCK
113.6 s + 0.5/fSCK
116.8 s + 1.5/fSCK
139.2 s + 0.5/fSCK
142.4 s + 1.5/fSCK
164.8 s + 0.5/fSCK
168.0 s + 1.5/fSCK
190.4 s + 0.5/fSCK
193.6 s + 1.5/fSCK
216.0 s + 0.5/fSCK
219.2 s + 1.5/fSCK
241.6 s + 0.5/fSCK
244.8 s + 1.5/fSCK
267.2 s + 0.5/fSCK
270.4 s + 1.5/fSCK
292.8 s + 0.5/fSCK
296.0 s + 1.5/fSCK
318.4 s + 0.5/fSCK
321.6 s + 1.5/fSCK
344.0 s + 0.5/fSCK
347.2 s + 1.5/fSCK
369.6 s + 0.5/fSCK
372.8 s + 1.5/fSCK
395.2 s + 0.5/fSCK
398.4 s + 1.5/fSCK
420.8 s + 0.5/fSCK
424.0 s + 1.5/fSCK
intervals are found from the following expressions (n: Value set in ADTI0 to ADTI4).
However, if a minimum which is calculated by the following expressions is smaller than 2/
fSCK, the minimum interval time is 2/fSCK.
26 fXX
28 0.5 fXX fSCK
Minimum = (n+1) × + +
Maximum = (n+1) × + +
26 fXX
36 1.5 fXX fSCK
busy control becomes invalid (see 18.4.3 (4) (a) Busy control option).

6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
ADTI ADTI7 0 0 ADTI4 ADTI3 ADTI2 ADTI1 ADTI0 FF6BH 00H R/W
Data Transfer Interval Specification (fXX = 2.5 MHz Operation) ADTI4 ADTI3 ADTI2 ADTI1
446.4 s + 0.5/fSCK
449.6 s + 1.5/fSCK
472.0 s + 0.5/fSCK
475.2 s + 1.5/fSCK
497.6 s + 0.5/fSCK
500.8 s + 1.5/fSCK
523.2 s + 0.5/fSCK
526.4 s + 1.5/fSCK
548.8 s + 0.5/fSCK
552.0 s + 1.5/fSCK
574.4 s + 0.5/fSCK
577.6 s + 1.5/fSCK
600.0 s + 0.5/fSCK
603.2 s + 1.5/fSCK
625.6 s + 0.5/fSCK
628.8 s + 1.5/fSCK
651.2 s + 0.5/fSCK
654.4 s + 1.5/fSCK
676.8 s + 0.5/fSCK
680.0 s + 1.5/fSCK
702.4 s + 0.5/fSCK
705.6 s + 1.5/fSCK
728.0 s + 0.5/fSCK
731.2 s + 1.5/fSCK
753.6 s + 0.5/fSCK
756.8 s + 1.5/fSCK
779.2 s + 0.5/fSCK
782.4 s + 1.5/fSCK
804.8 s + 0.5/fSCK
808.0 s + 1.5/fSCK
830.4 s + 0.5/fSCK
833.6 s + 1.5/fSCK
are found from the following expressions (n: Value set in ADTI0 to ADTI4). However, if a minimum
which is calculated by the following expressions is smaller than 2/fSCK, the minimum interval time
is 2/fSCK.
26 fXX
28 0.5 fXX fSCK
Minimum = (n+1) × + +
26 fXX
36 1.5 fXX fSCK
Maximum = (n+1) × + +
busy control becomes invalid (see 18.4.3 (4) (a) Busy control option).

(2) Automatic transmit/receive data setting
(a) Transmit data setting
Write transmit data from the least significant address FAC0H of internal buffer RAM (up to FADFH
at maximum). The transmit data should be in the order from high-order address to low-order
address.
Set to the automatic data transmit/receive address pointer (ADTP) the value obtained by
subtracting 1 from the number of transmit data bytes.
Set bit 7 (CSIE1) and bit 5 (ATE) of serial operating mode register 1 (CSIM1) to “1”.
Set bit 7 (RE) of the automatic data transmit/receive control register (ADTC) to 1.
Set a data transmit/receive interval in the automatic data transmit/receive interval specify register
(ADTI).
Write any value to the serial I/O shift register 1 (SIO1) (transfer start trigger).
the written value has no meaning.
The following operations are automatically carried out when (a) and (b) are set.
is carried out (start of automatic transmission/reception).
transmission/reception continues until the ADTP decremental output becomes 00H and
address FAC0H data is output (end of automatic transmission/reception).

(3) Communication operation
(a) Basic transmission/reception mode
This transmission/reception mode is the same as the 3-wire serial I/O mode in which specified number
of data are transmitted/received in 8-bit units.
Serial transmission is started by writing the desired data to serial I/O shift register 1 (SIO1) when bit 7
(CSIE1) of serial operation mode register 1 (CSIM1) is set at 1.
When the final byte has been sent, an interrupt request flag (CSIIF1) is set. However, judge the termination
of auto send and receive, not by CSIIF1 (interrupt request flag) but by bit 3 (TRF) of the auto data send
and receive control register (ADTC).
If busy control and strobe control are not executed, the P23/STB and P24/BUSY pins can be used as
normal input/output ports.
Figure 18-8 shows the basic transmission/reception mode operation timings, and Figure 18-9 shows the
operation flowchart. Figure 18-10 shows the operation of the internal buffer RAM when 6 bytes of data
are transmitted or received.
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
TRF
Cautions 1. Because, in the basic transmission/reception mode, the automatic transmit/receive
function writes/reads data to/from the internal buffer RAM after 1-byte transmission/
reception, an interval is inserted till the next transmission/reception. As the internal
buffer RAM write/read is performed at the same time as CPU processing, the
maximum interval is dependent upon CPU processing and the value of the automatic
receive interval time").
Interval

Figure 18-9. Basic Transmission/Reception Mode Flowchart
Write transmit data in internal buffer RAM
Set ADTP to the value (pointer value) obtained by subtracting 1
from the number of transmit
Set the transmission/reception operation interval time in ADTI
Write any data to SIO1
Write transmit data from internal buffer RAM to SIO1
Write receive data from SIO1 to internal buffer RAM
Pointer value = 0

In 6-byte transmission/reception (ARLD = 0, RE = 1) in basic transmit/receive mode, internal buffer RAM operates
as follows.
After any data has been written to serial I/O shift register 1 (SIO1) (start trigger: this data is not
transferred), transmit data 1 (T1) is transferred from the internal buffer RAM to SIO1. When
transmission of the first byte is completed, the receive data 1 (R1) is transferred from SIO1 to the
internal buffer RAM, and automatic data transmit/receive address pointer (ADTP) is decremented.
Then transmit data 2 (T2) is transferred from the internal buffer RAM to SIO1.
Transmission/reception of the third byte is completed, and transmit data 4 (T4) is transferred from
the internal buffer RAM to SIO1. When transmission of the fourth byte is completed, the receive data
4 (R4) is transferred from SIO1 to the internal buffer RAM, and ADTP is decremented.
When transmission of the sixth byte is completed, the receive data 6 (R6) is transferred from SIO1
to the internal buffer RAM, and the interrupt request flag (CSIIF1) is set (INTCSI1 generation).
(in Basic Transmit/Receive Mode) (1/2)
(a) Before transmission/reception
FADFH
FAC5H
Transmit data 1 (T1)
Receive data 1 (R1) SIO1
Transmit data 2 (T2)
Transmit data 3 (T3)
Transmit data 4 (T4)
Transmit data 5 (T5)
Transmit data 6 (T6)

Figure 18-10. Internal Buffer RAM Operation in 6-Byte Transmission/Reception
(in Basic Transmit/Receive Mode) (2/2)
(b) 4th byte transmission/reception
FADFH
FAC5H
Receive data 1 (R1)
Receive data 4 (R4) SIO1
Receive data 2 (R2)
Receive data 3 (R3)
Transmit data 4 (T4)
Transmit data 5 (T5)
Transmit data 6 (T6)
(c) Completion of transmission/reception
FADFH
FAC5H
Receive data 1 (R1)
Receive data 2 (R2)
Receive data 3 (R3)
Receive data 4 (R4)
Receive data 5 (R5)
Receive data 6 (R6)

(b) Basic transmission mode
In this mode, the specified number of 8-bit unit data are transmitted.
Serial transmission is started by writing the desired data to serial I/O shift register 1 (SIO1) when bit 7
(CSIE1) of serial operation mode register 1 (CSIM1) is set at 1.
When the final byte has been sent, an interrupt request flag (CSIIF1) is set. However, judge the termination
of auto send and receive, not by CSIIF1 (interrupt request flag) but by bit 3 (TRF) of the auto data send
and receive control register (ADTC).
If receive operation, busy control and strobe control are not executed, the P20/SI1, P23/STB and P24/
BUSY pins can be used as normal input/ports.
Figure 18-11 shows the basic transmission mode operation timings, and Figure 18-12 shows the operation
flowchart. Figure 18-13 shows the operation of the internal buffer RAM when 6 bytes of data are
transmitted or received.
SCK1
SO1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
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 till the next transmission. As the internal buffer RAM read is performed at
the same time as CPU processing, the maximum interval is dependent upon CPU
register (ADTI) (see (5) "Automatic transmit/receive interval time").
Interval

Figure 18-12. Basic Transmission Mode Flowchart
Write transmit data in internal buffer RAM
Set ADTP to the value (pointer value) obtained by subtracting 1
from the number of transmit
Set the transmission/reception operation interval time in ADTI
Write any data to SIO1
Write transmit data from internal buffer RAM to SIO1
Pointer value = 0

In 6-byte transmission (ARLD=0, RE=0) in basic transmit mode, internal buffer RAM operates as follows.
After any data has been written to serial I/O shift register 1 (SIO1) (start trigger: this data is not
transferred), transmit data 1 (T1) is transferred from the internal buffer RAM to SIO1. When
transmission of the first byte is completed, automatic data transmit/receive address pointer (ADTP)
is decremented. Then transmit data 2 (T2) is transferred from the internal buffer RAM to SIO1.
Transmission of the third byte is completed, and transmit data 4 (T4) is transferred from the internal
buffer RAM to SIO1. When transmission of the fourth byte is completed, ADTP is decremented.
When transmission of the sixth byte is completed, the interrupt request flag (CSIIF1) is set (INTCSI1
generation).
(in Basic Transmit Mode) (1/2)
(a) Before transmission
FADFH
FAC5H
Transmit data 1 (T1)
Transmit data 2 (T2)
Transmit data 3 (T3)
Transmit data 4 (T4)
Transmit data 5 (T5)
Transmit data 6 (T6)

Figure 18-13. Internal Buffer RAM Operation in 6-Byte Transmission
(in Basic Transmit Mode) (2/2)
(b) 4th byte transmission point
FADFH
FAC5H
Transmit data 1 (T1)
Transmit data 2 (T2)
Transmit data 3 (T3)
Transmit data 4 (T4)
Transmit data 5 (T5)
Transmit data 6 (T6)
(c) Completion of transmission
FADFH
FAC5H
Transmit data 1 (T1)
Transmit data 2 (T2)
Transmit data 3 (T3)
Transmit data 4 (T4)
Transmit data 5 (T5)
Transmit data 6 (T6)

(c) Repeat transmission mode
In this mode, data stored in the internal buffer RAM is transmitted repeatedly.
Serial transmission is started by writing the desired data to serial I/O shift register 1 (SIO1) when bit 7
(CSIE1) of serial operation mode register 1 (CSIM1) is set at 1.
Unlike the case of the basic transmission mode, an interrupt request flag (CSIIF1) is not set after sending
the final byte (FAC0H address data), but the auto data send and receive address pointer (ADTP) is reset
to the value it was at when transmission was started and the contents of the internal buffer’s RAM are
resent.
When a reception operation, busy control and strobe control are not performed, the P20/SI1, P23/STB
and P24/BUSY pins can be used as ordinary input/output ports.
The repeat transmission mode operation timing is shown in Figure 18-14, and the operation flowchart in
Figure 18-15. Figure 18-16 shows the operation of the internal buffer RAM when 6 bytes of data are
transmitted in the repeat transmission mode.
SCK1
SO1
D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
after the transmission of one byte, the interval is included in the period up to the next
transmission. As the internal buffer RAM read is performed at the same time as CPU
processing, the maximum interval is dependent upon the CPU operation and the value
matic transmit/receive interval time").
Interval Interval

Figure 18-15. Repeat Transmission Mode Flowchart
Write transmit data in internal buffer RAM
Set ADTP to the value (pointer value) obtained by subtracting 1
from the number of transmit
Set the transmission/reception operation interval time in ADTI
Write any data to SIO1
Write transmit data from internal buffer RAM to SIO1
Pointer value = 0

In 6-byte transmission (ARLD = 1, RE = 0) in repeat transmit mode, internal buffer RAM operates as follows.
After any data has been written to serial I/O shift register 1 (SIO1) (start trigger: this data is not
transferred), transmit data 1 (T1) is transferred from the internal buffer RAM to SIO1. When
transmission of the first byte is completed, automatic data transmit/receive address pointer (ADTP)
is decremented. Then transmit data 2 (T2) is transferred from the internal buffer RAM to SIO1.
Even when sending of the 6th byte is completed, the interrupt request flag (CSIIF1) is not set. The
initial pointer value is reset in ADTP.
Transmit data 1 (T1) is transferred from the internal buffer RAM to SIO1 again. When transmission
of the first byte is completed, ADTP is decremented. Then transmit data 2 (T2) is transferred from
the internal buffer RAM to SIO1.
(in Repeat Transmit Mode) (1/2)
(a) Before transmission
FADFH
FAC5H
Transmit data 1 (T1)
Transmit data 2 (T2)
Transmit data 3 (T3)
Transmit data 4 (T4)
Transmit data 5 (T5)
Transmit data 6 (T6)

Figure 18-16. Internal Buffer RAM Operation in 6-Byte Transmission
(in Repeat Transmit Mode) (2/2)
(b) Upon completion of transmission of 6 bytes
FADFH
FAC5H
Transmit data 1 (T1)
Transmit data 2 (T2)
Transmit data 3 (T3)
Transmit data 4 (T4)
Transmit data 5 (T5)
Transmit data 6 (T6)
(c) 7th byte transmission point
FADFH
FAC5H
Transmit data 1 (T1)
Transmit data 2 (T2)
Transmit data 3 (T3)
Transmit data 4 (T4)
Transmit data 5 (T5)
Transmit data 6 (T6)

(d) Automatic transmission/reception suspending and restart
Automatic transmission/reception can be temporarily suspended by setting bit 7 (CSIE1) of the serial
operating mode register 1 (CSIM1) to 0.
If during 8-bit data transfer, the transmission/reception is not suspended if bit 7 (CSIE1) is set to 0. It
is suspended upon completion of 8-bit data transfer.
When suspended, bit 3 (TRF) of the automatic data transmit/receive control register (ADTC) is set to 0
after transfer of the 8th bit, and all the port pins used with the serial interface pins for dual function (P20/
SI1, P21/SO1, P22/SCK1, P23/STB and P24/BUSY) are set to the port mode.
To restart auto send and receive, set CSIE1 at 1 and write the desired value in serial I/O shift register
1 (SIO1). The remaining can be transmitted in this way.
fer is suspended and the HALT mode is set if during 8-bit data transfer. When the
suspended point.
mode to 3-wire serial I/O mode while TRF=1.
Suspend CSIE1 = 0 (Suspended Command)
Restart Command CSIE1 = 1, Write to SIO1
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

(4) Synchronization control
Busy control and strobe control are functions for synchronizing sending and receiving between the master
device and slave device.
By using these functions, it is possible to detect bit slippage during sending and receiving.
Busy control is a function which causes the master device’s serial transmission to wait when the slave
device outputs a busy signal to the master device, and maintain the wait state while that busy signal is
active.
When the busy control option is used, the conditions shown below are necessary.
The system configuration between the master device and slave device in cases where the busy control
option is used is shown in Figure 18-18.
Master Device ( PD78058F, 78058FY Subseries) Slave Device µ
SCK1
SO1
SO1 SI1
SI1
BUSY
The master device inputs the busy signal output by the slave device to pin BUSY/P24. In sync with the
fall of the serial clock, the master device samples the input busy signal. Even if the busy signal becomes
active during sending or receiving of 8 bit data, the wait does not apply. If the busy signal becomes active
at the rise of the serial clock 2 clock cycles after sending or receiving of 8 bit data ends, the busy input
first becomes effective at that point, and thereafter, sending or receiving of data waits during the period
that the busy signal is active.
The busy signal’s active level is set in bit 0 (BUSY0) of ADTC.

Furthermore, in the case that the busy control option is used, select the internal clock for the serial clock.
The busy signal cannot be controlled with an external clock.
The operation timing when the busy control option is used is shown in Figure 18-19.
data send and receive interval instruction register (ADIT). If both are used simultane-
ously, busy control becomes invalid.
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
If the busy signal becomes inactive, the wait is canceled. If the sampled busy signal is inactive, sending
or receiving of the next 8 bit data begins from the fall of the next serial clock cycle.
Furthermore, the busy signal is asynchronous with the serial clock, so even if the slave side inactivates
the busy signal, it takes nearly 1 clock cycle at the most until it is sampled again. Also, it takes another
0.5 clock cycle after sampling until data transmission resumes.
Therefore, in order to definitely cancel a wait state, it is necessary for the slave side to keep the busy
signal for at least 1.5 clock cycles.
Figure 18-20 shows the timing of the busy signal and wait cancel. In this figure, an example of the case
where the busy signal becomes active when sending or receiving starts is shown.
Wait · Busy Input Release · Busy Input Valid

Figure 18-20 Busy Signal and Wait Cancel (When BUSY0 = 0)
SCK1
D7 SO1
D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0
1.5 clocks (min.)
In the case where the busy signal becomes inactive directly when sampled
BUSY Input Release Wait
Strobe control is a function for synchronizing the sending and receiving of data between a master device
and slave device. When sending or receiving of 8 bit data ends, the strobe signal is output by the master
device from pin STB/P23. By doing this, it is possible for the slave device to know the master transmission
end timing. Therefore, even if there is noise in the serial clock and bit slippage occurs, synchronization
is maintained and bit slippage has no effect on transmission of the next byte.
In the case that the strobe control option is used, the conditions shown below are necessary.
Normally, busy control and strobe control are used simultaneously as handshake signals. In this case,
together with output of the strobe signal from pin STB/P23, pin BUSY/P24 can be sampled and sending
or receiving can wait while the busy signal is being input.
If strobe control is not carried out, pin P23/STB can be used as a normal I/O port.
Operation timing when busy and strobe control are used is shown in Figure 18-21.
Furthermore, if strobe control is used, the interrupt request flag (CSIIF1), set when sending or receiving
ends, is set after the strobe signal is output.
BUSY (Active High) · BUSY Input Valid

Figure 18-21. Operation Timings When Using Busy & Strobe Control Option (BUSY0 = 0)
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
CSIIF1
TRF
Busy Input Release · Busy Input Valid

(c) Bit Slippage Detection Function Through the Busy Signal
During an auto send and receive operation, noise occur in the serial clock signal output by the master
device and bit slippage may occur in the slave device side serial clock. At this time, if the strobe control
option is not used, this bit slippage will have an effect on sending of the next byte. In such a case, the
busy control option can be used on the master device side and, by checking the busy signal during sending,
bit slippage can be detected.
Bit slippage detection through the busy signal is accomplished as follows.
The slave side outputs a busy signal after the serial clock rises on the 8th cycle of data sending or receiving
(at this time, if application of the wait state by the busy signal is not desired, the busy signal is made inactive
within 2 clock cycles).
The master device side samples the busy signal in sync with the fall of the serial clock’s front side. If
no bit slippage is occurring, the busy signal will be inactive in sampling for 8 clock cycles. If the busy
signal is found to be active in sampling, it is regarded as an occurrence of bit slippage error processing
is executed (bit 4 (ERR) of the auto data send and receive control register (ADTC) is set at (1)).
The operation timing of the bit slippage detection function through the busy signal is shown in Figure 18-
Figure 18-22. Operation Timing of the Bit Slippage Detection Function Through the Busy Signal
Bit Slippage Due to Noise
SO1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D7 D6 D5 D4 D3 D2 D1
SI1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D7 D6 D5 D4 D3 D2 D1
BUSY
CSIIF1
CSIE1
ERR
Error Interrupt Request Generation

(5) Automatic transmit/receive interval time
When using the automatic transmit/receive function, the read/write operations from/to the internal buffer RAM
are performed after transmitting/receiving one byte. Therefore, an interval is inserted before the next transmit/
receive.
Since the read/write operations from/to the internal buffer RAM are performed in parallel with the CPU
processing when using the automatic transmit/receive function by the internal clock, the interval depends on
the value which is set in the automatic transmit/receive interval specification register (ADTI) and the CPU
processing at the rising edge of the eighth serial clock. Whether it depends on the ADTI or not can be selected
by the setting of its bit 7 (ADTI7). When it is set to 0, the interval depends only on the CPU processing. When
it is set to 1, the interval depends on the contents of the ADTI or CPU processing, whichever is greater.
When the automatic transmit/receive function is used by an external clock, it must be selected so that the
interval may be longer than the value indicated in Table 18-3.
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
Interval

(a) When the automatic transmit/receive function is used by the internal clock
If bit 1 (CSIM11) of serial operation mode register 1 (CSIM1) is set at (1), the internal clock operates.
If the auto send and receive function is operated by the internal clock, interval timing by CPU processing
is as follows.
When bit 7 (ADTI7) of automatic data transmit/receive interval specify register (ADTI) is set to 0, the
interval depends on the CPU processing. When ADTI7 is set to 1, it depends on the contents of the ADTI
or CPU processing, whichever is greater.
Refer to Figure 18-5 Automatic Data Transmit/Receive Interval Specify Register Format for the
intervals which are set by the ADTI.
Table 18-2. Interval Timing Through CPU Processing (When the Internal Clock Is Operating)
CPU Processing Interval Time
When using multiplication instruction Max. (2.5TSCK, 13TCPU)
When using division instruction Max. (2.5TSCK, 20TCPU)
External access 1 wait mode Max. (2.5TSCK, 9TCPU)
Other than above Max. (2.5TSCK, 7TCPU)
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 selection register (OSMS))
Internal Clock
T CPU
T SCK
SCK1
SO1
D7 D6 D5 D4 D3 D2 D1 D0
SI1
D7 D6 D5 D4 D3 D2 D1 D0
fCPU : CPU clock (set by bit 0 to bit 2 (PCC0 to PCC2) of the processor clock control register (PCC)
and bit 0 (MCS) of the oscillation mode select register (OSMS).
fX · fCPU · Interval

(b) When the automatic transmit/receive function is used by the external clock
If bit 1 (CSIM11) of serial operation mode register 1 (CSIM1) is cleared to 0, external clock operation is
set.
When the automatic transmit/receive function is used by the external clock, it must be selected so that
the interval may be longer than the values shown as follows.
Table 18-3. Interval Timing Through CPU Processing (When the External Clock Is Operating)
CPU Processing Interval Time
When using multiplication instruction 13TCPU
When using division instruction 20TCPU
External access 1 wait mode 9TCPU
Other than above 7TCPU
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 selection register (OSMS))
![Page 432 of the NEC PD78056F user manual — [MEMO]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-432.webp?w=400)

19.1 Serial Interface Channel 2 Functions
Serial interface channel 2 has the following three modes.
This mode is used when serial transfer is not carried out to reduce power consumption.
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 scaling the input clock to the ASCK pin.
The MIDI standard baud rate (31.25 kbps) can be used by employing the dedicated UART baud rate generator.
In this mode, 8-bit data transfer is performed using three lines: the serial clock (SCK2), and serial data lines
(SI2, SO2).
In the 3-wire serial I/O mode, simultaneous transmission and reception is possible, increasing the data transfer
processing speed.
Either the MSB or LSB can be specified as the start bit for an 8-bit data serial transfer, allowing connection
to devices using either as the start bit.
The 3-wire serial I/O mode is useful for connection to peripheral I/Os and display controllers, etc., which
incorporate a conventional synchronous clocked serial interface, such as the 75X/XL Series, 78K Series,
17K Series, etc.
rate generator can be used for the operation clock. It is not possible to use a clock that is
input to pin SCK2 from the outside.

19.2 Serial Interface Channel 2 Configuration
Serial interface channel 2 consists of the following hardware.
Register Transmit shift register (TXS)
Receive shift register (RXS)
Receive buffer register (RXB)
Control register Serial operating mode register 2 (CSIM2)
Asynchronous serial interface mode register (ASIM)
Asynchronous serial interface status register (ASIS)
Baud rate generator control register (BRGC)
Port Mode Register 7 (PM7)Note
Item Configuration

Figure 19-1. Serial Interface Channel 2 Block Diagram


Figure 19-2. Baud Rate Generator Block Diagram
TXE CSIE2
Start Bit Sampling Clock
Selector fxx to fxx/210
RXE Start Bit Detection
MDL3 MDL2 MDL1 MDL0

(1) Transmit shift register (TXS)
This register is used to set the transmit data. The data written in TXS is transmitted as serial data.
If the data length is specified as 7 bits, bits 0 to 6 of the data written in TXS are transferred as transmit data.
Writing data to TXS starts the transmit operation.
TXS is written to with an 8-bit memory manipulation instruction. It cannot be read.
TXS value is FFH after RESET input.
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.
This register is used to convert serial data input to the RxD pin to parallel data. When one byte of data is
received, the receive data is transferred to the receive buffer register (RXB).
RXS cannot be directly manipulated by a program.
This register holds receive data. Each time one byte of data is received, new receive data is transferred from
the receive shift register (RXS).
If the data length is specified as 7 bits, the receive data is transferred to bits 0 to 6 of RXB, and the MSB of
RXB is always set to 0.
RXB is read with an 8-bit memory manipulation instruction. It cannot be written to.
RXB value is FFH after RESET input.
when a write instruction to RXB is performed, the value is written to TXS.
This circuit performs transmit operation control such as the addition of a start bit, parity bit and stop bit to data
written in the transmit shift register (TXS) in accordance with the contents set in the asynchronous serial
interface mode register (ASIM).
This circuit controls receive operations in accordance with the contents set in the asynchronous serial interface
mode register (ASIM). It performs error checks for parity errors, etc., during a receive operation, and if an
error is detected, sets a value in the asynchronous serial interface status register (ASIS) in accordance with
the error contents.

19.3 Serial Interface Channel 2 Control Registers
Serial interface channel 2 is controlled by the following four registers.
This register is set when serial interface channel 2 is used in the 3-wire serial I/O mode.
CSIM2 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets CSIM2 to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
22 CSCK 0 FF72H 00H R/W
CSCK
Serial Operating Mode Selection
3-wire serial I/O mode
MSB
LSB
CSIE2
Operation Control in 3-wire Serial I/O Mode

(2) Asynchronous serial interface mode register (ASIM)
This register is set when serial interface channel 2 is used in the asynchronous serial interface mode.
ASIM is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets ASIM to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
ASIM TXE RXE PS1 PS0 CL SL ISRM SCK FF70H 00H R/W
Clock Selection in Asynchronous Serial Interface Mode
Input clock from off-chip to ASCK pin
Dedicated baud rate generator outputNote
Control of Reception Completion Interrupt Request in Case of Error Generation
Reception completion interrupt request generated in case of error generation
Reception completion interrupt request not generated in case of error generation
SL Transmit Data Stop Bit Length Specification
PS0
0 parity always added in transmission No parity test in reception (parity error not generated) 0 1
1 Odd parity 0
TXE
an input/output port.

Table 19-2. Serial Interface Channel 2 Operating Mode Settings
(1) Operation Stop Mode
Shift Clock Start Bit TXE RXE SCK CSIE2 CSIM22 CSCK
P70/SI2 /RxD Pin Functions
P71/SO2 /TxD Pin Functions
P72/SCK2 /ASCK Pin Functions
0 0 × 0 × × ×
Other than above Setting prohibited
Shift Clock Start Bit TXE RXE SCK CSIE2 CSIM22 CSCK
P70/SI2 /RxD Pin Functions
P71/SO2 /TxD Pin Functions
P72/SCK2 /ASCK Pin Functions
1 Note 2 ×
0 0 0 1
LSB
SI2
Other than above Setting prohibited
Shift Clock Start Bit TXE RXE SCK CSIE2 CSIM22 CSCK
P70/SI2 /RxD Pin Functions
P71/SO2 /TxD Pin Functions
P72/SCK2 /ASCK Pin Functions
P70 TxD (CMOS output)
0 1 1 × TxD (CMOS output)
Other than above Setting prohibited

(3) Asynchronous serial interface status register (ASIS)
This is a register which displays the type of error when a reception error is generated in the asynchronous
serial interface mode.
ASIS is read with 8-bit memory manipulation instruction.
In 3-wire serial I/O mode, the contents of the ASIS are undefined.
RESET input sets ASIS to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
ASIS 0 FE OVE FF71H 00H R
OVE
Overrun error not generated
Overrun error generatedNote 1 (When next receive operation is completed before data from receive buffer register is read)
Framing error not generated
Framing error generatedNote 2 (When stop bit is not detected)
Parity error not generated
Parity error generated (When transmit data parity does not match)
will continue to be generated until RXB is read.
mode register (ASIM), only single stop bit detection is performed during reception.
Overrun Error Flag · Framing Error Flag · Parity Error Flag

(4) Baud rate generator control register (BRGC)
This register sets the serial clock for serial interface channel 2.
BRGC is set with an 8-bit memory manipulation instruction.
RESET input sets BRGC to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
BRGC TPS3 TPS2 TPS1 TPS0 MDL3 MDL2 MDL1 MDL0 FF73H 00H R/W
Baud Rate Generator Input Clock Selection MDL3 MDL2 MDL1 MDL0

Figure 19-6. Baud Rate Generator Control Register Format (2/2)
5-Bit Counter Source Clock Selection
TPS3 TPS2 TPS1 TPS0 n
0 fXX/210 fXX/210 (4.9 kHz) fX/211 (2.4 kHz) 11
0 1 0 1 fXX fX (5.0 MHz) fX/2 (2.5 MHz) 1
0 1 1 0 fXX/2 fX/2 (2.5 MHz) fX/22 (1.25 MHz) 2
0 1 1 1 fXX/22 fX/22 (1.25 MHz) fX/23 (625 kHz) 3
1 0 0 0 fXX/23 fX/23 (625 kHz) fX/24 (313 kHz) 4
1 0 0 1 fXX/24 fX/24 (313 kHz) fX/25 (156 kHz) 5
1 0 1 0 fXX/25 fX/25 (156 kHz) fX/26 (78.1 kHz) 6
1 0 1 1 fXX/26 fX/26 (78.1 kHz) fX/27 (39.1 kHz) 7
1 1 0 0 fXX/27 fX/27 (39.1 kHz) fX/28 (19.5 kHz) 8
1 1 0 1 fXX/28 fX/28 (19.5 kHz) fX/29 (9.8 kHz) 9
1 1 1 0 fXX/29 fX/29 (9.8 kHz) fX/210 (4.9 kHz) 10
Other than above Setting prohibited
output is disrupted and communication cannot be performed normally.
Therefore, do not write data to BRGC during a communication operation.

The baud rate transmit/receive clock generated is either a signal scaled from the main system clock, or a signal
scaled from the clock input from the ASCK pin.
(a) Generation of baud rate transmit/receive clock by means of main system clock
The transmit/receive clocks generated by scaling the main system clock. The baud rate generated from
the main system clock is found from the following expression.
[Baud rate] = [Hz]
2n × (k+16)
fx=5.0 MHz fx=4.19 MHz
BRGC Set Value Error (%) BRGC Set Value Error (%) BRGC Set Value Error (%) BRGC Set Value Error (%)
110 06H 0.88 E6H 0.88 03H –2.01 E3H –2.01
150 00H 1.73 E0H 1.73 EBH 1.14 DBH 1.14
300 E0H 1.73 D0H 1.73 DBH 1.14 CBH 1.14
600 D0H 1.73 C0H 1.73 CBH 1.14 BBH 1.14
1200 C0H 1.73 B0H 1.73 BBH 1.14 ABH 1.14
2400 B0H 1.73 A0H 1.73 ABH 1.14 9BH 1.14
4800 A0H 1.73 90H 1.73 9BH 1.14 8BH 1.14
9600 90H 1.73 80H 1.73 8BH 1.14 7BH 1.14
19200 80H 1.73 70H 1.73 7BH 1.14 6BH 1.14
31250 74H 0 64H 0 71H –1.31 61H –1.31
38400 70H 1.73 60H 1.73 6BH 1.14 5BH 1.14
76800 60H 1.73 50H 1.73 5BH 1.14 — —
fXX · Baud · Rate (bps)

(b) Generation of baud rate transmit/receive clock by means of external clock from ASCK pin
The transmit/receive clock is generated by scaling the clock input from the ASCK pin. The baud rate
generated from the clock input from the ASCK pin is obtained with the following expression.
[Baud rate] = [Hz]
Table 19-4. Relationship Between ASCK Pin Input Frequency and Baud Rate (When BRGC Is Set to 00H)
Baud Rate (bps) ASCK Pin Input Frequency
75 2.4 kHz
110 3.52 kHz
150 4.8 kHz
300 9.6 kHz
600 19.2 kHz
1200 38.4 kHz
2400 76.8 kHz
4800 153.6 kHz
9600 307.2 kHz
19200 614.4 kHz
31250 1000.0 kHz
38400 1228.8 kHz
fASCK · 2 × (k+16)

19.4 Serial Interface Channel 2 Operation
Serial interface channel 2 has the following three modes.
In the operation stop mode, serial transfer is not performed, and therefore power consumption can be reduced.
In the operation stop mode, the P70/SI2/RxD, P71/SO2/TxD and P72/SCK2/ASCK pins can be used as normal
input/output ports.
The operation stop mode is set by the serial operating mode register 2 (CSIM2) and asynchronous serial
interface mode register (ASIM).
CSIM2 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets CSIM2 to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
CSIM2 CSIE2 0 CSCK 0 FF72H 00H R/W
Operation Control in 3-wire Serial I/O Mode
Operation stopped · Operation enabled

(b) Asynchronous serial interface mode register (ASIM)
ASIM is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets ASIM to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
ASIM TXE RXE PS1 PS0 CL ISRM SCK FF70H 00H R/W
RXE
TXE

19.4.2 Asynchronous serial interface (UART) mode
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 scaling the input clock to the ASCK pin.
The MIDI standard baud rate (31.25 kbps) can be used by employing the dedicated UART baud rate generator.
The UART mode is set by the serial operating mode register 2 (CSIM2), asynchronous serial interface mode
register (ASIM), asynchronous serial interface status register (ASIS), and baud rate generator control register
(BRGC).
CSIM2 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets CSIM2 to 00H.
When the UART mode is selected, 00H should be set in CSIM2.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
22 CSCK 0
FF72H 00H R/W
CSCK
Serial Operating Mode Selection
3-wire serial I/O mode
MSB
LSB
CSIE2
Operation Control in 3-wire Serial I/O Mode

(b) Asynchronous serial interface mode register (ASIM)
ASIM is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets ASIM to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
ASIM TXE RXE PS1 PS0 CL SL ISRM SCK FF70H 00H R/W
Clock Selection in Asynchronous Serial Interface Mode
Input clock from off-chip to ASCK pin
Dedicated baud rate generator outputNote
Control of Reception Completion Interrupt Request in Case of Error Generation
Reception completion interrupt request generated in case of error generation
Reception completion interrupt request not generated in case of error generation
SL Transmit Data Stop Bit Length Specification
PS0
0 parity always added in transmission No parity test in reception (parity error not generated) 0 1
1 Odd parity 0
TXE
as an input/output port.
mode.

(c) Asynchronous serial interface status register (ASIS)
ASIS is set with 8-bit memory manipulation instruction.
RESET input sets ASIS to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
ASIS 0 FE OVE FF71H 00H R
OVE
Overrun error not generated
Overrun error generatedNote 1 (When next receive operation is completed before data from receive buffer register is read)
Framing error not generated
Framing error generatedNote 2 (When stop bit is not detected)
Parity error not generated
Parity error generated (When transmit data parity does not match)
errors will continue to be generated until RXB is read.
interface mode register (ASIM), only single stop bit detection is performed during reception.
Overrun Error Flag · Framing Error Flag · Parity Error Flag

(d) Baud rate generator control register (BRGC)
BRGC is set with an 8-bit memory manipulation instruction.
RESET input sets BRGC to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
BRGC TPS3 TPS2 TPS1 TPS0 MDL3 MDL2 MDL1 MDL0 FF73H 00H R/W
Baud Rate Generator Input Clock Selection MDL3 MDL2 MDL1 MDL0

5-Bit Counter Source Clock Selection
TPS3 TPS2 TPS1 TPS0 n
0 fXX/210 fX/210 (4.9 kHz) fX/211 (2.4 kHz) 11
0 1 0 1 fXX fX (5.0 MHz) fX/2 (2.5 MHz) 1
0 1 1 0 fXX/2 fX/2 (2.5 MHz) fX/22 (1.25 MHz) 2
0 1 1 1 fXX/22 fX/22 (1.25 MHz) fX/23 (625 kHz) 3
1 0 0 0 fXX/23 fX/23 (625 kHz) fX/24 (313 kHz) 4
1 0 0 1 fXX/24 fX/24 (313 kHz) fX/25 (156 kHz) 5
1 0 1 0 fXX/25 fX/25 (156 kHz) fX/26 (78.1 kHz) 6
1 0 1 1 fXX/26 fX/26 (78.1 kHz) fX/27 (39.1 kHz) 7
1 1 0 0 fXX/27 fX/27 (39.1 kHz) fX/28 (19.5 kHz) 8
1 1 0 1 fXX/28 fX/28 (19.5 kHz) fX/29 (9.8 kHz) 9
1 1 1 0 fXX/29 fX/29 (9.8 kHz) fX/210 (4.9 kHz) 10
Other than above Setting prohibited
output is disrupted and communication cannot be performed normally.
Therefore, do not write data to BRGC during a communication operation.

The baud rate transmit/receive clock generated is either a signal scaled from the main system clock, or
a signal scaled from the clock input from the ASCK pin.
(i) Generation of baud rate transmit/receive clock by means of main system clock
The transmit/receive clock is generated by scaling the main system clock. The baud rate generated
from the main system clock is obtained with the following expression.
[Baud rate] = [Hz]
2n × (k+16)
fx=5.0 MHz fx=4.19 MHz
BRGC Set Value Error (%) BRGC Set Value Error (%) BRGC Set Value Error (%) BRGC Set Value Error (%)
110 06H 0.88 E6H 0.88 03H –2.01 E3H –2.01
150 00H 1.73 E0H 1.73 EBH 1.14 DBH 1.14
300 E0H 1.73 D0H 1.73 DBH 1.14 CBH 1.14
600 D0H 1.73 C0H 1.73 CBH 1.14 BBH 1.14
1200 C0H 1.73 B0H 1.73 BBH 1.14 ABH 1.14
2400 B0H 1.73 A0H 1.73 ABH 1.14 9BH 1.14
4800 A0H 1.73 90H 1.73 9BH 1.14 8BH 1.14
9600 90H 1.73 80H 1.73 8BH 1.14 7BH 1.14
19200 80H 1.73 70H 1.73 7BH 1.14 6BH 1.14
31250 74H 0 64H 0 71H –1.31 61H –1.31
38400 70H 1.73 60H 1.73 6BH 1.14 5BH 1.14
76800 60H 1.73 50H 1.73 5BH 1.14 — —
fXX · Baud · Rate (bps)

(ii) Generation of baud rate transmit/receive clock by means of external clock from ASCK pin
The transmit/receive clock is generated by scaling the clock input from the ASCK pin. The baud rate
generated from the clock input from the ASCK pin is obtained with the following expression.
2 × (k+16) fASCK
[Baud rate] = [Hz]
Table 19-6. Relationship Between ASCK Pin Input Frequency and Baud Rate (When BRGC Is Set to 00H)
Baud Rate (bps) ASCK Pin Input Frequency
75 2.4 kHz
110 3.52 kHz
150 4.8 kHz
300 9.6 kHz
600 19.2 kHz
1200 38.4 kHz
2400 76.8 kHz
4800 153.6 kHz
9600 307.2 kHz
19200 614.4 kHz
31250 1000.0 kHz
38400 1228.8 kHz

(2) Communication operation
(a) Data format
The transmit/receive data format is as shown in Figure 19-7.
Bit Stop Bit Start
D0 D1 D2 D3 D4 D5 D6 D7 Parity
1 data frame is composed of each of the bits shown below.
The character bit length, parity selection, and stop bit length for each data frame is specified with 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 transmission rate is set by ASIM and the baud rate generator control register (BRGC).
If a serial data receive error is generated, the receive error contents can be determined by reading the
status of the asynchronous serial interface status register (ASIS).
One Data Frame · Bit · Character Bits

(b) Parity types and operation
The parity bit is used to detect a bit error in the communication data. Normally, the same kind of parity
bit is used on the transmitting side and the receiving side. With even parity and odd parity, a one-bit (odd
number) error can be detected. With 0 parity and no parity, an error cannot be detected.
The number of bits with a value of “1”, including the parity bit, in the transmit data is controlled to
be even.
The value of the parity bit is as follows:
Number of bits with a value of “1” in transmit data is odd: 1
Number of bits with a value of “1” in transmit data is even: 0
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.
Conversely to the situation with even parity, the number of bits with a value of “1”, including the
parity bit, in the transmit data is controlled to be odd. The value of the parity bit is as follows:
Number of bits with a value of “1” in transmit data is odd: 0
Number of bits with a value of “1” in transmit data is even: 1
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.
When transmitting, the parity bit is set to "0" irrespective of the transmit data.
When receiving, the parity bit is not checked. Therefore, a parity error is not generated, irrespective
of whether the parity bit is set to "0" or "1".
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 is not generated.

(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.
Request Generation Timing
(a) Stop bit length: 1
STOP
D1 D2 D6 D7 Parity D0 TxD (Output)
INTST
(b) Stop bit length: 2
D1 D2 D6 D7 Parity D0 TxD (Output)
START
INTST
performed during a transmit operation. If rewriting of the ASIM register is performed
state is restored by RESET input).
It is possible to determine whether transmission is in progress by software by using a
set by the INTST.

(d) Reception
When bit 6 (RXE) of the asynchronous serial interface mode register (ASIM) is set (1), a receive operation
is enabled and sampling of the RxD pin input is performed.
RxD pin input sampling is performed using the serial clock specified by ASIM.
When the RxD pin input becomes low, the baud rate generator’s 5 bit counter (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 RxD 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.
Even if an error occurs, the receive data for which the error occurred is transferred to RXB. When an
error occurs, if bit 1 (ISRM) of ASIM is cleared (0), INTSR is generated. If ISRM is set (1), INTSR is not
generated.
If the RXE bit is reset (0) during the receive operation, the receive operation is stopped immediately. In
this case, the contents of RXB and ASIS are not changed, and INTSR and INTSER are not generated.
STOP
D1 D2 D6 D7 Parity D0 RxD (Input)
INTSR
RXB is not read, an overrun error will be generated when the next data is received, and
the receive error state will continue indefinitely.

(e) Receive errors
Three kinds of errors can occur during a receive operation: a parity error, framing error, or overrun error.
The data reception result error flag is set in the asynchronous serial interface status register (ASIS) and
at the same time a receive error interrupt request (INTSER) is generated. Receive error causes are shown
in Table 19-7.
It is possible to determine what kind of error was generated during reception by reading the contents of
ASIS in the reception error interrupt servicing (INTSER) (see Figures 19-9 and 19-10).
The contents of ASIS are reset (0) by reading the receive buffer register (RXB) or receiving the next data
(if there is an error in the next data, the corresponding error flag is set).
Parity error Transmission-time parity specification and reception data parity do not match
Framing error Stop bit not detected
Overrun error Reception of next data is completed before data is read from receive register buffer
D0 D1 D2 D6 D7 STOP
START
INTSER (when a framing error or an overrun error is generated)
INTSER (when a parity error is generated)
(ASIM) is set to (1), INTSR is not generated.
reading the receive buffer register (RXB) or receiving the next data. To ascertain the error
contents, ASIS must be read before reading RXB.
is not read, an overrun error will be generated when the next data is received, and the
receive error state will continue indefinitely.

(3) UART mode cautions
(a) If bit 7 (TXE) of the asynchronous serial interface mode register (ASIM) is cleared to (0) during
transmission and sending operation is halt, be sure to set the transmit shift register (TXS) to FFH, then
set TXE to 1 before executing the next transmission.
(b) If bit 6 (RXE) of ASIM is cleared (0) during reception and receiving operation is halt, the status of the receive
buffer register (RXB) and whether or not a receive completion interrupt (INTSR) is generated differ
depending on the timing. The timing is shown in Figure 19-11.
Request (INTSR) Generation When Receiving Is Terminated
RXB
INTSR
When RXE is set to 0 at a time indicated by <1>, RXB holds the previous data and does not generate INTSR.
When RXE is set to 0 at a time indicated by <2>, RXB renews the data and does not generate INTSR.
When RXE is set to 0 at a time indicated by <3>, RXB renews the data and generates INTSR.
Parity RxD Pin · <3> <1> · <2>

19.4.3 3-wire serial I/O mode
The 3-wire serial I/O mode is useful for connection of peripheral I/Os and display controllers, etc., which incorporate
a conventional synchronous clocked serial interface, such as the 75X/XL Series, 78K Series, 17K Series, etc.
Communication is performed using three lines: the serial clock (SCK2), serial output (SO2), and serial input (SI2).
The 3-wire serial I/O mode is set with the serial operating mode register 2 (CSIM2) and serial bus interface
control register (SBIC).
CSIM2 is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets CSIM2 to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
22 CSCK 0
FF72H 00H R/W
CSCK
Serial Operating Mode Selection
3-wire serial I/O mode
MSB
LSB
CSIE2
Operation Control in 3-wire Serial I/O Mode

(b) Asynchronous serial interface mode register (ASIM)
ASIM is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets ASIM to 00H.
When the 3-wire serial I/O mode is selected, 00H should be set in ASIM.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
ASIM TXE RXE PS1 PS0 CL SL ISRM SCK FF70H 00H R/W
Clock Selection in Asynchronous Serial Interface Mode
Input clock from off-chip to ASCK pin
Dedicated baud rate generator output
Control of Reception Completion Interrupt Request in Case of Error Generation
Reception completion interrupt request generated in case of error generation
Reception completion interrupt request not generated in case of error generation
SL Transmit Data Stop Bit Length Specification
PS0
0 parity always added in transmission No parity test in reception (parity error not generated) 0 1
1 Odd parity 0
TXE

(c) Baud rate generator control register (BRGC)
BRGC is set with an 8-bit memory manipulation instruction.
RESET input sets BRGC to 00H.
6 5 4 3 2 1 0 7 Symbol
Address After Reset R/W
BRGC TPS3 TPS2 TPS1 TPS0 MDL3 MDL2 MDL1 MDL0 FF73H 00H R/W
Baud Rate Generator Input Clock Selection MDL3 MDL2 MDL1 MDL0

5-Bit Counter Source Clock Selection
TPS3 TPS2 TPS1 TPS0 n
0 fXX/210 fX/210 (4.9 kHz) fX/211 (2.4 kHz) 11
0 1 0 1 fXX fX (5.0 MHz) fX/2 (2.5 MHz) 1
0 1 1 0 fXX/2 fX/2 (2.5 MHz) fX/22 (1.25 MHz) 2
0 1 1 1 fXX/22 fX/22 (1.25 MHz) fX/23 (625 kHz) 3
1 0 0 0 fXX/23 fX/23 (625 kHz) fX/24 (313 kHz) 4
1 0 0 1 fXX/24 fX/24 (313 kHz) fX/25 (156 kHz) 5
1 0 1 0 fXX/25 fX/25 (156 kHz) fX/26 (78.1 kHz) 6
1 0 1 1 fXX/26 fX/26 (78.1 kHz) fX/27 (39.1 kHz) 7
1 1 0 0 fXX/27 fX/27 (39.1 kHz) fX/28 (19.5 kHz) 8
1 1 0 1 fXX/28 fX/28 (19.5 kHz) fX/29 (9.8 kHz) 9
1 1 1 0 fXX/29 fX/29 (9.8 kHz) fX/210 (4.9 kHz) 10
Other than above Setting prohibited
disrupted and communication cannot be performed normally.
Therefore, do not write data to BRGC 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.
Select a serial clock frequency with TPS0 to TPS3.
Be sure then to set MDL0 to MDL3 to 1,1,1,1.
The serial clock frequency is 1/2 the source clock frequency of the 5-bit counter.
Select a serial clock frequency with TPS0 to TPS3.
Be sure then to set MDL0 to MDL3 to 1,1,1,1.
The serial clock frequency is calculated by the following formula:
Serial clock frequency = [Hz]
2n x (k + 16)
fXX

(2) Communication operation
In the 3-wire serial I/O mode, data transmission/reception is performed in 8-bit units. Data is transmitted/
received bit by bit in synchronization with the serial clock.
Transmit shift register (TXS/SIO2) and receive shift register (RXS) shift operations are performed in
synchronization with the fall of the serial clock SCK2. Then transmit data is held in the SO2 latch and output
from the SO2 pin. Also, receive data input to the SI2 pin is latched in the receive buffer register (RXB/SIO2)
on the rise of SCK2.
At the end of an 8-bit transfer, the operation of the TXS/SIO2 or RXS stops automatically, and the interrupt
request flag (SRIF) is set.
SCK2 1 2 3 4 5 6 7 8
DI7 DI6 DI5 DI4 DI3 DI2 DI1 DI0
SO2 DO7 DO6 DO5 DO4 DO3 DO2 DO1 DO0
Transfer Start at the Falling Edge of SCK2
End of Transfer

(3) MSB/LSB switching as the start bit
The 3-wire serial I/O mode enables to select transfer to start from MSB or LSB.
Figure 19-13 shows the configuration of the transmit shift register (TXS/SIO2) and internal bus. As shown
in the figure, MSB/LSB can be read/written in reverse form.
MSB/LSB switching as the start bit can be specified with bit 2 (CSIM22) of the serial operating mode register
2 (CSIM2).
SI2 Transmit Shift Register (TXS/SIO2)
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.
Serial transfer is started by setting transfer data to the transmission shift register (TXS/SIO2) when the
following two conditions are satisfied.
Upon termination of 8-bit transfer, serial transfer automatically stops and the interrupt request flag (SRIF) is
set.

19.4.4 Restrictions on using UART mode
In the UART mode, a receive completion interrupt request (INTSR) is generated after a certain period of time
following the generation and clearing of the receive error interrupt request (INTSER). Thereby, the phenomenon
shown below may occur.
If the bit 1 (ISRM) of the asynchronous serial interface mode register (ASIM) is set to 1, the setting is made
such that receive completion interrupt request (INTSR) will not be generated upon the generation of a receive
error. However, in the receive error interrupt request (INTSER) servicing, if the receive buffer register (RXB)
is read within a certain timing (“a” in Figure 19-14), internal error flag is cleared (to 0). Therefore, no receive
error is judged to have been generated, and INTSR, which is not supposed to be generated, will be generated.
Figure 19-14 illustrates the operation above.
INTSER (when Framing or Overrun Error is Generated)
Error Flag (Internal Flag)
Cleared Upon Reading RXB
Interrupt Servicing Routine on CPU Side
Judged no receive error has been generated, and INTSR is generated.
To avoid this phenomenon, implement the following countermeasures.
Prohibit the reading of the receive buffer register (RXB) for a certain period (“T2” in Figure 19-15) after the
generation of a receive error interrupt request (INTSER).
Prohibit the reading of the receive buffer register (RXB) for a certain period (“T1 + T2” in Figure 19-15) after
the generation of a receive error interrupt request (INTSER).
fSCK · a · RXB Reading
![Page 469 of the NEC PD78056F user manual — [Condition]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-469.webp?w=400)
Figure 19-15. Period that Reading Receive Buffer Register Is Prohibited
D1 D2 D6 D7 STOP
D0
START
INTSR
INTSER (when Framing or Overrun Error is Generated)
INTSER (when Parity Error is Generated)
T1 : The amount of time for one unit of data sent in the baud rate selected with the baud
rate generator control register (BRGC) (1/baud rate)
T2 : The amount of time for 2 clocks of 5-bit counter source clock (fSCK) selected with
Example of countermeasures
An example of the countermeasures is shown below.
fX = 5.0 MHz
Processor clock control register (PCC) = 00H
Oscillation mode selection register (OSMS) = 01H
Baud rate generator control register (BRGC) = B0H (when 2400 bps is selected for baud rate)
TCY = 0.4 µs (tCY = 0.2 µs)
1 T1 = = 416.7 µs 2400
T2 = 12.8 x 2 = 25.6 µs
T1 + T2 = 2212 (clock)
RxD (Input) · Parity · tCY

[Example]
UART Receive Error Interrupt (INTSER) Servicing EI
Instructions for 2205 clocks (MIN.) of CPU clock are required.
7 Clocks (MIN.) of CPU Clock (Time from Interrupt Request to Servicing)
RETI
Main Processing · INTSER is Generated

20.1 Real-Time Output Port Functions
Data set previously in the real-time output buffer register can be transferred to the output latch by hardware
concurrently with timer interrupt request or external interrupt request generation, 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 that has no jitter can be output. This port is therefore suitable for control of
stepping motors, etc.
Port mode/real-time output port mode can be specified bit-wise.

20.2 Real-Time Output Port Configuration
The real-time output port consists of the following hardware.
Register Real-time output buffer register (RTBL, RTBH)
Control register Port mode register 12 (PM12)
Real-time output port mode register (RTPM)
Real-time output port control register (RTPC)
Real-time Output Port Control Register
Port Mode Register 12 (PM12)
INTP2
Real-time Output Buffer Register Higher 4 Bits (RTBH)
Real-time Output Buffer Register Lower 4 Bits (RTBL)
Output Trigger Control Circuit
INTTM2
Real-time Output port Mode Register (RTPM)
Item Configuration · Internal Bus · Output Latch

(1) Real-time output buffer register (RTBL, RTBH)
Addresses of RTBL and RTBH are mapped individually in the Special function register (SFR) area as shown
in Figure 20-2.
When specifying 4 bits × 2 channels as the operating mode, data are set individually in RTBL and RTBH.
When specifying 8 bits × 1 channel as the operating mode, data are set to both RTBL and RTBH by writing
8-bit data to either RTBL or RTBH.
Table 20-2 shows operations during manipulation of RTBL and RTBH.
Higher 4 Bits Lower 4 Bits
RTBL
FF31H
RTBH
Table 20-2. Operation in Real-time Output Buffer Register Manipulation
Operating Mode Register to be
During Read Note 1 During Write Note 2
Higher 4 Bits Lower 4 Bits Higher 4 Bits Lower 4 Bits
RTBL RTBH RTBL Invalid RTBL
4 bits × 2 channels
RTBH RTBH RTBL RTBH Invalid
8 bits × 1 channel
is read, 0 is read.
time a real-time output trigger is generated.
Manipulated

20.3 Real-Time Output Port Control Registers
The following three registers control the real-time output port.
This register sets the input or output mode of port 12 pins (P120 to P127) which are multiplexed with real-
time output pins (RTP0 to RTP7). To use port 12 as a real-time output port, the port pin that performs real-
time output must be set in the output mode (PM12n = 0: n = 0 to 7).
PM12 is set by using a 1-bit or 8-bit memory manipulation instruction.
This register is set to FFH by RESET input.
R/W
PM12
PM127
PM126
PM125
PM124
PM123
PM122
PM121
PM120
FF2CH
FFH
R/W
Selects I/O Mode of P12n Pin (n = 0 to 7)
Output mode (output buffer ON)
Input mode (ourput buffer OFF)
This register selects the real-time output port mode/port mode bit-wise.
RTPM is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets this register to 00H.
RTPM
RTPM7
RTPM6
RTPM5
RTPM4
RTPM3
RTPM2
RTPM1
RTPM0
FF34H 00H
R/W
Real-time Output Port Selection (n = 0 to 7)
Real-time Output Port Mode
is performed to the output mode (clear the corresponding bit of the port mode register
12 (PM12) to 0).
Therefore, when setting an initial value, data should be set to the output latch before
setting the real-time output mode.

(3) Real-time output port control register (RTPC)
This register sets the real-time output port operating mode and output trigger.
Table 20-3 shows the relation between the operating mode of the real-time output port and output trigger.
RTPC is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets this register to 00H.
RTPC
BYTE
EXTR
FF36H 00H
R/W
EXTR
Real-time Output Control by INTP2
INTP2 not specified as real-time output trigger
INTP2 specified as real-time output trigger
Real-time Output Port Operating Mode
4 Bits × 2 Channels
8 Bits × 1 Channel
BYTE EXTR Operating Mode RTBH ¡ Port Output RTBL ¡ Port Output
4 bits × 2 channels
0 INTTM1
8 bits × 1 channel
After Reset R/W · Symbol · Address
![Page 476 of the NEC PD78056F user manual — [MEMO]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-476.webp?w=400)

21.1 Interrupt Function Types
The following three types of interrupt functions are used.
This interrupt is acknowledged unconditionally even in the interrupt disabled status. It does not undergo
interrupt priority control and is given top priority over all other interrupt requests.
It generates a standby release signal.
A non-maskable interrupt contains one source of the watchdog timer interrupt request.
These interrupts undergo mask control. Maskable interrupts can be divided into a high interrupt priority group
and a low interrupt priority group by setting the priority specify flag register (PR0L, PR0H, PR1L).
Multiple high priority interrupts can be applied to low priority interrupts. If two or more interrupts with the same
priority are simultaneously generated, each interrupts has a predetermined priority (see Table 21-1).
A standby release signal is generated.
There are 7 external interrupt request source and 13 internal interrupt request source in maskable interrupts.
This is a vectored interrupt that occurs when the BRK instruction is executed. It is acknowledged even in a
disabled state. The software interrupt does not undergo interrupt priority control.

21.2 Interrupt Sources and Configuration
Combining all the factors in interrupts, non-maskable interrupts, maskable interrupts and software interrupts, there
are a total of 22 source (see Table 21-1).
Watchdog timer overflow Internal 0004H (A)
(with watchdog timer mode 1 selected)
INTWDT Watchdog timer overflow (B)
(with interval timer mode selected)
1 INTP0 Pin input edge detection External 0006H (C)
3 INTP2 000AH
4 INTP3 000CH
5 INTP4 000EH
6 INTP5 0010H
7 INTP6 0012H
8 INTCSI0 End of serial interface channel 0 transfer Internal 0014H (B)
9 INTCSI1 End of serial interface channel 1 transfer 0016H
Serial interface channel 2 UART reception 0018H
INTSR
End of serial interface channel 2 001AH
End of serial interface channel 2
INTST End of serial interface channel 2 001CH
highest priority and 18 is the lowest priority.

Table 21-1. Interrupt Source List (2/2)
INTTM3 Reference time interval signal from Internal 001EH (B)
INTTM00 Generation of 16-bit timer register, 0020H
INTTM01 Generation of 16-bit timer register, 0022H
INTTM1 Generation of 8-bit timer/event 0024H
counter 1 match signal
INTTM2 Generation of 8 bit timer/event 0026H
counter 2 match signal
18 INTAD End of A/D converter conversion 0028H
Software — BRK BRK instruction execution — 003EH (E)
highest priority and 18 is the lowest priority.

Figure 21-1. Basic Configuration of Interrupt Function (1/2)
(A) Internal non-maskable interrupt
Vector Table Address Generator
IE PR ISP MK
Vector Table Address Generator
Sampling Clock Select Register (SCS)
External Interrupt Mode Register (INTM0)
Vector Table Address Generator

Figure 21-1. Basic Configuration of Interrupt Function (2/2)
(D) External maskable interrupt (except INTP0)
External Interrupt Mode Register (INTM0, INTM1)
Vector Table Address Generator
Edge Detector Interrupt Request
(E) Software interrupt
Vector Table Address Generator

21.3 Interrupt Function Control Registers
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 specify flags corresponding
to interrupt request sources.
Interrupt Source Interrupt Request Flag Interrupt Mask Flag Priority Order Specification Flag
INTP0 PIF0 PMK0 PPR0
INTP1 PIF1 PMK1 PPR1
INTP2 PIF2 PMK2 PPR2
INTP3 PIF3 PMK3 PPR3
INTP4 PIF4 PMK4 PPR4
INTP5 PIF5 PMK5 PPR5
INTP6 PIF6 PMK6 PPR6
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
Register Register Register

(1) Interrupt request flag registers (IF0L, IF0H, IF1L)
The interrupt request flag is set to 1 when the corresponding interrupt request is generated or an instruction
is executed. It is cleared to 0 when an instruction is executed upon acknowledgment of an interrupt request
or upon application of RESET input.
IF0L, IF0H, and IF1L are set with a 1-bit or 8-bit memory manipulation instruction. If IF0L and IF0H are used
as a 16-bit register IF0 use a 16-bit memory manipulation instruction for the setting.
RESET input sets these registers to 00H.
IF0L
PIF6
PIF5
PIF4
PIF3
PIF2
PIF1
PIF0
TMIF4
FFE0H 00H
R/W
TMIF01 IF0H
TMIF00
TMIF3
STIF
SRIF
SERIF
CSIIF1
CSIIF0
FFE1H 00H R/W
ADIF
TMIF2
TMIF1
FFE2H 00H R/W
× × IF ×
No interrupt request signal
Interrupt request signal is generated; Interrupt request state
a watchdog timer is used in watchdog timer mode 1, set TMIF4 flag to 0.

(2) Interrupt mask flag registers (MK0L, MK0H, MK1L)
The interrupt mask flag is used to enable/disable the corresponding maskable interrupt service and to set
standby clear enable/disable.
MK0L, MK0H, and MK1L are set with a 1-bit or 8-bit memory manipulation instruction. If MK0L and MK0H
are used as a 16-bit register MK0, use a 16-bit memory manipulation instruction for the setting.
RESET input sets these registers to FFH.
FFE4H FFH
R/W
MK0L
PMK6
PMK5
PMK4
PMK3
PMK2
PMK
PMK
TMMK4
TMMK01 MK0H
TMMK00
TMMK3
STMK
SRMK
SERMK
CSIMK1
CSIMK0
FFE5H FFH R/W
ADMK
TMMK2
TMMK1
FFE6H FFH R/W
× × MK ×
function.
becomes undefined.
the output level is changed by specifying the output mode of the port function, an
interrupt request flag is set. Therefore, 1 should be set in the interrupt mask flag before
using the output mode.

(3) Priority specify flag registers (PR0L, PR0H, and PR1L)
The priority specify flag is used to set the corresponding maskable interrupt priority orders.
PR0L, PR0H, and PR1L are set with a 1-bit or 8-bit memory manipulation instruction. If PR0L and PR0H are
used as a 16-bit register PR0, use a 16-bit memory manipulation instruction for the setting.
RESET input sets these registers to FFH.
PR0L
PPR6
PPR5
PPR4
PPR3
PPR2
PPR1
PPR0
TMPR4
FFE8H FFH
R/W
FFE9H FFH R/W
TMPR01 PR0H
TMPR00
TMPR3
STPR
SRPR
SERPR
CSIPR1
CSIPR0
1 PR1L
ADPR
TMPR2
TMPR1
FFEAH FFH R/W
× × PR ×

(4) External interrupt mode register (INTM0, INTM1)
These registers set the valid edge for INTP0 to INTP6.
INTM0 and INTM1 are set by 8-bit memory manipulation instructions.
RESET input sets these registers to 00H.
INTM0
ES31
ES30
ES21
ES20
ES11
ES10
FFECH 00H
R/W
ES11
ES10
INTP0 Valid Edge Selection
Both falling and rising edges
ES20
INTP1 Valid Edge Selection
Both falling and rising edges
ES30
INTP2 Valid Edge Selection
Both falling and rising edges
of the 16-bit timer mode control register (TMC0) to 0, 0, and 0, respectively, and then
stopping timer operation.

Figure 21-6. External Interrupt Mode Register 1 Format
INTM1
ES71
ES70
ES61
ES60
ES51
ES50
ES41
ES40
FFEDH 00H
R/W
ES41
ES40
INTP3 Valid Edge Selection
Both falling and rising edges
ES50
INTP4 Valid Edge Selection
Both falling and rising edges
ES60
INTP5 Valid Edge Selection
Both falling and rising edges
ES70
INTP6 Valid Edge Selection
Both falling and rising edges

(5) Sampling clock select register (SCS)
This register is used to set the valid edge clock sampling clock to be input to INTP0. When remote controlled
data reception is carried out using INTP0, digital noise is removed with sampling clocks.
SCS is set with an 8-bit memory manipulation instruction.
RESET input sets SCS to 00H.
SCS
SCS1
SCS0
FF47H 00H
R/W
INTP0 Sampling Clock Selection
SCS0 MCS = 1 MCS = 0
fxx/2N
fxx/27
fx/27(39.1 kHz)
fx/28(19.5 kHz)
fxx/25
fx/25(156.3 kHz)
fx/26(78.1 kHz)
fxx/26
fx/26(78.1 kHz)
fx/27(39.1 kHz)
to the peripheral hardware. fXX/2N stops in the HALT mode.
Remarks 1. N : Value (N=0 to 4) at bits 0 to 2 (PCC0 to PCC2) of processor clock control register
After Reset R/W · Symbol · Address

The noise elimination circuit sets the interrupt request flag (PIF0) at (1) when the sampled INTP0 input level
is active twice in succession.
Figure 21-8 shows the input/output timing of the noise elimination circuit.
(a) When input is less than the sampling cycle (t SMP )
INTP0
PIF0
Since the level of INP0 is not high at any time when it is sampled, the PIF0 output remains at the low level.
(b) When input is equal to or twice the sampling cycle (tSMP)
PIF0
is the second time in succession that sampling has found the INTP0 level to be high, so the PIF0 flag is set at 1.
(c) When input is twice or more than the cycle frequency (tSMP)
PIF0
At the point when the level of INTP0 is found to be high the second time in succession, the PIF0 flag is set at 1.

(6) Program status word (PSW)
The program status word is a register to hold the instruction execution result and the current status for interrupt
request. The IE flag to set maskable interrupt enable/disable and the ISP flag to control multiple interrupt
processing are mapped.
In addition to being able to perform read and write operations in 8 bit units, operations using bit operation
commands and special commands (EI, DI) can be performed. Also, when a vectored interrupt request is
received or when a BRK command is executed, the contents of the PSW are automatically saved to the stack
and the IE flag is set at (0). Also, when a maskable interrupt request is received, the contents of the received
interrupt priority order specification flag are transferred to the ISP flag. The contents of the PSW are also saved
to the stack by the PUSH PSW command. The stack contents are recovered by the RETI, RETB and POP
PSW commands.
RESET input sets PSW to 02H.
IE PSW
Z
RBS1
AC
RBS0
ISP
CY 02H
Used when normal instruction is executed
Priority of Interrupt Currently Being Received
High-priority interrupt servicing (low-priority interrupt disable)
1 Interrupt request not acknowledged or low-priority interrupt servicing (all-maskable interrupts enable)
IE Interrupt request Acknowledge Enable/Disable
After Reset · 0 Disable · 1 Enable

21.4 Interrupt Servicing Operations
21.4.1 Non-maskable interrupt acknowledge operation
A non-maskable interrupt request is received without condition even when in the interrupt request reception
prohibited state. It does not undergo interrupt priority control and has highest priority over all other interrupts.
If a non-maskable interrupt request is acknowledged, the acknowledged interrupt is saved in the program status
word (PSW) and then program counter (PC), the IE and ISP flags are reset to 0, and the vector table contents are
loaded into PC and branched.
A new non-maskable interrupt request generated during execution of a non-maskable interrupt service program
is received after the execution of the non-maskable interrupt service program that is currently processing is completed
(after the RETI command is executed) and 1 command of the main routine is executed. If a new non-maskable interrupt
request is generated twice or more during non-maskable interrupt service program execution, only one non-maskable
interrupt request is acknowledged after termination of the non-maskable interrupt service program execution.
The flowchart from the time a non-maskable interrupt request is generated until it is received is shown in Figure
21-10, the non-maskable interrupt request acknowledge timing is shown in Figure 21-11 and reception operations
in cases where multiple non-maskable interrupt requests are generated are shown in Figure 21-12.

Figure 21-10. Flowchart from the Time a Non-maskable Interrupt Request Is Generated Until
WDTM4=1 (with watchdog timer
WDTM3=0 (with non-maskable interrupt selected)?
Interrupt control register unaccessed?
PSW and PC Save, Jump to Interrupt Servicing
Instruction Instruction CPU Processing
Interrupt requests generated during this time are received at the timing indicated by ↑.

Figure 21-12. Non-Maskable Interrupt Request Acknowledge Operation
(a) If a new non-maskable interrupt request is generated during
non-maskable interrupt servicing program execution
NMI Request NMI Request executed. NMI Request held.
Held NMI Request processed.
non-maskable interrupt servicing program execution
NMI Request NMI Request executed. NMI Request held NMI Request held. 1 Instruction Execution
Held NMI Request processed.
NMI Request is not received. Even if more than 2 NMI requests are generated, they can only be received 1 time.

21.4.2 Maskable Interrupt request reception
For a maskable interrupt request, the interrupt request flag is set at (1) and if the mask (MK) flag of that interrupt
is cleared (0), it is possible for it to be received. A vector interrupt request is received if an interrupt enable state
exists (when the IE flag is set at (1)). However, if a high priority order interrupt is being processed (when the ISP
flag is reset (0)), an interrupt request which has a low priority order specified for it is not received.
The timing from the time when a maskable interrupt request is generated until the interrupt is processed is shown
in Table 21-3.
For the timing of interrupt request reception, see Figures 21-14 and 21-15.
Minimum Time Maximum TimeNote
When ××PR×=0 7 clocks 32 clocks
When ××PR×=1 8 clocks 33 clocks
If two or more maskable interrupt requests are generated simultaneously, the request specified for higher priority
with the priority specify flag is acknowledged first. Also, when the priority order specification flag specifies the same
priority order for two interrupts, the interrupt request with the higher default priority order is received first.
Any reserved interrupts request are acknowledged when they become acknowledgeable.
Figure 21-13 shows interrupt request acknowledge processing algorithms.
If a maskable interrupt request is received, the contents of the program status word (PSW) and the program counter
(PC) are saved to the stack in that order, the IE flag is reset (0) and the content of the received interrupt’s priority
order specification flag is saved to the ISP flag. Further, for each interrupt request, data from the predetermined vector
table are loaded to the PC and branched.
Return from the interrupt is possible with the RETI instruction.
fCPU

Figure 21-13. Interrupt Request Acknowledge Processing Algorithm
× × IF=1?
Yes (Interrupt Request Generation)
× × PR=0?
Does one of the simultaneously generated XXPR=0 interrupt request have a
Any Simultaneously generated ××PR=0 interrupt requests?
Any Simultaneously generated high-priority
IE=1?
ISP=1?
ISP : Flag which shows the priority order of the interrupt currently being processed (0 = high priority order
interrupt being processed, 1 = no interrupt request being received, or low priority order interrupt being
processed.)

Figure 21-14. Interrupt Request Acknowledge Timing (Minimum Time)
PSW and PC Save, Jump to Interrupt Servicing
× × IF ( × × PR=0)
PSW and PC Save, Jump to Interrupt Servicing
× × IF ( × × PR=0)

21.4.3 Software interrupt request acknowledge operation
A software interrupt request is received by the execution of a BRK command. A software interrupt cannot be
prohibited.
If a software interrupt request is received, the contents of the program status word (PSW) and the program counter
(PC) are saved to the stack in that order, the IE flag is reset (0) and the contents of the vector table (003EH, 003FH)
are loaded in the PC and branched.
Return from the software interrupt is possible with the RETB instruction.
During interrupt processing, the capacity to receive other distinct interrupt requests is called multiple interrupts.
Multiple interrupts are not generated (except for nonmaskable interrupts) unless reception of an interrupt request
is permitted (IE = 1). Also, at the point when an interrupt request is received, further reception of an interrupt request
is prohibited (IE = 0). Therefore, to permit multiple interrupts, it is necessary to set the IE flag at (1) by the IE command
during interrupt processing and permit interrupt reception.
Also, even if interrupt reception is permitted, there are some cases where multiple interrupts are not permitted,
but that is controlled by the interrupts’ priority order. There are two types of interrupt priority order, the default priority
order and the programmable priority order, but control of multiple interrupts is controlled by programmable priority
order.
In the interrupt permitted state, if an interrupt request is generated with the same level as, or a higher level of priority
order than the interrupt currently being processed, it is received as a multiple interrupt. If an interrupt request with
a lower priority order than the interrupt currently being processed is generated, it is not received as a multiple interrupt.
An interrupt request generated while interrupts are prohibited, or when multiple interrupts are not permitted due
to the interrupt request’s low priority order, is held. Then, when the interrupt processing currently in progress is
completed, the interrupt request is received after 1 main processing command has been executed.
Furthermore, multiple interrupts are not permitted during processing of a nonmaskable interrupt.
Table 21-4 shows interrupt requests which can be multiple interrupts and Figure 21-16 shows a multiple interrupt
example.

Table 21-4. Interrupt Request Enabled for Multiple Interrupt During Interrupt Servicing
PR = 0 PR = 1
Interrupt Currently Being Processed
IE = 1 IE = 0 IE = 1 IE = 0
Non-maskable interrupt D
ISP=1 E E D E D
Software interrupt E E D E D

Figure 21-16. Multiple Interrupt Example (1/2)
Example 1 Example of multiple interrupt requests being generated twice.
IE=0
IE=0
EI
EI
EI
RETI
RETI
RETI
During processing of interrupt INTxx, 2 interrupt requests, INTyy and INTzz, are received and multiple
interrupts are generated. Before reception of each interrupt request, the IE command must be issued
and the interrupt request reception permitted status must exist.
Example 2 Example of multiple interrupts not being generated due to priority order control
Main Processing INTxx Servicing
EI
RETI
1 Instruction Execution IE=0
During processing of interrupt INTxx, interrupt request INTyy was generated, but the priority order
of this interrupt was lower than that of INTxx, so it was not received and multiple interrupts were not
generated. Interrupt request INTyy was held and received after 1 main processing command was
executed.

Example 3 Example of a multiple interrupt not being generated because an interrupt was not permitted.
Main Processing INTxx Servicing
IE=0
RETI
IE=0
RETI
In processing of interrupt INTxx, interrupt reception was not permitted (the IE command was not
issued), so interrupt request INTyy was not received and multiple interrupts were not generated.
Interrupt request INTyy was held and received after 1 main processing command was executed.

21.4.5 Interrupt request reserve
Among the commands, there are some for which, even if an interrupt request is generated while they are being
executed, reception of the interrupt request is held until execution of the next command is completed. The commands
of this type (interrupt request hold commands) are shown below.
software interrupt that is started by execution of the BRK command, the IE flag is cleared to 0.
Therefore, even if a maskable interrupt is generated during execution of the BRK command, the
interrupt request is not received. However, a non-maskable interrupt request is accepted.
The timing for holding an interrupt request is shown in Figure 21-17.
Instruction N Instruction M Save PSW and PC, Jump to interrupt service
level).
Interrupt service program · CPU processing

21.5 Test Functions
When a clock timer overflow occurs and when the port 4 falling edge is detected, a corresponding test input flag
is set (1) and a standby release signal is generated.
Unlike the interrupt function, vector processing is not executed.
There are two test input factors as shown in Table 21-5. The basic configuration is shown in Figure 21-18.
INTWT Watch timer overflow Internal
INTPT4 Falling edge detection at port 4 External
MK
IF Test input signal
The test function is controlled by the following three registers.
The names of the test input flags and test mask flags corresponding to the test input signals are listed in Table
Test Input Signal Name Test Input Flag Test Mask Flag
INTPT4 KRIF KRMK

(1) Interrupt request flag register 1L (IF1L)
It indicates whether a watch timer overflow is detected or not.
It is set by a 1-bit memory manipulation instruction and 8-bit memory manipulation instruction.
It is set to 00H by the RESET signal input.
IF1L
WTIF
ADIF
TMIF2
TMIF1
FFE2H 00H
R/W
WTIF
Watch Timer Overflow Detection Flag
It is used to set the standby mode enable/disable at the time the standby mode is released by the watch timer.
It is set by a 1-bit memory manipulation instruction and 8-bit memory manipulation instruction.
It is set to FFH by the RESET signal input.
MK1L
WTMK
ADMK
TMMK2
TMMK1
FFE6H FFH
R/W
WTMK
Standby Mode Control by Watch Timer
Enables releasing the standby mode.
Disables releasing the standby mode.

(3) Key return mode register (KRM)
This register is used to set enable/disable of standby function clear by key return signal (port 4 falling edge
detection).
KRM is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets KRM to 02H.
KRM
KRMK
KRIF
FFF6H 02H
R/W
KRIF
Detected (port 4 falling edge detection)
Standby Mode Control by Key Return Signal
Standby mode release enabled
Standby mode release disabled
21.5.2 Test input signal acknowledge operation
(1) Internal test signal (INTWT)
When the clock timer overflows, a internal test input signal (INTWT) is generated, and this causes the WTIF
flag to be set. At this time, a standby release signal is generated if not masked by an interrupt mask flag
(WTMK). If the WTIF flag is checked for a shorter period than the clock timer’s overflow period, the clock
function can be realized.
When the falling edge is input to the pins of port 4 (P40 to P47), an external test input signal (INTPT4) is
generated, and this causes the KRIF flag to be set. At this time, a standby release signal is generated if not
masked by an interrupt mask flag (KRMK). By using port 4 as the key matrix key return signal input, it can
be checked if there was key input or not by the status of the KRIF flag.

22.1 External Device Expansion Functions
The external device expansion functions connect external devices to areas other than the internal ROM, RAM,
and SFR. Connection of external devices uses ports 4 to 6. Ports 4 to 6 control address/data, read/write strobe,
wait, address strobe etc.
Pin Function at External Device Connection Alternate Function
AD0 to AD7 Multiplexed address/data bus P40 to P47
A8 to A15 Address bus P50 to P57
RD Read strobe signal P64
WR Write strobe signal P65
WAIT Wait signal P66
ASTB Address strobe signal P67
Table 22-2. State of Ports 4 to 6 Pins in External Memory Expansion Mode
Ports and bits Port 4 Port 5 Port 6
0 to 7 0 1 2 3 4 5 6 7 0 to 3 4 to 7
Single-chip mode Port
256-byte expansion mode Address/data Port Port RD, WR, WAIT, ASTB
4-Kbyte expansion mode Address/data Address Port Port RD, WR, WAIT, ASTB
16-Kbyte expansion mode Address/data Address Port Port RD, WR, WAIT, ASTB
Full address mode Address/data Address Port RD, WR, WAIT, ASTB
Name Function · External Expansion Modes

Memory maps when using the external device expansion function are as follows.
(a) Memory Map of the µ PD78056F and 78056FY, and of the
µPD78P058F and 78P058FY when the internal PROM is 48 Kbytes.
SFR
FF00H FEFFH
FB00H FAFFH
FAE0H FADFH
FAC0H FABFH
FA80H FA7FH
Full-Address Mode (when MM2 to MM0 = 111)
or 16-Kbyte Expansion Mode (when MM2 to MM0 = 101)
4-Kbyte Expansion Mode (when MM2 to MM0 = 100)
256-byte Expansion Mode (when MM2 to MM0 = 011)
0000H

Figure 22-1. Memory Map When Using External Device Expansion Function (2/2)
(b) µPD78058F, 78058FY, 78P058F, 78P058FY Memory (c) µPD78058F, 78058FY, 78P058F, 78P058FY Memory
map when internal ROM (PROM) size is 56 Kbytes map when internal ROM (PROM) size is 60 Kbytes
FFFFH
SFR
SFR
FF00H FEFFH
FF00H FEFFH
FB00H FAFFH
FB00H FAFFH
FAE0H FADFH
FAE0H FADFH
FAC0H FABFH
FAC0H FABFH
F800H F7FFH
F800H F7FFH
F400H F3FFH
F400H F3FFH
Full-Address Mode (when MM2 to MM0 = 111)
or 16-Kbyte Expansion Mode (when MM2 to MM0 = 101)
4-Kbyte Expansion Mode (when MM2 to MM0 = 100)
E100H F0FFH
256-byte Expansion Mode (when MM2 to MM0 = 011)
0000H
0000H
F000H to F3FFH can be used as external memory by setting the internal ROM (PROM) size to
less than 56 Kbytes by the memory size switching register (IMS).

22.2 External Device Expansion Function Control Register
The external device expansion function is controlled by the memory expansion mode register (MM) and memory
size switching register (IMS).
MM sets the wait count and external expansion area, and also sets the input/output of port 4.
MM is set with an 1-bit or 8-bit memory manipulation instruction.
RESET input sets this register to 10H.
MM
PW1
PW0
MM2
MM1
MM0
FFF8H 10H
R/W
Single-chip/ Memory Expansion Mode Selection
P40 to P47, P50 to P57, P64 to P67 Pin state
P40 to P47 P50 to P53 P54, P55 P56, P57 P64 to P67
P65=WR
P66=WAIT
A8-A11
P67=ASTB
A12, A13
Full address modeNote
Other than above Setting prohibited
Wait (one wait state insertion)
Wait control by external wait pin
the internal ROM, RAM, and SFR areas and the reserved areas.
Remark P60 to P63 enter the port mode without regard to the mode (single-chip mode or memory expansion
mode).

(2) Memory size switching register (IMS)
This register specifies the internal memory size. In principle, use IMS in a default status. However, when
using the external device expansion function with the µPD78058F, 78P058F, 78058FY and 78P058FY, set
IMS so that the internal ROM capacity is 56 Kbytes or lower.
IMS is set with an 8-bit memory manipulation instruction.
RESET input sets this register to the value indicated in Table 22-3.
IMS
RAM2
RAM1
RAM0
ROM3
ROM2
ROM1
ROM0
R/W
Internal ROM Size Selection ROM3
ROM1
ROM0
Setting prohibited Other than above
Internal High-Speed RAM Size Selection RAM2 RAM1 RAM0
1024 bytes 1 1 0
Setting prohibited Other than above
Part Number Reset Value
µPD78056F, 78056FY CCH
µPD78058F, 78058FY CFH

22.3 External Device Expansion Function Timing
Timing control signal output pins in the external memory expansion mode are as follows.
Read strobe signal output pin. The read strobe signal is output in data accesses and instruction fetches from
external memory.
During internal memory access, the read strobe signal is not output (maintains high level).
Write strobe signal output pin. The write strobe signal is output in data access to external memory.
During internal memory access, the write strobe signal is not output (maintains high level).
External wait signal input pin.
When the external wait is not used, the WAIT pin can be used as an input/output port.
During internal memory access, the external wait signal is ignored.
Address strobe signal output pin. Timing signal is output without regard to the data accesses and instruction
fetches from external memory.
The ASTB signal is also output when the internal memory is accessed.
(5) AD0 to AD7, A8 to A15 pins (Alternate function : P40 to P47, P50 to P57)
Address/data signal output pin. 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).
Timing charts are shown in Figure 22-4 to 22-7.

Figure 22-4. Instruction Fetch from External Memory
(a) No wait (PW1, PW0 = 0, 0) setting
ASTB
RD
Lower Address Operation Code
ASTB
RD
Lower Address Operation Code
ASTB
RD
Lower Address Operation Code AD0 to AD7
A8 to A15 Higher Address

Figure 22-5. External Memory Read Timing
(a) No wait (PW1, PW0 = 0, 0) setting
ASTB
RD
Lower Address Read Data
ASTB
RD
Lower Address Read Data
ASTB
RD
Lower Address Read Data AD0 to AD7
A8 to A15 Higher Address

Figure 22-6. External Memory Write Timing
(a) No wait (PW1, PW0 = 0, 0) setting
ASTB
WR
Lower Address Write Data Hi-Z
ASTB
WR
Lower Address Write Data
ASTB
WR
Hi-Z Lower Address Write Data

Figure 22-7. External Memory Read Modify Write Timing
(a) No wait (PW1, PW0 = 0, 0) setting
ASTB
RD
WR
Lower Address Write Data
ASTB
RD
WR
Write Data Read Data
ASTB
RD
WR
Hi-Z Lower Address Write Data Read Data

23.1 Standby Function and Configuration
23.1.1 Standby function
The standby function is designed to decrease power consumption of the system. The following two modes are
available.
HALT instruction execution sets the HALT mode. The HALT mode is intended to stop the CPU operation clock.
System clock oscillator continues oscillation. In this mode, current consumption cannot be decreased as in
the STOP mode. The HALT mode is valid to restart immediately upon interrupt request and to carry out
intermittent operations such as in watch applications.
STOP instruction execution sets the STOP mode. In the STOP mode, the main system clock oscillator stops
and the whole system stops. CPU current consumption can be considerably decreased.
Data memory low-voltage hold (down to VDD = 1.8 V) is possible. Thus, the STOP mode is effective to hold
data memory contents with ultra-low current consumption. Because this mode can be cleared upon interrupt
request, it enables intermittent operations to be carried out.
However, because a wait time is necessary to secure an oscillation stabilization time after the STOP mode
is cleared, select the HALT mode if it is necessary to start processing immediately upon interrupt request.
In any mode, all the contents of the register, flag and data memory just before standby mode setting are held. The
input/output port output latch and output buffer statuses are also held.
(subsystem clock oscillation cannot be stopped). The HALT mode can be used with either
the main system clock or the subsystem clock.
execute the STOP instruction.
converter when the standby function is used: first clear bit 7 (CS) of A/D converter mode
register (ADM) to 0 to stop the A/D conversion operation, and then execute the HALT or STOP
instruction.

23.1.2 Standby function control register
A wait time after the STOP mode is cleared upon interrupt request till the oscillation stabilizes is controlled with
the oscillation stabilization time select register (OSTS).
OSTS is set with an 8-bit memory manipulation instruction.
RESET input sets OSTS to 04H. However, it takes 217/fX, not 218/fX, until the STOP mode is cleared by RESET
input.
OSTS
OSTS2
OSTS1
OSTS0
FFFAH 04H
R/W
Selection of Oscillation Stabilization Time when STOP Mode is Released
OSTS1
OSTS0
MCS = 1 MCS = 0
2 12/fxx
212/fx(819 s)
2 13/fx(1.64 ms)
2 14/fxx
2 14/fx(3.28 ms)
2 15/fx(6.55 ms)
2 15/fxx
2 15/fx(6.55 ms)
2 16/fx(13.1 ms)
2 16/fxx
2 16/fx(13.1 ms)
2 17/fx(26.2 ms)
2 17/fxx
2 17/fx(26.2 ms)
2 18/fx(52.4 ms)
starts after the STOP mode is cleared (“a” in the figure below). This applies to STOP mode
clearance by RESET input as well as STOP mode clearance by interrupt request generation.
X1 Pin Voltage Waveform

23.2 Standby Function Operations
23.2.1 HALT mode
(1) HALT mode set and operating status
The HALT mode is set by executing the HALT instruction. It can be set with the main system clock or the
subsystem clock.
The operating status in the HALT mode is described below.
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 clockNote 1 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.
Port (output latch) 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.
Automatic Operation stops.
External interrupt INTP0 INTP0 is operable when clock supplied for peripheral hardware is selected Operation stops.
as sampling clock (fXX/25, fXX/26, fXX/27).
INTP1 to INTP6 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.

(2) HALT mode clear
The HALT mode can be cleared with the following four types of sources.
The HALT mode is cleared when an unmasked interrupt request is generated. If interrupt acknowledge
is enabled, vectored interrupt servicing is performed. If disabled, the next address instruction is executed.
Remarks 1. The broken line indicates the case when the interrupt request which has cleared the standby
status is acknowledged.
When an unmasked interrupt request is generated, the HALT mode is cleared and vectored interrupt
servicing is performed whether interrupt acknowledge is enabled or disabled.
The HALT mode is cleared by unmasked test input and the next address instruction of the HALT instruction
is executed.

(d) Clear upon RESET input
The HALT mode is cleared upon RESET signal input. As is the case with normal reset operation, a program
is executed after branching to the reset vector address.
Oscillation Stabilization Wait Status
Reset Period HALT Mode
Release Source MK×× PR×× IE ISP Operation
Maskable interrupt 0 0 0 × Next address instruction execution
request 0 0 1 × Interrupt service execution
0 1 0 1 Next address instruction execution
0 1 × 0
0 1 1 1 Interrupt service execution
1 × × × HALT mode hold
Non-maskable interrupt – – × × Interrupt service execution request
Test input 0 – × × Next address instruction execution
RESET input – – × × Reset processing

23.2.2 STOP mode
(1) STOP mode set and operating status
The STOP mode is set by executing the STOP instruction. It can be set only with the main system clock.
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.
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 set using the
oscillation stabilization time select register (OSTS), the operating mode is set.
The operating status in the STOP mode is described below.
Setting of STOP Mode With Subsystem Clock Without Subsystem Clock Item
Clock generator Only main system clock stops oscillation.
CPU Operation stops.
Port (output latch) Status before STOP mode setting is held.
16-bit timer/event counter Operable when watch timer output is Operation stops. selected as count clock (fXT is selected as count clock of watch timer)
8-bit timer/event counter Operable when TI1 and TI2 are selected for the count clock.
Watch timer Operable when fXT is selected for the Operation stops. count clock.
Watchdog timer Operation stops.
D/A converter Operable.
Real-time output port Operable when external trigger is used or TI1 and TI2 are selected for the 8-bit timer/event counter count clock.
Serial interface Other than Operable when externally supplied clock is specified as the serial clock. automatic transmit/receive function and UART
Automatic Operation stops. transmit/receive function and UART
External interrupt INTP0 Not operable.
INTP1 to INTP6 Operable.
Bus line for AD0 to AD7 High impedance. external A0 to A15 Status before STOP mode setting is held. expansion
ASTB Low level.
WR, RD High level.
WAIT High impedance.
A/D converter

(2) STOP mode release
The STOP mode can be cleared with the following three types of sources.
The STOP mode is cleared upon generation of an unmasked interrupt request. If interrupt acknowledge
is enabled, vectored interrupt servicing is performed after the lapse of the oscillation stabilization time.
If interrupt acknowledge is disabled, the next address instruction is executed.
Wait (Time set by OSTS)
Operationg Mode STOP Mode
Remark The broken line indicates the case when the interrupt request which has cleared the standby
status is acknowledged.
The STOP mode is cleared by unmasked test input. After the lapse of the oscillation stabilization time,
the instruction at the next address after the STOP instruction is executed.

(c) Release by RESET input
The STOP mode is cleared upon RESET input, and after the lapse of the oscillation stabilization time,
reset operation is performed.
Oscillation Stabilization Wait Status
Reset Period STOP Mode
Release Source MK×× PR×× IE ISP Operation
Maskable interrupt request 0 0 0 × Next address instruction execution
0 0 1 × Interrupt service execution
0 1 0 1 Next address instruction execution
0 1 × 0
0 1 1 1 Interrupt service execution
1 × × × STOP mode hold
Test input 0 – × × Next address instruction execution
RESET input – – × × Reset processing

24.1 Reset Function
The following two operations are available to generate the reset signal.
(1) External reset input with RESET pin
(2) Internal reset by watchdog timer overrun time detection
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
is set to the status as shown in Table 24-1. Each pin has high impedance during reset input or during oscillation
stabilization time just after reset clear.
When a high level is input to the RESET input, 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 Figure 24-2 to 24-
4).
oscillation continues.
However, the port pin becomes high-impedance.
RESET

Figure 24-2. Timing of Reset Input by RESET Input
Normal Operation Reset Period (Oscillation Stop)
Oscillation Stabilization Time Wait
Normal Operation (Reset Processing)
Figure 24-3. Timing of Reset due to Watchdog Timer Overflow
Reset Period (Oscillation Stop)
Oscillation Stabilization Time Wait
Normal Operation (Reset Processing)
Stop Status (Oscillation Stop)
Reset Period (Oscillation Stop)
Oscillation Stabilization Time Wait
Normal Operation (Reset Processing)

Table 24-1. Hardware Status After Reset (1/2)
Hardware Status after Reset
Program counter (PC) Note 1 The contents of reset vector
tables (0000H and 0001H)
are set.
Stack pointer (SP) Undefined
Program status word (PSW) 02H
RAM Data memory Undefined Note 2
General register Undefined Note 2
Port (Output latch) Ports 0 to 3, Port 7, 12, 13 00H (P0 to P3, P7, P12, P13)
Ports 4 to 6 (P4 to P6) Undefined
Port mode register (PM0 to PM3, PM5 to PM7, PM12, PM13) FFH
Pull-up resistor option register (PUOH, PUOL) 00H
Processor clock control register (PCC) 04H
Oscillation mode selection register (OSMS) 00H
Memory size switching register (IMS) Note 3
Internal expansion RAM size switching register (IXS)Note 4 0AH
Memory expansion mode register (MM) 10H
Oscillation stabilization time select register (OSTS) 04H
16-bit timer/event counter Timer register (TM0) 00H
Capture/compare register (CR00, CR01) Undefined
Clock selection register (TCL0) 00H
Mode control register (TMC0) 00H
Capture/compare control register 0 (CRC0) 04H
Output control register (TOC0) 00H
8-bit timer/event counter Timer register (TM1, TM2) 00H
Compare registers (CR10, CR20) Undefined
Clock select register (TCL1) 00H
Mode control registers (TMC1) 00H
Output control register (TOC1) 00H
statuses become undefined. All other hardware statuses remains unchanged after reset.
performed.

Table 24-1. Hardware Status after Reset (2/2)
Hardware Status after Reset
Watch timer Mode control register (TMC2) 00H
Clock select register (TCL2) 00H
Mode register (WDTM) 00H
Clock select register (TCL3) 88H
Shift registers (SIO0, SIO1) Undefined
Mode registers (CSIM0, CSIM1, CSIM2) 00H
Serial bus interface control register (SBIC) 00H
Slave address register (SVA) Undefined
Automatic data transmit/receive control register (ADTC) 00H
Automatic data transmit/receive address pointer (ADTP) 00H
Automatic data transmit/receive interval specify register (ADTI) 00H
Asynchronous serial interface mode register (ASIM) 00H
Asynchronous serial interface status register (ASIS) 00H
Baud rate generator control register (BRGC) 00H
Transmit shift register (TXS)
Receive buffer register (RXB)
Interrupt timing specify register (SINT) 00H
A/D converter Mode register (ADM) 01H
Conversion result register (ADCR) Undefined
Input select register (ADIS) 00H
D/A converter Mode register (DAM) 00H
Conversion value setting register (DACS0, DACS1) 00H
Real-time output port Mode register (RTPM) 00H
Control register (RTPC) 00H
Buffer register (RTBL, RTBH) 00H
ROM correction Correction address register (CORAD0, CORAD1)Note 0000H
Correction control register (CORCN)Note 00H
Request flag register (IF0L, IF0H, IF1L) 00H
Mask flag register (MK0L, MK0H, MK1L) FFH
Priority specify flag register (PR0L, PR0H, PR1L) FFH
External interrupt mode register (INTM0, INTM1) 00H
Key return mode register (KRM) 02H
Sampling clock select register (SCS) 00H
Watchdog timer · Serial interface · Interrupt

25.1 ROM Correction Functions
The µPD78058F, 78058FY Subseries can replace part of a program in the mask ROM with a program in the internal
expansion RAM.
Instruction bugs found in the mask ROM can be avoided, and program flow can be changed by using the ROM
correction.
The ROM correction can correct two places (max.) of the internal ROM (program).
IE-78K0-NS and IE-78001-R-A).
The ROM correction is executed by the following hardware.
Register Correction address registers 0 and 1 (CORAD0, CORAD1)
Control register Correction control register (CORCN)
Figure 25-1 shows a block diagram of the ROM correction.
Correction branch request signal (BR !7FDH)
Correction address register n (CORADn)
Remark n = 0, 1

(1) Correction address registers 0 and 1 (CORAD0, CORAD1)
These registers set the start address (correction address) of the instruction(s) to be corrected in the mask ROM.
The ROM correction corrects two places (max.) of the program. Addresses are set to two registers, CORAD0
and CORAD1. If only one place needs to be corrected, set the address to either of the registers.
CORAD0 and CORAD1 are set with a 16-bit memory manipulation instruction.
RESET input sets CORAD0 and CORAD1 to 0000H.
R/W
CORAD0
FF38H/FF39H
0000H
R/W
CORAD1 R/W
FF3AH/FF3BH 0000H
control register (CORCN : see Figure 25-3) are 0.
The comparator always 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.
After Reset · Symbol 15 · 0 Address

25.3 ROM Correction Control Registers
The ROM correction is controlled with the correction control register (CORCN).
This register controls whether or not the correction branch request signal is generated when the fetch
address matches the correction address set in correction address registers 0 and 1. The correction control
register consists of correction enable flags (COREN0, COREN1) and correction status flags (CORST0,
CORST1). The correction enable flags enable or disable the comparator match detection signal, and
correction status flags show the values are matched.
CORCN is set with a 1-bit or 8-bit memory manipulation instruction.
RESET input sets CORCN to 00H.
3 2 1 0
CORCN
0 COREN1 CORST1 COREN0 CORST0
FF8AH
CORST0
Correction address register 0 and fetch address match detection
Correction address register 0 and fetch address match detection control
CORST1
Correction address register 1 and fetch address match detection
Correction address register 1 and fetch address match detection control

25.4 ROM Correction Application
(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 register 0, 1
(CORAD0 or CORAD1) generates the correction branch.
00H
CSEG AT 1000H
01H
02H
0D
ADD A, #2
RA78K/0
BR !1002H
9B
FFH
Figure 25-5. Connecting Example with EEPROM (Using 2-Wire Serial I/O Mode)
PD78058F, 78058FY EEPROM
V DD
V DD V DD
CE
SCK0
SCL
SB1
SDA
P32
CS
EEPROM Source program · µ

(2) Assemble in advance the initialization routine as shown in Figure 25-6 to correct the program.
Is ROM correction used ? Note
Load the contents of external nonvolatile memory into internal expansion RAM Correction address register setting ROM correction enabled
the P20 input level is high, the ROM correction is used, otherwise, it is not used.
(3) After reset, store the contents that have been previously stored in the external nonvolatile memory with
initialization routine for ROM correction of the user to internal expansion RAM (see Figure 25-6).
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 with the main program.
(5) After the main program is started, the fetch address value and the values set in CORAD0 and CORAD1 are
always 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 by the correction branch request signal.
(7) Branch to the internal expansion RAM address set with the main program by 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 with the branch destination judgment
program, and branches to the correction program.

Figure 25-7. ROM Correction Operation
Internal ROM program start
Does fetch address match with correction
Set correction status flag
Correction branch (branch to address F7FDH)

25.5 ROM Correction Example
The example of ROM correction when the instruction at address 1000H “ADD A, #1” is changed to “ADD A, #2”
is as follows.
Internal ROM Internal Expansion RAM F400H
F702H
ADD A, #2 BR !1002H
1000H
ADD A, #1 MOV B, A
1002H
F7FDH
BR !F702H
F7FFH
EFFFH
(1) Branches to address F7FDH when the preset value 1000H in the correction address register 0, 1 (CORAD0,
CORAD1) matches the fetch address value after the main program is started.
(2) Branches to any address (address F702H in this example) by setting the entire-space branch instruction (BR
!addr16) to address F7FDH with the main program.
(3) Returns to the internal ROM program after executing the substitute instruction ADD A, #2.

25.6 Program Execution Flow
Figures 25-9 and 25-10 show the program transition diagrams when the ROM correction is used.
FFFFH
F7FFH
BR !JUMP
F7FDH
JUMP
0000H
(1) Branches to address F7FDH when fetch address matches correction address
(2) Branches to correction program
(3) Returns to internal ROM program
Remark Area filled with diagonal lines : Internal expansion RAM

Figure 25-10. Program Transition Diagram (When Two Places Are Corrected)
FFFFH
F7FFH
BR !JUMP
F7FDH
JUMP
0000H
(1) Branches to address F7FDH when fetch address matches correction address
(2) Branches to branch destination judgment program
(3) Branches to correction program 1 by branch destination judgment program (BTCLR !CORST0, $xxxxH)
(4) Returns to internal ROM program
(5) Branches to address F7FDH when fetch address matches correction address
(6) Branches to branch destination judgment program
(7) Branches to correction program 2 by branch destination judgment program (BTCLR !CORST1, $yyyyH)
(8) Returns to internal ROM program
Remark Area filled with diagonal lines : Internal expansion RAM

25.7 Cautions on ROM Correction
(1) Address values set in correction address registers 0 and 1 (CORAD0 and CORAD1) must be addresses where
instruction codes are stored.
(2) Correction address registers 0 and 1 (CORAD0 and CORAD1) should be set when the correction enable flags
(COREN0, COREN1) are “0” (when correction branch processing is disabled). If address is set to CORAD0
or CORAD1 when COREN0 or COREN1 is 1 (when the correction branch is in enabled state), the correction
branch may start with the different address from the set address value.
(3) Do not set the address value of instruction immediately after the instruction that sets the correction enable
flag (COREN0, COREN1) to 1, to correction address register 0 or 1 (CORAD0, CORAD1) ; the correction
branch may not start.
(4) Do not set the address value in table area of table reference instruction (CALLT instruction) (0040H to 007FH),
and the address value in 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.)

The µPD78P058F and 78P058FY are products which have one time PROM incorporated into them, which it is only
possible to write to once. The differences between PROM products (µPD78P058F and 78P058FY) and ROM products
(µPD78056F, 78056FY, 78058F and 78058FY) are shown in Table 26-1.
Table 26-1. Differences Between µPD78P058F, 78P058FY and Mask ROM Versions
Item µPD78P058F, 78P058FY Mask ROM version
Internal ROM structure One-time PROM Mask ROM
Internal ROM capacity 60 Kbytes µPD78056F, 78056FY: 48 Kbytes µPD78058F, 78058FY: 60 Kbytes
Internal expansion RAM capacity 1024 bytes µPD78056F, 78056FY: None µPD78058F, 78058FY: 1024 bytes
Changing internal ROM and internal high- EnableNote 1 Disable speed RAM capacities with memory size switching register
Changing of internal expansion RAM EnableNote 2 Disable capacity by internal expansion RAM size switching register
IC pin None Available
VPP pin Available None
Pins P60 to P63 pull resistance on-chip None Available mask option
Electrical characteristics Refer to the separate Data Sheet.
RAM capacity becomes 1024 bytes.
the process from prototype production to volume production, if the switchover from PROM
product to ROM product is studied, carry out a thorough evaluation of the CS products (not ES
products) among the mask ROM products.
Remark Only the µPD78058F and 78058FY, 78P058F, 78P058FY are provided with an internal expansion RAM
size switching register.

CHAPTER 26 µPD78P058F, 78P058FY
In the µPD78P058F and 78P058FY, internal memory can be selected through the memory size select register
(IMS). The same memory mapping as that of mask ROM versions that have a different internal memory can be done
by setting IMS.
IMS is set with an 8-bit memory manipulation instruction.
RESET input sets IMS to CFH.
IMS
RAM2
RAM1
RAM0
ROM3
ROM2
ROM1
ROM0
FFF0H CFH
R/W
Internal ROM Capacity Selection ROM3 ROM2 ROM1 ROM0
1 48 Kbytes 1 0 0
1 56 Kbytes 1 1 0
1 60 Kbytes 1 1 1
Setting prohibited Other than above
Internal High-Speed RAM Capacity Selection RAM2 RAM1 RAM0
1024 bytes 1 1 0
Setting prohibited Other than above
the capacity of the internal ROM should be less than 56 Kbytes.
The IMS settings to give the same memory map as mask ROM versions are shown in Table 26-2.
Relevant Mask ROM Version IMS Setting
µPD78056F, 78056FY CCH
µPD78058F, 78058FY CFH
After Reset R/W · Address · Symbol

CHAPTER 26 µPD78P058F, 78P058FY
The internal expansion RAM size of the µPD78P058F and 78P058FY can be defined using the internal expansion
RAM size switching register (IXS), thus enabling memory mapping that is the same as that of mask ROM products
with different internal expansion RAM. The IXS is set by an 8-bit memory manipulation instruction.
RESET signal input sets IXS to 0AH.
R/W
IXS
IXRAM3
IXRAM2
IXRAM1
IXRAM0
FFF4H 0AH
W
Internal Extension RAM Capacity Selection IXRAM3 IXRAM2 IXRAM1
0 bytes 1 1 0 0
1024 bytes 1 0 1
Setting prohibited Other than above
The value in the IXS that has the identical memory map to the mask ROM versions is given in Table 26-3.
Pertinent Mask ROM Versions Value Set to IXS
0AH
Remark If a program for the µPD78P058F or 78P058FY which includes “MOV IXS, #0CH” is implemented with
the µPD78056F, or 78056FY, this instruction is ignored and causes no malfunction.

CHAPTER 26 µPD78P058F, 78P058FY
The µPD78P058F and 78P058FY include on-chip PROM in a 60 Kbyte configuration as program memory. To
write a program into the µPD78P058F or 78P058FY PROM, make the device enter the PROM programming
mode by setting the levels of the VPP and RESET pins as specified. For the connection of unused pins, see
paragraph (2) PROM programming mode in section 1.5 or 2.5 Pin Configuration (Top View).
EFFFH.) The program cannot be correctly written by a PROM programmer which does not have
a write address specification function.
When +5 V or +12.5 V is applied to the VPP pin and a low-level signal is applied to the RESET pin, the µPD78P058F
and µPD78P058FY are set to the PROM programming mode. This is one of the operating modes shown in Table
26-4 below according to the setting of the CE, OE, and PGM pins.
The PROM contents can be read by setting the read mode.
RESET VPP VDD CE OE PGM D0 to D7
Page data latch H L H Data input
Page write H H L High impedance
Byte write L H L Data input
Program verify L L H Data output
Program inhibit High impedance
× L L
Read L L H Data output
Output disabled +5 V +5V L H × High impedance
Standby H × × High impedance
Read mode is set by setting CE to L and OE to L.
If OE is set to H, data output becomes high impedance and the output disable mode is set.
Therefore, if multiple µPD78P058Fs or 78P058FYs are connected to the data bus, data can be read from any
one device by controlling the OE pin.
Pin · Operating Mode

CHAPTER 26 µPD78P058F, 78P058FY
Setting CE to H sets the standby mode.
In this mode, data output becomes high impedance irrespective of the status of OE.
Setting CE to H, PGM to H, and OE to L at the start of the page write mode sets the page data latch mode.
In this mode, 1-page 4-byte data is latched in the internal address/data latch circuit.
After a 1-page 4-byte address and data are latched by the page data latch mode, a page write is executed
by applying a 0.1-ms program pulse (active-low) to the PGM pin while CE=H and OE=H. After this, program
verification can be performed by setting CE to L and OE to L.
If programming is not performed by one program pulse, repeated write and verify operations are executed
X times (X ≤ 10).
A byte write is executed by applying a 0.1-ms program pulse (active-low) to the PGM pin while CE=L and OE=H.
After this, program verification can be performed by setting OE to L.
If programming is not performed by one program pulse, repeated write and verify operations are executed
X times (X ≤ 10).
Setting CE to L, PGM to H, and OE to L sets the program verify mode.
After writing is performed, this mode should be used to check whether the data was written correctly.
The program inhibit mode is used when the OE pins, VPP pins and pins D0 to D7 of multiple µPD78P058Fs
or 78P058FYs are connected in parallel and any one of these devices must be written to.
The page write mode or byte write mode described above is used to perform a write. At this time, the write
is not performed on the device which has the PGM pin driven high.

CHAPTER 26 µPD78P058F, 78P058FY
Figure 26-3. Page Program Mode Flowchart
VDD = 6.5 V, VPP= 12.5 V
G = Start address
N = Last address of program
Address = Address + 1
Address = Address + 1
Address = Address + 1
Address = Address + 1
Yes X = 10?
0.1-ms program pulse
Address = N? No
VDD = 4.5 to 5.5 V, VPP= VDD

CHAPTER 26 µPD78P058F, 78P058FY
Page Program Program Verify
Data Input Data Output
V DD V PP
V DD +1.5
V DD V DD
V IH CE
V IH
PGM
V IH
OE

CHAPTER 26 µPD78P058F, 78P058FY
Remark:
G = Start address
N = Last address of program
VDD = 6.5 V, VPP= 12.5 V
X = X + 1
Yes X = 10? Address = Address + 1
0.1-ms program pulse
VDD = 4.5 to 5.5 V, VPP= VDD

CHAPTER 26 µPD78P058F, 78P058FY
Data Input Data Output
V PP
V DD
V DD +1.5
V DD
V DD
V IH
CE
V IH
PGM
V IH
OE
to the VPP pin may have an adverse affect on device reliability.
Program Program Verify · A0 to A16 · D0 to D7

CHAPTER 26 µPD78P058F, 78P058FY
PROM contents can be read onto the external data bus (D0 to D7) using the following procedure.
(1) Fix the RESET pin low, and supply +5 V to the VPP pin. Unused pins are handled as shown in paragraph,
(2) PROM programming mode in section 1.5 or 2.5 Pin Configuration (Top View).
(2) Supply +5 V to the VDD and VPP pins.
(3) Input the address of data to be read to pins A0 through A16.
(4) Read mode is entered.
(5) Data is output to pins D0 through D7.
The timing for steps (2) through (5) above is shown in Figure 26-7.
Address Input A0 to A16

CHAPTER 26 µPD78P058F, 78P058FY
One-time PROM versions cannot be fully tested by NEC before shipment due to the structure of one-time PROM.
Therefore, after users have written data into the PROM, screening should be implemented by user: that is, store
devices at high temperature for one day as specified below, and verify their contents after the devices have returned
to room temperature.
Storage Temperature Storage Time
125°C 24 hours
![Page 548 of the NEC PD78056F user manual — [MEMO]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-548.webp?w=400)

This chapter describes each instruction set of the µPD78058F and 78058FY Subseries as list table. For details
of its operation and operation code, refer to the separate document 78K/0 Series USER’S MANUAL—Instructions
(U12326E).

27.1 Legends Used in Operation List
27.1.1 Operand identifiers and description methods
Operands are described in “Operand” column of each instruction in accordance with the description method of the
instruction operand identifier (refer to the assembler specifications for detail). When there are two or more description
methods, select one of them. Alphabetic letters in capitals and symbols, #, !, $ and [ ] are key words and must be
described as they are. Each symbol has the following meaning.
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.
r X (R0), A (R1), C (R2), B (R3), E (R4), D (R5), L (R6), H (R7),
rp AX (RP0), BC (RP1), DE (RP2), HL (RP3)
sfr Special-function register symbolNote
sfrp Special-function register symbol (16-bit manipulatable register even addresses only)Note
saddr FE20H-FF1FH Immediate data or labels
saddrp FE20H-FF1FH Immediate data or labels (even address only)
addr16 0000H-FFFFH Immediate data or labels
(Only even addresses for 16-bit data transfer instructions)
addr11 0800H-0FFFH Immediate data or labels
addr5 0040H-007FH Immediate data or labels (even address only)
word 16-bit immediate data or label
byte 8-bit immediate data or label
bit 3-bit immediate data or label
RBn RB0 to RB3
Remark For special-function register symbols, refer to Table 5-3 Special-Function Register List.
Identifier Description Method

27.1.2 Description of “operation” column
: Logical product (AND)
: Logical sum (OR)
: Exclusive logical sum (exclusive OR)

27.2 Operation List
Mnemonic Operands Byte Operation Instruction
r, #byte 2 4 – r ← byte
saddr, #byte 3 6 7 (saddr) ← byte
sfr, #byte 3 – 7 sfr ← byte
A, r Note 3 1 2 – A ← r
r, A Note 3 1 2 – r ← A
A, saddr 2 4 5 A ← (saddr)
saddr, A 2 4 5 (saddr) ← A
A, sfr 2 – 5 A ← sfr
sfr, A 2 – 5 sfr ← A
A, !addr16 3 8 9 + n A ← (addr16)
!addr16, A 3 8 9 + m (addr16) ← A
PSW, #byte 3 – 7 PSW ← byte × × ×
PSW, A 2 – 5 PSW ← A × × ×
A, [DE] 1 4 5 + n A ← (DE)
[DE], A 1 4 5 + m (DE) ← A
A, [HL] 1 4 5 + n A ← (HL)
[HL], A 1 4 5 + m (HL) ← A
A, [HL + byte] 2 8 9 + n A ← (HL + byte)
[HL + byte], A 2 8 9 + m (HL + byte) ← A
A, [HL + B] 1 6 7 + n A ← (HL + B)
[HL + B], A 1 6 7 + m (HL + B) ← A
A, [HL + C] 1 6 7 + n A ← (HL + C)
[HL + C], A 1 6 7 + m (HL + C) ← A
A, r Note 3 1 2 – A ↔ r
A, saddr 2 4 6 A ↔ (saddr)
A, sfr 2 – 6 A ↔ sfr
A, !addr16 3 8 10 + n + m A ↔ (addr16)
XCH A, [DE] 1 4 6 + n + m A ↔ (DE)
A, [HL] 1 4 6 + n + m A ↔ (HL)
A, [HL + byte] 2 8 10 + n + m A ↔ (HL + byte)
A, [HL + B] 2 8 10 + n + m A ↔ (HL + B)
A, [HL + C] 2 8 10 + n + m A ↔ (HL + C)
Remarks 1. One instruction clock is the length of 1 clock cycle of the CPU clock (fCPU) selected by the processor
clock control register (PCC).
Clock Flag · Group · 8-bit data transfer

Mnemonic Operands Byte Operation Instruction
rp, #word 3 6 – rp ← word
saddrp, #word 4 8 10 (saddrp) ← word
sfrp, #word 4 – 10 sfrp ← word
AX, saddrp 2 6 8 AX ← (saddrp)
saddrp, AX 2 6 8 (saddrp) ← AX
MOVW AX, sfrp 2 – 8 AX ← sfrp
sfrp, AX 2 – 8 sfrp ← AX
AX, rp Note 3 1 4 – AX ← rp
rp, AX Note 3 1 4 – rp ← AX
AX, !addr16 3 10 12 + 2n AX ← (addr16)
!addr16, AX 3 10 12 + 2m (addr16) ← AX
XCHW AX, rp Note 3 1 4 – AX ↔ rp
A, #byte 2 4 – A, CY ← A + byte × × ×
saddr, #byte 3 6 8 (saddr), CY ← (saddr) + byte × × ×
A, r Note 4 2 4 – A, CY ← A + r × × ×
r, A 2 4 – r, CY ← r + A × × ×
A, saddr 2 4 5 A, CY ← A + (saddr) × × ×
A, !addr16 3 8 9 + n A, CY ← A + (addr16) × × ×
A, [HL] 1 4 5 + n A, CY ← A + (HL) × × ×
A, [HL + byte] 2 8 9 + n A, CY ← A + (HL + byte) × × ×
A, [HL + B] 2 8 9 + n A, CY ← A + (HL + B) × × ×
A, [HL + C] 2 8 9 + n A, CY ← A + (HL + C) × × ×
A, #byte 2 4 – A, CY ← A + byte + CY × × ×
saddr, #byte 3 6 8 (saddr), CY ← (saddr) + byte + CY × × ×
A, r Note 4 2 4 – A, CY ← A + r + CY × × ×
r, A 2 4 – r, CY ← r + A + CY × × ×
A, saddr 2 4 5 A, CY ← A + (saddr) + CY × × ×
A, !addr16 3 8 9 + n A, CY ← A + (addr16) + CY × × ×
A, [HL] 1 4 5 + n A, CY ← A + (HL) + CY × × ×
A, [HL + byte] 2 8 9 + n A, CY ← A + (HL + byte) + CY × × ×
A, [HL + B] 2 8 9 + n A, CY ← A + (HL + B) + CY × × ×
A, [HL + C] 2 8 9 + n A, CY ← A + (HL + C) + CY × × ×
Remarks 1. One instruction clock is the length of 1 clock cycle of the CPU clock (fCPU) selected by the processor
clock control register (PCC).

Mnemonic Operands Byte Operation Instruction
A, #byte 2 4 – A, CY ← A – byte × × ×
saddr, #byte 3 6 8 (saddr), CY ← (saddr) – byte × × ×
A, r Note 3 2 4 – A, CY ← A – r × × ×
r, A 2 4 – r, CY ← r – A × × ×
A, saddr 2 4 5 A, CY ← A – (saddr) × × ×
A, !addr16 3 8 9 + n A, CY ← A – (addr16) × × ×
A, [HL] 1 4 5 + n A, CY ← A – (HL) × × ×
A, [HL + byte] 2 8 9 + n A, CY ← A – (HL + byte) × × ×
A, [HL + B] 2 8 9 + n A, CY ← A – (HL + B) × × ×
A, [HL + C] 2 8 9 + n A, CY ← A – (HL + C) × × ×
A, #byte 2 4 – A, CY ← A – byte – CY × × ×
saddr, #byte 3 6 8 (saddr), CY ← (saddr) – byte – CY × × ×
A, r Note 3 2 4 – A, CY ← A – r – CY × × ×
r, A 2 4 – r, CY ← r – A – CY × × ×
A, saddr 2 4 5 A, CY ← A – (saddr) – CY × × ×
A, !addr16 3 8 9 + n A, CY ← A – (addr16) – CY × × ×
A, [HL] 1 4 5 + n A, CY ← A – (HL) – CY × × ×
A, [HL + byte] 2 8 9 + n A, CY ← A – (HL + byte) – CY × × ×
A, [HL + B] 2 8 9 + n A, CY ← A – (HL + B) – CY × × ×
A, [HL + C] 2 8 9 + n A, CY ← A – (HL + C) – CY × × ×
A, #byte 2 4 – A ← A byte ×
saddr, #byte 3 6 8 (saddr) ← (saddr) byte ×
A, r Note 3 2 4 – A ← A r ×
r, A 2 4 – r ← r A ×
A, saddr 2 4 5 A ← A (saddr) ×
A, !addr16 3 8 9 + n A ← A (addr16) ×
A, [HL] 1 4 5 + n A ← A (HL) ×
A, [HL + byte] 2 8 9 + n A ← A (HL + byte) ×
A, [HL + B] 2 8 9 + n A ← A (HL + B) ×
A, [HL + C] 2 8 9 + n A ← A (HL + C) ×
Remarks 1. One instruction clock is the length of 1 clock cycle of the CPU clock (fCPU) selected by the processor
clock control register (PCC).
Clock Flag · Group · 8-bit operation

Mnemonic Operands Byte Operation Instruction
A, #byte 2 4 – A ← A byte ×
saddr, #byte 3 6 8 (saddr) ← (saddr) byte ×
A, r Note 3 2 4 – A ← A r ×
r, A 2 4 – r ← r A ×
A, saddr 2 4 5 A ← A (saddr) ×
A, !addr16 3 8 9 + n A ← A (addr16) ×
A, [HL] 1 4 5 + n A ← A (HL) ×
A, [HL + byte] 2 8 9 + n A ← A (HL + byte) ×
A, [HL + B] 2 8 9 + n A ← A (HL + B) ×
A, [HL + C] 2 8 9 + n A ← A (HL + C) ×
A, #byte 2 4 – A ← A byte ×
saddr, #byte 3 6 8 (saddr) ← (saddr) byte ×
A, r Note 3 2 4 – A ← A r ×
r, A 2 4 – r ← r A ×
A, saddr 2 4 5 A ← A (saddr) ×
A, !addr16 3 8 9 + n A ← A (addr16) ×
A, [HL] 1 4 5 + n A ← A (HL) ×
A, [HL + byte] 2 8 9 + n A ← A (HL + byte) ×
A, [HL + B] 2 8 9 + n A ← A (HL + B) ×
A, [HL + C] 2 8 9 + n A ← A (HL + C) ×
A, #byte 2 4 – A – byte × × ×
saddr, #byte 3 6 8 (saddr) – byte × × ×
A, r Note 3 2 4 – A – r × × ×
r, A 2 4 – r – A × × ×
A, saddr 2 4 5 A – (saddr) × × ×
A, !addr16 3 8 9 + n A – (addr16) × × ×
A, [HL] 1 4 5 + n A – (HL) × × ×
A, [HL + byte] 2 8 9 + n A – (HL + byte) × × ×
A, [HL + B] 2 8 9 + n A – (HL + B) × × ×
A, [HL + C] 2 8 9 + n A – (HL + C) × × ×
Remarks 1. One instruction clock is the length of 1 clock cycle of the CPU clock (fCPU) selected by the processor
clock control register (PCC).
Clock Flag · Group · 8-bit operation

Mnemonic Operands Byte Operation Instruction
ADDW AX, #word 3 6 – AX, CY ← AX + word × × ×
SUBW AX, #word 3 6 – AX, CY ← AX – word × × ×
CMPW AX, #word 3 6 – AX – word × × ×
MULU X 2 16 – AX ← A × X
DIVUW C 2 25 – AX (Quotient), C (Remainder) ← AX ÷ C
r 1 2 – r ← r + 1 × ×
saddr 2 4 6 (saddr) ← (saddr) + 1 × ×
r 1 2 – r ← r – 1 × ×
saddr 2 4 6 (saddr) ← (saddr) – 1 × ×
INCW rp 1 4 – rp ← rp + 1
DECW rp 1 4 – rp ← rp – 1
ROR A, 1 1 2 – (CY, A7 ← A0, Am – 1 ← Am) × 1 time ×
ROL A, 1 1 2 – (CY, A0 ← A7, Am + 1 ← Am) × 1 time ×
RORC A, 1 1 2 – (CY ← A0, A7 ← CY, Am – 1 ← Am) × 1 time ×
ROLC A, 1 1 2 – (CY ← A7, A0 ← CY, Am + 1 ← Am) × 1 time ×
A3 – 0 ← (HL)3 – 0, (HL)7 – 4 ← A3 – 0, (HL)3 – 0 ← (HL)7 – 4
ROR4 [HL] 2 10 12 + n + m
A3 – 0 ← (HL)7 – 4, (HL)3 – 0 ← A3 – 0, (HL)7 – 4 ← (HL)3 – 0
ROL4 [HL] 2 10 12 + n + m
Decimal Adjust Accumulator after Addition
Decimal Adjust Accumulator after Subtract
CY, saddr.bit 3 6 7 CY ← (saddr.bit) ×
CY, sfr.bit 3 – 7 CY ← sfr.bit ×
CY, A.bit 2 4 – CY ← A.bit ×
CY, PSW.bit 3 – 7 CY ← PSW.bit ×
CY, [HL].bit 2 6 7 + n CY ← (HL).bit ×
saddr.bit, CY 3 6 8 (saddr.bit) ← CY
sfr.bit, CY 3 – 8 sfr.bit ← CY
A.bit, CY 2 4 – A.bit ← CY
PSW.bit, CY 3 – 8 PSW.bit ← CY × ×
[HL].bit, CY 2 6 8 + n + m (HL).bit ← CY
Remarks 1. One instruction clock is the length of 1 clock cycle of the CPU clock (fCPU) selected by the processor
clock control register (PCC).

Mnemonic Operands Byte Operation Instruction
CY, saddr.bit 3 6 7 CY ← CY (saddr.bit) ×
CY, sfr.bit 3 – 7 CY ← CY sfr.bit ×
AND1 CY, A.bit 2 4 – CY ← CY A.bit ×
CY, PSW.bit 3 – 7 CY ← CY PSW.bit ×
CY, [HL].bit 2 6 7 + n CY ← CY (HL).bit ×
CY, saddr.bit 3 6 7 CY ← CY (saddr.bit) ×
CY, sfr.bit 3 – 7 CY ← CY sfr.bit ×
OR1 CY, A.bit 2 4 – CY ← CY A.bit ×
CY, PSW.bit 3 – 7 CY ← CY PSW.bit ×
CY, [HL].bit 2 6 7 + n CY ← CY (HL).bit ×
CY, saddr.bit 3 6 7 CY ← CY (saddr.bit) ×
CY, sfr.bit 3 – 7 CY ← CY sfr.bit ×
XOR1 CY, A.bit 2 4 – CY ← CY A.bit ×
CY, PSW. bit 3 – 7 CY ← CY PSW.bit ×
CY, [HL].bit 2 6 7 + n CY ← CY (HL).bit ×
saddr.bit 2 4 6 (saddr.bit) ← 1
sfr.bit 3 – 8 sfr.bit ← 1
SET1 A.bit 2 4 – A.bit ← 1
PSW.bit 2 – 6 PSW.bit ← 1 × × ×
[HL].bit 2 6 8 + n + m (HL).bit ← 1
saddr.bit 2 4 6 (saddr.bit) ← 0
sfr.bit 3 – 8 sfr.bit ← 0
CLR1 A.bit 2 4 – A.bit ← 0
PSW.bit 2 – 6 PSW.bit ← 0 × × ×
[HL].bit 2 6 8 + n + m (HL).bit ← 0
SET1 CY 1 2 – CY ← 1 1
CLR1 CY 1 2 – CY ← 0 0
NOT1 CY 1 2 – CY ← CY ×
Remarks 1. One instruction clock is the length of 1 clock cycle of the CPU clock (fCPU) selected by the processor
clock control register (PCC).
Clock Flag · Group · Bit manipu- late

Mnemonic Operands Byte Operation Instruction
(SP – 1) ← (PC + 3)H, (SP – 2) ← (PC + 3)L, PC ← addr16, SP ← SP – 2
CALL!addr16 3 7 –
(SP – 1) ← (PC + 2)H, (SP – 2) ← (PC + 2)L, CALLF!addr11 2 5 – PC15 – 11 ← 00001, PC10 – 0 ← addr11, SP ← SP – 2
(SP – 1) ← (PC + 1)H, (SP – 2) ← (PC + 1)L, PCH ← (00000000, addr5 + 1), PCL ← (00000000, addr5), SP ← SP – 2
CALLT [addr5] 1 6 –
(SP – 1) ← PSW, (SP – 2) ← (PC + 1)H, BRK 1 6 – (SP – 3) ← (PC + 1)L, PCH ← (003FH), PCL ← (003EH), SP ← SP – 3, IE ← 0
PCH ← (SP + 1), PCL ← (SP), SP ← SP + 2
PCH ← (SP + 1), PCL ← (SP), RETI 1 6 – PSW ← (SP + 2), SP ← SP + 3, R R R NMIS ← 0
PCH ← (SP + 1), PCL ← (SP), PSW ← (SP + 2), SP ← SP + 3
PSW 1 2 – (SP – 1) ← PSW, SP ← SP – 1
rp 1 4 – PUSH
(SP – 1) ← rpH, (SP – 2) ← rpL, SP ← SP – 2
PSW 1 2 – PSW ← (SP), SP ← SP + 1 R R R
rpH ← (SP + 1), rpL ← (SP), SP ← SP + 2
rp 1 4 –
SP, #word 4 – 10 SP ← word
MOVW SP, AX 2 – 8 SP ← AX
!addr16 3 6 – PC ← addr16
BR $addr16 2 6 – PC ← PC + 2 + jdisp8
AX 2 8 – PCH ← A, PCL ← X
BC $addr16 2 6 – PC ← PC + 2 + jdisp8 if CY = 1
BNC $addr16 2 6 – PC ← PC + 2 + jdisp8 if CY = 0
BZ $addr16 2 6 – PC ← PC + 2 + jdisp8 if Z = 1
BNZ $addr16 2 6 – PC ← PC + 2 + jdisp8 if Z = 0
Remarks 1. One instruction clock is the length of 1 clock cycle of the CPU clock (fCPU) selected by the processor
clock control register (PCC).

Mnemonic Operands Byte Operation Instruction
saddr.bit, $addr16 3 8 9 PC ← PC + 3 + jdisp8 if(saddr.bit) = 1
sfr.bit, $addr16 4 – 11 PC ← PC + 4 + jdisp8 if sfr.bit = 1
BT A.bit, $addr16 3 8 – PC ← PC + 3 + jdisp8 if A.bit = 1
PSW.bit, $addr16 3 – 9 PC ← PC + 3 + jdisp8 if PSW.bit = 1
[HL].bit, $addr16 3 10 11 + n PC ← PC + 3 + jdisp8 if (HL).bit = 1
saddr.bit, $addr16 4 10 11 PC ← PC + 4 + jdisp8 if(saddr.bit) = 0
sfr.bit, $addr16 4 – 11 PC ← PC + 4 + jdisp8 if sfr.bit = 0
BF A.bit, $addr16 3 8 – PC ← PC + 3 + jdisp8 if A.bit = 0
PSW.bit, $addr16 4 – 11 PC ← PC + 4 + jdisp8 if PSW. bit = 0
[HL].bit, $addr16 3 10 11 + n PC ← PC + 3 + jdisp8 if (HL).bit = 0
PC ← PC + 4 + jdisp8 saddr.bit, $addr16 4 10 12 if(saddr.bit) = 1 then reset(saddr.bit)
PC ← PC + 4 + jdisp8 if sfr.bit = 1 then reset sfr.bit
sfr.bit, $addr16 4 – 12
BTCLR PC ← PC + 3 + jdisp8 if A.bit = 1 then reset A.bit
A.bit, $addr16 3 8 –
PC ← PC + 4 + jdisp8 if PSW.bit = 1 then reset PSW.bit
PSW.bit, $addr16 4 – 12 × × ×
PC ← PC + 3 + jdisp8 if (HL).bit = 1 then reset (HL).bit
[HL].bit, $addr16 3 10 12 + n + m
B ← B – 1, then PC ← PC + 2 + jdisp8 if B ≠ 0
B, $addr16 2 6 –
C ← C –1, then PC ← PC + 2 + jdisp8 if C ≠ 0
DBNZ C, $addr16 2 6 –
(saddr) ← (saddr) – 1, then PC ← PC + 3 + jdisp8 if(saddr) ≠ 0
saddr. $addr16 3 8 10
SEL RBn 2 4 – RBS1, 0 ← n
NOP 1 2 – No Operation
EI 2 – 6 IE ← 1(Enable Interrupt)
DI 2 – 6 IE ← 0(Disable Interrupt)
HALT 2 6 – Set HALT Mode
STOP 2 6 – Set STOP Mode
Remarks 1. One instruction clock is the length of 1 clock cycle of the CPU clock (fCPU) selected by the processor
clock control register (PCC).

27.3 Instructions Listed by Addressing Type
(1) 8-bit instructions
MOV, XCH, ADD, ADDC, SUB, SUBC, AND, OR, XOR, CMP, MULU, DIVUW, INC, DEC, ROR, ROL, RORC,
![Page 561 of the NEC PD78056F user manual — [HL + B] [HL + C]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-561.webp?w=400)
Second Operand [HL + byte] #byte A rNote sfr saddr !addr16 PSW [DE] [HL] [HL + B] $addr16 1 None First Operand [HL + C]
A ADD MOV ROR
ADDC XCH ROL SUB ADD RORC
SUBC ADDC ROLC AND SUB
OR SUBC XOR AND
CMP OR XOR
r MOV MOV INC ADD DEC
SUBC AND
OR XOR
CMP
B, C DBNZ
saddr MOV MOV DBNZ INC
SUB SUBC
AND OR
XOR CMP
PSW MOV MOV PUSH POP
[DE] MOV
[HL] MOV ROR4 ROL4
[HL + byte] MOV
X MULU
C DIVUW
sfr MOV MOV · !addr16 MOV

(2) 16-bit instructions
MOVW, XCHW, ADDW, SUBW, CMPW, PUSH, POP, INCW, DECW
#word AX rpNote sfrp saddrp !addr16 SP None
SUBW XCHW
CMPW
rp MOVW MOVWNote INCW
PUSH
POP
SP MOVW MOVW
MOV1, AND1, OR1, XOR1, SET1, CLR1, NOT1, BT, BF, BTCLR
A.bit sfr.bit saddr.bit PSW.bit [HL].bit CY $addr16 None
A.bit MOV1 BT SET1
BTCLR
sfr.bit MOV1 BT SET1
BTCLR
saddr.bit MOV1 BT SET1
BTCLR
PSW.bit MOV1 BT SET1
BTCLR
[HL].bit MOV1 BT SET1
BTCLR
CY MOV1 MOV1 MOV1 MOV1 MOV1 SET1
AND1 AND1 AND1 AND1 AND1 CLR1
OR1 OR1 OR1 OR1 OR1 NOT1
XOR1 XOR1 XOR1 XOR1 XOR1

(4) Call/instructions/branch instructions
CALL, CALLF, CALLT, BR, BC, BNC, BZ, BNZ, BT, BF, BTCLR, DBNZ
AX !addr16 !addr11 [addr5] $addr16
Basic instruction BR CALL CALLF CALLT BR
BNC
BZ
BNZ
BTCLR
DBNZ
(5) Other instructions
ADJBA, ADJBS, BRK, RET, RETI, RETB, SEL, NOP, EI, DI, HALT, STOP
![Page 564 of the NEC PD78056F user manual — [MEMO]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-564.webp?w=400)

The major differences among the µPD78054, 78058F, and 780058 Subseries are shown in Table A-1.
Table A-1. Major Differences Among µPD78054, 78058F, and 780058 Subseries (1/2)
Product Name µPD78054 Subseries µPD78058F Subseries µPD780058 Subseries
EMI noise countermeasure No Yes Yes
Power-supply voltage VDD = 2.0 to 6.0 V VDD = 2.7 to 6.0 V VDD = 1.8 to 5.5 V
PROM versions µPD78P054, 78P058 µPD78P058F No
Flash memory versions No No µPD78F0058
Internal ROM size µPD78052 : 16 Kbytes µPD78056F : 48 Kbytes µPD780053 : 24 Kbytes µPD78053 : 24 Kbytes µPD78058F : 60 Kbytes µPD780054 : 32 Kbytes µPD78054 : 32 Kbytes µPD78P058F : 60 Kbytes µPD780055 : 40 Kbytes µPD78P054 : 32 Kbytes µPD780056 : 48 Kbytes µuPD78056 : 48 Kbytes µPD780058 : 60 Kbytes µPD78058 : 60 Kbytes µPD78F0058 : 60 Kbytes µPD78P058 : 60 Kbytes
Internal high-speed RAM size µPD78052 : 512 bytes 1024 bytes 1024 bytes
µPD78053, 78054, 78P054, 78056, 78058, 78P058 : 1024 bytes
AVDD pin Supply power for A/D Supply power for A/D con- None (The supply power
converter verter and port output buffer for the port output buffer is VDD0)
AVREF0 pin Reference voltage input for A/D converter Reference voltage input and analog power supply for A/D
Serial interface channel 2 On-chip 3-wire serial I/O/UART mode 3-wire serial I/O / UART mode with time-sharing function
External maskable interrupt 7 6
Item · converter

APPENDIX A. DIFFERENCES AMONG µPD78054, 78058F, AND 780058 SUBSERIES
Table A-1. Major Differences Among µPD78054, 78058F, and 780058 Subseries (2/2)
Product Name µPD78054 Subseries µPD78058F Subseries µPD780058 Subseries
Emulation probe EP-78230GC-R, EP-780058GC-R,
Device file DF78054 DF780058
Electrical specifications Refer to the respective data sheet of each output.
Item · Recommended soldering conditions

The following development tools are available for the development of systems that employ the µPD78058F and
78058FY Subseries.
Figure B-1 shows the configuration of the development tools.

Figure B-1. Development Tool Configuration (1/2)
(1) When using in-circuit emulator IE-78K0-NS
Tool for PROM writing
Interface adapter, PC card interface, etc.
In-circuit emulator PROM writing environment
Product with on-chip PROM
Conversion socket or conversion adapter

Figure B-1. Development Tool Configuration (2/2)
(2) When using in-circuit emulator IE-78001-R-A
Tool for PROM writing
Host machine (PC or EWS)
In-circuit emulator PROM writing environment
Emulation probe conversion board
Product with on-chip PROM
Remark The areas shown with dotted lines differ depending on the development environment. Refer to B.3.1
Hardware.

B.1 Language Processing Software
RA78K/0 Program that converts program written in mnemonic into object codes that Assembler package can be executed by microcontroller. In addition, automatic functions to generate symbol table and optimize branch instructions are also provided. Used in combination with optional device file (DF78054). This assembler package is a DOS-based application. However, it can also run under Windows environment by using Project Manager (included in the assembler package) on Windows.
CC78K/0 Program that converts program written in C language into object codes that C compiler package can be executed by microcontroller. Used in combination with optional assembler package and device file. This C compiler package is a DOS-based application. However, it can also run under Windows environment by using Project Manager (included in the assembler package) on Windows.
DF78054Note File containing information peculiar to the device. Device file Used in combination with optional tools (RA78K/0, CC78K/0, SM78K0, ID78K0-NS, or ID78K0). Compatible OS and host machine differ depending on tools to be used.
CC78K/0-L Source program of functions for generating object library included in C C library source file compiler package. Necessary for changing object library included in C compiler package according to customer’s specifications. Being a source file, its operating environment does not depend on OS.
Remark ×××× in part number differs depending on the host machine and OS used.
µS××××RA78K0 µS××××CC78K0 µS××××DF78054 µS××××CC78K0-L
×××× Host Machine OS Supply Media
AA13 PC-9800 Series Windows (Japanese)Notes 1, 2 3.5-inch 2HD FD
AB13 IBM PC/ATTM and Windows (Japanese)Notes 1, 2 3.5-inch 2HC FD
BB13 compatibles Windows (English)Notes 1, 2
3P16 HP9000 series 700TM HP-UXTM (Rel. 9.05) DAT (DDS)
3K13 SPARCstationTM SunOSTM (Rel. 4.1.4) 3.5-inch 2HC FD
3R13 NEWSTM (RISC) NEWS-OSTM (Rel. 6.1) 3.5-inch 2HC FD
3K15 1/4-inch CGMT

B.2 PROM Programming Tool
B.2.1 Hardware
PG-1500 This is a PROM programmer capable of programming the single-chip microcontroller with on-chip
PROM programmer PROM by manipulating from the stand-alone or host machine through connection of the
separately available programmer adapter and the attached board. It can also program separate
PROM ICs with a capacity from 256 Kbits to 4 Mbits.
PA-78P054GC This is a PROM programmer adapter for the µPD78P058F, 78P058FY, and is used connected to
PROM programmer the PG-1500.
PG-1500 controller This program controls the PG-1500 from the host machine through serial and/or parallel interface
cable(s).
The PG-1500 controller is a DOS-based application. When using Windows, start it from the DOS
prompt.
Remark ×××× of the part number differs depending on the host machine and OS used. Refer to the table below.
µS××××PG1500
×××× Host Machine OS Supply Media
5A13 PC-9800 Series MS-DOS 3.5-inch 2HD FD
(Ver. 3.30 to 6.2Note)
7B13 IBM PC/AT and Refer to B.4 3.5-inch 2HC FD
provided in MS-DOS version 5.0 or later.
compatibles

B.3 Debugging Tool
B.3.1 Hardware (1/2)
(1) When using in-circuit emulator IE-78K0-NS
IE-78K0-NSNote The in-circuit emulator serves to debug hardware and software when
In-circuit emulator developing application systems using a 78K/0 Series product. It corresponds
to integrated debugger (ID78K0-NS). This emulator should be used in
combination with power supply unit, emulation probe, and interface adapter
which is required to connect this emulator to the host machine.
IE-70000-MC-PS-B This adapter is used for supplying power from a receptacle of 100-V to
Power supply unit 240-V AC.
IE-70000-98-IF-CNote This adapter is required when using the PC-9800 Series computer (except
Interface adapter notebook type) as the IE-78K0-NS host machine.
IE-70000-CD-IFNote This is PC card and interface cable requied when using the PC-9800 Series
PC card Interface notebook-type computer as the IE-78K0-NS host machine.
IE-70000-PC-IF-CNote This adapter is required when using the IBM PC/AT and their compatible
Interface adapter machine as the IE-78K0-NS host machine.
IE-780308-NS-EM1Note This board emulates the operations of the peripheral hardware peculiar to
Emulation board a device. It should be used in combination with an in-circuit emulator.
NP-80GC This probe is used to connect the in-circuit emulator to the target system
Emulation probe and is designed for 80-pin plastic QFP (GC-3B9, GC-8BT types).
EV-9200GC-80 This conversion socket connects the NP-80GC to the target system board
Conversion socket designed to mount a 80-pin plastic QFP (GC-3B9, GC-8BT types).
(Refer to Figure B-2)
NP-80GK This probe is used to connect the in-circuit emulator to the target system
Emulation probe and is designed for 80-pin plastic QFP (GK-BE9 type).
TGK-080SDW This conversion adapter connects the TGK-080SDW to the target system
Conversion adapter board designed to mount a 80-pin plastic QFP (GK-BE9 type).
(Refer to Figure B-3)
Remarks 1. NP-80GC is a product of Naitou Densei Machidaseisakusho Co., Ltd.
Inquiries : Daimaru Kougyou Co., Ltd.
(06) 244-6672 Osaka Electronic Component Division

B.3.1 Hardware (2/2)
(2) When using in-circuit emulator IE-78001-R-A
IE-78001-R-ANote 1 The in-circuit emulator serves to debug hardware and software when
In-circuit emulator developing application systems using a 78K/0 Series product. It corresponds
to integrated debugger (ID78K0). This emulator should be used in combination
with emulation probe, and interface adapter which is required to connect this
emulator to the host machine.
IE-70000-98-IF-B or This adapter is required when using the PC-9800 Series computer (except
IE-70000-98-IF-CNote 1 notebook type) as the IE-78001-R-A host machine.
IE-70000-PC-IF-B or This adapter is required when using the IBM PC/AT and their compatible
IE-70000-PC-IF-CNote 1 machine as the IE-78001-R-A host machine.
IE-78000-R-SV3 This is an adapter and cable necessary when using EWS as a host
Interface adapter machine for the IE-78000-R-A.
As Ethernet™, 10Base-5 is supported. With other mode, commercially
available conversion adapter is necessary.
IE-780308-NS-EM1Note 1 This board emulates the operations of the peripheral hardware peculiar to
Emulation board a device. It should be used in combination with an in-circuit emulator and
emulation probe conversion.
IE-78K0-R-EX1Note 1 This board is required when using the IE-780308-NS-EM1 with the
Emulation probe IE-78001-R-A.
IE-78064-R-EMNote 2 This is a board for emulation of peripheral hardware inherent to this device.
IE-780308-R-EM (IE-78064-R-EM is for 3.0 to 6.0 V and IE-780308-R-EM is for 2.0 to 5.0 V.)
Emulation board Use in combination with a IE-78001-R-A.
NP-EP-78230GC-R This probe is used to connect the in-circuit emulator to the target system
Emulation probe and is designed for 80-pin plastic QFP (GC-3B9, GC-8BT types).
EV-9200GC-80 This conversion socket connects the EP-78230GC-R to the target system
Conversion socket board designed to mount a 80-pin plastic QFP (GC-3B9, GC-8BT types).
(Refer to Figure B-2)
NP-EP-78054GK-R This probe is used to connect the in-circuit emulator to the target system
Emulation probe and is designed for 80-pin plastic TQFP (GK-BE9 type).
TGK-080SDW This conversion adapter connects the EP-78054GK-R to the target system
Conversion adapter board designed to mount a 80-pin plastic TQFP (GK-BE9 type).
(Refer to Figure B-3)
Remarks 1. TGK-080SDW is a product of TOKYO ELETECH CORPORATION.
Inquiries : Daimaru Kougyou Co., Ltd.
(06) 244-6672 Osaka Electronic Component Division
Interface adapter · Interface adapter · conversion board

B.3.2 Software (1/2)
SM78K0 This simulator can debug target system at C source level or assembler level while
System simulator simulating operation of target system on host machine.
SM78K0 runs on Windows.
By using SM78K0, logic and performance of application can be verified without in-circuit
emulator independently of hardware development, so that development efficiency and
software quality can be improved.
This simulator is used with optional device file (DF78054).
Remark ×××× of the part number differs depending on the host machine and OS used. Refer to the table below.
µS××××SM78K0
×××× Host Machine OS Supply Media
AA13 PC-9800 Series Windows (Japanese)Note 3.5-inch 2HD FD
AB13 IBM PC/AT and Windows (Japanese)Note 3.5-inch 2HC FD
BB13 compatibles Windows (English)Note

B.3.2 Software (2/2)
ID78K0-NSNote This is a control program that is used to debug the 78K/0 Series.
Integrated debugger It uses Windows on a personal computer and OSF/MotifTM on EWS as a
(Supports the in-circuit graphical user interface, and has the appearance and operability conforming
emulator IE-78K0-NS) to these interfaces. Moreover, debugging functions supporting C language
are reinforced, and the trace result can be displayed in C language level
by using a window integrating function that associates the source program,
ID78K0 disassemble display, and memory display with the trace result. In addition,
Integrated debugger it can enhance the debugging efficiency of a program using a real-time OS
(Supports the in-circuit by incorporating function expansion modules such as a task debugger and
emulator IE-78001-R-A) system performance analyzer.
This debugger is used in combination with an optional device file (DF78054).
Remark ×××× in the part number differs depending on the host machine and OS used.
µS××××ID78K0-NS
×××× Host Machine OS Supply Media
AA13 PC-9800 Series Windows (Japanese)Note 3.5-inch 2HD FD
AB13 IBM PC/AT and Windows (Japanese)Note 3.5-inch 2HC FD
BB13 compatibles Windows (English)Note
µS××××ID78K0
×××× Host Machine OS Supply Media
AA13 PC-9800 Series Windows (Japanese)Note 3.5-inch 2HD FD
AB13 IBM PC/AT and Windows (Japanese)Note 3.5-inch 2HC FD
BB13 compatibles Windows (English)Note
3P16 HP9000 series 700 HP-UX (Rel. 9.05) DAT (DDS)
3K13 SPARCstation SunOS (Rel. 4.1.4) 3.5-inch 2HC FD
3R13 NEWS (RISC) NEWS-OS (Rel. 6.1) 3.5-inch 2HC FD
3K15 1/4-inch CGMT

B.4 OS for IBM PC
The following OSs for the IBM PC are supported.
PC DOS Ver. 5.02 to Ver. 6.3
J6.1/VNote to J6.3/VNote
IBM DOSTM J5.02/VNote
MS-DOS Ver. 5.0 to Ver. 6.22
5.0/VNote to 6.2/VNote
cannot be used with this software.
If you have a former in-circuit emulator for the 78K/0 Series (IE-78000-R or IE-78000-R-A), your in-circuit emulator
can be upgraded to be equivalent to the IE-78001-R-A in-circuit emulator by simply replacing the break board with
the IE-78001-R-BK (under development).
In-circuit Emulator Cabinet UpgradingNote Board to be Purchased
OS Version · IE-78000-R Required IE-78001-R-BK · IE-78000-R-A Not required

Drawing and Footprint for Conversion Socket (EV-9200GC-80)
Figure B-2. EV-9200GC-80 Drawings (For Reference Only)
Based on EV-9200GC-80 (1) Package drawing (in mm)
A
M


Figure B-3. EV-9200GC-80 Footprints (For Reference Only)
Based on EV-9200GC-80 (2) Pad drawing (in mm)
G
J
K
D
F
E
H I
B A
EV-9200GC-80-P1
ITEM MILLIMETERS INCHES
A
B
0.65±0.02 × 19=12.35±0.05
+0.002 –0.001
+0.003 –0.002
0.026 × 0.748=0.486
0.65±0.02 × 19=12.35±0.05
0.026 × 0.748=0.486
+0.002 –0.001
+0.003 –0.002
F
G
6.0±0.05
+0.004 –0.003
6.0±0.05
+0.004 –0.003
0.35±0.02
+0.001 –0.002
2.36±0.03
+0.001 –0.002
1.57±0.03
+0.001 –0.002
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).

Drawing of Conversion Adapter (TGK-080SDW)
Figure B-4. TGK-080SDW Drawings (For Reference) (unit: mm)
Reference diagram: TGK-080SDW Package dimension (unit: mm)

e 1.3 0.051 f 3.55 g 0.3 0.012 0.140
![Page 580 of the NEC PD78056F user manual — [MEMO]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-580.webp?w=400)

This chapter describes the embedded software that is available for the µPD78058F and 78058FY Subseries to
allow users to develop and maintain application programs for these subseries.

C.1 Real-time OS (1/2)
RX78K/0 RX78K/0 is real-time OS conforming to µITRON specifications.
Real-time OS Tool (configurator) that generates nucleus of RX78K/0 and plural information tables is supplied.
Used in combination with an optional assembler package (RA78K/0) and device file (DF78054).
RX78K/0 is a DOS-based application. Therefore run the RX78K/0 from the DOS prompt under
Windows.
permission in advance.
Remark The part numbers ×××× and differ depending on the host machine and OS used.
Product Outline Upper Limit of Quantity for Mass Production
Evaluation object Do not use for mass-produced product
0.1 million
010M
S01
Source program for mass-produced object
PC-9800 Series Windows (Japanese)Notes 1, 2
3.5-inch 2HD FD
IBM PC/AT and compatibles
Windows (Japanese)Notes 1, 2
3.5-inch 2HC FD
Windows (English)Notes 1, 2
3P16 HP9000 series 700
DAT (DDS) HP-UX (Rel. 9.05)
SunOS (Rel. 4.1.4)
3.5-inch 2HC FD
3R13 NEWS (RISC)
NEWS-OS (Rel. 6.1)
3.5-inch 2HC FD

Real-time OS (2/2)
MX78K0 µITRON-specification subset OS. Nucleus of MX78K0 is supplied.
OS This OS performs task management, event management, and time management. It controls the
task execution sequence for task management and selects the task to be executed next.
MX78K0 is a DOS-based application. Therefore run the MX78K0 from the DOS prompt under
Windows.
Remark ×××× and in the part number differ depending on the host machine and OS used.
Product Outline Upper Limit of Quantity for Mass Production
Evaluation object Use for trial product
Object for mass- produced product
Use for mass-produced product
Can be purchased only when object for mass- produced product is purchased
PC-9800 Series Windows (Japanese)Notes 1, 2
3.5-inch 2HD FD
IBM PC/AT and compatibles
Windows (Japanese)Notes 1, 2
3.5-inch 2HC FD
Windows (English)Notes 1, 2
3P16 HP9000 series 700
DAT (DDS) HP-UX (Rel. 9.05)
SunOS (Rel. 4.1.4)
3.5-inch 2HC FD
3.5-inch 2HC FD 3R13 NEWS (RISC)
NEWS-OS (Rel. 6.1)
![Page 584 of the NEC PD78056F user manual — [MEMO]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-584.webp?w=400)



![Page 588 of the NEC PD78056F user manual — [P]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-588.webp?w=400)
CR00: Capture/compare register 00 177
CR01: Capture/compare register 01 177
CR10: Compare registers 10 219
CR20: Compare registers 20 219
CRC0: Capture/compare control register 0 182
CSIM1: Serial operating mode register 1 393, 403
CSIM2: Serial operating mode register 2 438, 446, 448, 461
DACS0: D/A conversion value set register 0 281
DACS1: D/A conversion value set register 1 281
DAM: D/A converter mode register 282
IF0H: Interrupt request flag register 0H 483
IF0L: Interrupt request flag register 0L 483
IF1L: Interrupt request flag register 1L 483, 503
IMS: Memory size switching register 509, 538
INTM0: External interrupt mode register 0 185, 486
INTM1: External interrupt mode register 1 268, 486
IXS: Internal expansion RAM size switching register 539
KRM: Key return mode register 151, 504
MK0H: Interrupt mask flag register 0H 484
MK0L: Interrupt mask flag register 0L 484
MK1L: Interrupt mask flag register 1L 484, 503
MM: Memory expansion mode register 150, 508
OSMS: Oscillation mode selection register 159
OSTS: Oscillation stabilization time select register 516
P0: Port 0 130
P12: Port 12 144
P13: Port 13 145
P1: Port 1 132
P2: Port 2 133
P3: Port 3 137
P4: Port 4 138
P5: Port 5 139
P6: Port 6 140
P7: Port 7 142
![Page 589 of the NEC PD78056F user manual — [T]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-589.webp?w=400)
PCC: Processor clock control register 157
PM0: Port mode register 0 130, 146
PM12: Port mode register 12 130, 146, 474
PM13: Port mode register 13 130, 146
PM1: Port mode register 1 130, 146
PM2: Port mode register 2 130, 146
PM3: Port mode register 3 130, 146, 184, 224, 256, 260
PM5: Port mode register 5 130, 146
PM6: Port mode register 6 130, 146
PM7: Port mode register 7 130, 146
PR0H: Priority specify flag register 0H 485
PR0L: Priority specify flag register 0L 485
PR1L: Priority specify flag register 1L 485
PSW: Program status word 490
PUOH: Pull-up resistor option register H 149
PUOL: Pull-up resistor option register L 149
RTBH: Real-time output buffer register H 473
RTBL: Real-time output buffer register L 473
RTPC: Real-time output port control register 475
RTPM: Real-time output port mode register 474
RXB: Receive buffer register 437
RXS: Receive shift register 437
SAR: Successive approximation register 264
SCS: Sampling clock select register 186, 488
SFR: Special-function register 108
SINT: Interrupt timing specify register 298, 316, 351, 360, 370
SIO0: Serial I/O shift register 0 290, 342
SIO1: Serial I/O shift register 1 390
SVA: Slave address register 290, 342, 362, 373
TCL0: Timer clock select register 0 178, 254
TCL1: Timer clock select register 1 220
TCL2: Timer clock select register 2 240, 248, 258
TCL3: Timer clock select register 3 292, 345, 391
TM0: 16-bit timer register 178
TM1: 8-bit timer register 1 219
TM2: 8-bit timer register 2 219
TMC0: 16-bit timer mode control register 180
TMC1: 8-bit timer mode control register 222
TMC2: Watch timer mode control register 243
TMS: 16-bit time register 219
TOC0: 16-bit timer output control register 182
![Page 590 of the NEC PD78056F user manual — [W]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-590.webp?w=400)
TOC1: 8-bit timer output control register 223
TXS: Transmit shift register 437
WDTM: Watchdog timer mode register 250

Major revisions by edition and revised chapters are shown below.
Edition Major Revisions from Previous Edition Revised Chapters
2nd The following products have already been developed: Throughout µPD78056GC-×××-8BT, 78058FGC-×××-8BT, 78P058FGC-8BT, 78056FYGC-×××-8BT, 78058FYGC-×××-88BT
The block diagrams of the following ports were changed. CHAPTER 6 PORT Figures 6-5 and 6-7 P20, P21, P23 to P26 Block Diagram, Figures 6-6 and FUNCTIONS 6-8 P22 and P27 Block Diagram, Figure 6-9 P30 to P37 Block Diagram, Figure 6-16 P71 and P72 Block Diagram
Table 7-2 Relationship between CPU Clock and Minimum Instruction CHAPTER 7 CLOCK Execution Time was added. GENERATOR
Figures 9-10 and 9-13 Square-Wave Output Operation Timing were added. CHAPTER 9 8-BIT TIME/EVENT COUNTER
Format was changed.
CSCK was deleted from Figure 19-1 Serial Interface Channel 2 Block Diagram CHAPTER 19 SERIAL and Figure 19-2 Baud Rate Generator Block Diagram INTERFACE CHANNEL 2
Figure 19-3 Serial Operating Mode Register 2 Format was changed.
Table 19-2 Serial Interface Channel 2 Operating Mode Settings (2) 3-Wire
serial I/O mode was changed.
Figure 19-10 Receive Error Timing was changed.
19.4.4 Restrictions on using UART mode was added.
APPENDIX A. DIFFERENCES AMONG THE µPD78054, 78058F, AND 780058 APPENDIX A SUBSERIES was added. DIFFERENCES
AMONG µPD78054, 78058F, AND 780058 SUBSERIES
Overall revision: Contents were adapted to correspond with in-circuit emulators APPENDIX B IE-78K0-NS and IE-78001-R-A DEVELOPMENT TOOLS
![Page 592 of the NEC PD78056F user manual — [MEMO]](/cdn/reader/26/2639789e95e63e6b299df244b1fc72cdc66a54ad768e13816b09ef2e4b058750/images/page-592.webp?w=400)

Although NEC has taken all possible steps to ensure that the documentation supplied to our customers is complete, bug free and up-to-date, we readily accept that errors may occur. Despite all the care and precautions we've taken, you may encounter problems in the documentation. Please complete this form whenever you'd like to report errors or suggest improvements to us.
Tel. FAX
Thank you for your kind support.
North America NEC Electronics Inc. Corporate Communications Dept. Fax: 1-800-729-9288
Hong Kong, Philippines, Oceania NEC Electronics Hong Kong Ltd. Fax: +852-2886-9022/9044
Asian Nations except Philippines NEC Electronics Singapore Pte. Ltd. Fax: +65-250-3583
Korea NEC Electronics Hong Kong Ltd. Seoul Branch Fax: 02-528-4411
Japan NEC Semiconductor Technical Hotline Fax: 044-548-7900
Europe NEC Electronics (Europe) GmbH Technical Documentation Dept. Fax: +49-211-6503-274
South America NEC do Brasil S.A. Fax: +55-11-6465-6829
Taiwan NEC Electronics Taiwan Ltd. Fax: 02-719-5951
Document title:
Document number: Page number:
If possible, please fax the referenced page or drawing.
Clarity
Technical Accuracy
Organization
Owners and our team usually reply within a day — and your question helps the next person too.
Be the first to ask — other owners or our team will answer.