(O. D. No. IEM-5119H)
Date Published September 1994 P
Printed in Japan
GENERAL
1
PIN FUNCTIONS
CPU FUNCTION
CLOCK GENERATOR
PORT FUNCTIONS
REAL-TIME OUTPUT FUNCTION
TIMER/COUNTER UNITS
A/D CONVERTER
ASYNCHRONOUS SERIAL INTERFACE
CLOCK SYNCHRONOUS SERIAL INTERFACE
EDGE DETECTION FUNCTION
INTERRUPT FUNCTIONS
LOCAL BUS INTERFACE FUNCTION
STANDBY FUNCTION
2
3
4
5
6
7
8
9
10
11
12
13
14
RESET FUNCTION
APPLICATION EXAMPLES
PROGRAMMING FOR THE
INSTRUCTION OPERATIONS
78K/II SERIES PRODUCT LIST
DEVELOPMENT TOOLS
SOFTWARE FOR EMBEDDED APPLICATIONS
REGISTER INDEX
µ
PD78214
INDEX
15
16
17
18
A
B
C
D
E
Cautions on CMOS Devices
1Countermeasures against static electricity for all MOSs
CautionWhen handling MOS devices, take care so that they are not electrostatically charged.
Strong static electricity may cause dielectric breakdown in gates. When transporting or
storing MOS devices, use conductive trays, magazine cases, shock absorbers, or metal
cases that NEC uses for packaging and shipping. Be sure to ground MOS devices during
assembling. Do not allow MOS devices to stand on plastic plates or do not touch pins.
Also handle boards on which MOS devices are mounted in the same way.
2CMOS-specific handling of unused input pins
CautionHold CMOS devices at a fixed input level.
Unlike bipolar or NMOS devices, if a CMOS device is operated with no input, an
intermediate-level input may be caused by noise. This allows current to flow in the CMOS
device, resulting in a malfunction. Use a pull-up or pull-down resistor to hold a fixed input
level. Since unused pins may function as output pins at unexpected times, each unused
pin should be separately connected to the V
If handling of unused pins is documented, follow the instructions in the document.
3Statuses of all MOS devices at initialization
CautionThe initial status of a MOS device is unpredictable when power is turned on.
Since characteristics of a MOS device are determined by the amount of ions implanted
in molecules, the initial status cannot be determined in the manufacture process. NEC
has no responsibility for the output statuses of pins, input and output settings, and the
contents of registers at power on. However, NEC assures operation after reset and items
for mode setting if they are defined.
When you turn on a device having a reset function, be sure to reset the device first.
DD or GND pin through a resistor.
EWS-4800 Series, EWS-UX/V, and QTOP are trademarks of NEC Corporation.
MS-DOS is a trademark of Microsoft Corporation.
IBM DOS, PC/AT, and PC DOS are trademarks of IBM Corporation.
SPARCstation is a trademark of SPARC International, Inc.
Sun OS is a trademark of Sun Microsystems Inc.
HP9000 Series 300 and HP-UX are trademarks of Hewlett-Packard.
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.
The devices listed in this document are not suitable for use in aerospace equipment, submarine cables, nuclear
reactor control systems and life support systems. If customers intend to use NEC devices for above applications
or they intend to use "Standard" quality grade NEC devices for applications not intended by NEC, please contact
our sales people in advance.
Application examples recommended by NEC Corporation
Standard: Computer, Office equipment, Communication equipment, Test and Measurement equipment,
Machine tools, Industrial robots, Audio and Visual equipment, Other consumer products, etc.
Special: Automotive and Transportation equipment, Traffic control systems, Antidisaster systems, Anticrime
systems, etc.
M7 92.6
Main Revisions in This Edition
PageDescription
P.55V
P.329
P.383"Caution" has been added in (b) of Section
P.429Appendix B has been modified as follows:
P.441Appendix C has been added.
Major changes in this revision are indicated by stars (★)
in the margins.
and "Caution" have been added in (a) of Fig.
SS
4-2.
"Caution" has been added in (2) of Section 12.4.6.
14.4.2.
• "IBM PC series" has been changed to "IBM
PC/AT."
• Upgraded versions of MS-DOS are now
supported by some development tools
designed for the PC-9800 series.
• 3.5" 2HC has been added to as a PC DOS
distribution media.
• MS DOS and IBM DOS have been added
as supported operating systems for the
IBM PC/AT.
• The description of real-time OS has been
deleted.
PREFACE
Users:
This manual is aimed at engineers who need to be familiar with the capabilities of the µPD78214 sub-series for
application program development purposes.
Purpose:
The purpose of this manual is to help users understand the hardware capabilities of the µPD78214 sub-series.
Organization:
Two manuals are available for the µPD78214 sub-series: The hardware manual (this manual) and instruction
manual (common to all 78K/II series products). The contents of the manuals are:
HardwareInstruction
Pin functionsCPU functions
Internal block functionsAddressing
Interrupt functionsInstruction set
Other built-in functions
Important information related to using the products described in this manual is provided in the form of
“Caution” notes, appearing in appropriate places in each chapter. Each “Caution” is repeated at the end
of the chapter. Be careful to observe these notes when using the products.
Guidance:
Readers of this manual are assumed to have a general knowledge of electronics, logical circuits, and microcomputers.
When using this manual with the µPD78212, µPD78213, µPD78P214, µPD78212(A), µPD78213(A), µPD78214(A), or
µ
PD78P214(A):
This manual describes the functions of the µPD78212, µPD78213, µPD78214, µPD78P214, µPD78212(A), µPD78213(A),
µ
PD78214(A), and µPD78P214(A). The relationships between these products are shown in the figure on the next
page. Where there is no functional difference between the products, only the µPD78214 is described, that
description also being applicable to the µPD78212, µPD78213, µPD78P214, µPD78212(A), µPD78213(A), µPD78214(A),
and µPD78P214(A).
The examples given in this manual are prepared for “Standard” quality products for general electronics
devices. If customers intend to use the examples in this manual in fields where the “Special” quality is
required, note the quality grade of the parts and circuits actually used.
PD78P214
µ
PD78P214(A)
µ
PROM 16K
RAM 512
PD78214
µ
PD78214(A)
µ
PD78212
µ
PD78212(A)
µ
ROM 16K
RAM 512
ROM 8K
RAM 384
PD78213
µ
PD78213(A)
µ
ROM-less
RAM 512
To check the details of a register when you know the name of the register:
See Appendix D.
To check the differences between the µPD78214 sub-series and other models of the 78K/II series:
First see Appendix A to determine the differences between the models then see Appendix E for details.
To check the details of a function when you know the name of the function:
See Appendix E.
If the microcomputer does not operate correctly during debugging:
See the cautions at the end of the chapter related to the erroneous function.
To become familiar with the general functions of the µPD78214 sub-series:
Read the entire manual in the order of the table of contents.
To determine the instructions supported by the µPD78214 sub-series in detail:
Refer to 78K/II Series User’s Manual, Instruction (IEU-1311).
To determine the electrical characteristics of the µPD78214 sub-series:
Refer to the separate data sheet.
Application examples of the µPD78214 sub-series:
Refer to the separate application note.
Notation:
Data weight:High-order digits on the left side
Low-order digits on the right side
Active low:××× (Pins and signal names are overscored.)
Note:Explanation of a noted part of text
Caution:Information demanding the user's special attention
Remarks:Supplementary information
Numeric value: Binary: ××××B or ××××
Decimal: ××××
Hexadecimal : ××××H
Register representation
7
6
5
4
3
2
1
0
EDC
Register name
B
1
0
×
A
1
0
The encircled bit number indicates that the bit name
×
is used as reserved word by the NEC assembler and
defined by the header file, sfrbit.h, by C compiler.
Write operationRead operation
Either 0 or 1 can be
written to this bit without
affecting the register
operation.
Write 0 to this bit.
Write 1 to this bit.
Write a value according to
the necessary function.
Never use the code combinations indicated "Not to be set" in the register descriptions.
Characters likely to be confused: 0 (zero) and O (uppercase "O")
1 (one), l (lowercase "L"), and I (uppercase "I")
Related documents:
The following reference documents are also available.
0 or 1 is read from these
bits.
A value is read according
to the operation.
• Documents related to the µPD78214 sub-series
Product
Document
Data Sheet
User's ManualHardware
Instruction
Application Note Basic
Application
Floating-Point Arithme-
tic Operation Programs
• Serial Bus Interface (SBI) User’s Manual (IEM-1303)
APPENDIX C SOFTWARE FOR EMBEDDED APPLICATIONS .......................................................................... 441
C.1FUZZY INFERENCE DEVELOPMENT SUPPORT SYSTEM .............................................. 441
APPENDIX D REGISTER INDEX..........................................................................................................................443
D.1REGISTER INDEX .................................................................................................................443
D.2REGISTER SYMBOL INDEX ................................................................................................445
APPENDIX E INDEX .............................................................................................................................................447
12-5Interrupt Request Acceptance Processing Time .......................................................................317
12-6Macro Service Processing Time ..................................................................................................318
12-7Interrupts That Can Use a Macro Service .................................................................................. 320
12-8Interrupt Requests That Can Specify Macro Service and Related SFRs (Type A) ................ 324
12-9Illegal Write Access Conditions and Corresponding Operations ........................................... 324
12-10Interrupt Requests That Can Specify Macro Service and SFRs (Type C) ..............................331
12-11Illegal Write Access Conditions and Corresponding Operations ........................................... 331
12-12Illegal Write Access Conditions and Corresponding Operations ........................................... 344
Example of Setting the BRGC Register When the Baud Rate Generator for UART Is Used .......
(Asynchronous Serial Interface) .................................................................................................. 257
255
13-1Conditions and Operations for Illegal Write Access .................................................................350
13-2System Clock Frequency and Refresh Pulse Output Cycle
When Pseudo Static RAM Is Used ..............................................................................................368
13-3Conditions and Operations for Illegal Write Access .................................................................373
14-1Operation States in HALT Mode .................................................................................................379
14-2Sources for Releasing HALT Mode and Operations Performed After Release ..................... 380
14-3Release of HALT Mode by a Maskable Interrupt Request ....................................................... 381
14-4Operation States in STOP Mode .................................................................................................382
15-1Pin States during Reset and After Reset State Is Released ..................................................... 390
15-2Hardware States after Reset ........................................................................................................391
17-1Operating Modes for PROM Programming ...............................................................................399
18-18-Bit Instructions for Each Addressing Type .............................................................................416
18-216-Bit Instructions for Each Addressing Type ........................................................................... 417
18-3Bit Manipulation Instructions for Each Addressing Type ........................................................ 418
18-4Call Instructions and Branch Instructions for Each Addressing Type....................................419
- xviii -
CHAPTER 1 GENERAL
The µPD78214 sub-series is part of the 78K/II series of eight-bit single-chip microcomputers capable of accessing
an expanded memory space of 1 megabyte. This sub-series consists of the following products.
The µPD78214 offers a 16-KB masked ROM, 512-byte RAM, highly functional timers/counters, a high-precision A/
D converter, and two independent serial interfaces.
The µPD78212 is the same as the µPD78214 except that it offers an 8-KB ROM and 384-byte RAM.
The µPD78213 is the same as the µPD78214 except that it has no built-in ROM.
The µPD78P214 is the PROM version (used in place of masked ROM) of the µPD78214.
•µPD78P214DW: Programs can be written repeatedly (suitable for evaluating an application system).
• Others: A program can be written once (suitable for application systems produced in small lots).
The µPD78212(A), µPD78213(A), µPD78214(A), and µPD78P214(A) are the special quality versions of the µPD78212,
µ
PD78213, µPD78214, and µPD78P214, respectively.
PD78P214
µ
PD78P214(A)
µ
PROM 16K
RAM 512
PD78214
µ
PD78214(A)
µ
ROM 16K
RAM 512
PD78213
µ
PD78213(A)
µ
ROM-less
RAM 512
1
PD78212
µ
PD78212(A)
µ
This sub-series can be applied to the following:
Standard-quality products
°
• Printers
• Electronic typewriters
• Electronic cash registers (ECRs)
• Plain paper copiers (PPCs)
• Electronic musical instruments
• Air conditioners
• Cellular phones
• Cameras
Special-quality products
°
• Vehicle-mounted electrical equipment
• Combustion control
ROM 8K
RAM 384
1
µ
PD78214 Sub-Series
PD78218A sub-series
µ
78K/II Products
PD78244 sub-series
µ
PD78234 sub-series
µ
EEPROM is added.
The macro service and
timer/counter are
enhanced.
The D/A converter
is contained.
The PWM output
function is added.
The macro service
and timer/counter
are enhanced.
The internal memory
is expanded.
The macro service and
timer/counter are
enhanced.
PD78P214
PD78P214(A)
PD78214
PD78214(A)
µ
PD78214 sub-series
µ
PD78213
µ
µ
µ
µ
PD78213(A)
PD78212
PD78212(A)
µ
µ
µ
The A/D converter is contained.
The timer/counter and baud rated
generator function are enhanced.
The comparator is deleted.
The following are contained:
A/D converter
D/A converter
The PWM output function is
added.
The macro service and timer/
counter are enhanced.
The comparator is deleted.
PD78224 sub-series
µ
2
Chapter 1 General
1.1 FEATURES
78K/II series
°
Multiplexed internal bus (faster execution of instructions)
°
Minimum instruction cycle (operating at 12 MHz): 333 ns (µPD78212, µPD78214, and µPD78P214),
or 500 ns (µPD78213)
Instruction set suitable for control applications
°
Data memory expansion function (memory space of 1MB with two bank designation pointers)
°
Interrupt controller (with two priority levels)
°
• Vectored interrupt handling
• Macro service
Internal memory
°
• ROM
Masked ROM : 16KB (µPD78214), 8KB (µPD78212), or none (µPD78213)
PROM: 16KB (µPD78P214)
• RAM: 512 bytes (µPD78213, µPD78214, and µPD78P214), or 384 bytes (µPD78212)
Number of I/O pins: 54 (µPD78212, µPD78214, and µPD78P214), or 36 (µPD78213)
°
• Number of pins with software-programmable pull-up resistors: 16 (µPD78213 only),
or 34 (other than µPD78213)
• Number of LED direct-drive pins: 16 (µPD78212, µPD78214, and µPD78P214)
• Number of transistor direct-drive pins: 8
Serial interface
°
• UART (baud rate generator included)
• Synchronous serial interface (three-wire serial I/O, serial bus interface)
Real-time output ports (two stepper motors can be independently controlled by combining the output ports with
°
an eight-bit timer/counter.)
Eight-bit A/D converter (analog eight-bit input)
°
Highly functional timer/counter units
°
• 16-bit unit
• Three eight-bit units
1
3
µ
PD78214 Sub-Series
1.2 ORDERING INFORMATION AND QUALITY GRADE
1.2.1 Ordering Information
Ordering codePackageInternal ROM
µ
PD78212CW-×××64-pin plastic shrink DIP (750 mil)Masked ROM
µ
PD78212GC-×××-AB864-pin plastic QFP (14 × 14 mm)Masked ROM
µ
PD78212GJ-×××-5BJ74-pin plastic QFP (20 × 20 mm)Masked ROM
µ
PD78213CW64-pin plastic shrink DIP (750 mil)None
µ
PD78213GC-AB864-pin plastic QFP (14 × 14 mm)None
µ
PD78213GJ-5BJ74-pin plastic QFP (20 × 20 mm)None
µ
PD78213GQ-3664-pin plastic QUIPNone
µ
PD78213L68-pin plastic QFJNone
µ
PD78214CW-×××64-pin plastic shrink DIP (750 mil)Masked ROM
µ
PD78214GC-×××-AB864-pin plastic QFP (14 × 14 mm)Masked ROM
µ
PD78214GJ-×××-5BJ74-pin plastic QFP (20 × 20 mm)Masked ROM
Note QTOPTM microcomputers. QTOP microcomputers are a line of one-time PROM single-chip microcomputers that are fully supported by
NEC, from writing of the program, through marking and screening, to verifying.
Remark ××× indicates the ROM code number.
1
Refer to “Quality grade on NEC Semiconductor Devices” (Document number IEI-1209), published by NEC
Corporation, for the specifications of the quality grade of the devices and the recommended applications.
Caution The symbols enclosed in parentheses indicate that the corresponding pins, not used in PROM programming mode, shall be handled
as follows:
L: Connect the corresponding pin independently to VSS, through a 10-kΩ resistor.
G: Connect the corresponding pin to VSS.
Open : Leave the corresponding pin unconnected.
Caution The symbols enclosed in parentheses indicate that the corresponding pins, not used in PROM programming mode, shall be handled
★
Remark The NC pin is not connected inside the chip.
as follows:
L: Connect the corresponding pin independently to VSS, through a 10-kΩ resistor.
G: Connect the corresponding pin to VSS.
Open : Leave the corresponding pin unconnected.
(L)
RESET
A11
A10
(L)
12
(3) 64-pin plastic QFP (14 × 14 mm)
Chapter 1 General
OE
(L)
RESET
(Open)
(G)
V
A15
A14
A13
A12
A11
A10
(L)
(L)
CE
64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49
1
2
3
4
5
6
7
8
SS
9
10
11
12
13
14
15
16
A7A6A5A4A3A2A1
µ
µ
µ
PD78P214GC-AB8
PD78P214GC-×××-AB8
PD78P214GC(A)-AB8
A0
(Open)
(L)
48
47
46
45
44
43
42
41
40
39
38
37
36
35
34
33
(L)
VDD
VPP
(L)
(Open)
(G)
1
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
A8
D7D6D5D4D3
Caution The symbols enclosed in parentheses indicate that the corresponding pins, not used in PROM programming mode, shall be handled
as follows:
L: Connect the corresponding pin independently to VSS, through a 10-kΩ resistor.
G: Connect the corresponding pin to VSS.
Open : Leave the corresponding pin unconnected.
Caution The symbols enclosed in parentheses indicate that the corresponding pins, not used in PROM programming mode, shall be handled
★
Remark The NC pins are not connected inside the chip.
as follows:
L: Connect the corresponding pin independently to VSS, through a 10-kΩ resistor.
G: Connect the corresponding pin to VSS.
Open : Leave the corresponding pin unconnected.
(L)
VPP
VDD
VDD
(L)
NC
14
Chapter 1 General
V
PP
: Programming power supply
RESET : Reset
D0-D7: Data bus
A0-A14 : Address bus
V
SS
: Ground
OE: Output enable
V
DD
: Power supply
CE: Chip enable
P20/NMI : Port 2/non-maskable interrupt
NC: Non-connection
1
15
µ
PD78214 Sub-Series
1.4 EXAMPLE APPLICATION SYSTEM (PRINTER)
PD24C1000
µ
Kanji character
generator
PD78214
µ
Decoder
A16-A19
Pseudo SRAM
PD27C256A
µ
PROM
RD
WR
REFRQ
TO
SCK
SO
Data bus
AD0-AD7
XD
R
TXD
Latch
ASTB
Ports
AVREF
Address bus
A8-A15
AVSS
AN0
AN1
AN2-AN7
Gate array
I/O expansion
Centronics interface, etc.
VSS
VDD
X1X2
RESET
16
MP00-P03
Stepping motor
Carriage motor
MP04-P07
Paper feed motor
Print head driver
Shift register
RS-232C
driver
Temperature sensor
Motor supply voltage
SW input for each mode
1.5 BLOCK DIAGRAM
A16-A19 (expansion)
A8-A15
AD0-AD7
A0-A14
PC
D0-D7
RD
WR
Note 1
ROM
WAIT
REFRQ
ASTB
CE
OE
• Micro ROM
• Micro-
sequencer
X1
Chapter 1 General
1
X2
RESET
EA
VDD
VPP
System controlBus control
VSS
PD78213(A),
General register
Shaded portions: In PROM
programming mode
GR :
Note 3
RAM
P70
-P75
µ
PD78214(A)
µ
PD78P214,
µ
PD78P214,
µ
PD78214,
µ
PD78214,
µ
PD78213,
µ
Address bus
Programmable
NMI
ALU
UART
interrupt controller
Baud rate generator
TXD
RXD
ASCK
SCK
INTP0-INTP5
Data bus (8)
SP
PSW
Boolean
Temporary
registers
processpr
SFR address/data bus
Timer/counter
Clocked serial interface
Timer/counter (16 bits)
channel-1(PS+8 bits)
SI
TO0
TO1
SO/SB0
INTP3
INTP0
Note 2
• RAM
(256 bytes)
• GR
• Macro service
channel
Bus interface
Timer/counter
channel-2 (PS+8 bits)
Timer/counter
TO2
TO3
INTP1
INTP2
Data bus
channel-3 (PS+8 bits)
Real-time output port
(4 bits×2)
P00-P03
P04-P07
AN0-AN7
Port
A/D converter
AVSS
AVREF
INTP5
P0P2P3P4P5P6P7
P64
P60
P50
P40
P30
P20
P00
-P67
-P63
-P57
-P47
Note 4 Note 4Note 4
-P37
-P27
-P07
PD78212(A), 16KB for
µ
PD78212(A), 256 bytes for
µ
PD78212 and
µ
PD78212 and
µ
PD78213(A), 8KB for
µ
PD78213 and
µ
PD78213, P40-P47, P50-P57, P64, or P65 do not operate as ports.
µ
PD78214(A)
µ
and
2. Internal dual-port RAM
3. Peripheral RAM (PRAM). 128 bytes for
4. For the
Notes 1. None for
17
µ
PD78214 Sub-Series
1.6 FUNCTIONS
Item
Number of basic instructions (mnemonics)
Minimum instruction execution
time (when operating at 12 MHz)
Capacity of
internal memory
Memory area
Number of
I/O pins
Real-time output ports
General-purpose registers
Timer/counters
Input pins
Output pins
I/O pins
Total
Connected to a
pull-up resistor
Driving a LED
directly
Note
Driving a
Special-function
pins
transistor directly
ROM
RAM
µ
PD78212
8K bytes16K bytesNone
384 bytes512 bytes
64KB for program and 1MB for data
Two four-bit ports or one eight-bit port
Four banks of eight eight-bit registers (memory mapping)
16-bit timer/counter, consisting of
one timer register, one capture
register, and two compare registers.
µ
PD78214
333 ns500 ns
2810
5436
3416
160
µ
PD78P214
65
14
12
8
Pulse output possible (toggle
output or PWM/PPG output)
µ
PD78213
8-bit timer/counter unit 1, consisting of
one timer register, one capture/
compare register, and one compare
register
8-bit timer/counter unit 2, consisting
of one timer register, one capture
register, and two compare registers.
8-bit timer/counter unit 3, consisting
of one timer register and one
compare register
Serial interface
Note The number of I/O pins includes special-function pins.
Eight channels, each having a resolution of eight bits
• 19 interrupts (seven external and 12 internal) plus those caused by
BRK instructions
• Two programmable priority levels
• Two types of interrupt handling, vectored interrupt and macro
service
• 16-bit calculation
• Multiplication (8 bits by 8 bits) and division (16 bits by 8 bits)
• Bit manipulation
• BCD conversion
• Others
• 64-pin plastic shrink DIP (750 mil) for all products
• 64-pin plastic QUIP for all products other than µPD78212,
µ
PD78212(A), and µPD78P214(A)
• 68-pin plastic QFJ for all products other than µPD78212,
µ
PD78212(A), µPD78213(A), and µPD78P214(A)
• 64-pin plastic QFP (14 x 14 mm)
µ
PD78213(A)
• 74-pin plastic QFP (20 x 20 mm) for all products other than
µ
PD78212(A), µPD78213(A), and µPD78P214(A)
• 64-pin ceramic shrink DIP with window (750 mil) for µPD78P214
only
µ
PD78214
µ
PD78P214
Note
for all products other than
PD78213
1
Note Small package with a lead pitch of 0.8 mm, suitable for cameras.
19
µ
PD78214 Sub-Series
1.7 DIFFERENCES BETWEEN THE µPD78210
Product
Item
RAM capacity
I/O pins
Timer/counter
Serial interface
Interrupt
A/D converter
Package
Others
128 bytes
• Software programmable pull-up resistors:
Not supported
• Transistor direct drive outputs: Not
supported
PWM/PPG output: Not supported
Scaler for the baud rate generator output:
Not supported
Macro service can be applied to some
interrupt requests.
• Six input pins.
• A voltage ranging from 0 V to AV
applied to the input pins.
64-pin QFP: Not supported
The area at addresses 0FE20H to 0FE7FH can
only be accessed in saddr addressing mode.
µ
PD78210
Note
AND µPD78213
can be
REF
Note For maintenance purposes only.
µ
PD78213
512 bytes
• Software programmable pull-up resistors:
Supported
• Transistor direct drive outputs: Supported
PWM/PPG output: Supported
Scaler for the baud rate generator output:
Supported
Macro service can be applied to all interrupt
requests with the exception of that caused by
a serial receive error.
• Eight input pins.
• A voltage ranging from 0 V to AV
applied only to those pins for which A/D
conversion is being performed, as well as
the pins selected by the ANI0 to ANI3 bits
of the ADM register.
64-pin QFP: Supported
The area at addresses 0FE20H to 0FE7FH can
be accessed in any addressing mode.
REF
can be
20
Chapter 1 General
1.8 DIFFERENCES BETWEEN THE µPD78214 SUB-SERIES AND µPD78218A SUB-SERIES
Series name
Product
Minimum instruction cycle
(when operating at 12 MHz)
Operating voltage range
Internal memory
Number of I/O pins5436545436
Execution time (number of
clocks) required for PUSH
PSW instruction
One-shot output of 16-bit
timer/counter
Bit width of macro-service
counter
MPD or MPT increment in
macro-service type C
Restriction imposed on data
transfer from memory to SFR
in macro-service type A
Macro-service execution time
Restriction imposed
on input voltage
Restriction imposed
A/D converter
on the AV
Oscillation settling time when
STOP mode is released
Package
ROM
RAM
REF
voltage
µ
(masked ROM)
• Five or seven when internal dual-port RAM is
• Seven or nine in all other cases
Only the eight lower-order bits are incremented.
(The eight high-order bits remain as is.)
The macro-service execution time depends on the macro-service mode and other
factors, and also varies with the sub-series. For details, refer to the table of macroservice execution times in the relevant user's manual.
A voltage ranging from 0 V to AV
applied only to those pins for which A/D conversion is performed and the pins selected by the
ANI0 to ANI3 bits of the ADM register.
Pulse width of NMI at its active level, plus 16
counts on the corresponding counter
• 64-pin plastic shrink DIP (750 mil) for all
• 64-pin plastic QUIP for all products other than
• 68-pin plastic QFJ for all products other than
• 64-pin plastic QFP (14 × 14 mm) for all products
• 74-pin plastic QFP (20 × 20 mm) for all products
• 64-pin ceramic shrink DIP with window (750
µ
PD78214 Sub-Series
µ
µ
PD78212
PD78212(A)
333 ns500 ns333 ns333 ns500 ns
8K bytes
used for the stack area
Transfer data shall not be D0H to DFH.
products
µ
PD78212, µPD78212(A), and µPD78P214(A)
µ
PD78212, µPD78212(A), µPD78213(A), and
µ
PD78P214(A)
other than µPD78213(A)
other than µPD78212(A), µPD78213(A), and
µ
PD78P214(A)
mil) for µPD78P214 only
µ
PD78213
µ
PD78213(A)
ROM-less
3.4 V to V
PD78214
µ
PD78214(A)
16K bytes
(masked ROM)
512 bytes1024 bytes384 bytes
None
Eight bits
V
= +5 V ±10%
DD
REF
DD
µ
PD78P214
µ
PD78P214(A)
16K bytes
(PROM)
can be
µ
PD78217A
ROM-less
• Six when internal dual-port RAM
is used for the stack area
• Eight in all other cases
Eight bits or 16 bits (selectable,
except for macro service type A)
Transfer source buffer (memory)
addresses shall not be 0FED0H to
0FEDFH.
A voltage ranging from 0 V to
AV
pins for which A/D conversion is
being performed.
15 counts on the corresponding
counter or pulse width of NMI at its
active level, plus 16 counts on the
corresponding counter
• 64-pin plastic shrink DIP (750 mil)
for all products
• 64-pin plastic QFP (14 × 14 mm)
for all products
• 64-pin ceramic shrink DIP with
window (750 mil) for the
µ
PD78P218A only
The 16 bits are incremented.
REF
µ
PD78218A Sub-Series
µ
PD78218A
32K bytes
(masked ROM)
Supported
can be applied only to those
3.6 V to V
DD
µ
PD78P218A
V
= +5 V
DD
±0.3 V
32K bytes
(PROM)
1
21
µ
PD78214 Sub-Series
1.9 DIFFERENCES BETWEEN THE µPD78212 AND µPD78212(A)
Product
Item
Quality grade
Package
Standard
• 64-pin plastoc shrink DIP
• 64-pin plastic QFP
• 74-pin plastic QFP
1.10 DIFFERENCES BETWEEN THE
Product
Item
Quality grade
Maximum period in which 74-
pin plastic QFPs can be soldered
satisfactorily, after their sealed
packaging has been opened
Package
Standard
No limit
• 64-pin plastic shrink DIP
• 64-pin plastic QFP
• 74-pin plastic QFP
• 64-pin plastic QUIP
• 68-pin plastic QFJ
µ
PD78212
Special
• 64-pin plastoc shrink DIP
• 64-pin plastic QFP
µ
PD78213 AND µPD78214, AND THE µPD78213(A) AND µPD78214(A)
µ
PD78213, µPD78214
Special
Seven days
Note
Note
Note
µ
PD78212(A)
µ
PD78213(A), µPD78214(A)
Note Not supported for the µPD78213(A)
1.11 DIFFERENCES BETWEEN THE µPD78P214 AND µPD78P214(A)
Item
Quality grade
Package
Product
Standard
• 64-pin plastic shrink DIP
• 64-pin ceramic shrink DIP with window
• 64-pin plastic QFP
• 74-pin plastic QFP
• 64-pin plastic QUIP
• 68-pin plastic QFJ
µ
PD78P214
Special
• 64-pin plastic shrink DIP
• 64-pin plastic QFP
µ
PD78P214(A)
22
Chapter 1 General
1.12 DIFFERENCES BETWEEN THE µPD78212, µPD78213, µPD78214, AND µPD78P214
1.12.1 Functional Differences
Product name
Parameter
Internal ROM
Internal RAM
Port 4
Port 5
Port 6
Others
µ
PD78212
8KB masked ROM at
00000H to 01FFFH
384 bytes at 0FD80H
to 0FEFFH
Used as both
general-purpose I/O
port (P40 to P47) and
address/data bus
(AD0 to AD7)
Used as both
general-purpose I/O
port (P50 to P57) and
address bus (A8 to
A15)
P64 and P65 are
used as both
general-purpose I/O
ports, and the RD
and WR pins,
respectively.
———
µ
PD78213
None
512 bytes at 0FD00H to 0FEFFH
Used only as
address/data bus
(AD0 to AD7)
Used only as
address bus (A8 to
A15)
P64 and P65 are
used only as the RD
and WR pins,
respectively.
µ
16KB masked ROM
at 00000H to 03FFFH
Used as both general-purpose I/O port
(P40 to P47) and address/data bus (AD0 to
AD7)
Used as both general-purpose I/O port
(P50 to P57) and address bus (A8 to A15)
P64 and P65 are used as both general-
purpose I/O ports, and the RD and WR
pins, respectively.
PD78214
µ
PD78P214
16KB PROM at
00000H to 03FFFH
PROM programming
mode is supported
1
1.12.2 Package Differences
These products are available with either of two types of QFP (64-pin and 74-pin). Taking differences such as their
soldering conditions, listed below, into consideration, select an appropriate QFP.
Item
Package size
Infrared reflow soldering or
vapor-phase soldering (VPS)
Humidity control for
infrared reflow soldering or
VPS
Soldering conditions
Note The corresponding package is not available for the special quality grade versions of these products, indicated by suffix (A).
14 × 14 mm, lead pitch: 0.8 mm
Supported by µPD78212, µ78213
µ
78214, and µ78P214
The µPD78212, µPD78213
µ
PD78214, and µPD78P214 shall be
soldered within two days of their sealed
package being opened.
64-pin QFP74-pin QFP
20 × 20 mm, lead pitch: 1.0 mm
Note
,
Supported by µPD78212
Note
µ
Note
78213
,
The µPD78P214
within seven days of its sealed package
being opened.
The µPD78212
µ
PD78214 can be soldered at any time
after their sealed package has been
opened.
, µ78214, and µ78P214
Note
shall be soldered
Note
, µPD78213
Note
,
Note
Note
, and
23
24
2.1 PIN FUNCTION LIST
CHAPTER 2 PIN FUNCTIONS
2.1.1 Normal Operating mode
(1) Ports
Pin name for
secondary
function
INTP2/CI
INTP4/ASCK
SO/SB0
TO0-TO3
AD0-AD7
A16-A19
WAIT/AN6
REFRQ/AN7
AN0-AN5
Note 1
Note 1
Input/Output
OutputP00-P07
Input
Input/Output
Input/Output
Input/Output
Output
Input/Output
Input
PinFunction
P20
P21
P22
P23
P24
P25
P26
P27
P30
P31
P32
P33
P34-P37
P40-P47
P50-P57
P60-P63
Note 2
P64
Note 2
P65
P66
P67
P70-P75
—
NMI
INTP0
INTP1
INTP3
INTP5
SI
RxD
TxD
SCK
A8-A15
RD
WR
2
Port 0 (P0):
Can be used as two four-bit, real-time output ports. Can drive transistors
directly.
Port 2 (P2):
Cannot be used as a general-purpose port (non-maskable interrupt). The
input level can be checked as part of the interrupt routine. Pins P22 to
P27 can be collectively connected to internal pull-up resistors by means
of software.
Port 3 (P3):
Each pin can be assigned to be either an input or output pin. Input pins
can be collectively connected to internal pull-up resistors by means of
software.
Port 4 (P4):
Can be simultaneously assigned to be either input or output pins. Can be
collectively connected to internal pull-up resistors by means of software.
Can directly drive LEDs.
Port 5 (P5):
Each pin can be assigned to be either an input or output pin. Input pins
can be collectively connected to internal pull-up resistors by means of
software. Can directly drive LEDs.
Port 6 (P6):
Each of pins P64 to P67 can be assigned to be either an input or output
pin. Input pins P64 to P67 can be collectively connected to internal pull-
up resistors by means of software.
Port 7 (P7)
Notes 1. In the case of the µPD78213, these pins do not function as ports.
2. In the case of the µPD78213, neither P64 nor P65 functions as a port.
25
µ
PD78214 Sub-Series
(2) Pins other than those which function as ports
PinFunction
TO0-TO3
CI
RxD
TxD
ASCK
SB0
SI
SO
SCK
Input/output
Output
Input
Input
Output
Input
Input/output
Input
Output
Input/output
Timer output
Count clock supplied to eight-bit timer/counter unit 2
Serial data input (UART)
Serial data output (UART)
Baud rate clock input (UART)
Serial data input/output (SB2)
Serial data input (three-wire serial I/O)
Serial data output (three-wire serial I/O)
Serial clock input/output (SBI, three-wire serial I/O)
NMI
INTP0
INTP1
INTP2
Input
External interrupt requests
INTP3
INTP4
INTP5
AD0-AD7
A8-A15
A16-A19
RD
WR
WAIT
ASTB
REFRQ
RESET
X1
X2
Input/output
Output
Output
Output
Output
Input
Output
Output
Input
Input
—
Time-multiplexed address/data bus (external memory connected)
High-order address bus (external memory connected)
High-order address when the addresses are expanded (external memory connected)
Read strobe to external memory
Write strobe to external memory
Wait insertion
Latch timing for addresses A0 to A7 (when external memory is accessed)
Refresh pulse to external pseudo-static memory
Chip reset
Connected to the crystal oscillator used for the system clock (a clock
signal can be input to X1)
Designating ROM-less operation (access to the external memory
EA
Input
mapped to the same area as the internal ROM). Set this pin to low for
the µPD78213, or to high for the µPD78212 and µPD78214.
Pin name for
secondary function
P34-P37
P23/INTP2
P30
P31
P25/INTP4
P33/SO
P27
P33/SB0
P32
P20
P21
P22
P23/CI
P24
P25/ASCK
P26
P40-P47
P50-P57
Note
Note
P60-P63
Note
P64
Note
P65
P66/AN6
—
P67/AN7
—
—
—
AN0-AN5
AN6, AN7
AV
REF
AV
SS
V
DD
V
SS
Input
—
Analog voltage input for A/D converter
A/D converter reference voltage
A/D converter ground
Main power
Ground
NC
Note These pins do not function as ports in the case of the µPD78213.
26
P70-P75
P66/WAIT,
P67/REFRQ
—
—
Chapter 2 Pin Functions
2.1.2 PROM Programming Mode (only for the µPD78P214, P20/NMI = 12.5 V, RESET = L)
Pin
P20/NMI
RESET
A0-A14
D0-D7
CE
OE
V
PP
V
DD
V
SS
NC
Input/output
Input
Input/output
Input
—
Setting PROM programming mode
Address bus
Data bus
PROM enable input
Read strobe to PROM
Power for programming
Main power
Ground
Function
—
2.2 PIN FUNCTIONS
2.2.1 Normal Operating mode
(1) P00 to P07 (Port 0): Tristate outputs
Port 0, an eight-bit output port with output latches, can directly drive transistors. Its eight bits can be
simultaneously set to either output mode or high impedance mode by specifying the port-0 mode register
(PM0) accordingly.
Port 0 can output the contents of the buffer registers (P0L, P0H) in real-time at any interval, in units of eight
or four bits (P00 to P03 and P04 to P07). The real-time output port control register (RTPC) determines whether
port 0 is used as a normal output port or real-time output port.
When the RESET signal is input, the output of port 0 becomes high impedance, resulting in the contents of
the output latches becoming undefined.
(2) P20 to P27 (port 2): Inputs
Port 2 is an eight-bit input port. P22 to P27 are provided with software-programmable pull-up resistors. P20
to P27 also act as input pins for control signals such as external interrupts (see Table 2-1). To prevent
malfunctions caused by noise, port 2 provides Schmitt-triggered input circuits.
2
Table 2-1 Port 2 Functions
Port
P20
P21
P22
P23
P24
P25
P26
P27
Note An NMI input is received regardless of whether interrupts are enabled or disabled.
Input port/NMI input
Input port/INTP0 input/CR11 capture trigger input/trigger signal for real-time output port
Input port/INTP1 input/CR22 capture trigger input
Input port/INTP2 input/CI input
Input port/INTP3 input/CR02 capture trigger input
Input port/INTP4 input/ASCK input
Input port/INTP5 input/external trigger signal for A/D converter
Input port/SI input
Note
Function
27
µ
PD78214 Sub-Series
(a) When functioning as a port
Signals applied to these pins can be read and these pins can be tested, regardless of whether these pins
are acting as secondary function pins.
(b) When functioning as control-signal input pins
(i) NMI (non-maskable interrupt)
Apply an external non-maskable interrupt request signal to this pin. The external interrupt mode
register (IMTM0) specifies whether an interrupt is detected at its rising or falling edge.
(ii) INTP0 to INTP5 (interrupts from peripherals)
Apply external interrupt request signals to these pins. When an interrupt request signal is detected
at the edge specified by the external interrupt mode registers (INTM0 and INTM1), at any of the INTP0
to INTP5 pins, an interrupt is generated. (For details, see Chapter 11.)
The INTP0 to INTP3 and INTP5 pins can also be used as external trigger input pins for a range of
functions, as described below.
• INTP0: Capture trigger input for eight-bit timer/counter unit 1, and trigger input for real-time output
port
• INTP1: Capture trigger input for eight-bit timer/counter unit 2
• INTP2: External count clock input for eight-bit timer/counter unit 2
• INTP3: Capture trigger input for 16-bit timer/counter
• INTP5: External trigger input for A/D converter
(iii) CI (clock input)
External clock input for eight-bit timer/counter unit 2
(iv) ASCK (asynchronous serial clock)
External baud-rate clock input.
(v) SI (serial input)
Serial data input (when three-wire serial input mode is used)
(3) P30-P37 (port 3): Tristate inputs/outputs
Port 3, an eight-bit input and output port with output latches, is provided with software-programmable pullup resistors. Each pin can be used as an input or output pin by specifying the port-3 mode register (PM3).
It also acts as a control signal pin.
It can be used in either of the following two operating modes, as listed in Table 2-2, by specifying the port3 mode control register (PMC3). The signals applied to these pins can be read and these pins can be tested
regardless of whether these pins are acting as secondary function pins.
When the RESET signal is input, the output of port 3 becomes high impedance, such that it functions as an
input port, resulting in the contents of the output latches becoming undefined.
28
Table 2-2 Port 3 Operating Mode (n = 0 to 7)
Chapter 2 Pin Functions
Mode
PMC3 setting
P30
P31
P32
P33
P34
P35
P36
P37
Port mode
PMC3n = 0
I/O port
Control signal I/O mode
PMC3n = 1
RxD input
TxD output
SCK input/output
SO output/SB0 input/output
TO0 output
TO1 output
TO2 output
TO3 output
(a) Port mode
Pins for which port mode is specified by the PMC3 can be used independently as input or output pins by
specifying the port-3 mode register (PM3).
(b) Control signal I/O mode
Each pin can be used as a control signal pin by specifying the PMC3 register.
(i) RxD (receive data)
Serial data input for asynchronous serial interface
(ii) TxD (transmit data)
Serial data output for asynchronous serial interface
(iii) SCK (serial clock)
Serial clock input or output for synchronous serial interface
(iv) SO (serial output)/SBO (serial bus)
Serial data output (when three-wire serial I/O mode is used), or serial bus input or output in SBI mode
(v) TO0 to TO3 (timer output)
Timer outputs
(4) P40-P47 (port 4): Tristate inputs/outputs
Port 4, an eight-bit I/O port with output latches, is provided with software-programmable pull-up resistors and
can directly drive LEDs. Its pins can be collectively used as input or output pins by specifying the memory
expansion mode register (MM).
It acts as a time-multiplexed address/data bus (AD0 to AD7) when external memory or I/O devices are
expanded.
In the case of the µPD78213, it acts as a time-multiplexed address/data bus (AD0 to AD7).
When the RESET signal is input, the output of port 4 becomes high impedance, such that it functions as an
input port, resulting in the contents of the output latches becoming undefined.
(5) P50 to P57 (port 5): Tristate inputs/outputs
Port 5, an eight-bit I/O port with output latches, is provided with software-programmable pull-up resistors and
can directly drive LEDs. Its pins can be used independently as input or output pins by specifying the port-5
mode register(PM5) accordingly.
It acts as an address bus (A8 to A15) when external memory or I/O devices are expanded.
In the case of the µPD78213, it functions as an address bus (A8 to A15).
When the RESET signal is input, the output of port 5 becomes high impedance, such that it functions as an
input port, resulting in the contents of the output latches becoming undefined.
2
29
µ
PD78214 Sub-Series
(6) P60 to P67 (port 6): Output (P60 to P63) and tristate inputs/outputs (P64 to P67)
Port 6 is an eight-bit I/O port with output latches. Pins P64 to P67 are provided with software-programmable
pull-up resistors.
The pins of port 6 also function as control signal input pins, as listed in Table 2-3. To use these pins as control
signal input pins, set up is required.
In the case of the µPD78213, P64 and P65 act as an RD output and WR output, respectively.
When the RESET signal is applied, P60 to P63 go low and P64 to P67 function as an input port (the outputs
become high impedance). The contents of the output latches become undefined at the four high-order bits
and 0H at the four low-order bits.
Table 2-3 Port 6 Operating Mode
Pin
P60-P63
P64
P65
P66
P67
Caution While the RESET signal is being applied, P60 to P63 is high impedance. When the RESET signal is released, the output of these pins
is low level. Design the peripheral circuit so that it operates normally when pins P60 to P63 initially output low level.
Remark For details, see Chapter 13.
Port modeControl signal I/O mode
Output port
Input/output
port
A16-A19 output
RD output
WR output
WAIT input/AN6 input
REFRQ output/AN7 input
Operation required to assign pins as control signal pins
Set the MM6 bit of the MM register to 1.
For the µPD78213, specify external memory expansion
mode using bits MM2 to MM0 of the MM register.
Set the PW register, or bits PWn1 and PWn0 (n = 2
and 3) of the MM register and P66 to input mode.
Set the RFEN bit of the RFM register to 1.
(a) Port mode
P60 to P63 are an output port. Each of pins P64 to P67 can be used for input or output by specifying the
port-6 mode register (PM6) accordingly.
(b) Control signal I/O mode
(i) A16 to A19 (address bus)
High-order address bus output when the external memory area is expanded (10000H to FFFFFH). The
memory expansion register (MM) controls these pins.
(ii) RD (read strobe)
Strobe signal output used for reading the external memory. In the case of the µPD78213, the MM
register controls this pin.
(iii) WR (write strobe)
Strobe signal output used for writing to the external memory. In the case of the µPD78213, the MM
register controls this pin.
(iv) WAIT (wait)
Wait signal input. The programmable wait control (PW) register or MM register controls this pin.
(v) REFRQ (refresh request)
Used for outputting refresh pulses to the external pseudo-static memory. The refresh mode register
(RFM) controls this pin.
(vi) AN6 and AN7 (analog input)
Analog inputs to the A/D converter.
(7) P70 to P75 (port 7): Input
Port 7 is a six-bit input port. Its pins also function as analog input pins (AN0 to AN5) for the A/D converter.
Signals applied to these pins can be read and these pins can be tested regardless of whether these pins are
acting as secondary function pins.
30
Chapter 2 Pin Functions
(8) ASTB (address strobe): Output
Timing signal output used for latching addresses externally to enable access to external memory.
(9) EA (external access): Input
Control signal input used for switching the program memory from the internal ROM to the external memory.
When this signal is high, the internal ROM is accessed. When low, the external memory is accessed in ROMless mode. In the case of the µPD78212, µPD78214, and µPD78P214, always apply a high-level signal to this
pin. In the case of the µPD78213, apply a low-level signal.
(10) X1 and X2 (crystal)
Pins for connecting the crystal used for internal clock oscillation. When an external clock signal is supplied,
apply it to pin X1. Also, apply the signal having the inverted phase of this clock signal to pin X2.
(11) RESET (reset): Input
Low-active reset input.
(12) AV
(13) AV
(14) V
(15) V
(16) NC (non-connection)
REF
Input of the reference voltage and power for the A/D converter.
SS
A/D converter ground.
DD
Main power input. Connect all VDD pins to the power.
SS
Ground. Connect all VSS pins to the ground.
Not connected inside the chip.
2
2.2.2 PROM Programming Mode (for the µPD78P214)
(1) P20/NMI: Input
Input used for setting the µPD78P214 to PROM programming mode. When a voltage of 12.5 V is applied to
this pin and the RESET pin goes low, the µPD78P214 enters PROM programming mode.
(2) RESET: Input
Input used for setting the µPD78P214 to PROM programming mode. When a low-level signal is applied to this
pin and a voltage of 12.5 V is applied to the P20/NMI pin, the µPD78P214 enters PROM programming mode.
(3) A0 to A14 (address bus): Inputs
Address bus used for the internal PROM (0000H to 3FFFFH). Apply a low-level signal to pin A14.
(4) D0 to D7 (data bus): Inputs/outputs
Data bus, through which programs are read or written to and from the internal PROM.
(5) CE (chip enable): Input
Enable signal input for the internal PROM. When this signal is active, programs can be either written or read.
(6) OE (output enable): Input
Read strobe signal input for the internal PROM. When this input goes active while the CE is low, one byte of
the program at the address specified by pins A0 to A14 in the internal PROM is read through pins D0 to D7.
(7) VPP (programming power supply)
Power supply for writing programs. When the CE goes low while the VPP is 12.5 V and the OE is high, the data
on pins D0 to D7 is written into the internal PROM at the address specified by pins A0 to A14.
(8) V
DD
Main power input.
31
µ
PD78214 Sub-Series
(9) V
SS
Ground.
(10) NC (non-connection)
Not connected inside the chip.
32
Chapter 2 Pin Functions
2.3 I/O CIRCUITS AND UNUSED-PIN HANDLING
Table 2-4 lists the types of I/O circuits provided for each pin and describes how pins are handled when not used.
Fig. 2-1 illustrates the I/O circuit types.
Pin
P00-P07
P20/NMI
P21/INTP0
P22/INTP1
P23/INTP2/CI
P24/INTP3
P25/INTP4/ASCK
P26/INTP5
P27/SI
P30/RxD
P31/TxD
P32/SCK
P33/SB0/SO
P34/TO0-P37/TO3
P40/AD0-P47/AD7
P50/A8-P57/A15
P60/A16-P63/A19
P64/RD
P65/WR
P66/WAIT/AN6
P67/REFRQ/AN7
P70/AN0-P75/AN5
ASTB
RESET
EA
AV
REF
AV
SS
Table 2-4 Types of I/O Circuits and Unused-Pin Handling
Type of I/O circuit
4Output
2
2-A
5-A
8-A
10-A
5-A
4
5-A
11
9
4
2
1
—
Input/outputRecommended unused-pin handling
Leave open.
Connect to VDD or VSS.
Input
Connect to VDD.
Input/output
Output
Input/output
Input
Output
Input
Connect to VDD when used as an input pin.
Leave open when used as an output pin.
Leave open.
Connect to VDD when used as an input pin.
Leave open when used as an output pin.
Connect to V
Leave open when used as an output pin.
Connect to VSS.
Leave open.
Connect to VDD or V
Connect to VSS.
Note
when used as an input pin.
DD
—
Note
.
SS
2
Note See Section 8.6.
Remark Since the type numbers of I/O circuits are numbered in the 78K series, they may not be serial in a certain product. (A product may
Caution When an I/O pin is used as both an input and output pin, connect the pin to the VDD pin through a resistor of less than 100 kilohms.
not contain some of these I/O circuits.)
(Especially, when the RESET pin goes to a voltage higher than the low level upon power on, or when an I/O pin is switched with
software.)
33
µ
PD78214 Sub-Series
Fig. 2-1 I/O Circuits Provided for Pins
Type 1
V
DD
P
IN
N
Type 2
IN
Schmitt trigger input with hysteresis characteristics
Type 4
Data
Output
disable
DD
V
P
N
Push-pull output which can output high impedance
(both the positive and negative channels are off.)
Type 8-A
V
DD
OUT
Type 2-A
V
DD
P
Pull-up
enable
IN
Schmitt trigger input with hysteresis characteristics
Type 5-A
V
DD
Pull-up
enable
Data
Output
disable
Input
enable
P
V
DD
P
N
Type 9
IN/OUT
Pull-up
enable
Output
disable
Type 10-A
Pull-up
enable
Open
drain
Output
disable
Data
Data
P
Comparator
V
DD
IN
P
P
N
IN/OUT
N
(Threshold voltage)
Vref
+
–
Input
enable
Type 11
V
DD
V
DD
P
V
DD
P
Pull-up
enable
Data
Output
disable
P
V
DD
P
IN/OUT
N
IN/OUT
N
Input
enable
Comparator
+
–
Vref
(Threshold voltage)
P
N
34
Chapter 2 Pin Functions
2.4 NOTES
(1) While the RESET signal is being applied, pins P60 to P63 are high impedance. When the RESET signal is
released, the output of these pins is low level. Design the peripheral circuit so that it operates satisfactorily
when pins P60 to P63 initially output the low level.
(2) When an I/O pin is used as both an input and output pin, connect the pin to the VDD pin through a resistor of
less than 100 kilohms. (Especially, when the RESET pin goes to a voltage higher than the low level upon power
on, or when an I/O pin is switched with software.)
2
35
36
CHAPTER 3 CPU FUNCTION
3.1 MEMORY SPACE
The µPD78214 can access a memory space of up to 1M byte. Figs. 3-1 to 3-4 show the corresponding memory
maps. The mapping of program memory depends on the status of the EA pin. The EA pin of the µPD78213 must
be tied low.
(1)µPD78212
Program memory is mapped to the internal ROM (8K bytes: 00000H to 01FFFH) and external memory (56704
bytes: 02000H to 0FD7FH). External memory is accessed in external memory expansion mode. The area
mapped as external memory can also be used as data memory.
Data memory is mapped to internal RAM (384 bytes: 0FD80H to 0FEFFH). In 1M-byte expansion mode,
external memory (960K bytes: 10000H to FFFFFH) is mapped as expanded data memory.
(2)µPD78213
Program memory is mapped to external memory (64768 bytes: 00000H to 0FCFFH). This area can also be used
as data memory.
Data memory is mapped to internal RAM (512 bytes: 0FD00H to 0FEFFH). In 1M-byte expansion mode,
external memory (960K bytes: 10000H to FFFFFH) is mapped as expanded data memory.
(3)µPD78214, µPD78P214
Program memory is mapped to internal ROM (16K bytes: 00000H to 03FFFH) and external memory (48384
bytes: 04000H to 0FCFFH). External memory is accessed in external memory expansion mode. The area
mapped as external memory can also be used as data memory.
Data memory is mapped to internal RAM (512 bytes: 0FD00H to 0FEFFH). In 1M-byte expansion mode,
external memory (960K bytes: 10000H to FFFFFH) is mapped as expanded data memory.
3
37
µ
PD78214 Sub-Series
Fig. 3-1 Memory Map of µPD78212 (EA Pin Driven High)
FFFFFH
Data memory
Expansion address
10000H
0FFFFH
0FFDFH
0FFD0H
0FF00H
0FEFFH
Data
memory
0FD80H
0FD7FH
Memory space (1M byte)
Program memory/
data memory
02000H
01FFFH
Program memory/
data memory
00000H
External memory
(960K bytes)
Special function registers (SFR)
Note 2
(256 bytes)
Internal RAM
(384 bytes)
External memory
(56704 bytes)
Internal ROM
(8K bytes)
Note 1
0FEFFH
0FEE0H
0FEDFH
0FEC2H
0FD80H
01FFFH
01000H
00FFFH
00800H
007FFH
00080H
0007FH
00040H
0003FH
00000H
General registers
(32 bytes)
Macro service control
words (30 bytes)
Data area
(512 bytes)
Program area
(4K bytes)
CALLF entry area
(2K bytes)
Program area
(1920 bytes)
CALLT table area
(64 bytes)
Vector table area
(64 bytes)
Notes 1. Accessed in 1M-byte expansion mode.
2. External SFR area
Remark The shaded areas indicate internal memory.
38
Fig. 3-2 Memory Map of µPD78212 (EA Pin Driven Low)
FFFFFH
Chapter 3 CPU Function
Data memory
Expansion address
10000H
0FFFFH
0FFDFH
0FFD0H
0FF00H
0FEFFH
Data
memory
0FD80H
0FD7FH
Memory space (1M byte)
Ordinary address (64K bytes)
Program memory/data memory
00000H
External memory
(960K bytes)
Special function registers (SFR)
Note 2
(256 bytes)
Internal RAM
(384 bytes)
External memory
(64896 bytes)
Note 1
0FEFFH
0FEE0H
0FEDFH
0FEC2H
0FD80H
00FFFH
00800H
007FFH
00080H
0007FH
00040H
0003FH
00000H
3
General registers
(32 bytes)
Macro service control
words (30 bytes)
Data area
(512 bytes)
CALLF entry area
(2K bytes)
Program area
(1920 bytes)
CALLT table area
(64 bytes)
Vector table area
(64 bytes)
Notes 1. Accessed in 1M-byte expansion mode.
2. External SFR area
Remark The shaded areas indicate internal memory.
39
µ
PD78214 Sub-Series
Fig. 3-3 Memory Map of µPD78213, µPD78214, or µPD78P214 (EA Pin Driven Low)
In the area from 00000H to 03FFFH (00000H to 01FFFH for the µPD78212), a 16K × 8 bit ROM (8K × 8 bit ROM for
the µPD78212) is incorporated. Programs and table data are stored in this area. Usually, the program counter (PC)
is used for addressing.
If the µPD78213 is used or if the EA pin is driven low, this area becomes external memory (ROM-less operation).
(1) Vector table area
The 64-byte area from 00000H to 0003FH is reserved as a vector table area. Stored in the vector table area
is the program start address to which a program is branched if RESET is input or if an interrupt request occurs.
The low-order eight bits of the 16-bit address are stored at even-numbered addresses, and the high-order
eight bits at odd-numbered addresses.
Table 3-1 Vector Table
Vector table address
00000H
00002H
00006H
00008H
0000AH
0000CH
0000EH
00010H
00012H
00014H
00016H
00018H
0001AH
0001CH
00020H
00022H
00024H
00026H
0003EH
Interrupt request
Reset (RESET input)
NMI
INTP0
INTP1
INTP2
INTP3
INTP4/INTC30
INTP5/INTAD
INTC20
INTC00
INTC01
INTC10
INTC11
INTC21
INTSER
INTSR
INTST
INTCSI
BRK
(2) CALLT instruction table area
In the 64-byte area from 00040H to 0007FH, the subroutine entry address of a one-byte call instruction (CALLT)
can be stored.
(3) CALLF instruction entry area
A two-byte call instruction (CALLF) can directly call a subroutine, starting from an address between 00800H
and 00FFFH.
42
Chapter 3 CPU Function
3.1.2 Internal RAM Area
A 512-byte (384-byte for the µPD78212) general-purpose static RAM is incorporated into the area from 0FD00H to
0FEFFH.
This area consists of the following two RAMs:
Peripheral RAM (PRAM): 0FD00H to 0FDFFH (0FD80H to 0FDFFH for the µPD78212)
°
Internal dual-port RAM (IRAM): 0FE00H to 0FEFFH
°
The internal dual-port RAM (IRAM) can be accessed at high speed.
Short direct addressing mode for high-speed access can be used for the area from 0FE20H to 0FEFFH. (Refer to
Chapter 6, Instruction, “78K/II Series User’s Manual.”)
General-purpose registers of four banks are mapped into the 32-byte area from 0FEE0H to 0FEFFH. Macro service
control words are mapped into the 30-byte area from 0FEC2H to 0FEDFH.
Caution Program fetch from the internal RAM area is prohibited.
Remark It is convenient to store data, work areas, and status flags that are frequently accessed in the area from 0FE20H to 0FEC1H. The area
from 0FE00H to 0FE1FH can be accessed at high speed. If this area is used as a stack area, macro service channel, or a data transfer
area for a macro service, system throughput can be improved. (For this area, short direct addressing cannot be used. This area is
addressed in the same way as other memory spaces. The area, however, can be accessed faster than other memory spaces. In terms
of the efficiency of the entire system, it is advantageous to use the area as a stack area, macro service channel, or a data transfer area
for a macro service channel.)
3
3.1.3 Special Function Register (SFR) Area
Special function registers (SFR), which are on-chip hardware peripherals, are mapped into the area from 0FF00H
to 0FFFFH (see Section 3.2.5).
The area from 0FFD0H to 0FFDFH is mapped as an external SFR area. This area allows the µPD78214 in external
memory expansion mode (selected by memory expansion mode register MM) and µPD78213 (ROM-less) to access
external peripheral I/O.
Caution Never access an address to which no SFR is mapped in this area. If this is attempted, the µPD78214 may enter a deadlock. To restore
the device from the deadlock, a reset signal must be input.
3.1.4 External SFR Area
In the SFR area, the 16-byte area from 0FFD0H to 0FFDFH is mapped as an external SFR area. This area allows the
µ
PD78214 in external memory expansion mode (selected by memory expansion mode register MM) and the
µ
PD78213 (ROM-less) to access external peripheral I/O through the address bus or address/data bus.
The external SFR area can be accessed by the SFR addressing method. The area features the following: Peripheral
I/O can be easily manipulated and the object size can be compressed. This area can also be specified as an SFR
of macro service type B.
When the external SFR area is accessed, the bus operates as in ordinary memory access (see Chapter 13).
3.1.5 External Memory Space
The area from 04000H to 0FCFFH (02000H to 0FD7FH for the µPD78212) is an external memory space that can be
accessed by setting a memory expansion mode register (MM). In this area, programs and table data can be stored
and peripheral I/O devices can be mapped.
For the µPD78213, the area from 00000H to 0FCFFH can be accessed at any time.
3.1.6 External Extension Data Memory Space
The area from 10000H to FFFFFH can be accessed if 1M-byte expansion mode is selected by the memory expansion
mode register (MM). In this mode, pins P60 to P63 of port 6 function as the expansion address bus of four bits (A16
to A19). The data memory space is manipulated as 16 banks of 64K bytes. The low-order four bits of registers P6
and PM6 function as a bank register for selecting a bank. This memory space is useful if the kanji character
generator or a large amount of data is used.
43
µ
PD78214 Sub-Series
To access the space, specify the bank to be used (high-order four bits of address, A16 to A19) in the bank register
(P60 to P63 of register P6, or PM60 to PM63 of register PM6). Then, execute an instruction which allows extended
addressing. The high-order four bits of address output from pins P60 to P63 are valid only while an instruction
that allows extended addressing is being executed.
Because two bank registers are provided, two data banks can always be used. To select either of the two bank
registers, specify the operand of the instruction with or without &. If & is added, register P6 is selected as the bank
register. If & is omitted, register PM6 is selected as the bank register.
If one of the two banks is specified as the main data bank in a RAM area, and if the other bank is specified as the
sub-data bank in a data ROM area, for example, the data read from the data ROM (for example, character data for
the printer) can easily be enlarged or reduced in size and stored in the RAM.
Example Specifying bank 1 as the main bank and bank 5 as the sub-bank and transferring the data from bank 5 to bank 1
MOVMM, #47H; Selects memory expansion mode.
MOVPM6, #1H; Sets the main bank register (PM6).
MOVP6, #5H; Sets the sub-bank register (P6).
MOVB, #0FFH; Sets the loop counter.
·
·
·
LOOP :
·
·
·
·
·
MOVA, &[HL+]; Reads data from bank 5. (The contents of register P6 are added as the most significant address.)
MOV[DE+], A; Stores the data in bank 1. (The contents of register PM6 are added as the most significant address.)
·
·
·
·
·
·
·
DBNZB, $LOOP; Repetition
Fig. 3-5 Sample Data Transfer between Banks
Bank 1
10000H
1FFFFH
Remarks 1. The MOV [DE+], A and MOV A, &[HL+] instructions are both held in bank 0.
2. The instruction that uses register PM6 as the bank register requires a shorter instruction code and shorter execution time than
that which uses register P6. The instruction that manipulates register P6 requires a shorter instruction code and shorter execution
time than that which manipulates register PM6. It is, therefore, efficient to use PM6 as the main bank register that specifies the
bank accessed most frequently and P6 as the sub-bank register that frequently specifies different banks.
(main data bank)
50000H
5FFFFH
MOV [DE+], AMOV A, &[HL+]
A register
Bank 5
(auxiliary data bank)
44
Chapter 3 CPU Function
3.2 REGISTERS
3.2.1 Program Counter (PC)
This 16-bit binary counter holds the address of the program to be executed next (see Fig. 3-6).
Usually, the address is automatically incremented according to the number of bytes of the instruction to be
fetched. If an instruction causing a branch is executed, the contents of the register or immediate data are set.
µ
When RESET is input, the contents at address 00000H of the internal ROM (external memory for the
are specified in the low-order eight bits of the PC and the contents at address 00001H are specified in the high-order
eight bits of the PC.
This 8-bit register consists of flags that are set or reset according to the execution results of an instruction (see Fig.
3-7).
The contents can be read and written in units of eight bits. Each flag can be manipulated by a bit manipulation
instruction. The PSW is saved to a stack when a vectored interrupt request is acknowledged or when the BRK or
PUSH PSW instruction is executed. The PSW is restored when an RETI, RETB, or POP PSW instruction is executed.
When RESET is input, the PSW is set to 02H. (In this state, no interrupt requests can be acknowledged.)
PD78213)
3
Fig. 3-7 Configuration of the Program Status Word
76543210
IEZ RBS1 AC RBS0 0ISPCY
PSW
(1) Carry flag (CY)
This flag indicates whether an overflow or underflow occurs when an add/subtract instruction is executed.
If a shift/rotate instruction is executed, the flag holds a shift-out value. If a bit arithmetic/logical instruction
is executed, the flag functions as a bit accumulator.
(2) Interrupt priority status flag (ISP)
This flag manages the priority of maskable vectored interrupts that can currently be acknowledged. If a
maskable interrupt is acknowledged, the contents of the priority designation flag of the acknowledged
interrupt are transferred to the ISP flag. If a non-maskable interrupt (NMI) is acknowledged, this flag is set to
0.
If the ISP flag is set to 0, vectored interrupts assigned a lower priority by the priority designation flag register
(PR0) cannot be acknowledged. If the ISP flag is set to 1, interrupts can be acknowledged, independent of the
priority. The actual acknowledgment of interrupts is controlled according to the status of the IE flag.
The contents are updated each time a maskable vectored interrupt is acknowledged.
For details, see Chapter 12.
45
µ
PD78214 Sub-Series
(3) Register bank selection flags (RBS0, RBS1)
These two flags are used to select one of four register banks (see Table 3-2).
The flags hold two-bit information indicating the register bank selected by the SEL RBn instruction.
Table 3-2 Selecting a Register Bank
RBS1
0
0
1
1
RBS0Specified register bank
0
1
0
1
Register bank 0
Register bank 1
Register bank 2
Register bank 3
(4) Auxiliary carry flag (AC)
If an operation generates a carry from bit 3 or a borrow into bit 3, this flag is set (1). Otherwise, the flag is reset
(0).
The flag is used when a BCD conversion instruction is executed.
(5) Zero flag (Z)
If an operation results in zero, this flag is set (1). Otherwise, the flag is reset (0).
(6) Interrupt request enable flag (IE)
This flag controls the CPU’s acknowledgment of interrupt requests.
If the flag is set to 0, interrupts are inhibited. Only nonmaskable interrupts and unmasked macro services can
be acknowledged. All other interrupts are prohibited.
If the flag is set to 1, interrupts are permitted. The ISP flag, interrupt mask flag corresponding to each interrupt
request, and priority designation flag control the acknowledgment of an interrupt request.
When the EI instruction is executed, the IE flag is set (1). When the DI instruction is executed or when an
interrupt is acknowledged, the flag is reset (0).
3.2.3 Stack Pointer (SP)
This 16-bit register holds the first address of a stack area (LIFO: 00000H to 0FFFFH) (see Fig. 3-8). The stack pointer
is used to address a stack area when a subroutine is executed or when an interrupt is handled.
The contents of the SP are decremented before data is written into the stack area and incremented after data is
read from the stack area (see Figs. 3-9 and 3-10).
A special instruction can access the SP.
The contents of the SP become undefined when RESET is input. Immediately after a reset is released (before a
subroutine is called or before an interrupt is acknowledged), run an initialization program to initialize the SP.
Example Initializing the SP
MOVW SP, #0FEE0H; SP ← 0FEE0H (if used from FEDFH)
Cautions 1. In stack addressing, the entire 64K bytes can be accessed. A stack area cannot be mapped in the SFR area or internal ROM area.
2. The SP becomes undefined when RESET is input. Meanwhile, nonmaskable interrupts can be acknowledged immediately after
a reset is released. If a nonmaskable interrupt request occurs, while the SP is undefined, immediately after a reset is released,
an unpredictable operation may be carried out. To minimize this danger, initialize the SP immediately after a reset is released.
For details, see Section 12.3.2.
Register pair, high
↓
SP ⇒
↓
SP + 1
↓
SP + 2
SP ← SP + 2
RET instruction
Stack
PC7-PC0
PC15-PC8
SP ⇒
↓
SP + 1
↓
SP + 2
↓
SP + 3
SP ← SP + 3
RETI instruction
Stack
PC7-PC0
PC15-PC8
PSW
3
3.2.4 General-Purpose Registers
(1) Configuration
General-purpose registers are mapped to special addresses (0FEE0H to 0FEFFH) in data memory. The
registers are grouped into four banks, each of which consists of eight 8-bit registers (X, A, C, B, E, D, L, H) (see
Fig. 3-11).
47
µ
PD78214 Sub-Series
0FEE0H
0FEFFH
Fig. 3-11 Configuration of General-Purpose Registers
(8-bit processing)(16-bit processing)
A E1H
B E3H
D E5H
H E7H
A E9H
B EBH
D EDH
H EFH
A F1H
B F3H
D F5H
H F7H
A F9H
B FBH
D FDH
H FFH
X E0H
C E2H
E E4H
L E6H
X E8H
C EAH
E ECH
L EEH
X F0H
C F2H
E F4H
L F6H
X F8H
C FAH
E FCH
L FEH
↑
Register bank 3
(RBS1, 0 = 11)
↓
↑
Register bank 2
(RBS1, 0 = 10)
↓
↑
Register bank 1
(RBS1, 0 = 01)
↓
↑
Register bank 0
(RBS1, 0 = 00)
↓
AX
BC
DE
HL
AX
BC
DE
HL
AX
BC
DE
HL
AX
BC
DE
HL
E0H
E2H
E4H
E6H
E8H
EAH
ECH
EEH
F0H
F2H
F4H
F6H
F8H
FAH
FCH
FEH
To specify the register bank to be used to execute an instruction, use the CPU control instruction (SEL RBn).
When RESET is input, register bank 0 is specified.
The current register bank can be checked by reading the register bank selection flags (RBS0, RBS1) in the PSW.
The area from 0FEE0H to 0FEFFH can be addressed and accessed as an ordinary data memory area,
irrespective of whether the area is used for general-purpose registers.
Remark To restore the current register bank after it is changed to a different register bank, execute the PUSH PSW instruction to save the PSW
to a stack, then execute the SEL RBn instruction. The POP PSW instruction can restore the register bank if the stack position is not
changed. If an interrupt handling program changes the register bank, the PSW is automatically saved to a stack when an interrupt
is acknowledged. The PSW is restored by the RETI or RETB instruction. If a single register bank is predetermined for the interrupt
handling routine, only the SEL RBn instruction need be executed. The PUSH PSW instruction need not be executed.
Examples 1. Changing the register bank by an ordinary program
Specifying register bank 2
·
·
·
·
·
PUSH PSW
SELRB2
·
·
·
·
·
POPPSW
·
·
·
·
·
Register bank 2 is used.
The previous register bank is used.
2. Changing the register bank by an interrupt handling program
Selecting register bank 1
SELRB1
·
·
·
·
·
RETI
Register bank 1 is used.
The previous register bank is automatically
restored upon return from the interrupt
handling program.
48
Chapter 3 CPU Function
(2) Function
General-purpose registers can be operated in units of eight bits. They can also be operated in units of 16 bits,
that is, a pair of eight-bit registers can be operated as a single unit (AX, BC, DE, HL).
Each register can temporarily hold operation results or can be used as an operand of an arithmetic/logical
instruction between registers.
General-purpose registers are grouped into four register banks. By separating the register banks to be used
for ordinary operation from those for interrupt handling, an efficient program can be created.
The registers have different functions as described below:
A (R1): Central register for the transfer of 8-bit data or arithmetic/logical operations. This
register can also hold bit data.
The register can also hold the offset value for indexed addressing.
AX (RP0): Central register for the transfer of 16-bit data or arithmetic/logical operations
X (R0): Register that can hold bit data
B (R3): Register with the functions of a loop counter. The register can be used by the DBNZ
instruction.
This register can also hold the offset value for indexed addressing.
C (R2): Register with the functions of a loop counter. The register can be used by the DBNZ
instruction.
DE (RP2), HL (RP3) : Registers with the functions of a pointer. The registers specify a base address for register
indirect addressing and base addressing.
This register can also hold the offset value for indexed addressing.
Each register can be identified by a name representing its function (X, A, C, B, E, D, L, H, AX, BC, DE, HL) or
by an absolute name (R0 to R7, RP0 to RP3). For details of the relationship between the function names and
absolute names, see Table 3-3.
3
Table 3-3 Function Names and Absolute Names
Function nameAbsolute name
X
A
C
B
E
D
L
H
R0
R1
R2
R3
R4
R5
R6
R7
Function nameAbsolute name
AX
BC
DE
HL
RP0
RP1
RP2
RP3
49
µ
PD78214 Sub-Series
3.2.5 Special Function Registers (SFR)
A mode register, control register, and other registers with special functions, which are built-in hardware
peripherals, are mapped into the 256-byte space from 0FF00H to 0FFFFH.
Caution Never access an address to which no SFR is mapped in this area. If this is attempted, the µPD78214 may enter a deadlock. To clear
Table 3-4 lists the special function registers (SFR). The following column headings are used:
• Symbol : Symbol indicating the built-in SFR. This is a reserved word for NEC’s assembler (RA78K/II). For the
• R/W: Whether the contents of the SFR can be read or written
• Bit unit : Number of bits that can be manipulated when the SFR is operated. The SFR that can be manipulated
• At reset : Status of the register when RESET is input
the deadlock, a reset signal must be input to the device.
C compiler (CC78K/II), the #pragma sfr instruction allows this symbol to be used as an sfr variable.
R/W : Read/write
R: Read-only
W: Write-only
in units of 16 bits can be coded in the sfrp operand or specified by an even address. The SFR that can
be manipulated in one-bit units can be coded in the bit manipulation instruction.
At resetName of special function register (SFR)R/W
3
Not defined
×0H
Not defined
00H
Not defined
FFH
F×H
10H
00H
51
µ
PD78214 Sub-Series
Table 3-4 Special Function Registers (SFR) (2/2)
0FF50H
0FF51H
0FF52H
0FF54H
0FF56H
0FF5CH
0FF5DH
0FF5EH
0FF5FH
0FF68H
0FF6AH
0FF80H
0FF82H
0FF86H
0FF88H
0FF8AH
0FF8CH
0FF8EH
0FF90H
0FFC0H
0FFC4H
0FFC5H
0FFC6H
0FFD0H
0FFDFH
0FFE0H
0FFE1H
0FFE4H
0FFE5H
0FFE8H
0FFE9H
0FFECH
0FFEDH
0FFF4H
0FFF5H
0FFF8H
16-bit timer register 0
8-bit timer register 1
8-bit timer register 2
8-bit timer register 3
Prescaler mode register 0
Timer control register 0
Prescaler mode register 1
Timer control register 1
A/D converter mode register
A/D conversion result register
Clock synchronous serial interface mode register
Serial bus interface control register
Serial shift register
Asynchronous serial interface mode register
Asynchronous serial interface status register
Serial reception buffer: UART
Serial transmission shift register: UART
Baud rate generator control register
Standby control register
Memory expansion mode register
Programmable weight control register
Refresh mode register
External SFR area
Interrupt request flag register L
Interrupt request flag register H
Interrupt mask flag register L
Interrupt mask flag register H
Priority designation flag register L
Priority designation flag register H
Interrupt service mode register L
Interrupt service mode register H
External interrupt mode register 0
External interrupt mode register 1
Interrupt status register
R/W
TM00000H
TM1
TM2
TM3
PRM0
TMC0
PRM1
TMC1
ADM
ADCR
CSIM
SBIC
ASIM
ASIS
RXB
TXS
BRGC
STBC
RFM
IF0L
IF0H
MK0L
MK0H
PR0L
PR0H
ISM0L
ISM0H
INTM0
INTM1
SIO
MM
PW
—
MK0
ISM0
IST
R
W
R/W
W
R/W
R
R/W
R
W
R/W
IF0
R/W
PR0
Bit unit
8 bits
1 bit
—
—
—
—
—
°
—
°
—
°
—
°
—
°
—
°
—
°
°
°
—
°
°
°
°
°
—
°
°
°
°
°
—
°
—
°
—
°
—
°
°
°
°
°
°
°
°°
°
°
°
°
°
°
°
°
°
°
°
°
°
°
°
°
°
°
°
°
°
°
16 bits
°
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
—
°
°
°
°
—
—
At resetName of special function register (SFR)SymbolAddress
00H
00H
Not defined
00H
Not defined
80H
00H
Not defined
00H
0000 × 000B
20H
80H
00H
Not defined
0000H
FFFFH
FFFFH
0000H
00H
52
Chapter 3 CPU Function
3.3 NOTES
(1) A program fetch from the internal RAM area is prohibited.
(2) Operation of the stack pointer
In stack addressing, the entire 64K bytes can be accessed. No stack area can be mapped into the SFR area
or internal ROM area.
(3) Special function register (SFR)
Never access an address to which no SFR is mapped in the area from 0FF00H to 0FFFFH. If this is attempted,
the µPD78214 may enter a deadlock. To clear the deadlock, a reset signal must be input to the device.
(4) Initializing the stack pointer
The SP becomes undefined when RESET is input. Meanwhile, nonmaskable interrupts can be acknowledged
immediately after a reset is released. If a nonmaskable interrupt request occurs while the SP is undefined
immediately after a reset is released, an unpredictable operation may be carried out. To minimize this danger,
initialize the SP immediately after a reset is released. For details, see Section 12.3.2.
3
53
54
CHAPTER 4 CLOCK GENERATOR
4.1 CONFIGURATION AND FUNCTION
A clock generator generates and controls the internal system clock (CLK) sent to the CPU. Fig. 4-1 shows the
configuration of the clock generator.
Fig. 4-1 Block Diagram of Clock Generator
Frequency
X1
Clock
oscillator
X2
STOP mode
Remarks fXX: Crystal/ceramic oscillation frequency
fX: External clock frequency
f
: Internal system clock frequency (= 1/2·fXX or 1/2·fX)
CLK
f or f
XXX
divider
1/2
CLK
f
Internal system
clock (CLK)
The clock oscillator oscillates according to a crystal or ceramic resonator connected to pins X1 and X2. In standby
(STOP) mode, the oscillation is stopped (see Chapter 14).
The external clock can also be input. To input the external clock, input the clock signal to pin X1 and the inverted
signal to pin X2. If the external clock is input, STOP mode cannot be selected.
The frequency divider divides the output from the clock oscillator (fXX for the crystal/ceramic oscillation, fX for the
external clock) by two and generates the internal system clock (CLK).
Fig. 4-2 External Circuit for the Clock Oscillator
(a) Crystal/ceramic oscillation(b) External clock
µ
PD78214
PD78214
µ
VSS
X1
X1
4
★
X2
Caution When using the clock oscillator, the adverse influence of stray capacitance must be avoided. When configuring the circuit enclosed
in a dashed line, observe the following:
• Minimize the wiring length.
• Do not let other signal lines cross this circuit.
• Keep this circuit away from lines through which a varying high current flows.
• Always ground the capacitors of the oscillator at the same potential as VSS. Do not ground the capacitors to a ground pattern
through which a high current flows.
• Do not draw signals from the oscillator.
74HC04, etc.
X2
55
★
µ
PD78214 Sub-Series
Remark Different uses of the crystal and ceramic resonator
Generally, a crystal’s oscillation frequency is quite stable. Crystals are ideal for high-precision time management (for example, clock
or frequency measurement). In comparison with crystals, ceramic resonators are less stable but offer three advantages: a shorter
oscillation start time, smaller dimensions, and lower price. Ceramic resonators are suitable for general applications (which do not
require high-precision time management). If a ceramic resonator incorporating capacitors is used, the number of components and
the mounting area can be reduced.
4.2 NOTES
Regarding the clock generator, note the following:
4.2.1 Inputting an External Clock
(1) When inputting an external clock, do not select STOP mode. The clock generator may be damaged. At least,
its reliability will be adversely affected.
(2) When inputting an external clock, input the clock signal to pin X1 and the inverted signal to pin X2. If the
inverted signal is not input to the pin X2, malfunctions may readily occur due to noise.
(3) When inputting an external clock, use HCMOS or a device having equivalent drive capability.
(4) Do not draw signals from pins X1 and X2. Draw signals from point a shown in Fig. 4-3.
Fig. 4-3 Point from Which Signals Can Be Drawn When an External Clock Is Input
PD78214
µ
a
X1
X2
(5) Minimize the length of the line connecting pin X1 to pin X2 through the inverter.
4.2.2 Using the Crystal/Ceramic Oscillator
(1) The oscillator is a high-frequency analog circuit. Use the oscillator carefully. Special notes are given below:
• Minimize the lengths of the wiring.
• Do not let other signal lines cross this circuit.
• Keep the oscillator away from a line through which a varying high current flows.
• Always ground the capacitors of the oscillator at the same potential as pin VSS. Do not ground the
capacitors to a ground pattern through which a high current flows.
• Do not draw signals from the oscillator.
The microcomputer is capable of normal, stable operation only when the oscillation is normal and stable. If
a high-precision oscillation frequency is required, consult with the oscillator manufacturer.
56
Fig. 4-4 Notes on Connection of the Oscillator
µ
PD78214
Chapter 4 Clock Generator
X2
Cautions 1. Place the oscillator as close as possible to pins X1 and X2.
2. Do not let other signal lines cross the circuit enclosed in a dashed line.
X1VSS
Fig. 4-5 Incorrect Oscillator Connections
(a) The wiring length of the external circuit is too long.
PD78214
µ
X2
X1VSS
(b) A signal line is allowed to cross the oscillator.
PD78214
X2
µ
X1VSS
Pnm
4
57
µ
PD78214 Sub-Series
(c) A varying high current flows too close to the signal
line.
PD78214
µ
X2
High
current
X1VSS
(e) A signal is being drawn from the oscillator.
PD78214
µ
X2
X1VSS
(d)
A current flows through the ground line of the
oscillator. (The potentials vary at points A, B, and C.)
DD
V
PD78214
µ
Pnm
X2
ABC
High current
X1VSS
(2) At power-on or return from STOP mode, some time is required for the oscillation to settle. Generally, a crystal
requires a few milliseconds, and a ceramic resonator several hundreds of microseconds, for the oscillation
to settle.
The oscillation settling time is determined as described below. Ensure that sufficient time is allowed for the
oscillation to settle.
1 At power on: RESET input (reset period)
2 At return from STOP mode : (i) RESET input (reset period)
(ii) (Period in which the NMI signal is active) + (period specified for the timer
for automatic start)
58
CHAPTER 5 PORT FUNCTIONS
5.1 DIGITAL I/O PORTS
The µPD78214 has the ports shown in Fig. 5-1. These ports can be used for various types of control. Table 5-1 lists
the function of each port. For ports 2 through 6, software can specify whether to use a built-in pull-up resistor for
inputs.
Fig. 5-1 Port Configuration
5
P00-P07
P20-P27
P30
P37
P40-P47
P50
P57
P60-P63
8
4
Port 0
8
Port 2
Port 3
Port 4
Port 5
Note
Note
8
P64
P67
P70-P75
Note For µPD78213, P40 through P47, P50 through P57, P64, or P65 does not function as ports.
6
Port 6
Port 7
Note
59
µ
PD78214 Sub-Series
Table 5-1 Port Functions
NamePin name
Port 0
Port 2
Port 3
Note
Port 4
Note
Port 5
Note
Port 6
Port 7
Note For µPD78213, P40 through P47, P50 through P57, P64, or P65 does not function as ports.
P00-P07
P20-P27
P30-P37
P40-P47
P50-P57
P60-P63
P64-P67
P70-P75
Can be specified for either output in 8-bit
units or high impedance.
Can also function as 4-bit real-time
output port (P00-P03 and P04-P07).
Can drive transistors directly.
Input port
Can be specified for either input or
output in bit units.
Can be specified for either input or
output in 8-bit units
Can drive LEDs directly.
Can be specified for either input or
output in bit units
Can drive LEDs directly.
Output port
Can be specified for either input or
output in bit units
Input port
Function
Software-specified pull-up resistor
—
In 6-bit units (P22-P27)
For all input pins at a time
In 8-bit units
For all input pins at a time
—
For all input pins at a time
—
Table 5-2 Number of I/O Ports
I/O
Port
Input port
I/O port
Output port
Total
Total
14 (14)
28 (10)
12 (12)
54 (36)
Software-specified pull-up resistors
Input modeOutput mode
Directly driven LEDsDirect driven transistor
6 (6)
28 (10)
—
34 (16)
Values enclosed in parentheses apply to the µPD78213.
—
16 (0)
0 (0)
16 (0)
—
0 (0)
8 (8)
8 (8)
5.2 PORT 0
Port 0 is an 8-bit output-only port with an output latch and can drive transistors directly. The port 0 mode register
(PM0) can specify that port 0 be in either the output mode or high-impedance state in 8-bit units.
A set of P00 through P03 and a set of P04 through P07 function as a 4-bit real-time output port. Similarly, a set of
P00 through P07 functions as an 8-bit real-time output port. These ports can output the contents of the P0L and
P0H buffers at arbitrary intervals. The real-time output trigger control register (RTPC) specifies whether port 0 is
to function as an ordinary output port or real-time output port.
When the RESET signal is input, the output of port 0 becomes high impedance, and the contents of the output latch
become undefined.
60
5.2.1 Hardware Configuration
Fig. 5-2 shows the hardware configuration of port 0.
Fig. 5-2 Configuration of Port 0
Chapter 5 Port Functions
WRRTPC
RDRTPC
WRPM0
WRP0L
Internal bus
RDP0L
WROUT
RDIN
Real-time output port control register
P0LM
(P0HM)
Port 0 mode register
PM0n
(PM0m)
Buffer register
P0Ln
(P0Hm)
Trigger
Selector
5.2.2 Setting the Input/Output Mode and Control Mode
Output latch
P0n
(P0m)
5
P0n
(P0m)
n = 0, 1, 2, 3
m = 4, 5, 6, 7
The port 0 mode register (PM0) sets the I/O mode of port 0, as shown in Fig. 5-3. This register is set by an 8-bit
data transfer instruction. (It can neither manipulated in bit units nor read-accessed).
Fig. 5-3 Port 0 Mode Register Format
0
PM077PM066PM055PM044PM033PM022PM011PM00
PM0
PM0
00H
FFH
Other than above
(FFH when RESET is input)
Specifies P0n pin mode (n = 0 to 7)
Output mode (output buffer ON)
High-impedance state (output buffer OFF)
Cannot be set
To use port 0 as a real-time output port, it is necessary to set the P0LM and P0HM bits of the real-time output port
control register (RTPC) to 1.
When the P0LM and P0HM bits are set, the output buffer for each pin is turned on, and the contents of the output
latch are output to the pin, regardless of the contents of the PM0.
61
µ
PD78214 Sub-Series
5.2.3 Operation
Port 0 is an output-only port.
Once port 0 is put in the output mode, the output latch becomes operable, enabling data transfer between the
output latch and accumulator according to a transfer instruction. The output latch can be loaded with any data
by a logical operation instruction. Once the output latch is loaded with some data, it retains the data until it is
loaded with other data.
If port 0 is specified to be a real-time output port, no data can be written to the output latch. However, it is possible
to read the contents of the output latch if it is in the real-time output port mode.
Fig. 5-4 Port Specified as an Output Port
WRPORT
RDOUT
Internal bus
Output
Iatch
P0n
n = 0 to 7
5.2.4 Built-In Pull-Up Resistor
Port 0 has no built-in pull-up resistor.
5.2.5 Driving Transistors
Because port 0 has an enhanced driving capacity for the high level side of the output buffer, it can drive a transistor
directly on an active-high signal.
Fig. 5-5 shows an example of connecting a transistor to the port.
Fig. 5-5 Example of Driving a Transistor
VDD
Load
62
P0n
Chapter 5 Port Functions
5.3 PORT 2
Port 2 is an 8-bit input-only port. P22 through P27 have a software-programmable built-in pull-up resistor. In
addition to functioning as an input port, port 2 functions as a control signal input pin such as for external interrupts
(see Table 5-3). All the 8 input pins of port 2 are configured as Schmitt trigger circuits in order to prevent
malfunction due to noise.
Table 5-3 Functions of Port 2
PortFunction
P20
P21
P22
P23
P24
P25
P26
P27
Input port/NMI input
Input port/INTP0 input/CR11 capture trigger input/real-time output port trigger signal
Note NMI inputs are accepted regardless of whether interrupts are enabled.
(a) Function as a port pin
Although the pins of port 0 are shared by more than one function, the level of each pin can be read and tested.
(b) Function as a control signal input pin
(i) NMI (nonmaskable interrupt)
The NMI pin receives a nonmaskable interrupt request from the outside. The external interrupt mode
register (INTM0) specifies which edge, rising or falling, is valid as an interrupt request signal.
(ii) INTP0 through INTP5 (interrupt from peripherals)
The INTP0 through INTP5 pins receive interrupt requests from the outside. An interrupt occurs when one
of these pin receives an edge specified as valid by the external interrupt mode register (INTM0 and
INTM1). (See Chapter 11.)
The INTP0 through INTP3 and INTP5 pins are also used to receive external triggers, as listed below:
• INTP0: 8-bit timer/counter 1 capture trigger input and real-time output port trigger signal
The CI pin receives external clock inputs for 8-bit timer/counter 2.
(iv) ASCK (asynchronous serial clock)
The ASCK pin receives a baud rate clock from the outside.
(v) SI (serial input)
The SI pin receives serial data (during three-wire serial I/O mode).
63
µ
PD78214 Sub-Series
5.3.1 Hardware Configuration
Fig. 5-6 shows the configuration of port 2
Fig. 5-6 Block Diagram of Port 2
V
DD
WRPUO
RDPUO
RDP2n
RDP27
Internal bus
Interrupt and
control signals
SI input
3-wire serial
I/O mode
Pull-up resistor option register
PUO2
Noise
Edge
detector
Noise
eliminator
eliminator
P2n
n = 0, 1, 2, ···, 6
P27
Note P20 or P21 does not have a circuit enclosed in a dotted box.
5.3.2 Setting the Input Mode and Control Mode
Port 2 is an input-only port.
There is no register to specify an input mode for port 2. Port 2 is always ready to receive control signals. A register
such as a control register in the hardware is used to specify what control signal to receive.
5.3.3 Operation
Port 2 is an input-only port, and the level of each pin of it can be read and tested.
For P20 through P27, the level from which noise has be removed can be read and tested. See Chapter 11 for
removing noise.
64
Chapter 5 Port Functions
Fig. 5-7 Port Specified as an Input Port
RDIN
P2n
Noise
Internal bus
Caution For the in-circuit emulator, the level of each port 2 pin from which noise has not been removed can be read and tested.
eliminator
5.3.4 Built-In Pull-Up Resistor
P22 through P27 have built-in pull-up resistors. When they must be pulled up, the built-in pull-up resistors should
be used. Use of the built-in pull-up resistors can reduce the number of the required components and the required
installation space.
The PUO2 bit of the pull-up-resistor-option register (PUO) can specify whether to use the built-in pull-up resistors
at P22 through P27, for all six pins at one time. (It is impossible to specify use of the built-in pull-up resistor for
an individual bit independently of the other bits.)
P20 or P21 does not have a built-in pull-up resistor.
n = 0 to 7
5
Fig. 5-8 Built-In Pull-Up Resistor Format
1
0
PUO
Remark Resetting the PUO2 bit to 00H can reduce the required current in the STOP mode.
07PUO66PUO55PUO44PUO33PUO220
PUO2
Specifies pull-up resistor connection of port 2
0
Not connected with port 2
1
Connected with pins P22 to P27
(00H when RESET is input)
0
65
µ
PD78214 Sub-Series
Fig. 5-9 Connection of Pull-Up Resistors (Port 2)
VDD
P22
P23
P24
Input buffer
Internal bus
PUO2
Pull-up resistor option register (PUO)
Caution P22 through P26 are not pulled up immediately after a reset. In this case, INTP1 through INTP5 (one of the multiple functions
assigned to P22 to P26) may set interrupt request flags. To avoid this problem, specify use of the pull-up resistors in the initialization
routine, before clearing the interrupt flags.
P25
P26
P27
5.4 PORT 3
Port 3 is an 8-bit I/O port with an output latch. The port 3 mode register (PM3) can put each bit of this port in either
the input or output mode, separately from the other bits. Each pin has a software-programmable built-in pull-up
resistor.
In addition to I/O functions, each pin works as control signal pin.
The port 3 mode control register (PMC3) can specify the mode of operation for each pin separately from the other
pins, as listed in Table 5-4. The level of any pin can be read and tested, regardless of what function the pin is
performing.
When the RESET signal is input, port 3 becomes an input port (in the high output impedance state), and the
contents of the output latch become undefined.
66
Table 5-4 Port 3 Operating Modes (n = 0 through 7)
Chapter 5 Port Functions
ModeControl signal I/O mode
Condition
P30
P31
P32
P33
P34
P35
P36
P37
Port mode
PMC3n = 0
I/O port
PMC3n = 1
RxD input
TxD output
SCK I/O
SO output or SB0 I/O
TO0 output
TO1 output
TO2 output
TO3 output
(a) Port mode
If a port is put in a port mode by the PMC3 register, the port mode register (PM3) can put each bit of the port
in either the input or output mode independently of the other bits.
(b) Control signal I/O mode
The PMC3 register can specify each pin of port 3 as a control pin independently of the other pins, as described
below.
(i) RxD (receive data)
The RxD pin receives serial data from the asynchronous serial interface.
(ii) TxD (transmit data)
The TxD pin outputs serial data to the asynchronous serial interface.
(iii) SCK (serial clock)
The SCK pin is a serial clock I/O pin for the clock-synchronized serial interface.
(iv) SO (serial output)/SB0 (serial bus)
The SO pin outputs serial data (during three-wire serial I/O mode). The SB0 pin is a serial bus I/O pin
(during the SBI mode).
Remark For bit 3 (P33) of port 3, “SB0” is a reserved word in the NEC assembly program package. The bit is also defined in a header
file named sfrbit.h by the C compiler.
(v) TO0 through TO3 (timer output)
The TO0 through TO3 pins are timer output pins.
5
67
µ
PD78214 Sub-Series
5.4.1 Hardware Configuration
Fig. 5-10 through 5-13 show the configuration of port 3.
Fig. 5-10 Block Diagram of P30 (Port 3)
WRPUO
RDPUO
WRPM30
WRPMC30
RDPMC30
WRP30
Internal bus
RDP30
RDP30
RxD input
Port 3 mode register
PM30
PMC30
P30
Pull-up resistor option register
PUO3
VDD
P30
68
Chapter 5 Port Functions
Fig. 5-11 Block Diagram of P31, and P34 through P37 (Port 3)
WRPUO
RDPUO
WRPM3n
WRPMC3n
RDPMC3n
WRP3n
Internal bus
RDP3n
RDP3n
Port 3 mode register
PM3n
PMC3n
TO, TxD output
Output latch
P3n
Pull-up resistor option register
PUO3
Selector
VDD
5
P3n
n = 1, 4, 5, 6, 7
69
µ
PD78214 Sub-Series
★
WRPUO
RDPUO
WRPM32
WRPMC32
RDPMC32
WRP32
Internal bus
RDP32
RDP32
Fig. 5-12 Block Diagram of P32 (Port 3)
Pull-up resistor option register
PUO3
Port 3 mode register
PM32
PMC32
External
SCK
SCK
output
Output latch
P32
SCK input
VDD
P32
Selector
70
Chapter 5 Port Functions
WRPUO
RDPUO
WRPM33
WRPMC33
RDPMC33
WRP33
Internal bus
Fig. 5-13 Block Diagram of P33 (Port 3)
Pull-up resistor option register
PUO3
Port 3 mode register
PM33
Output disable
PMC33
PMC33
SB0 output
Output latch
SO output
Selector
P33
★
5
VDD
P33
SBI mode
RDOUT
RDIN
SB0 input
PMC33
Output
disable
5.4.2 Setting the I/O Mode and Control Mode
The port 3 mode register (PM3) can put each pin of port 3 in either the input or output mode independently of the
other pins, as shown in Fig. 5-14.
The PM3 register is loaded with data using an 8-bit data transfer instruction; it cannot be bit-manipulated or readaccessed.
In addition to I/O port functions, each pin of port 3 works as a control signal pin. As shown in Fig. 5-15, the port
3 mode control register (PMC3) can specify the mode of control for each pin.
71
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.