Waveform distor tion due to input noise or a reflected wave may cause malfunction. If the input of the
CMOS device stays in the area between V
malfunction. Take care to prevent chattering noise from entering the device when the input level is fixed,
and also in the transition period when the input level passes through the area between V
IH (MIN).
V
HANDLING OF UNUSED INPUT PINS
2
Unconnected CMOS device inputs can be cause of malfunction. If an input pin is unconnected, it is
possible that an internal input level may be generated due to noise, etc., causing malfunction. CMOS
devices behave differently than Bipolar or NMOS devices. Input levels of CMOS devices must be fixed
high or low by using pull-up or pull-down circuitry. Each unused pin should be connected to V
via a resistor if there is a possibility that it will be an output pin. All handling related to unused pins must
be judged separately for each device and according to related specifications governing the device.
3
PRECAUTION AGAINST ESD
A strong electric field, when exposed to a MOS device, can cause destruction of the gate oxide and
ultimately degrade the device operation. Steps must be taken to stop generation of static electricity as
much as possible, and quickly dissipate it when it has occurred. Environmental control must be
adequate. When it is dry, a humidifier should be used. It is recommended to avoid using insulators that
easily build up static electricity. Semiconductor devices must be stored and transported in an anti-static
container, static shielding bag or conductive material. All test and measurement tools including work
benches and floors should be grounded. The operator should be grounded using a wrist strap.
Semiconductor devices must not be touched with bare hands. Similar precautions need to be taken for
PW boards with mounted semiconductor devices.
IL (MAX) and VIH (MIN) due to noise, etc., the device may
IL (MAX) and
DD or GND
4
STATUS BEFORE INITIALIZATION
Power-on does not necessarily define the initial status of a MOS device. Immediately after the power
source is turned ON, devices with reset functions have not yet been initialized. Hence, power-on does
not guarantee output pin levels, I/O settings or contents of registers. A device is not initialized until the
reset signal is received. A reset operation must be executed immediately after power-on for devices
with reset functions.
5
POWER ON/OFF SEQUENCE
In the case of a device that uses different power supplies for the internal operation and external
interface, as a rule, switch on the external power supply after switching on the internal power supply.
When switching the power supply off, as a rule, switch off the external power supply and then the
internal power supply. Use of the reverse power on/off sequences may result in the application of an
overvoltage to the internal elements of the device, causing malfunction and degradation of internal
elements due to the passage of an abnormal current.
The correct power on/off sequence must be judged separately for each device and according to related
specifications governing the device.
6
INPUT OF SIGNAL DURING POWER OFF STATE
Do not input signals or an I/O pull-up power supply while the device is not powered. The current
injection that results from input of such a signal or I/O pull-up power supply may cause malfunction and
the abnormal current that passes in the device at this time may cause degradation of internal elements.
Input of signals during the power off state must be judged separately for each device and according to
related specifications governing the device.
User’s Manual U15331EJ4V1UD 3
EEPROM and FIP are trademarks of NEC Electronics Corporation.
Windows and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the
United States and/or other countries.
PC/AT is a trademark of International Business Machines Corporation.
HP9000 series 700 and HP-UX are trademarks of Hewlett-Packard Company.
SPARCstation is a trademark of SPARC International, Inc.
Solaris and SunOS are trademarks of Sun Microsystems, Inc.
These commodities, technology or software, must be exported in accordance
with the export administration regulations of the exporting country.
Diversion contrary to the law of that country is prohibited.
4 User’s Manual U15331EJ4V1UD
•
The information in this document is current as of July, 2005. The information is subject to change
without notice. For actual design-in, refer to the latest publications of NEC Electronics data sheets or
data books, etc., for the most up-to-date specifications of NEC Electronics products. Not all
products and/or types are available in every country. Please check with an NEC Electronics sales
representative for availability and additional information.
No part of this document may be copied or reproduced in any form or by any means without the prior
•
written consent of NEC Electronics. NEC Electronics assumes no responsibility for any errors that may
appear in this document.
•
NEC Electronics does not assume any liability for infringement of patents, copyrights or other intellectual
property rights of third parties by or arising from the use of NEC Electronics products listed in this document
or any other liability arising from the use of such products. No license, express, implied or otherwise, is
granted under any patents, copyrights or other intellectual property rights of NEC Electronics or others.
Descriptions of circuits, software and other related information in this document are provided for illustrative
•
purposes in semiconductor product operation and application examples. The incorporation of these
circuits, software and information in the design of a customer's equipment shall be done under the full
responsibility of the customer. NEC Electronics assumes no responsibility for any losses incurred by
customers or third parties arising from the use of these circuits, software and information.
•
While NEC Electronics endeavors to enhance the quality, reliability and safety of NEC Electronics products,
customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely. To
minimize risks of damage to property or injury (including death) to persons arising from defects in NEC
Electronics products, customers must incorporate sufficient safety measures in their design, such as
redundancy, fire-containment and anti-failure features.
•
NEC Electronics products are classified into the following three quality grades: "Standard", "Special" and
"Specific".
The "Specific" quality grade applies only to NEC Electronics products developed based on a customerdesignated "quality assurance program" for a specific application. The recommended applications of an NEC
Electronics product depend on its quality grade, as indicated below. Customers must check the quality grade of
each NEC Electronics product before using it in a particular application.
"Standard":
"Special":
"Specific":
Computers, office equipment, communications equipment, test and measurement equipment, audio
and visual equipment, home electronic appliances, machine tools, personal electronic equipment
and industrial robots.
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).
Aircraft, aerospace equipment, submersible repeaters, nuclear reactor control systems, life
support systems and medical equipment for life support, etc.
The quality grade of NEC Electronics products is "Standard" unless otherwise expressly specified in NEC
Electronics data sheets or data books, etc. If customers wish to use NEC Electronics products in applications
not intended by NEC Electronics, they must contact an NEC Electronics sales representative in advance to
determine NEC Electronics' willingness to support a given application.
(Note)
(1)
"NEC Electronics" as used in this statement means NEC Electronics Corporation and also includes its
majority-owned subsidiaries.
(2)
"NEC Electronics products" means any product developed or manufactured by or for NEC Electronics (as
defined above).
M8E 02. 11-1
User’s Manual U15331EJ4V1UD 5
Regional Information
Some information contained in this document may vary from country to country. Before using any NEC
Electronics product in your application, pIease contact the NEC Electronics office in your country to
obtain a list of authorized representatives and distributors. They will verify:
•
Device availability
•
Ordering information
•
Product release schedule
•
Availability of related technical literature
•
Development environment specifications (for example, specifications for third-party tools and
components, host computers, power plugs, AC supply voltages, and so forth)
•
Network requirements
In addition, trademarks, registered trademarks, export restrictions, and other legal issues may also vary
from country to country.
CHAPTER 4 PORT FUNCTIONS ...........................................................................................................75
4.1 Port Functions............................................................................................................................75
4.2 Port Configuration .....................................................................................................................76
4.2.1 Port 0 ............................................................................................................................................77
4.2.2 Port 1 ............................................................................................................................................78
4.2.3 Port 2 ............................................................................................................................................79
4.2.4 Port 3 ............................................................................................................................................84
4.2.5 Port 5 ............................................................................................................................................86
4.2.6 Port 6 ............................................................................................................................................87
4.2.7 Port 7 ............................................................................................................................................89
4.2.8 Port 8 ............................................................................................................................................90
4.3 Registers Controlling Port Function ........................................................................................91
4.4 Port Function Operation............................................................................................................94
4.4.1 Writing to I/O port ..........................................................................................................................94
4.4.2 Reading from I/O port.................................................................................................................... 94
4.4.3 Arithmetic operation of I/O port .....................................................................................................94
3-9 Program Counter Configuration ...................................................................................................................58
3-10 Program Status Word Configuration ............................................................................................................58
4-1 Port Types....................................................................................................................................................75
4-2 Block Diagram of P00 to P07 .......................................................................................................................77
4-3 Block Diagram of P10 and P11 ....................................................................................................................78
4-4 Block Diagram of P20 ..................................................................................................................................79
4-5 Block Diagram of P21 ..................................................................................................................................80
4-6 Block Diagram of P22 and P25 ....................................................................................................................81
4-7 Block Diagram of P23 ..................................................................................................................................82
4-8 Block Diagram of P24 ..................................................................................................................................83
4-9 Block Diagram of P30 to P33 .......................................................................................................................84
4-10 Block Diagram of P34 ..................................................................................................................................85
4-11 Block Diagram of P50 to P53.......................................................................................................................86
4-12 Block Diagram of P60 to P67.......................................................................................................................87
4-13 Block Diagram of P70 to P73.......................................................................................................................89
4-14 Block Diagram of P80 to P87.......................................................................................................................90
4-15 Port Mode Register Format..........................................................................................................................91
4-16 Format of Pull-Up Resistor Option Registers ...............................................................................................93
4-17 Port Function Register Format .....................................................................................................................93
5-1 Clock Generator Block Diagram (
5-2 Clock Generator Block Diagram (
5-3 Format of Processor Clock Control Register................................................................................................98
5-4 Format of Subclock Oscillation Mode Register.............................................................................................99
5-5 Format of Subclock Control Register............................................................................................................99
5-6 Subclock Selection Register Format ..........................................................................................................100
5-7 External Circuit of Main System Clock Oscillator........................................................................................101
5-8 External Circuit of Subsystem Clock Oscillator...........................................................................................102
5-9 Examples of Incorrect Resonator Connection ............................................................................................103
5-10 Switching Between System Clock and CPU Clock.....................................................................................107
6-1 Block Diagram of 16-Bit Timer 20 ..............................................................................................................109
6-2 Format of 16-Bit Timer Mode Control Register 20......................................................................................111
6-3 Format of Port Mode Register 3 .................................................................................................................112
6-4 Settings of 16-Bit Timer Mode Control Register 20 for Timer Interrupt Operation......................................113
6-5 Timing of Timer Interrupt Operation ...........................................................................................................114
6-6 Settings of 16-Bit Timer Mode Control Register 20 for Timer Output Operation ........................................115
7-1 Block Diagram of 24-Bit Event Counter......................................................................................................121
7-2 Block Diagram of Timer 50.........................................................................................................................123
7-3 Block Diagram of Timer 60.........................................................................................................................124
7-4 Block Diagram of Timer 61.........................................................................................................................125
7-5 Block Diagram of Output Controller (Timer 60) ..........................................................................................126
7-6 Format of 8-Bit Timer Mode Control Register 50 .......................................................................................128
7-7 Format of 8-Bit Timer Mode Control Register 60........................................................................................130
7-8 Format of Carrier Generator Output Control Register 60 ...........................................................................131
7-9 Format of 8-Bit Timer Mode Control Register 61........................................................................................132
7-10 Format of Port Mode Register 3.................................................................................................................133
7-11 Timing of Interval Timer Operation with 8-Bit Resolution (Basic Operation)...............................................136
7-12 Timing of Interval Timer Operation with 8-Bit Resolution (When CRnm Is Set to 00H)..............................136
7-13 Timing of Interval Timer Operation with 8-Bit Resolution (When CRnm Is Set to FFH)..............................137
7-14 Timing of Interval Timer Operation with 8-Bit Resolution (When CRnm Changes from N to M (N < M))....137
7-15 Timing of Interval Timer Operation with 8-Bit Resolution (When CRnm Changes from N to M (N > M))....138
7-16 Timing of Interval Timer Operation with 8-Bit Resolution (When Timer 60 Match Signal Is Selected
for Timer 50 Count Clock) ..........................................................................................................................139
7-17 Timing of Operation of External Event Counter with 8-Bit Resolution ........................................................140
7-18 Timing of Square-Wave Output with 8-Bit Resolution ................................................................................142
7-19 Timing of Interval Timer Operation with 16-Bit Resolution .........................................................................145
7-20 Timing of External Event Counter Operation with 16-Bit Resolution ..........................................................147
18 User’s Manual U15331EJ4V1UD
LIST OF FIGURES (3/6)
Figure No. Title Page
7-21 Timing of Square-Wave Output with 16-Bit Resolution ..............................................................................149
7-22 Timing of Carrier Generator Operation (When CR60 = N, CRH60 = M (M > N))........................................151
7-23 Timing of Carrier Generator Operation (When CR60 = N, CRH60 = M (M < N))........................................152
10-7 How to Reduce Current Consumption in Standby Mode ............................................................................182
10-8 Conversion Result Read Timing (if Conversion Result Is Undefined) ........................................................183
10-9 Conversion Result Read Timing (if Conversion Result Is Normal).............................................................183
10-10 Analog Input Pin Handling..........................................................................................................................184
10-11 A/D Conversion End Interrupt Request Generation Timing........................................................................185
10-12 AV
11-1 Block Diagram of Serial Interface 20..........................................................................................................187
11-2 Bock Diagram of Baud Rate Generator 20.................................................................................................188
11-3 Format of Serial Operation Mode Register 20............................................................................................190
16-13 Interrupt Request Acknowledgment Program Algorithm.............................................................................303
16-14 Interrupt Request Acknowledgment Timing (Example: MOV A, r)..............................................................304
16-15 Interrupt Request Acknowledgment Timing (When Interrupt Request Flag Is Generated in Final
Clock Under Execution) .............................................................................................................................304
16-16 Example of Multiple Interrupt Servicing......................................................................................................305
17-1 Format of Oscillation Stabilization Time Selection Register .......................................................................308
17-2 Releasing HALT Mode by Interrupt ............................................................................................................310
User’s Manual U15331EJ4V1UD 21
LIST OF FIGURES (6/6)
Figure No. Title Page
17-3 Releasing HALT Mode by RESET Input.....................................................................................................311
17-4 Releasing STOP Mode by Interrupt............................................................................................................313
17-5 Releasing STOP Mode by RESET Input ....................................................................................................314
18-1 Block Diagram of Reset Function...............................................................................................................315
18-2 Reset Timing by RESET Input ...................................................................................................................316
18-3 Reset Timing by Overflow in Watchdog Timer ...........................................................................................316
18-4 Reset Timing by RESET Input in STOP Mode ...........................................................................................316
19-1 Environment for Writing Program to Flash Memory....................................................................................320
19-2 Communication Mode Selection Format ....................................................................................................321
19-3 Example of Connection with Dedicated Flash Programmer .......................................................................322
19-4 V
19-5 Signal Conflict (Input Pin of Serial Interface)..............................................................................................325
19-6 Abnormal Operation of Other Device .........................................................................................................325
19-7 Signal Conflict (RESET Pin).......................................................................................................................326
19-8 Wiring Example for Flash Writing Adapter with 3-Wire Serial I/O...............................................................327
19-9 Wiring Example for Flash Writing Adapter with 3-Wire Serial I/O with Handshake.....................................328
19-10 Wiring Example for Flash Writing Adapter with UART................................................................................329
A-1 Development Tools ....................................................................................................................................370
B-1 Distance Between In-Circuit Emulator and Conversion Socket (80GC) .....................................................375
B-2 Connection Conditions of Target System (When NP-80GC-TQ Is Used)...................................................376
B-3 Connection Conditions of Target System (When NP-H80GC-TQ Is Used) ................................................376
B-4 Distance Between In-Circuit Emulator and Conversion Adapter (80GK)....................................................377
B-5 Connection Conditions of Target System (When NP-80GK Is Used) .........................................................378
B-6 Connection Conditions of Target System (When NP-H80GK-TQ Is Used) ................................................378
PP Pin Connection Example .....................................................................................................................324
22 User’s Manual U15331EJ4V1UD
LIST OF TABLES (1/3)
Table No. Title Page
2-1 Types of Pin I/O Circuits ..............................................................................................................................45
3-1 Internal ROM Capacity.................................................................................................................................52
3-4 Special Function Registers .........................................................................................................................63
4-1 Port Functions..............................................................................................................................................76
4-2 Configuration of Port ....................................................................................................................................76
4-3 Port Mode Registers and Output Latch Settings When Using Alternate Functions ......................................92
5-1 Configuration of Clock Generator.................................................................................................................95
5-2 Maximum Time Required for Switching CPU Clock ...................................................................................106
6-2 Interval Time of 16-Bit Timer 20.................................................................................................................113
6-3 Settings of Capture Edge ...........................................................................................................................116
7-2 Configuration of 8-Bit Timers 50, 60, and 61..............................................................................................122
7-3 Interval Time of Timer 50 ...........................................................................................................................135
7-4 Interval Time of Timer 60 ...........................................................................................................................135
7-5 Interval Time of Timer 61 ...........................................................................................................................135
7-6 Square-Wave Output Range of Timer 50...................................................................................................141
7-7 Square-Wave Output Range of Timer 60...................................................................................................142
7-8 Square-Wave Output Range of Timer 61...................................................................................................142
7-9 Interval Time with 16-Bit Resolution...........................................................................................................144
7-10 Square-Wave Output Range with 16-Bit Resolution...................................................................................148
8-1 Interval Time of Interval Timer ...................................................................................................................162
8-2 Configuration of Watch Timer ....................................................................................................................162
8-3 Interval Time of Interval Timer ...................................................................................................................165
9-1 Watchdog Timer Program Loop Detection Time ........................................................................................167
9-2 Interval Time ..............................................................................................................................................167
9-3 Configuration of Watchdog Timer...............................................................................................................168
9-4 Watchdog Timer Program Loop Detection Time ........................................................................................171
9-5 Interval Time of Interval Timer ...................................................................................................................172
User’s Manual U15331EJ4V1UD 23
LIST OF TABLES (2/3)
Table No. Title Page
10-1 Configuration of 10-Bit A/D Converter ........................................................................................................173
11-1 Configuration of Serial Interface 20............................................................................................................186
11-2 Serial Interface 20 Operation Mode Settings..............................................................................................192
11-3 Example of Relationship Between System Clock and Baud Rate ..............................................................195
11-4 Relationship Between ASCK20 Pin Input Frequency and Baud Rate (When BRGC20 Is Set to 80H).......196
11-5 Example of Relationship Between System Clock and Baud Rate ..............................................................203
11-6 Relationship Between ASCK20 Pin Input Frequency and Baud Rate (When BRGC20 Is Set to 80H).......203
12-1 Configuration of Serial Interface 1A0..........................................................................................................217
12-2 Timing of Interrupt Request Signal Generation ..........................................................................................249
13-1 Maximum Number of Display Pixels...........................................................................................................250
13-2 Configuration of LCD Controller/Driver.......................................................................................................250
13-4 COM Signals ..............................................................................................................................................258
13-5 Select and Deselect Voltages (COM0 to COM2) .......................................................................................260
13-6 Select and Deselect Voltages (COM0 to COM3) .......................................................................................263
16-3 Flags Corresponding to Interrupt Request Signal Names ..........................................................................294
16-4 Time from Generation of Maskable Interrupt Request to Servicing............................................................303
17-1 Operation Statuses in HALT Mode.............................................................................................................309
17-2 Operation After Releasing HALT Mode ......................................................................................................311
17-3 Operation Statuses in STOP Mode ............................................................................................................312
17-4 Operation After Releasing STOP Mode .....................................................................................................314
18-1 Status of Hardware After Reset..................................................................................................................317
19-1 Differences Between
19-2 Communication Mode List..........................................................................................................................321
19-3 Pin Connection List ....................................................................................................................................323
LC0 to VLC2 Pins ..........................................................................................................265
3-wire serial I/O mode (with automatic transfer function): 1 channel
• Common signal outputs: 4
• Internal reset by watchdog timer
µ
memory)
−
Note 2
PD78F9488
Note 3
µ
PD789489
48 KB 48 KB (flash
512 bytes
µ
PD78F9489
memory)
Note 1
(1/2)
Notes 1. Whether a circuit to multiply the clock by 4 is used or not is selected by a mask option or the subclock
selection register.
2. 12 pins are used either as a port function or LCD segment output selected by a mask option or port
function register.
User’s Manual U15331EJ4V1UD 35
CHAPTER 1 GENERAL
Item
Supply voltage VDD = 1.8 to 5.5 V
Operating ambient temperature TA = −40 to +85°C
Package • 80-pin plastic QFP (14 × 14)
µ
PD789488
• 80-pin plastic TQFP (fine pitch) (12 × 12)
µ
PD78F9488
An outline of the timer is shown below.
16-Bit
Timer 20
Operation
mode
Function
Interval timer
External event
counter
Timer outputs 1 output 1 output 1 output 1 output
Square-wave
outputs
Capture 1 input
Interrupt sources 1 1 1 1 2 2
−
− −
−
8-Bit
Timer 50
1 channel 1 channel 1 channel 1 channel
1 output 1 output 1 output
− − − − −
8-Bit
Timer 60
1 channel 1 channel
µ
PD789489
8-Bit
Timer 61
µ
PD78F9489
Watch
Timer
Note
1
− −
− −
− −
1 channel
(2/2)
Watchdog
Timer
Note
2
Notes 1. The watch timer can perform both watch timer and interval timer functions at the same time.
2. The watchdog timer has watchdog timer and interval timer functions. However, use the watchdog timer
by selecting either the watchdog timer function or interval timer function.
36 User’s Manual U15331EJ4V1UD
CHAPTER 2 PIN FUNCTIONS
2.1 List of Pin Functions
(1) Port pins (1/2)
Pin Name I/O Function After Reset Alternate Function
Note 2
Note 1
Note 2
−
−
Note 1
Note 2
P00 to P07 I/O Port 0.
8-bit I/O port.
Input KR0 to KR7
KR00 to KR07
Input/output can be specified in 1-bit units.
When used as an input port, an on-chip pull-up resistor can be
specified in 1-bit units by pull-up resistor option register B0
(PUB0) or the key return mode register (KRM00).
P10, P11 I/O Port 1.
Input
2-bit I/O port.
Input/output can be specified in 1-bit units.
When used as an input port, an on-chip pull-up resistor can be
specified in 1-bit units by pull-up resistor option register B1
(PUB1).
P20 SCK20/ASCK20
P21 SO20/TxD20
P22 SI20/RxD20
P23 SCK10
P24 SO10
P25
P30 INTP0/TO50/TMI60
P31 INTP1/TO60
P32 INTP2/TMI61/TO61
P33 INTP3/CPT20/TO20
P34
P50 to P53 I/O Port 5.
I/O Port 2.
6-bit I/O port.
Input/output can be specified in 1-bit units.
When used as an input port, an on-chip pull-up resistor can be
specified in 1-bit units by pull-up resistor option register B2
(PUB2).
I/O Port 3.
5-bit I/O port.
Input/output can be specified in 1-bit units.
When used as an input port, on-chip pull-up resistors can be
specified in 1-bit units by pull-up resistor option register B3
(PUB3).
Input
SI10
Input
RIN
Input
4-bit N-ch open-drain I/O port.
Input/output can be specified in 1-bit units.
For mask ROM version, an on-chip pull-up resistor can be
specified by mask option.
P60 to P67 Input Port 6.
8-bit input port.
Input ANI0 to ANI7
ANI0/KR10 to
ANI7/KR17
Notes 1. µPD789488 and 78F9488 only
2. µPD789489 and 78F9489 only
User’s Manual U15331EJ4V1UD 37
CHAPTER 2 PIN FUNCTIONS
(1) Port pins (2/2)
Pin Name I/O Function After Reset Alternate Function
P70 to P73
P80 to P87
Note 1
Input Port 7.
Note 2
I/O Port 8.
4-bit input port.
(Only when input port is selected by mask option or port
function register)
8-bit I/O port.
(Only when I/O port is selected by mask option or port function
register)
Input
Input
−
−
Notes 1. Whether to use these pins as input port pins (P70 to P73) or segment outputs (S16 to S19) can be
selected in 1-bit units by means of a mask option in the
µ
PD789488, 789489 or a port mode register in
the µPD78F9488, 78F9489 (refer to 4.3 (3) Port function registers and CHAPTER 20 MASK OPTIONS).
2. Whether to use these pins as I/O port pins (P80 to P87) or segment outputs (S20 to S27) can be
selected in 1-bit units by means of a mask option in the
the
µ
PD78F9488, 78F9489 (refer to 4.3 (3) Port function registers and CHAPTER 20 MASK
µ
PD789488, 789489 or a port mode register in
OPTIONS).
(2) Non-port pins (1/2)
Pin Name I/O Function After Reset Alternate Function
ANI0 to ANI7 – A/D converter analog input – P60 to P67
AVSS– A/D converter ground potential – –
AVDD– A/D converter analog power supply – –
X1 Input – –
X2 –
XT1 Input – –
XT2 –
RESET Input System reset input Input –
VDD– Positive power supply – –
VSS – Ground potential – –
IC0 – Internally connected. Connect directly to VSS. – –
VPP– Sets flash memory programming mode. Used to apply high
Output
Note 1
Only when segment output is selected by
Note 2
mask option
Only when segment output is selected by
mask option
Connecting crystal resonator for main system clock oscillation
Connecting crystal resonator for subsystem clock oscillation
voltage when a program is written or verified.
output
output
P60/KR10 to
P67/KR17
– –
– –
– –
–
–
–
–
Note 3
Note 4
Notes 1. Whether to use these pins as input ports pins (P70 to P73) or segment outputs (S16 to S19) can be
selected in 1-bit units by means of a mask option in the µPD789488, 789489 or a port mode register in
µ
PD78F9488, 78F9489 (refer to 4.3(3) Port function registers and CHAPTER 20 MASK
the
OPTIONS).
2. Whether to use these pins as I/O port pins (P80 to P87) or segment outputs (S20 to S27) can be
selected in 1-bit units by means of a mask option in the
µ
PD78F9488, 78F9489 (refer to 4.3(3) Port function registers and CHAPTER 20 MASK
the
µ
PD789488, 789489 or a port mode register in
OPTIONS).
3.
4.
µ
PD789488 and 78F9488 only
µ
PD789489 and 78F9489 only
User’s Manual U15331EJ4V1UD
39
CHAPTER 2 PIN FUNCTIONS
2.2 Description of Pin Functions
2.2.1 P00 to P07 (Port 0)
These pins constitute an 8-bit I/O port. In addition, these pins enable key return signal detection.
Port 0 can be specified in the following operation modes in 1-bit units.
(1) Port mode
These pins constitute an 8-bit I/O port and can be set in the input or output port mode in 1-bit units by port
mode register 0 (PM0). When used as an input port, use of an on-chip pull-up resistor can be specified by
pull-up resistor option register B0 (PUB0) in 1-bit units.
(2) Control mode
In this mode, P00 to P07 function as key return signal detection pins (KR0 to KR7 (
KR00 to KR07 (
2.2.2 P10, P11 (Port 1)
These pins constitute a 2-bit I/O port and can be set in the input or output port mode in 1-bit units by port mode
register 1 (PM1). When used as an input port, use of an on-chip pull-up resistor can be specified by pull-up resistor
option register B1 (PUB1) in 1-bit units.
2.2.3 P20 to P25 (Port 2)
µ
PD789489, 78F9489)).
µ
PD789488, 78F9488),
These pins constitute a 6-bit I/O port. In addition, these pins enable serial interface data I/O and serial clock I/O.
Port 2 can be specified in the following operation modes in 1-bit units.
(1) Port mode
In this mode, P20 to P25 function as a 6-bit I/O port. Port 2 can be set in the input or output port mode in 1-
bit units by port mode register 2 (PM2). When used as an input port, use of an on-chip pull-up resistor can
be specified by pull-up resistor option register B2 (PUB2) in 1-bit units.
(2) Control mode
In this mode, P20 to P25 function as the serial interface data I/O and serial clock I/O.
(a) SI20, SO20, SI10, SO10
These are the serial data I/O pins of the serial interface.
(b) SCK20, SCK10
These are the serial clock I/O pins of the serial interface.
(c) RxD20, TxD20
These are the serial data I/O pins of the asynchronous serial interface.
(d) ASCK20
This is the serial clock input pin of the asynchronous serial interface.
Caution When using P20 to P25 as serial interface pins, the I/O mode and output latch must be set
according to the functions to be used. For the details of the setting, refer to Table 11-2 Serial
Interface 20 Operation Mode Setting and 12.3 (1) Serial operation mode register 1A0 (CSIM1A0).
40
User’s Manual U15331EJ4V1UD
2.2.4 P30 to P34 (Port 3)
CHAPTER 2 PIN FUNCTIONS
These pins constitute a 5-bit I/O port. In addition, they also function as timer I/O, external interrupt input, and
Note
remote control receive data input
.
Port 3 can be specified in the following operation modes in 1-bit units.
(1) Port mode
In this mode, P30 to P34 function as a 5-bit I/O port. Port 3 can be set in the input or output port mode in 1-
bit units by port mode register 3 (PM3). When used as an input port, use of an on-chip pull-up resistor can
be specified by pull-up resistor option register B3 (PUB3) in 1-bit units.
(2) Control mode
In this mode, P30 to P34 function as timer I/O, external interrupt input, and remote control receive data
Note
input
.
(a) TMI60, TMI61
These are the external clock input pins of timers 60 and 61.
(b) TO20, TO50, TO60, TO61
These are the timer output pins of timers 20, 50, 60, and 61.
(c) CPT20
This is the capture edge input pin of 16-bit timer 20.
(d) INTP0 to INTP3
These are external interrupt input pins for which valid edges (rising edge, falling edge, or both rising and
falling edges) can be specified.
(e) RIN
Note
This is the data input pin of the remote controller receiver.
µ
Note
PD789489 and 78F9489 only
2.2.5 P50 to P53 (Port 5)
These pins constitute as a 4-bit N-ch open-drain I/O port. Port 5 can be set in the input or output port mode in 1-
bit units by port mode register 5 (PM5). In the mask ROM version, use of an on-chip pull-up resistor can be specified
by a mask option in 1-bit units.
User’s Manual U15331EJ4V1UD
41
2.2.6 P60 to P67 (Port 6)
CHAPTER 2 PIN FUNCTIONS
This is an 8-bit input-only port. In addition to a general-purpose input port function, it has A/D converter input and
Note
key return signal detection
functions.
(1) Port mode
In this mode, P60 to P67 function as an 8-bit input-only port.
(2) Control mode
In this mode, P60 to P67 function as the analog inputs of the A/D converter and key return signal detection
Note
.
pins
(a) ANI0 to ANI7
These are the analog input pins of the A/D converter.
Note
(b) KR10 to KR17
These are the key return signal detection pins.
Note µPD789489 and 78F9489 only
2.2.7 P70 to P73 (Port 7)
These pins constitute a 4-bit input-only port. This port can be used only when the port function is selected by a
µ
mask option in the
PD789488, 789489 or by a port function register in the µPD78F9488, 78F9489.
2.2.8 P80 to P87 (Port 8)
These pins constitute an 8-bit I/O port. Port 8 can be set in the input or output mode in 1-bit units by port mode
register 8 (PM8). This port can be used only when the port function is selected by a mask option in the µPD789488,
789489 or by a port function register in the
µ
PD78F9488, 78F9489.
2.2.9 S0 to S27
Note
These pins are the segment signal output pins for the LCD controller/driver.
Note Pins S16 through S27 can be used only when segment output is selected by a mask option in the
µ
PD789488, 789489 or by a port function register in the µPD78F9488, 78F9489.
2.2.10 COM0 to COM3
These pins are the common signal output pins for the LCD controller/driver.
2.2.11 V
LC0 to VLC2
These pins are the power supply voltage pins for driving the LCD.
2.2.12 CAPH, CAPL
These pins are the capacitor connection pins for driving the LCD.
42
User’s Manual U15331EJ4V1UD
CHAPTER 2 PIN FUNCTIONS
2.2.13 RESET
This pin inputs an active-low system reset signal.
2.2.14 X1, X2
These pins are used to connect a crystal resonator for main system clock oscillation.
To supply an external clock, input the clock to X1 and input the inverted signal to X2.
2.2.15 XT1, XT2
These pins are used to connect a crystal resonator for subsystem clock oscillation.
To supply an external clock, input the clock to XT1 and input the inverted signal to XT2.
2.2.16 AV
DD
This is the analog power supply pin of the A/D converter. Always use the same potential as that of the VDD pin even
when the A/D converter is not used.
2.2.17 AV
SS
This is the ground potential pin of the A/D converter. Always use the same potential as that of the VSS pin even
when the A/D converter is not used.
2.2.18 V
DD
This is the positive power supply pin.
2.2.19 V
SS
This is the ground pin.
2.2.20 V
PP (flash memory version only)
A high voltage should be applied to this pin when the flash memory programming mode is set and when the
program is written or verified.
Handle the pins in either of the following ways.
• Independently connect a 10 kΩ pull-down resistor.
• Switch this pin to be directly connected to the dedicated flash programmer in programming mode or to V
normal operation mode using a jumper on the board.
If the wiring between the V
PP pin and VSS pin is very long or external noise is superimposed on the VPP pin, the
user program may not run correctly.
SS in
User’s Manual U15331EJ4V1UD
43
CHAPTER 2 PIN FUNCTIONS
2.2.21 IC0 (mask ROM version only)
µ
The IC0 (Internally Connected) pin is used to set the
the normal operation mode, directly connect this pin to the V
If there is a potential difference between the IC0 pin and V
PD789489 Subseries in the test mode before shipment. In
SS pin with as short a wiring length as possible.
SS pin due to a long wiring length or external noise
superimposed on the IC0 pin, the user program may not run correctly.
• Directly connect the IC0 pin to the V
IC0
V
SS
Keep short
SS pin.
44
User’s Manual U15331EJ4V1UD
CHAPTER 2 PIN FUNCTIONS
2.3 Pin I/O Circuits and Recommended Connection of Unused Pins
The I/O circuit type of each pin and recommended connection of unused pins are shown in Table 2-1.
For the I/O circuit configuration of each type, see Figure 2-1.
Table 2-1. Types of Pin I/O Circuits (1/2)
Pin Name I/O Circuit Type I/O Recommended Connection of Unused Pins
P00/KR0 to P07/KR7
P00/KR00 to P07/KR07
P10, P11 5-A
P20/SCK20/ASCK20 8-A
P21/SO20/TxD20 5-A
P22/SI20/RxD20
P23/SCK10
P24/SO10 5-A
P25/SI10
P30/INTP0/TO50/
TMI60
P31/INTP1/TO60
P32/INTP2/TO61/
TMI61
P33/INTP3/CPT20/
TO20
Note 1
P34
Note 2
P34/RIN
P50 to P53
(mask ROM version)
P50 to P53
(flash memory version)
P60/ANI0 to P67/ANI7
P60/ANI0/KR10 to
P67/ANI7/KR17
P70 to P73
P80 to P87
Note 3
Note 3
COM0 to COM3 18
S0 to S15
S16 to S19
S20 to S27
Note 4
Note 4
CAPH, CAPL
VLC0 to VLC2
AVDDConnect directly to VDD
AVSS
Notes1. When µPD789488, 78F9488 is used.
2. When
3. Only when port pin is selected by mask option or port function register.
4. Only when segment output pin is selected by mask option or port function register.
Note 1
Note 2
I/O
8-A
Input: Independently connect to V
Output: Leave open.
DD or VSS via a resistor.
8-A
8-A
Input: Independently connect to V
SS via a resistor.
Output: Leave open.
13-W
Input: Independently connect to V
DD via a resistor.
Output: Leave open.
13-V
Note 2
Note 1
9-C
Input Connect to V
DD or VSS.
2-H
5-K I/O Input: Independently connect to VDD or VSS via a resistor.
Output: Leave open.
Output
Leave open.
17
– –
Connect directly to VSS
µ
PD789489, 78F9489 is used.
User’s Manual U15331EJ4V1UD
45
CHAPTER 2 PIN FUNCTIONS
Table 2-1. Types of Pin I/O Circuits (2/2)
Pin Name I/O Circuit Type I/O Recommended Connection of Unused Pins
XT1 Input Connect to VSS.
XT2
–
– Leave open.
RESET 2 Input –
IC0 Connect directly to VSS.
VPP
– –
Independently connect a 10 kΩ pull-down resistor, or connect
directly to V
SS.
Figure 2-1. I/O Circuit Types (1/2)
Type 2 Type 2-H
IN
IN
Input
enable
Schmitt-triggered input with hysteresis characteristics.
Type 5-A Type 5-K
V
DD
Pull-up
enable
Data
Output
disable
V
V
SS
DD
P-ch
N-ch
P-ch
IN/OUT
Data
Output
disable
Input
enable
Input
enable
Type 8-A Type 9-C
V
DD
Pull-up
enable
Data
V
DD
P-ch
P-ch
IN
IN/OUT
Output
disable
N-ch
V
SS
P-ch
N-ch
V
DD
P-ch
IN/OUT
N
-ch
Comparator
+
SS
AV
V
REF
(Threshold voltage)
Input
enable
46
User’s Manual U15331EJ4V1UD
CHAPTER 2 PIN FUNCTIONS
Figure 2-1. I/O Circuit Types (2/2)
Type 13-W Type 13-V
V
DD
Data
Output
disable
Input
enable
Middle-voltage input buffer
Mask
option
IN/OUT
N
-ch
V
SS
Data
Output
disable
Input
enable
Type 17 Type 18
V
LC0
V
LC1
SEG
data
LC2
V
P-ch
P-ch
N-ch
P-ch
OUT
N-ch
P-ch
N-ch
N-ch
VLC0
VLC1
COM
data
VLC2
Middle-voltage input buffer
P-ch
P-ch
N-ch
P-ch
N-ch
N-ch
P-ch
N-ch
IN/OUT
N
-ch
V
SS
N-ch
OUT
P-ch
User’s Manual U15331EJ4V1UD
47
CHAPTER 3 CPU ARCHITECTURE
3.1 Memory Space
The µPD789489 Subseries can access 64 KB of memory space. Figures 3-1 to 3-4 show the memory maps.
Data memory
space
F F F F H
F F 0 0 H
F E F F H
F B 0 0 H
F A F F H
F A 1 C H
F A 1 B H
F A 0 0 H
F 9 F F H
8 0 0 0 H
7 F F F H
Figure 3-1. Memory Map (
Special function registers
256 × 8 bits
Internal high-speed RAM
1024 × 8 bits
Reserved
LCD display RAM
28 × 4 bits
Reserved
µ
PD789488)
7 F F F H
Program memory
space
0 0 0 0 H
Internal ROM
32768 × 8 bits
0 0 8 0 H
0 0 7 F H
0 0 4 0 H
0 0 3 F H
0 0 2 E H
0 0 2 D H
0 0 0 0 H
Program area
CALLT table area
Program area
Vector table area
48 User’s Manual U15331EJ4V1UD
Data memory
space
F F F F H
F F 0 0 H
F E F F H
F B 0 0 H
F A F F H
F A 1 C H
F A 1 B H
F A 0 0 H
F 9 F F H
8 0 0 0 H
7 F F F H
CHAPTER 3 CPU ARCHITECTURE
Figure 3-2. Memory Map (µPD78F9488)
Special function registers
256 × 8 bits
Internal high-speed RAM
1024 × 8 bits
Reserved
LCD display RAM
28 × 4 bits
7 F F F H
Reserved
Program memory
space
0 0 0 0 H
Flash memory
32768 × 8 bits
Program area
0 0 8 0 H
0 0 7 F H
0 0 4 0 H
0 0 3 F H
0 0 2 E H
0 0 2 D H
0 0 0 0 H
CALLT table area
Program area
Vector table area
User’s Manual U15331EJ4V1UD 49
Data memory
space
Program memory
space
F F F F H
F F 0 0 H
F E F F H
F B 0 0 H
F A F F H
F A 1 C H
F A 1 B H
F A 0 0 H
F 9 F F H
F 7 0 0 H
F 6 F F H
F 5 0 0 H
F 4 F F H
C 0 0 0 H
B F F F H
0 0 0 0 H
CHAPTER 3 CPU ARCHITECTURE
Figure 3-3. Memory Map (µPD789489)
Special function registers
256 × 8 bits
Internal high-speed RAM
1024 × 8 bits
Reserved
LCD display RAM
28 × 4 bits
Reserved
Internal low-speed
512 × 8 bits
Reserved
Internal ROM
49152 × 8 bits
B F F F H
0 0 8 0 H
0 0 7 F H
0 0 4 0 H
0 0 3 F H
0 0 3 0 H
0 0 2 F H
0 0 0 0 H
Program area
CALLT table area
Program area
Vector table area
50 User’s Manual U15331EJ4V1UD
Data memory
space
Program memory
space
F F F F H
F F 0 0 H
F E F F H
F B 0 0 H
F A F F H
F A 1 C H
F A 1 B H
F A 0 0 H
F 9 F F H
F 7 0 0 H
F 6 F F H
F 5 0 0 H
F 4 F F H
C 0 0 0 H
B F F F H
0 0 0 0 H
CHAPTER 3 CPU ARCHITECTURE
Figure 3-4. Memory Map (µPD78F9489)
Special function registers
256 × 8 bits
Internal high-speed RAM
1024 × 8 bits
Reserved
LCD display RAM
28 × 4 bits
Reserved
Internal low-speed RAM
512 × 8 bits
Reserved
Flash memory
49152 × 8 bits
B F F F H
0 0 8 0 H
0 0 7 F H
0 0 4 0 H
0 0 3 F H
0 0 3 0 H
0 0 2 F H
0 0 0 0 H
Program area
CALLT table area
Program area
Vector table area
User’s Manual U15331EJ4V1UD 51
CHAPTER 3 CPU ARCHITECTURE
3.1.1 Internal program memory space
The internal program memory space stores programs and table data. This space is usually addressed by the
program counter (PC).
The
µ
PD789489 Subseries provide internal ROM (or flash memory) with the following capacity for each product.
Table 3-1. Internal ROM Capacity
Part Number Internal ROM
Structure Capacity
µ
PD789488 Mask ROM
µ
PD78F9488 Flash memory
µ
PD789489 Mask ROM
µ
PD78F9489 Flash memory
32768 × 8 bits
49152 × 8 bits
The following areas are allocated to the internal program memory space.
(1) Vector table area
The 46-byte area of addresses 0000H to 002DH is reserved in the
µ
PD789488 and 78F9488, and the 48-
byte area of address 0000H to 002FH is reserved in the µPD789489 and 78F9489 as a vector table area.
This area stores program start addresses to be used when branching by RESET input or interrupt request
generation. Of a 16-bit program address, the lower 8 bits are stored in an even address, and the higher 8
bits are stored in an odd address.
PD789489 and 78F9489 only. There are no interrupt requests corresponding to vector table
µ
addresses 000EH, and 0026H through 002EH for
PD789488 and 78F9488.
(2) CALLT instruction table area
The subroutine entry address of a 1-byte call instruction (CALLT) can be stored in the 64-byte area of
addresses 0040H to 007FH.
52 User’s Manual U15331EJ4V1UD
CHAPTER 3 CPU ARCHITECTURE
3.1.2 Internal data memory space
(1) Internal high-speed RAM and internal low-speed RAM
The
µ
PD789489 Subseries products incorporate the internal high-speed RAM and internal low-speed RAM of
the following capacity for each product.
The internal high-speed RAM can also be used as a stack.
The internal low-speed RAM cannot be used as a stack.
Part Number Internal High-Speed RAM Internal Low-Speed RAM
µ
PD789488
µ
PD78F9488
µ
PD789489
µ
PD78F9489
1024 × 8 bits
(2) LCD display RAM
LCD display RAM is incorporated in the area between FA00H and FA1BH.
The LCD display RAM can also be used as ordinary RAM.
3.1.3 Special function register (SFR) area
−
512 × 8 bits
Special function registers (SFRs) of on-chip peripheral hardware are allocated in the area between FF00H and
FFFFH (see Table 3-4).
User’s Manual U15331EJ4V1UD 53
CHAPTER 3 CPU ARCHITECTURE
3.1.4 Data memory addressing
µ
PD789489 Subseries is provided with a variety of addressing modes to make memory manipulation as
The
efficient as possible. At the addresses corresponding to data memory area (FB00H to FFFFH) especially, specific
addressing modes that correspond to the particular function of an area, such as the special function registers, are
available. Figures 3-5 to 3-8 show the data memory addressing modes.
F F F F H
F F 2 0 H
F F 1 F H
F F 0 0 H
F E F F H
Figure 3-5. Data Memory Addressing (
Special function registers
256 × 8 bits
SFR addressing
µ
PD789488)
F E 2 0 H
F E 1 F H
F B 0 0 H
F A F F H
F A 1 C H
F A 1 B H
F A 0 0 H
F 9 F F H
8 0 0 0 H
7 F F F H
Internal high-speed RAM
1024 × 8 bits
Reserved
LCD display RAM
28 × 4 bits
Reserved
Internal ROM
32768 × 8 bits
Short direct addressing
Direct addressing
Register indirect addressing
Based addressing
0 0 0 0 H
54 User’s Manual U15331EJ4V1UD
F F F F H
F F 2 0 H
F F 1 F H
F F 0 0 H
F E F F H
Figure 3-6. Data Memory Addressing (µPD78F9488)
Special function registers
256 × 8 bits
CHAPTER 3 CPU ARCHITECTURE
SFR addressing
F E 2 0 H
F E 1 F H
F B 0 0 H
F A F F H
F A 1 C H
F A 1 B H
F A 0 0 H
F 9 F F H
8 0 0 0 H
7 F F F H
Internal high-speed RAM
1024 × 8 bits
Reserved
LCD display RAM
28 × 4 bits
Reserved
Flash memory
32768 × 8 bits
Short direct addressing
Direct addressing
Register indirect addressing
Based addressing
0 0 0 0 H
User’s Manual U15331EJ4V1UD 55
F F F F H
CHAPTER 3 CPU ARCHITECTURE
Figure 3-7. Data Memory Addressing (µPD789489)
F F 2 0 H
F F 1 F H
F F 0 0 H
F E F F H
F E 2 0 H
F E 1 F H
F B 0 0 H
F A F F H
F A 1 C H
F A 1 B H
F A 0 0 H
F 9 F F H
F 7 0 0 H
F 6 F F H
F 5 0 0 H
F 4 F F H
C 0 0 0 H
B F F F H
Special function registers (SFR)
256 × 8 bits
Internal high-speed RAM
1024 × 8 bits
Reserved
LCD display RAM
28 × 4 bits
Reserved
Internal low-speed RAM
512 × 8 bits
Reserved
SFR addressing
Short direct addressing
Direct addressing
Register indirect addressing
Based addressing
0 0 0 0 H
Internal ROM
49152 × 8 bits
56 User’s Manual U15331EJ4V1UD
F F F F H
F F 2 0 H
F F 1 F H
F F 0 0 H
F E F F H
F E 2 0 H
F E 1 F H
F B 0 0 H
F A F F H
F A 1 C H
F A 1 B H
F A 0 0 H
F 9 F F H
F 7 0 0 H
F 6 F F H
F 5 0 0 H
F 4 F F H
C 0 0 0 H
B F F F H
Figure 3-8. Data Memory Addressing (µPD78F9489)
Special function registers
256 × 8 bits
Internal high-speed RAM
1024 × 8 bits
Reserved
LCD display RAM
28 × 4 bits
Reserved
Internal low-speed
512 × 8 bits
Reserved
CHAPTER 3 CPU ARCHITECTURE
SFR addressing
Short direct addressing
Direct addressing
Register indirect addressing
Based addressing
0 0 0 0 H
Flash memory
49152 × 8 bits
User’s Manual U15331EJ4V1UD 57
CHAPTER 3 CPU ARCHITECTURE
3.2 Processor Registers
The µPD789489 Subseries is provided with the following on-chip processor registers.
3.2.1 Control registers
The control registers contain special functions to control the program sequence status and stack memory. The
program counter, program status word, and stack pointer are control registers.
(1) Program counter (PC)
The program counter is a 16-bit register that holds the address information of the next program to be
executed.
In normal operation, the PC is automatically incremented according to the number of bytes of the instruction
to be fetched. When a branch instruction is executed, immediate data or register contents are set.
RESET input sets the reset vector table values at addresses 0000H and 0001H to the program counter.
The program status word is an 8-bit register consisting of various flags to be set/reset by instruction
execution.
The program status word contents are automatically stacked upon interrupt request generation or PUSH
PSW instruction execution and are automatically restored upon execution of the RETI and POP PSW
instructions.
RESET input sets PSW to 02H.
Figure 3-10. Program Status Word Configuration
70
PSW
IE
Z0AC001CY
58 User’s Manual U15331EJ4V1UD
(a) Interrupt enable flag (IE)
This flag controls interrupt request acknowledgement operations of the CPU.
When 0, IE is set to the interrupt disabled status (DI), and interrupt requests other than non-maskable
interrupts are all disabled.
When 1, IE is set to the interrupt enabled status (EI). Interrupt request acknowledgement enable is
controlled by the interrupt mask flag for the corresponding interrupt source.
IE is reset (0) upon DI instruction execution or interrupt acknowledgment and is set (1) upon EI
instruction execution.
(b) Zero flag (Z)
When the operation result is zero, this flag is set (1). It is reset (0) in all other cases.
(c) Auxiliary carry flag (AC)
If the operation result has a carry from bit 3 or a borrow at bit 3, this flag is set (1). It is reset (0) in all
other cases.
(d) Carry flag (CY)
This flag stores an overflow or 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.
CHAPTER 3 CPU ARCHITECTURE
User’s Manual U15331EJ4V1UD 59
CHAPTER 3 CPU ARCHITECTURE
(3) Stack pointer (SP)
This is a 16-bit register that holds the start address of the memory stack area. Only the internal high-speed
RAM area can be set as the stack area.
The SP is decremented ahead of write (save) to the stack memory and is incremented after read (restore)
from the stack memory.
Each stack operation saves/restores data as shown in Figures 3-12 and 3-13.
Caution Since RESET input makes the SP contents undefined, be sure to initialize the SP before
instruction execution.
Figure 3-12. Data to Be Saved to Stack Memory
015
SP SP _ 2
SP _ 2
SP _ 1
SP
SP
SP + 1
PUSH rp
instruction
Lower
register pairs
Higher
register pairs
SP SP _ 2
SP _ 2
SP _ 1
SP
CALL, CALLT
instructions
PC7 to PC0
PC15 to PC8
Figure 3-13. Data to Be Restored from Stack Memory
instruction
Lower
register pairs
Higher
register pairs
SP
SP + 1
RET instructionPOP rp
PC7 to PC0
PC15 to PC8
SP SP _ 3
SP _ 3
SP _ 2
SP _ 1
SP
SP
SP + 1
Interrupt
PC7 to PC0
PC15 to PC8
PSW
RETI instruction
PC7 to PC0
PC15 to PC8
SP SP + 2
SP SP + 2
60 User’s Manual U15331EJ4V1UD
SP + 2
SP SP + 3
PSW
CHAPTER 3 CPU ARCHITECTURE
3.2.2 General-purpose registers
The general-purpose registers consist of eight 8-bit registers (X, A, C, B, E, D, L, and H).
Each register can be used as an 8-bit register, or two 8-bit registers in pairs can be used as a 16-bit register (AX,
BC, DE, and HL).
General-purpose registers can be described in terms of function names (X, A, C, B, E, D, L, H, AX, BC, DE, or HL)
Unlike a general-purpose register, each special function register has a special function.
The special function registers are allocated in the 256-byte area of FF00H to FFFFH.
Special function registers can be manipulated, like general-purpose registers, by operation, transfer, and bit
manipulation instructions. The manipulatable bit units (1, 8, and 16) differ depending on the special function register
type.
The manipulatable bits can be specified as follows.
• 1-bit manipulation
Describe the symbol reserved by the assembler for the 1-bit manipulation instruction operand (sfr.bit). This
manipulation can also be specified with an address.
• 8-bit manipulation
Describe the symbol reserved by the assembler for the 8-bit manipulation instruction operand (sfr). This
manipulation can also be specified with an address.
• 16-bit manipulation
Describe the symbol reserved by the assembler for the 16-bit manipulation instruction operand. When
addressing an address, describe an even address.
Table 3-4 lists the special function registers. The meanings of the symbols in this table are as follows.
• Symbol
Indicates the addresses of the implemented special-function registers. The symbols shown in this column are
reserved words in the assembler, and have already been defined as sfr variables by the #pragma sfr directive in
the C compiler. Therefore, these symbols can be used as instruction operands if an assembler or integrated
debugger is used.
• R/W
Indicates whether the special function register in question can be read or written.
R/W: Read/write
R: Read only
W: Write only
• Bit unit for manipulation
Indicates the bit units (1, 8, 16) in which the special function register in question can be manipulated.
• After reset
Indicates the status of the special function register when the RESET signal is input.
62 User’s Manual U15331EJ4V1UD
CHAPTER 3 CPU ARCHITECTURE
Table 3-4. Special Function Registers (1/3)
FF00H Port 0 P0
R/W
FF01H Port 1 P1
FF02H Port 2 P2
FF03H Port 3 P3
FF05H Port 5 P5
FF06H Port 6 P6
FF07H Port 7
FF08H Port 8
Note
P7
Note
P8 R/W
R
FF0AH 8-bit compare register 61 CR61 W
FF0BH 8-bit timer counter 61 TM61 R
FF0CH 8-bit compare register 60 CR60
CR6 W
FF0DH 8-bit compare register 50 CR50
FF0EH 8-bit timer counter 60 TM60
TM6 R
FF0FH 8-bit timer counter 50 TM50
FF11H Serial I/O shift register 1A0 SIO1A0 R/W
FF12H 16-bit multiplication result store register L MUL0L
MUL0
R
FF13H 16-bit multiplication result store register H MUL0H
FF14H
A/D conversion result register 0 ADCRL0
FF15H
FF16H
16-bit compare register 20 CR20 W
FF17H
FF18H
16-bit timer counter 20 TM20
R
FF19H
FF1AH
16-bit capture register 20 TCP20
FF1BH
FF20H Port mode register 0 PM0
R/W
FF21H Port mode register 1 PM1
FF22H Port mode register 2 PM2
FF23H Port mode register 3 PM3
FF25H Port mode register 5 PM5
FF28H Port mode register 8
Note
PM8
FF30H Pull-up resistor option register B0 PUB0
FF31H Pull-up resistor option register B1 PUB1
FF32H Pull-up resistor option register B2 PUB2
FF33H Pull-up resistor option register B3 PUB3
Bit Unit for ManipulationAddress Special Function Register (SFR) Name Symbol R/W
1 Bit 8 Bits 16 Bits
√ √ −
√ √ −
√ √ −
√ √ −
√ √ −
√ √ −
√ √ −
√ √ −
− √ −
− √ −
− √
√
− √
− √
√
− √
− √ −
− √
√
− √
− − √
− − √
− − √
− − √
√ √ −
√ √ −
√ √ −
√ √ −
√ √ −
√ √ −
√ √ −
√ √ −
√ √ −
√ √ −
After
Reset
00H
Undefined
00H
Undefined
00H
Undefined
0000H
FFFFH
0000H
Undefined
FFH
00H
Note When used as port function by mask option or port function register.
FF6EH Remote controller receive end width select register
RMSCR
Note 2
RMGPHS
Note 2
RMGPHL
Note 2
RMDLS
Note 2
RMDLL
Note 2
RMDH0S
Note 2
RMDH0L
Note 2
RMDH1S
Note 2
RMDH1L
Note 2
RMER
W
R
R/W
FF70H Asynchronous serial interface mode register 20 ASIM20
FF71H Asynchronous serial interface status register 20 ASIS20 R
FF72H Serial operation mode register 20 CSIM20
R/W
FF73H Baud rate generator control register 20 BRGC20
Transmit shift register 20 TXS20W
Receive buffer register 20 RXB20
FF78H Serial operation mode register 1A0 CSIM1A0
SIO20
R
R/W
FF79H Automatic data transmit/receive control register 0 ADTC0
FF7AH Automatic data transmit/receive address pointer 0 ADTP0
FF7BH Automatic data transmit/receive interval specification
ADTI0
register 0
Bit Unit for Manipulation Address Special Function Register (SFR) Name Symbol R/W
1 Bit 8 Bits 16 Bits
− √ −
√ √ −
− √ −
√ √ −
√ √ −
√ √ −
√ √ −
− √ −
√ √ −
√ √ −
√ √ −
− √ −
− √ −
√ √ −
− √ −
− √ −
− √ −
− √ −
− √ −
− √ −
− √ −
− √ −
− √ −
− √ −
− √ −
− √ −
√ √ −
√ √ −
√ √ −
− √ −
− √ −
− √ −
√ √ −
√ √ −
− √ −
√ √ −
After
Reset
Undefined
00H
Undefined
00H
FFH FF74H
Undefined
00H
Undefined
00H
Notes 1. These registers function only in the µPD78F9488 and 78F9489; however, writing to these registers in
µ
PD789488 and 789489 will not affect the operation.
the
µ
2.
PD789489 and 78F9489 only
64 User’s Manual U15331EJ4V1UD
CHAPTER 3 CPU ARCHITECTURE
Table 3-4. Special Function Registers (3/3)
FF80H A/D converter mode register 0 ADML0
FF84H Analog input channel specification register 0 ADS0
FFA0H Serial interface buffer memory 0 SBMEM0
FFA1H Serial interface buffer memory 1 SBMEM1
FFA2H Serial interface buffer memory 2 SBMEM2
FFA3H Serial interface buffer memory 3 SBMEM3
FFA4H Serial interface buffer memory 4 SBMEM4
FFA5H Serial interface buffer memory 5 SBMEM5
FFA6H Serial interface buffer memory 6 SBMEM6
FFA7H Serial interface buffer memory 7 SBMEM7
FFA8H Serial interface buffer memory 8 SBMEM8
FFA9H Serial interface buffer memory 9 SBMEM9
FFAAH Serial interface buffer memory A SBMEMA
FFABH Serial interface buffer memory B SBMEMB
FFACH Serial interface buffer memory C SBMEMC
FFADH Serial interface buffer memory D SBMEMD
FFAEH Serial interface buffer memory E SBMEME
FFAFH Serial interface buffer memory F SBMEMF
FFB0H LCD mode register 0 LCDM0
FFB2H LCD clock control register 0 LCDC0
FFB3H LCD voltage boost control register 0 LCDVA0
FFD0H Multiplication data register A0 MRA0
FFD1H Multiplication data register B0 MRB0
FFD2H Multiplier control register 0 MULC0
FFE0H Interrupt request flag register 0 IF0
FFE1H Interrupt request flag register 1 IF1
FFE2H Interrupt request flag register 2 IF2
FFE4H Interrupt mask flag register 0 MK0
FFE5H Interrupt mask flag register 1 MK1
FFE6H Interrupt mask flag register 2 MK2
FFECH External interrupt mode register 0 INTM0
FFEDH External interrupt mode register 1 INTM1
FFF0H Subclock oscillation mode register SCKM
FFF2H Subclock control register CSS
FFF4H Key return mode register 01
Note
KRM01
FFF5H Key return mode register 00 KRM00
FFF9H Watchdog timer mode register WDTM
FFFAH Oscillation stabilization time selection register OSTS
FFFBH Processor clock control register PCC
Bit Unit for ManipulationAddress Special Function Register (SFR) Name Symbol R/W
1 Bit 8 Bits 16 Bits
R/W
√ √ −
√ √ −
− √ −
− √ −
− √ −
− √ −
− √ −
− √ −
− √ −
− √ −
− √ −
− √ −
− √ −
− √ −
− √ −
− √ −
− √ −
− √ −
√ √ −
√ √ −
√ √ −
W
− √ −
− √ −
R/W
√ √ −
√ √ −
√ √ −
√ √ −
√ √ −
√ √ −
√ √ −
− √
− √
√
√−
√
√−
√
√−
√
√−
√
√−
−√
√−
√
−
−
−
After
Reset
00H
Undefined
00H
Undefined
00H
FFH
00H
04H
02H
Note µPD789489 and 78F9489 only
User’s Manual U15331EJ4V1UD 65
CHAPTER 3 CPU ARCHITECTURE
3.3 Instruction Address Addressing
An instruction address is determined by the program counter (PC) contents. The PC contents 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 each instruction, refer to 78K/0S Series
Instructions User’s Manual (U11047E)).
3.3.1 Relative addressing
[Function]
The value obtained by adding 8-bit immediate data (displacement value: jdisp8) of an instruction code to the
start address of the following instruction is transferred to the program counter (PC) and branched. The
displacement value is treated as signed two’s complement data (–128 to +127) and bit 7 becomes a sign bit.
This means that information is relatively branched to a location between –128 and +127, from the start address
of the next instruction when relative addressing is used.
This function is carried out when the BR $addr16 instruction or a conditional branch instruction is executed.
[Illustration]
150
PC
+
...
PC is the start address of
the next instruction of
a BR instruction.
150
α
150
PC
When S = 0, α indicates all bits 0.
When S = 1, α indicates all bits 1.
876
S
jdisp8
66 User’s Manual U15331EJ4V1UD
CHAPTER 3 CPU ARCHITECTURE
3.3.2 Immediate addressing
[Function]
Immediate data in the instruction word is transferred to the program counter (PC) and branched.
This function is carried out when the CALL !addr16 or BR !addr16 instruction is executed.
CALL !addr16 and BR !addr16 instructions can be branched to any location in the memory space.
[Illustration]
In case of CALL !addr16 and BR !addr16 instructions
70
CALL or BR
Low Addr.
High Addr.
150
PC
87
User’s Manual U15331EJ4V1UD 67
CHAPTER 3 CPU ARCHITECTURE
3.3.3 Table indirect addressing
[Function]
Table contents (branch destination address) of the particular location to be addressed by the lower 5-bit
immediate data of an instruction code from bit 1 to bit 5 are transferred to the program counter (PC) and
branched.
This function is carried out when the CALLT [addr5] instruction is executed. The instruction enables a branch
to any location in the memory space by referring to the addresses stored in the memory table at 40H to 7FH.
[Illustration]
76510
Instruction code
ta4–0
001
Effective address
Effective address + 1
151
00000000
01
Memory (Table)
70
Low Addr.
High Addr.
150
PC
87
87
650
0
3.3.4 Register addressing
[Function]
The register pair (AX) contents to be specified with an instruction word are transferred to the program counter
(PC) and branched.
This function is carried out when the BR AX instruction is executed.
[Illustration]
70
07
rp
150
PC
AX
87
68 User’s Manual U15331EJ4V1UD
CHAPTER 3 CPU ARCHITECTURE
3.4 Operand Address Addressing
The following various methods are available to specify the register and memory (addressing) which undergo
manipulation during instruction execution.
3.4.1 Direct addressing
[Function]
The memory indicated with immediate data in an instruction word is directly addressed.
[Operand format]
Identifier Description
addr16 Label or 16-bit immediate data
[Description example]
MOV A, !FE00H; When setting !addr16 to FE00H
Instruction code00101001OP code
[Illustration]
00000000
11111110
70
OP code
addr16 (Lower)
addr16 (Higher)
Memory
00H
FEH
User’s Manual U15331EJ4V1UD 69
CHAPTER 3 CPU ARCHITECTURE
3.4.2 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 is the 256-byte space FE20H to FF1FH where the addressing is applied. Internal high-speed
RAM and special function registers (SFRs) are mapped at FE20H to FEFFH and FF00H to FF1FH,
respectively.
The SFR area (FF00H to FF1FH) where short direct addressing is applied is a part of the whole SFR area.
Ports that are frequently accessed in a program and the compare register of the timer/event counter are
mapped in this area, and these SFRs can be manipulated with a small number of bytes and clocks.
When 8-bit immediate data is at 20H to FFH, bit 8 of an effective address is set to 0. When it is at 00H to 1FH,
bit 8 is set to 1. See [Illustration] below.
[Operand format]
Identifier Description
saddr Label or FE20H to FF1FH immediate data
saddrp Label or FE20H to FF1FH immediate data (even address only)
[Description example]
MOV FE90H, #50H; When setting saddr to FE90H and the immediate data to 50H
Instruction code11110101
OP code
[Illustration]
Effective
address
10010000
01010000
07
OP code
saddr-offset
15
1
111111
When 8-bit immediate data is 20H to FFH, α = 0.
When 8-bit immediate data is 00H to 1FH, α = 1.
8
α
90H (saddr-offset)
50H (Immediate data)
Short direct memory
0
70 User’s Manual U15331EJ4V1UD
CHAPTER 3 CPU ARCHITECTURE
3.4.3 Special function register (SFR) addressing
[Function]
The memory-mapped special function registers (SFRs) are addressed with 8-bit immediate data in an
instruction word.
This addressing is applied to the 256-byte space FF00H to FFFFH. However, the SFRs mapped at FF00H to
FF1FH can also be accessed with short direct addressing.
[Operand format]
Identifier Description
sfr Special function register name
[Description example]
MOV PM0, A; When selecting PM0 for sfr
Instruction code11100111
[Illustration]
Effective
Address
OP code
sfr-offset
15
1
111111
07
87
1
00100000
0
SFR
User’s Manual U15331EJ4V1UD 71
CHAPTER 3 CPU ARCHITECTURE
3.4.4 Register addressing
[Function]
In the register addressing mode, general-purpose registers are accessed as operands. The general-purpose
register to be accessed is specified by a register specification code or functional name in the 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 instruction code.
[Operand format]
Identifier Description
r X, A, C, B, E, D, L, H
rp AX, BC, DE, HL
r and rp can be described with absolute names (R0 to R7 and RP0 to RP3) as well as function names (X, A, C,
B, E, D, L, H, AX, BC, DE, and HL).
[Description example]
MOV A, C; When selecting the C register for r
Instruction code00001010
00100101
INCW DE; When selecting the DE register pair for rp
Instruction code10001000
Register specification code
Register specification code
72 User’s Manual U15331EJ4V1UD
CHAPTER 3 CPU ARCHITECTURE
3.4.5 Register indirect addressing
[Function]
In the register indirect addressing mode, memory is manipulated according to the contents of a register pair
specified as an operand. The register pair to be accessed is specified by the register pair specification code in
an instruction code.
This addressing can be carried out for all the memory spaces.
[Operand format]
Identifier Description
−
[Description example]
MOV A, [DE]; When selecting register pair [DE]
Instruction code00101011
[Illustration]
1508D7
DE
Addressed memory
contents are
transferred.
7 0
A
[DE], [HL]
E
Memory address
07
specified with
register pair DE.
User’s Manual U15331EJ4V1UD 73
CHAPTER 3 CPU ARCHITECTURE
3.4.6 Based addressing
[Function]
8-bit immediate data is added to the contents of the base register, that is, the HL register pair, and the sum is
used to address the memory. Addition is performed by expanding the offset data as a positive number to 16
bits. A carry from the 16th bit is ignored. This addressing can be carried out for all the memory spaces.
[Operand format]
Identifier Description
−
[HL+byte]
[Description example]
MOV A, [HL+10H]; When setting byte to 10H
Instruction code00101101
00010000
3.4.7 Stack addressing
[Function]
The stack area is indirectly addressed with the stack pointer (SP) contents.
This addressing method is automatically employed when the PUSH, POP, subroutine call, and return
instructions are executed or the register is saved/restored upon generation of an interrupt request.
Only the internal high-speed RAM area can be addressed using stack addressing.
[Description example]
In the case of PUSH DE
Instruction code10101010
74 User’s Manual U15331EJ4V1UD
CHAPTER 4 PORT FUNCTIONS
4.1 Port Functions
The µPD789489 Subseries provides the ports shown in Figure 4-1, enabling various methods of control. The
functions of each port are shown in Table 4-1.
Numerous other functions are provided that can be used in addition to the digital I/O port functions. For more
information on these additional functions, see CHAPTER 2 PIN FUNCTIONS.
Figure 4-1. Port Types
P50
Port 5
P53
P60
Port 6
P67
P70
Port 7
P73
P80
Port 8
P87
P00
P07
P10
P11
P20
P25
P30
P34
Port 0
Port 1
Port 2
Port 3
Remark Ports 7 and 8 are used when the port function is selected by a mask option or port function register.
User’s Manual U15331EJ4V1UD 75
CHAPTER 4 PORT FUNCTIONS
Table 4-1. Port Functions
Port Name Pin Name Function
Port 0 P00 to P07 I/O port. Input/output can be specified in 1-bit units.
When used as an input port, an on-chip pull-up resistor can be specified in 1-bit units by
pull-up resistor option register B0 (PUB0) or the key return mode register (KRM00).
Port 1 P10, P11 I/O port. Input/output can be specified in 1-bit units.
When used as an input port, an on-chip pull-up resistor can be specified in 1-bit units by
pull-up resistor option register B1 (PUB1).
Port 2 P20 to P25 I/O port. Input/output can be specified in 1-bit units.
When used as an input port, an on-chip pull-up resistor can be specified in 1-bit units by
pull-up resistor option register B2 (PUB2).
Port 3 P30 to P34 I/O port. Input/output can be specified in 1-bit units.
When used as an input port, an on-chip pull-up resistor can be specified in 1-bit units by
pull-up resistor option register B3 (PUB3).
Port 5 P50 to P53 N-ch open-drain I/O port. Input/output can be specified in 1-bit units.
An on-chip pull-up resistor can be specified by mask option.
Port 6 P60 to P67 Input port
Note 1
Port 7
Port 8
P70 to P73 Input port (only when input port is selected by mask option or port function register)
Note 2
P80 to P87 I/O port (only when I/O port is selected by mask option or port function register)
Notes 1. Whether to use these pins as input port pins (P70 to P73) or segment outputs (S16 to S19) can be
selected in 1-bit units by means of a mask option in the µPD789488, 789489 or a port mode register in
µ
PD78F9488, 78F9489 (refer to 4.3 (3) Port function registers and CHAPTER 20 MASK
the
OPTIONS).
2. Whether to use these pins as I/O port pins (P80 to P87) or segment outputs (S20 to S27) can be
selected in 1-bit units by means of a mask option for the
µ
PD78F9488, 78F9489 (refer to 4.3 (3) Port function registers and CHAPTER 20 MASK
the
µ
PD789488, 789489 or a port mode register in
OPTIONS).
4.2 Port Configuration
Ports have the following hardware configuration.
Table 4-2. Configuration of Port
Item Configuration
Control registers Port mode registers (PMm: m = 0 to 3, 5, 8)