Do not use this product for mass production after the on-chip debug function has been used because its reliability cannot
be guaranteed, due to issues with respect to the number of times the flash memory can be rewritten. NEC Electronics
does not accept complaints concerning when use this product for mass production after the on-chip debug function has
been used.
Document No. U17555EJ4V0UD00 (4th edition)
Date Published March 2007 NS CP(K)
μ
PD78F0881(A2)
μ
PD78F0882(A2)
μ
PD78F0883(A2)
μ
PD78F0884(A2)
μ
PD78F0885(A2)
μ
PD78F0886(A2)
Printed in Japan
2005
[MEMO]
2
User’s Manual U17555EJ4V0UD
NOTES FOR CMOS DEVICES
1
VOLTAGE APPLICATION WAVEFORM AT INPUT PIN
Waveform distortion due to input noise or a reflected wave may cause malfunction. If the input of the
IL
CMOS device stays in the area between V
malfunction. Take care to prevent chattering noise from entering the device when the input level is fixed,
and also in the transition period when the input level passes through the area between V
IH
(MIN).
V
HANDLING OF UNUSED INPUT PINS
2
Unconnected CMOS device inputs can be cause of malfunction. If an input pin is unconnected, it is
possible that an internal input level may be generated due to noise, etc., causing malfunction. CMOS
devices behave differently than Bipolar or NMOS devices. Input levels of CMOS devices must be fixed
high or low by using pull-up or pull-down circuitry. Each unused pin should be connected to V
via a resistor if there is a possibility that it will be an output pin. All handling related to unused pins must
be judged separately for each device and according to related specifications governing the device.
3
PRECAUTION AGAINST ESD
A strong electric field, when exposed to a MOS device, can cause destruction of the gate oxide and
ultimately degrade the device operation. Steps must be taken to stop generation of static electricity as
much as possible, and quickly dissipate it when it has occurred. Environmental control must be
adequate. When it is dry, a humidifier should be used. It is recommended to avoid using insulators that
easily build up static electricity. Semiconductor devices must be stored and transported in an anti-static
container, static shielding bag or conductive material. All test and measurement tools including work
benches and floors should be grounded. The operator should be grounded using a wrist strap.
Semiconductor devices must not be touched with bare hands. Similar precautions need to be taken for
PW boards with mounted semiconductor devices.
(MAX) and VIH (MIN) due to noise, etc., the device may
IL
(MAX) and
DD
or GND
4
STATUS BEFORE INITIALIZATION
Power-on does not necessarily define the initial status of a MOS device. Immediately after the power
source is turned ON, devices with reset functions have not yet been initialized. Hence, power-on does
not guarantee output pin levels, I/O settings or contents of registers. A device is not initialized until the
reset signal is received. A reset operation must be executed immediately after power-on for devices
with reset functions.
5
POWER ON/OFF SEQUENCE
In the case of a device that uses different power supplies for the internal operation and external
interface, as a rule, switch on the external power supply after switching on the internal power supply.
When switching the power supply off, as a rule, switch off the external power supply and then the
internal power supply. Use of the reverse power on/off sequences may result in the application of an
overvoltage to the internal elements of the device, causing malfunction and degradation of internal
elements due to the passage of an abnormal current.
The correct power on/off sequence must be judged separately for each device and according to related
specifications governing the device.
6
INPUT OF SIGNAL DURING POWER OFF STATE
Do not input signals or an I/O pull-up power supply while the device is not powered. The current
injection that results from input of such a signal or I/O pull-up power supply may cause malfunction and
the abnormal current that passes in the device at this time may cause degradation of internal elements.
Input of signals during the power off state must be judged separately for each device and according to
related specifications governing the device.
User’s Manual U17555EJ4V0UD
3
EEPROM is trademark of NEC Electronics Corporation.
Windows, Windows NT and Windows XP are either registered trademarks or trademarks of Microsoft
Corporation in the United States and/or other countries.
PC/AT is a trademark of International Business Machines Corporation.
HP9000 series 700 and HP-UX are trademarks of Hewlett-Packard Company.
SPARCstation is a trademark of SPARC International, Inc.
Solaris and SunOS are trademarks of Sun Microsystems, Inc.
SuperFlash
is a registered trademark of Silicon Storage Technology, Inc. in several countries including the
United States and Japan.
®
Caution: This product uses SuperFlash
technology licensed from Silicon Storage Technology, inc.
•
The information in this document is current as of March, 2007. The information is subject to change
without notice. For actual design-in, refer to the latest publications of NEC Electronics data sheets or
data books, etc., for the most up-to-date specifications of NEC Electronics products. Not all
products and/or types are available in every country. Please check with an NEC Electronics sales
representative for availability and additional information.
•
No part of this document may be copied or reproduced in any form or by any means without the prior
written consent of NEC Electronics. NEC Electronics assumes no responsibility for any errors that may
appear in this document.
•
NEC Electronics does not assume any liability for infringement of patents, copyrights or other intellectual
property rights of third parties by or arising from the use of NEC Electronics products listed in this document
or any other liability arising from the use of such products. No license, express, implied or otherwise, is
granted under any patents, copyrights or other intellectual property rights of NEC Electronics or others.
Descriptions of circuits, software and other related information in this document are provided for illustrative
•
purposes in semiconductor product operation and application examples. The incorporation of these
circuits, software and information in the design of a customer's equipment shall be done under the full
responsibility of the customer. NEC Electronics assumes no responsibility for any losses incurred by
customers or third parties arising from the use of these circuits, software and information.
•
While NEC Electronics endeavors to enhance the quality, reliability and safety of NEC Electronics products,
customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely. To
minimize risks of damage to property or injury (including death) to persons arising from defects in NEC
Electronics products, customers must incorporate sufficient safety measures in their design, such as
redundancy, fire-containment and anti-failure features.
•
NEC Electronics products are classified into the following three quality grades: "Standard", "Special" and
"Specific".
The "Specific" quality grade applies only to NEC Electronics products developed based on a customerdesignated "quality assurance program" for a specific application. The recommended applications of an NEC
Electronics product depend on its quality grade, as indicated below. Customers must check the quality grade of
each NEC Electronics product before using it in a particular application.
"Standard":
"Special":
"Specific":
Computers, office equipment, communications equipment, test and measurement equipment, audio
and visual equipment, home electronic appliances, machine tools, personal electronic equipment
and industrial robots.
Transportation equipment (automobiles, trains, ships, etc.), traffic control systems, anti-disaster
systems, anti-crime systems, safety equipment and medical equipment (not specifically designed
for life support).
Aircraft, aerospace equipment, submersible repeaters, nuclear reactor control systems, life
support systems and medical equipment for life support, etc.
The quality grade of NEC Electronics products is "Standard" unless otherwise expressly specified in NEC
Electronics data sheets or data books, etc. If customers wish to use NEC Electronics products in applications
not intended by NEC Electronics, they must contact an NEC Electronics sales representative in advance to
determine NEC Electronics' willingness to support a given application.
(Note)
(1)
"NEC Electronics" as used in this statement means NEC Electronics Corporation and also includes its
majority-owned subsidiaries.
(2)
"NEC Electronics products" means any product developed or manufactured by or for NEC Electronics (as
defined above).
4
User’s Manual U17555EJ4V0UD
M8E 02. 11-1
[MEMO]
User’s Manual U17555EJ4V0UD
5
INTRODUCTION
Readers This manual is intended for user engineers who wish to understand the functions of the
78K0/FC2 and design and develop application systems and programs for these devices.
The target products are as follows.
78K0/FC2:
Purpose This manual is intended to give users an understanding of the functions described in the
Organization below.
Organization The 78K0/FC2 manual is separated into two parts: this manual and the instructions
edition (common to the 78K/0 Series).
• Pin functions
• Internal block functions
• Interrupts
• Other on-chip peripheral functions
• Electrical specifications
How to Read This Manual It is assumed that the readers of this manual have general knowledge of electrical
engineering, logic circuits, and microcontrollers.
• When using this manual as the manual for (A) and (A2) grade products:
→ Only the quality grade differs between (A) grade products and (A2) grade
• μPD78F0881→ μPD78F0881 (A), 78F0881 (A2)
•
•
•
•
•
• To gain a general understanding of functions:
→ Read this manual in the order of the CONTENTS. The mark <R> shows major
• How to interpret the register format:
→ For a bit number enclosed in brackets, the bit name is defined as a reserved word
• To check the details of a register when you know the register name:
→ Refer to APPENDIX C REGISTER INDEX.
ConventionsData significance: Higher digits on the left and lower digits on the right Active low representations: ××× (overscore over pin and signal name)
Note: Footnote for item marked with Note in the text.
Caution: Information requiring particular attention
Remark: Supplementary information
Numerical representations: Binary
Decimal
Hexadecimal
2.2.15 VDD and EVDD .................................................................................................................................. 37
2.2.16 VSS and EVSS................................................................................................................................... 37
3.2.1 Control registers ................................................................................................................................ 54
3.4.3 Direct addressing ...............................................................................................................................70
3.4.4 Short direct addressing ......................................................................................................................71
3.4.5 Special function register (SFR) addressing........................................................................................72
3.4.7 Based addressing ..............................................................................................................................74
3.4.8 Based indexed addressing.................................................................................................................75
CHAPTER 4 PORT FUNCTIONS ........................................................................................................... 77
4.1 Port Functions.............................................................................................................................. 77
4.2 Port Configuration ....................................................................................................................... 78
4.2.1 Port 0 .................................................................................................................................................79
4.2.2 Port 1 .................................................................................................................................................81
4.2.3 Port 3 .................................................................................................................................................84
4.2.4 Port 4 .................................................................................................................................................86
4.2.5 Port 6 .................................................................................................................................................87
4.2.6 Port 7 .................................................................................................................................................88
4.2.7 Port 8 .................................................................................................................................................91
4.2.8 Port 9 .................................................................................................................................................92
4.2.9 Port 12 ...............................................................................................................................................94
4.2.10 Port 13 .............................................................................................................................................97
4.3 Registers Controlling Port Function .......................................................................................... 99
4.4 Port Function Operations.......................................................................................................... 106
4.4.1 Writing to I/O port.............................................................................................................................106
4.4.2 Reading from I/O port.......................................................................................................................106
4.4.3 Operations on I/O port......................................................................................................................106
4.5 Cautions on 1-Bit Manipulation Instruction for Port Register n (Pn).................................... 107
15.1.1 Features .........................................................................................................................................349
15.1.2 Overview of functions .....................................................................................................................350
15.3.1 Determining bus priority .................................................................................................................363
15.3.2 Bit stuffing ......................................................................................................................................363
15.3.3 Multi masters..................................................................................................................................363
15.3.4 Multi cast ........................................................................................................................................363
15.3.5 CAN sleep mode/CAN stop mode function ....................................................................................363
15.3.6 Error control function ......................................................................................................................364
15.3.7 Baud rate control function ..............................................................................................................370
15.4 Connection With Target System ............................................................................................. 374
15.5 Internal Registers of CAN Controller...................................................................................... 375
15.5.1 CAN controller configuration...........................................................................................................375
15.5.2 Register access type ......................................................................................................................376
15.5.3 Register bit configuration................................................................................................................385
15.6 Bit Set/Clear Function.............................................................................................................. 389
15.7 Control Registers ..................................................................................................................... 391
15.8 CAN Controller Initialization.................................................................................................... 426
15.8.1 Initialization of CAN module ...........................................................................................................426
15.8.2 Initialization of message buffer.......................................................................................................426
15.8.3 Redefinition of message buffer.......................................................................................................426
15.8.4 Transition from initialization mode to operation mode ....................................................................427
15.8.5 Resetting error counter C0ERC of CAN module ............................................................................428
15.9.2 Receive Data Read ........................................................................................................................430
15.9.3 Receive history list function............................................................................................................431
15.9.4 Mask function .................................................................................................................................433
15.9.5 Multi buffer receive block function ..................................................................................................435
16.4.4 Interrupt request hold .....................................................................................................................507
CHAPTER 17 STANDBY FUNCTION .................................................................................................. 508
17.1 Standby Function and Configuration..................................................................................... 508
17.1.1 Standby function ............................................................................................................................508
17.2 Standby Function Operation................................................................................................... 511
17.2.1 HALT mode....................................................................................................................................511
23.6.2 Serial interface pins........................................................................................................................580
23.6.4 Port pins .........................................................................................................................................582
23.6.6 Other signal pins ............................................................................................................................582
23.6.7 Power supply..................................................................................................................................583
Input Serial data input to asynchronous serial interface Input
Output Serial data output from asynchronous serial interface Input
Input
Output
Input
Output
Note
Input A/D converter analog input Input P80 to P87, P90
External interrupt request input for which the valid edge (rising
edge, falling edge, or both rising and falling edges) can be
specified
External count clock input to 16-bit timer/event counter 00
Capture trigger input to capture registers (CR000, CR010) of
16-bit timer/event counter 00
Capture trigger input to capture register (CR000) of 16-bit
timer/event counter 00
Capture trigger input to capture register (CR001) of 16-bit
timer/event counter 01
16-bit timer/event counter 01 output
External count clock input to 8-bit timer/event counter 51
8-bit timer H1 output
Clock output (for trimming of high-speed system clock,
subsystem clock)
Input
P73/BUZ
P11/SI10
P10/SCK10
Input
Input
Input
Input
Input P72/INTP6
P00
P01/TO00
P06/TO01
P06/TI011
P33/TO51/INTP4
P16/INTP5
Note ANI8 is μPD78F0884, 78F0885, and 78F0886 only.
30
User’s Manual U17555EJ4V0UD
CHAPTER 2 PIN FUNCTIONS
Table 2-3. Non-port pins (2/2)
Pin Name I/O Function After Reset Alternate Function
CTxD Input CAN transmit data output Input P70
CRxD Output CAN receive data input Input P71
AVREF Input
A/D converter reference voltage input and positive power
−−
supply for port 2
AVSS
RESET Input System reset input
X1 Input Input P121
X2
XT1 Input Input P123
XT2
A/D converter ground potential. Make the same potential as
−
SS or VSS.
EV
Connecting resonator for high-speed system clock
−
Connecting resonator for subsystem clock
−
− −
− −
Input P122/EXCLK
Input P124/EXCLKS
EXCLK Input External clock input for main system clock Input P122/X2
EXCLKS Input External clock input for subsystem clock Input P124/XT2
EXLVI Input Potential input for external low-voltage detection Input P120/INTP0
VDD
EVDD
VSS
EVSS
FLMD0
REGC
Positive power supply (except for ports)
−
Positive power supply for ports
−
Ground potential (except for ports)
−
Ground potential for ports
−
Flash memory programming mode setting.
−
This is the pin for connecting regulator output (2.5 V)
−
− −
− −
− −
− −
− −
− −
stabilization capacitance for internal operation. Connect this
SS via a capacitor (0.47 to 1
pin to V
μ
F: recommended).
User’s Manual U17555EJ4V0UD
31
CHAPTER 2 PIN FUNCTIONS
2.2 Description of Pin Functions
2.2.1 P00, P01, P06 (port 0)
P00, P01 and P06 function as a 3-bit I/O port. These pins also function as timer I/O.
The following operation modes can be specified in 1-bit units.
(1) Port mode
P00, P01 and P06 function as 3-bit I/O port. P00, P01 and P06 can be set to input or output in 1-bit units using
port mode register 0 (PM0). Use of an on-chip pull-up resistor can be specified by pull-up resistor option register
0 (PU0).
(2) Control mode
P00, P01 and P06 function as timer I/O.
(a) TI000
These is the pin for inputting an external count clock to 16-bit timer/event counters 00 and are also for
inputting a capture trigger signal to the capture registers (CR000) of 16-bit timer/event counters 00.
(b) TI010, TI011
These are the pin for inputting a capture trigger signal to the capture register (CR010, CR011) of 16-bit
timer/event counters 00 and 01.
(c) TO00, TO01
These are timer output pin.
Caution P06 is
μ
PD78F0884, 78F0885, and 78F0886 only.
32
User’s Manual U17555EJ4V0UD
CHAPTER 2 PIN FUNCTIONS
2.2.2 P10 to P17 (port 1)
P10 to P17 function as an 8-bit I/O port. These pins also function as pins for external interrupt request input, serial
interface data I/O, clock I/O, and timer I/O.
The following operation modes can be specified in 1-bit units.
(1) Port mode
P10 to P17 function as an 8-bit I/O port. P10 to P17 can be set to input or output in 1-bit units using port mode
register 1 (PM1). Use of an on-chip pull-up resistor can be specified by pull-up resistor option register 1 (PU1).
(2) Control mode
P10 to P17 function as external interrupt request input, serial interface data I/O, clock I/O, and timer I/O.
(a) SI10
This is a serial interface serial data input pin.
(b) SO10
This is a serial interface serial data output pin.
(c) SCK10
This is a serial interface serial clock I/O pin.
(d) RxD60, RxD61
These are the serial data input pins of the asynchronous serial interface.
(e) TxD60, TxD61
These are the serial data output pins of the asynchronous serial interface.
(f) TI50
This is the pin for inputting an external count clock to 8-bit timer/event counter 50.
(g) TO50, TOH0, and TOH1
These are timer output pins.
(h) INTP5
This is an external interrupt request input pin for which the valid edge (rising edge, falling edge, or both rising
and falling edges) can be specified.
User’s Manual U17555EJ4V0UD
33
CHAPTER 2 PIN FUNCTIONS
2.2.3 P30 to P33 (port 3)
P30 to P33 function as a 4-bit I/O port. These pins also function as pins for external interrupt request input and
timer I/O.
The following operation modes can be specified in 1-bit units.
(1) Port mode
P30 to P33 function as a 4-bit I/O port. P30 to P33 can be set to input or output in 1-bit units using port mode
register 3 (PM3). Use of an on-chip pull-up resistor can be specified by pull-up resistor option register 3 (PU3).
(2) Control mode
P30 to P33 function as external interrupt request input pins and timer I/O pins.
(a) INTP1 to INTP4
These are the external interrupt request input pins for which the valid edge (rising edge, falling edge, or both
rising and falling edges) can be specified.
(b) TI51
This is an external count clock input pin to 8-bit timer/event counter 51.
(c) TO51
This is a timer output pin.
Cautions 1. Be sure to pull the P31/INTP2 pin down before a reset release, to prevent malfunction.
2. Connect P31/INTP2 as follows when writing the flash memory with a flash programmer.
- P31/INTP2: Connect to EV
SS via a resistor (10 kΩ: recommended).
The above connection is not necessary when writing the flash memory by means of self
programming.
Remark P31/INTP2 and P32/INTP3 can be used as on-chip debug mode setting pins when the on-chip debug
function is used. For details, refer to CHAPTER 24 ON-CHIP DEBUG FUNCTION.
2.2.4 P40, P41 (port 4)
P40, P41 function as a 2-bit I/O port. P40, P41 can be set to input or output in 1-bit units using port mode register
4 (PM4). Use of an on-chip pull-up resistor can be specified by pull-up resistor option register 4 (PU4).
2.2.5 P60 to P63 (port 6)
P60 to P63 function as a 4-bit I/O port. P60 to P63 can be set to input port or output port in 1-bit units using port
mode register 6 (PM6)
P60 to P63 are N-ch open-drain pins.
Caution P63 is
μ
PD78F0884, 78F0885, and 78F0886 only.
34
User’s Manual U17555EJ4V0UD
CHAPTER 2 PIN FUNCTIONS
2.2.6 P70 to P73 (port 7)
P70 to P73 function as a 4-bit I/O port. These pins also function as external interrupt request input, clock output
pins, buzzer output pins, CAN I/F I/O.
The following operation modes can be specified in 1-bit units.
(1) Port mode
P70 to P73 function as a 4-bit I/O port. P70 to P73 can be set to input or output in 1-bit units using port mode
register 7 (PM7). Use of an on-chip pull-up resistor can be specified by pull-up resistor option register 7 (PU7).
(2) Control mode
P70 to P73 function as external interrupt request input, output pins, buzzer output pins, CAN I/F I/O.
(a) INTP6, INTP7
These are the external interrupt request input pins for which the valid edge (rising edge, falling edge, or both
rising and falling edges) can be specified.
(b) CRxD
This is the CAN serial receive data input pin.
(c) CTxD
This is the CAN serial transmit data output pin.
(d) PCL
This is a clock output pin.
(e) BUZ
This is a buzzer output pin.
2.2.7 P80 to P87 (port 8)
P80 to P87 function as an 8-bit I/O port. These pins also function as pins for A/D converter analog input.
The following operation modes can be specified in 1-bit units.
(1) Port mode
P80 to P87 function as an 8-bit I/O port. P80 to P87 can be set to input or output in 1-bit units using port mode
register 8 (PM8).
(2) Control mode
P80 to P87 function as A/D converter analog input pins (ANI0 to ANI7). When using these pins as analog input
pins, see (5) P80/ANI0 to P87/ANI7, P90/ANI8 in 12.6 Cautions for A/D Converter.
CautionP80/ANI0 to P87/ANI7 is set in the analog input mode after release of reset.
User’s Manual U17555EJ4V0UD
35
CHAPTER 2 PIN FUNCTIONS
2.2.8 P90 (port 9)
P90 function as a 1-bit I/O port. These pins also function as pins for A/D converter analog input.
The following operation modes can be specified in 1-bit units.
(1) Port mode
P90 function as a 1-bit I/O port. P90 can be set to input or output in 1-bit units using port mode register 9 (PM9).
(2) Control mode
P90 function as A/D converter analog input pins (ANI8). When using these pins as analog input pins, see (5)
P80/ANI0 to P87/ANI7, P90/ANI8 in 12.6 Cautions for A/D Converter.
Cautions 1. P80/ANI0 to P87/ANI7 is set in the analog input mode after release of reset.
2. P90 is
μ
PD78F0884, 78F0885, and 78F0886 only.
2.2.9 P120 to P124 (port 12)
P120 to P124 function as a 5-bit I/O port. These pins also function as pins for external interrupt request input,
external clock input for main system clock, external clock input for subsystem clock and potential input for external
low-voltage detection. The following operation modes can be specified in 1-bit units.
(1) Port mode
P120 to P124 function as a 5-bit I/O port. P120 to P124 can be set to input or output using port mode register 12
(PM12). Only for P120, use of an on-chip pull-up resistor can be specified by pull-up resistor option register 12
(PU12).
(2) Control mode
P120 to P124 function as pins for external interrupt request input, potential input for external low-voltage
detection, resonator connection for main system clock, resonator connection for subsystem clock, external clock
input for main system clock and external clock input for subsystem clock.
(a) INTP0
This functions as an external interrupt request input for which the valid edge (rising edge, falling edge, or
both rising and falling edges) can be specified.
(b) EXLVI
This is a potential input pin for external low-voltage detection.
(c) X1, X2
These are the pins for connecting a resonator for high-speed system clock.
When supplying an external clock, input a signal to the X1 pin and input the inverse signal to the X2 pin.
Caution Connect P121/X1 as follows when writing the flash memory with a flash programmer.
- P121/X1: When using this pin as a port, connect it to V
SS via a resistor (10 kΩ:
recommended) (in the input mode) or leave it open (in the output mode).
The above connection is not necessary when writing the flash memory by means of self
programming.
Remark The X1 and X2 pins can be used as on-chip debug mode setting pins when the on-chip debug
function is used. For details, refer to CHAPTER 24 ON-CHIP DEBUG FUNCTION.
36
User’s Manual U17555EJ4V0UD
CHAPTER 2 PIN FUNCTIONS
(d) EXCLK
This is an external clock input pin for main system clock.
(e) XT1, XT2
These are the pins for connecting a resonator for subsystem clock.
When supplying an external clock, input a signal to the XT1 pin and input the inverse signal to the XT2 pin.
(f) EXCLKS
This is an external clock input pin for subsystem clock.
2.2.10 P130, P131 (port 13)
P130 functions as a 1-bit output-only port. P131 function as a 1-bit I/O port. P131 can be set to input or output in
1-bit units using port mode register 13 (PM13). Use of an on-chip pull-up resistor can be specified by pull-up resistor
option register 13 (PU13).
Caution P131 is
μ
PD78F0884, 78F0885, and 78F0886 only.
2.2.11 AV
REF
This is the A/D converter reference voltage input pin.
When the A/D converter is not used, connect this pin directly to EV
DD or VDD
Note
.
Note Connect port 8 and port 9 directly to EVDD when it is used as a digital port.
2.2.12 AVSS
This is the A/D converter ground potential pin. Even when the A/D converter is not used, always use this pin with
the same potential as the EV
SS pin or VSS pin.
2.2.13 RESET
This is the active-low system reset input pin.
2.2.14 REGC
This is the pin for connecting regulator output (2.5 V) stabilization capacitance for internal operation. Connect this
pin to V
SS via a capacitor (0.47 to 1 µF: recommended).
REGC
SS
V
Caution Keep the wiring length as short as possible for the broken-line part in the above figure.
2.2.15 V
DD and EVDD
DD is the positive power supply pin for other than ports.
V
EVDD is the positive power supply pin for ports.
2.2.16 V
SS and EVSS
SS is the ground potential pin for other than ports.
V
SS is the ground potential pin for ports.
EV
User’s Manual U17555EJ4V0UD
37
CHAPTER 2 PIN FUNCTIONS
2.2.17 FLMD0
This is a pin for setting flash memory programming mode.
Connect to EV
SS or VSS in the normal operation mode. In flash memory programming mode, be sure to connect
this pin to the flash programmer.
38
User’s Manual U17555EJ4V0UD
CHAPTER 2 PIN FUNCTIONS
2.3 Pin I/O Circuits and Recommended Connection of Unused Pins
Table 2-4 shows the types of pin I/O circuits and the recommended connections of unused pins.
Refer to Figure 2-1 for the configuration of the I/O circuit of each type.
Table 2-4. Pin I/O Circuit Types (1/2)
Pin Name I/O Circuit
I/O Recommended Connection of Unused Pins
Type
P00/TI000
P01/TI010/TO00
P06/TI011/TO01
Note 1
5-AH
I/O
Input: Independently connect to EV
EV
Output: Leave open.
P10/SCK10/TxD61
P11/SI10/RxD61
P12/SO10
5-H
P13/TxD60
P14/RxD60 5-AH
P15/TOH0 5-H
P16/TOH1/INTP5
5-AH
P17/TI50/TO50
P30/INTP1
P31/INTP2
Note 2
P32/INTP3
P33/TI51/TO51/INTP4
P40, P41 5-H
P60 to P63
Note 1
13-P Input: Connect to EVSS.
Output: Leave this pin open at low-level
output after clearing the output latch of the
port to 0.
DD or
SS via a resistor.
P70/CTxD 5-H
P71/CRxD
5-AH
P72/PCL/INTP6
Input: Independently connect to EV
SS via a resistor.
EV
Output: Leave open.
DD or
P73/BUZ/INTP7
P80/ANI0 to P87/ANI7
P90/ANI8
Note 1
Note 3
11-G I/O
<Analog setting>
Connect to AV
REF or AVSS.
<Digital setting>
Input: Independently connect to EV
SS via a resistor.
EV
DD or
Output: Leave open.
Notes 1. P06, P63 and P90 are μPD78F0884, 78F0885, and 78F0886 only.
2. Connect P31/INTP2 as follows when writing the flash memory with a flash
programmer.
- P31/INTP2: Connect to EV
SS via a resistor (10 kΩ: recommended).
The above connection is not necessary when writing the flash memory by means
of self programming.
3. P80/ANI0 to P87/ANI7 and P90/ANI8 is set in the analog input mode after release
of reset.
User’s Manual U17555EJ4V0UD
39
CHAPTER 2 PIN FUNCTIONS
Table 2-4. Pin I/O Circuit Types (2/2)
Pin Name I/O Circuit
I/O Recommended Connection of Unused Pins
Type
P120/INTP0/EXLVI 5-AH I/O Input: Independently connect to EVDD or
EV
SS via a resistor.
Output: Leave open.
P121/X1
P122/X2/EXCLK
P123/XT1
Note 1, 2
Note 1
Note 1
P124/XT2/EXCLKS
Note 1
37 I/O Input: Independently connect to EV
EV
SS via a resistor.
Output: Leave open.
DD or
P130 3-C Output Leave open.
Note 3
P131
5-AH I/O Input: Independently connect to EVDD or
EV
SS via a resistor.
Output: Leave open.
RESET 2 Input Connect to EVDD or VDD.
AVREFConnect directly to EVDD or VDD
−−
Note 4
.
AVSSConnect directly to EVSS or VSS.
FLMD0
Connect to EVSS or VSS.
Notes 1. Use the recommended connection above in I/O port mode (see Figure 5-6 Format
of Clock Operation Mode Select Register (OSCCTL)) when these pins are not
used.
2. Connect P121/X1 as follows when writing the flash memory with a flash
programmer.
- P121/X1: When using this pin as a port, connect it to V
SS via a resistor (10 kΩ:
recommended) (in the input mode) or leave it open (in the output mode).
The above connection is not necessary when writing the flash memory by means
of self programming.
3. P131 is
μ
PD78F0884, 78F0885, and 78F0886 only.
4. Connect port 8 directly to EVDD when it is used as a digital port.
40
User’s Manual U17555EJ4V0UD
CHAPTER 2 PIN FUNCTIONS
Figure 2-1. Pin I/O Circuit List (1/2)
Type 2
Type 5-H
EV
DD
IN
Schmitt-triggered input with hysteresis characteristics
Type 3-C
EV
DD
P-ch
Data
OUT
N-ch
Vss
Pullup
enable
Output
data
Output
disable
Input
enable
Type 11-G
Data
Output
disable
Comparator
(threshold voltage)
+
_
AV
REF
AV
P-ch
DD
EV
P-ch
IN/OUT
N-ch
EVss
REF
AV
P-ch
IN/OUT
N-ch
AV
SS
P-ch
N-ch
SS
Type 5-AH
Pull-up
enable
Data
Output
disable
Input
enable
EV
EV
DD
P-ch
N
SS
-ch
EV
DD
P-ch
IN/OUT
Input enable
Type 13-P
Data
Output disable
input enable
IN/OUT
N-ch
EVss
User’s Manual U17555EJ4V0UD
41
Type 37
Reset
Data
Output
disable
Input
enable
Reset
Data
Output
disable
Input
enable
EV
EVSS
EV
EVSS
DD
P-ch
N
DD
P-ch
N
-ch
CHAPTER 2 PIN FUNCTIONS
Figure 2-1. Pin I/O Circuit List (2/2)
X2,
-ch
N-ch
P-ch
XT2
X1,
XT1
42
User’s Manual U17555EJ4V0UD
CHAPTER 3 CPU ARCHITECTURE
3.1 Memory Space
Products in the 78K0/FC2 can each access a 64 KB memory space. Figures 3-1 to 3-3 show the memory map.
Caution Regardless of the internal memory capacity, the initial values of the internal memory size
switching register (IMS) and internal expansion RAM size switching register (IXS) of the
78K0/FC2 is fixed (IMS = CFH, IXS = 0CH). Therefore, set the value corresponding to each
product as indicated below.
Table 3-1. Set Values of Internal Memory Size Switching Register (IMS)
and Internal Expansion RAM Size Switching Register (IXS)
Flash Memory Version IMS IXS
μ
PD78F0881, 78F0884
μ
PD78F0882, 78F0885
μ
PD78F0883, 78F0886
C8H 0AH
CCH 08H
CFH 08H
User’s Manual U17555EJ4V0UD
43
CHAPTER 3 CPU ARCHITECTURE
Figure 3-1. Memory Map (μPD78F0881, 78F0884)
Data memory
space
RAM space in
which instruction
can be fetched
Program
memory space
FFFFH
FF00H
FEFFH
FEE0H
FEDFH
FB00H
FAFFH
FA00H
F9FFH
F800H
F7FFH
F400H
F3FFH
8000H
7FFFH
0190H
018FH
0083H
0082H
0000H
Special function registers
(SFR)
256 × 8 bits
General-purpose
registers
32 × 8 bits
Internal high-speed RAM
1024 × 8 bits
Note 1
AFCAN area
(256 × 8 bits)
Reserved
Internal expansion RAM
1024 × 8 bits
Reserved
Flash memory
32768 × 8 bits
Note 2
FF20H
FF1FH
FE20H
FE1FH
FE10H
FE0FH
Short direct
addressing
7FFFH
1085H
1084H
1080H
107FH
1000H
0FFFH
0800H
07FFH
0085H
0084H
0080H
007FH
0040H
003FH
0000H
Program area
Option byte area
5 × 8 bits
Program area
CALLF entry area
2048 × 8 bits
Program area
1915 × 8 bits
Option byte area
5 × 8 bits
CALLT table area
64 × 8 bits
Vector table area
64 × 8 bits
Note 3
Note 3
1FFFH
Boot cluster 1
Boot cluster 0
Notes 1. During on-chip debugging, use of this area is disabled since it is used as the user data backup area for
communication.
2. During on-chip debugging, use of this area is disabled since it is used as the communication command
area (269 bytes).
3. When boot swap is not used: Set the option bytes to 0080H to 0084H.
When boot swap is used: Set the option bytes to 0080H to 0084H and 1080H to 1084H.
4. Writing boot cluster 0 can be prohibited depending on the setting of security (see 23.8 Security
Setting).
Remark The flash memory is divided into blocks (one block = 1 KB). For the address values and block numbers,
see Table 3-2 Correspondence Between Address Values and Block Numbers in Flash Memory.
7FFFH
EC00H
EBFFH
Block 1FH
Note 4
44
07FFH
0400H
03FFH
0000H
Block 01H
Block 00H
User’s Manual U17555EJ4V0UD
1 KB
CHAPTER 3 CPU ARCHITECTURE
Figure 3-2. Memory Map (μPD78F0882, 78F0884)
Data memory
space
RAM space in
which instruction
can be fetched
Program
memory space
FFFFH
FF00H
FEFFH
FEE0H
FEDFH
FB00H
FAFFH
FA00H
F9FFH
F800H
F7FFH
F000H
EFFFH
C000H
BFFFH
0190H
018FH
0083H
0082H
0000H
Special function registers
(SFR)
256 × 8 bits
General-purpose
registers
32 × 8 bits
Internal high-speed RAM
1024 × 8 bits
Note 1
AFCAN area
(256 × 8 bits)
Reserved
Internal expansion RAM
2048 × 8 bits
Reserved
Flash memory
49152 × 8 bits
Note 2
FF20H
FF1FH
FE20H
FE1FH
FE10H
FE0FH
Short direct
addressing
BFFFH
1085H
1084H
1080H
107FH
1000H
0FFFH
0800H
07FFH
0085H
0084H
0080H
007FH
0040H
003FH
0000H
Program area
Option byte area
5 × 8 bits
Program area
CALLF entry area
2048 × 8 bits
Program area
1915 × 8 bits
Option byte area
5 × 8 bits
CALLT table area
64 × 8 bits
Vector table area
64 × 8 bits
Note 3
Note 3
1FFFH
Boot cluster 1
Boot cluster 0
Notes 1. During on-chip debugging, use of this area is disabled since it is used as the user data backup area for
communication.
2. During on-chip debugging, use of this area is disabled since it is used as the communication command
area (269 byte).
3. When boot swap is not used: Set the option bytes to 0080H to 0084H.
When boot swap is used: Set the option bytes to 0080H to 0084H and 1080H to 1084H.
4. Writing boot cluster 0 can be prohibited depending on the setting of security (see 23.8 Security
Setting).
Remark The flash memory is divided into blocks (one block = 1 KB). For the address values and block numbers,
see Table 3-2 Correspondence Between Address Values and Block Numbers in Flash Memory.
BFFFH
EC00H
EBFFH
Block 2FH
Note 4
07FFH
0400H
03FFH
0000H
Block 01H
Block 00H
User’s Manual U17555EJ4V0UD
1 KB
45
CHAPTER 3 CPU ARCHITECTURE
Figure 3-3. Memory Map (μPD78F0883, 78F0886)
Data memory
space
RAM space in
which instruction
can be fetched
Program
memory space
FFFFH
FF00H
FEFFH
FEE0H
FEDFH
FB00H
FAFFH
FA00H
F9FFH
F800H
F7FFH
F000H
EFFFH
0190H
018FH
0083H
0082H
0000H
Special function registers
(SFR)
256 × 8 bits
General-purpose
registers
32 × 8 bits
Internal high-speed RAM
1024 × 8 bits
Note 1
AFCAN area
(256 × 8 bits)
Reserved
Internal expansion RAM
2048 × 8 bits
Flash memory
61440 × 8 bits
Note 2
FF20H
FF1FH
FE20H
FE1FH
FE10H
FE0FH
Short direct
addressing
EFFFH
1085H
1084H
1080H
107FH
1000H
0FFFH
0800H
07FFH
0085H
0084H
0080H
007FH
0040H
003FH
0000H
Program area
Option byte area
5 × 8 bits
Program area
CALLF entry area
2048 × 8 bits
Program area
1915 × 8 bits
Option byte area
5 × 8 bits
CALLT table area
64 × 8 bits
Vector table area
64 × 8 bits
Note 3
Note 3
1FFFH
Boot cluster 1
Boot cluster 0
Notes 1. During on-chip debugging, use of this area is disabled since it is used as the user data backup area for
communication.
2. During on-chip debugging, use of this area is disabled since it is used as the communication command
area (269 bytes).
3. When boot swap is not used: Set the option bytes to 0080H to 0084H.
When boot swap is used: Set the option bytes to 0080H to 0084H and 1080H to 1084H.
4. Writing boot cluster 0 can be prohibited depending on the setting of security (see 23.8 Security
Setting).
Remark The flash memory is divided into blocks (one block = 1 KB). For the address values and block numbers,
see Table 3-2 Correspondence Between Address Values and Block Numbers in Flash Memory.
EFFFH
EC00H
EBFFH
Block 3BH
Note 4
46
07FFH
0400H
03FFH
0000H
Block 01H
Block 00H
User’s Manual U17555EJ4V0UD
1 KB
CHAPTER 3 CPU ARCHITECTURE
Correspondence between the address values and block numbers in the flash memory are shown below.
Table 3-2. Correspondence Between Address Values and Block Numbers in Flash Memory
The 64-byte area 0040H to 007FH can store the subroutine entry address of a 1-byte call instruction (CALLT).
(3) Option byte area
The option byte area is assigned to the 1-byte area of 0080H. Refer to CHAPTER 22 OPTION BYTE for details.
48
User’s Manual U17555EJ4V0UD
CHAPTER 3 CPU ARCHITECTURE
(4) CALLF instruction entry area
The area 0800H to 0FFFH can perform a direct subroutine call with a 2-byte call instruction (CALLF).
(5) On-chip debug security ID setting area
A 10-byte area of 0085H to 008EH and 1085H to 108EH can be used as an on-chip debug security ID setting
area. Set the on-chip debug security ID of 10 bytes at 0085H to 008EH when the boot swap is not used and at
0085H to 008EH and 1085H to 108EH when the boot swap is used. For details, see CHAPTER 24 ON-CHIP
DEBUG FUNCTION.
3.1.2 Internal data memory space
78K0/FC2 products incorporate the following RAM.
(1) Internal high-speed RAM
Table 3-5. Internal High-Speed RAM Capacity
Part Number Internal High-Speed RAM
μ
PD78F0881, 78F0884
μ
PD78F0882, 78F0885
μ
PD78F0883, 78F0886
1024 × 8 bits (FB00H to FEFFH)
The 32-byte area FEE0H to FEFFH is assigned to four general-purpose register banks consisting of eight 8-bit
registers per one bank.
This area cannot be used as a program area in which instructions are written and executed.
The internal high-speed RAM can also be used as a stack memory.
(2) Internal expansion RAM
Table 3-6. Internal Expansion RAM Capacity
Part Number Internal Expansion RAM
μ
PD78F0881, 78F0884 1024 × 8 bits (F400H to F7FFH)
μ
PD78F0882, 78F0885 2048 × 8 bits (F000H to F7FFH)
μ
PD78F0883, 78F0886
The internal expansion RAM can also be used as a normal data area similar to the internal high-speed RAM, as
well as a program area in which instructions can be written and executed.
The internal expansion RAM cannot be used as a stack memory.
3.1.3 Special function register (SFR) area
On-chip peripheral hardware special function registers (SFRs) are allocated in the area FF00H to FFFFH (refer to
Table 3-7 Special Function Register List in 3.2.3 Special Function Registers (SFRs)).
Caution Do not access addresses to which SFRs are not assigned.
User’s Manual U17555EJ4V0UD
49
CHAPTER 3 CPU ARCHITECTURE
3.1.4 Data memory addressing
Addressing refers to the method of specifying the address of the instruction to be executed next or the address of
the register or memory relevant to the execution of instructions.
Several addressing modes are provided for addressing the memory relevant to the execution of instructions for the
78K0/FC2, based on operability and other considerations. For areas containing data memory in particular, special
addressing methods designed for the functions of special function registers (SFR) and general-purpose registers are
available for use. Figure 3-4 to 3-6 show correspondence between data memory and addressing. For details of each
addressing mode, refer to 3.4 Operand Address Addressing.
50
User’s Manual U17555EJ4V0UD
CHAPTER 3 CPU ARCHITECTURE
Figure 3-4. Correspondence Between Data Memory and Addressing (μPD78F0881, μPD78F0884)
FFFFH
FF00H
FEFFH
FEE0H
FEDFH
FB00H
FAFFH
FA00H
F9FFH
F800H
F7FFH
Special function registers (SFR)
256 × 8 bits
General-purpose registers
32 × 8 bits
Internal high-speed RAM
1024 × 8 bits
Note 1
AFCAN area
(256 × 8 bits)
Reserved
Internal expansion RAM
1024 × 8 bits
SFR addressing
FF20H
FF1FH
Register addressing
FE20H
FE1FH
FE10H
FE0FH
Short direct
addressing
Direct addressing
Register indirect addressing
Based addressing
Based indexed addressing
F400H
F3FFH
Reserved
8000H
7FFFH
0190H
018FH
0083H
0082H
0000H
Flash memory
32768 × 8 bits
Note 2
Notes 1. During on-chip debugging, use of this area is disabled since it is used as the user data backup area for
communication.
2. During on-chip debugging, use of this area is disabled since it is used as the communication command
area (269 bytes).
User’s Manual U17555EJ4V0UD
51
CHAPTER 3 CPU ARCHITECTURE
Figure 3-5. Correspondence Between Data Memory and Addressing (μPD78F0882, 78F0885)
FFFFH
FF00H
FEFFH
FEE0H
FEDFH
FB00H
FAFFH
FA00H
F9FFH
F800H
F7FFH
Special function registers (SFR)
256 × 8 bits
General-purpose registers
32 × 8 bits
Internal high-speed RAM
1024 × 8 bits
Note 1
AFCAN area
(256 × 8 bits)
Reserved
Internal expansion RAM
2048 × 8 bits
SFR addressing
FF20H
FF1FH
Register addressing
FE20H
FE1FH
FE10H
FE0FH
Short direct
addressing
Direct addressing
Register indirect addressing
Based addressing
Based indexed addressing
F000H
EFFFH
Reserved
C000H
BFFFH
Flash memory
49152 × 8 bits
0190H
018FH
0083H
0082H
0000H
Note 2
Notes 1. During on-chip debugging, use of this area is disabled since it is used as the user data backup area for
communication.
2. During on-chip debugging, use of this area is disabled since it is used as the communication command
area (269 bytes).
52
User’s Manual U17555EJ4V0UD
FFFFH
CHAPTER 3 CPU ARCHITECTURE
Figure 3-6. Correspondence Between Data Memory and Addressing (μPD78F0883, 78F0886)
FF00H
FEFFH
FEE0H
FEDFH
FB00H
FAFFH
FA00H
F9FFH
F800H
F7FFH
Special function registers (SFR)
256 × 8 bits
General-purpose registers
32 × 8 bits
Internal high-speed RAM
1024 × 8 bits
Note 1
AFCAN area
(256 × 8 bits)
Reserved
Internal expansion RAM
2048 × 8 bits
SFR addressing
FF20H
FF1FH
Register addressing
FE20H
FE1FH
FE10H
FE0FH
Short direct
addressing
Direct addressing
Register indirect addressing
Based addressing
Based indexed addressing
F000H
EFFFH
Flash memory
61440 × 8 bits
0190H
018FH
0083H
0082H
0000H
Note 2
Notes 1. During on-chip debugging, use of this area is disabled since it is used as the user data backup area for
communication.
2. During on-chip debugging, use of this area is disabled since it is used as the communication command
area (269 bytes).
User’s Manual U17555EJ4V0UD
53
CHAPTER 3 CPU ARCHITECTURE
3.2 Processor Registers
78K0/FC2 products incorporate the following processor registers.
3.2.1 Control registers
The control registers control the program sequence, statuses and stack memory. The control registers consist of a
program counter (PC), a program status word (PSW) and a stack pointer (SP).
(1) Program counter (PC)
The program counter is a 16-bit register that holds the address information of the next program to be executed.
In normal operation, the PC is automatically incremented according to the number of bytes of the instruction to be
fetched. When a branch instruction is executed, immediate data and register contents are set.
Reset signal generation sets the reset Vector code values at addresses 0000H and 0001H to the program
2. Regardless of the internal memory capacity, the initial values of the internal memory size switching
register (IMS) and internal expansion RAM size switching register (IXS) of the 78K0/FC2 is fixed (IMS =
CFH, IXS = 0CH). Therefore, set the value corresponding to each as indicated below.
Flash Memory Version IMS IXS
μ
PD78F0881, 78F0884 C8H 0AH
μ
PD78F0882, 78F0885 CCH 08H
μ
PD78F0883, 78F0886
CFH 08H
64
User’s Manual U17555EJ4V0UD
CHAPTER 3 CPU ARCHITECTURE
3.3 Instruction Address Addressing
An instruction address is determined by program counter (PC) contents and is normally incremented (+1 for each
byte) automatically according to the number of bytes of an instruction to be fetched each time another instruction is
executed. When a branch instruction is executed, the branch destination information is set to the PC and branched by
the following addressing (for details of instructions, refer to 78K/0 Series Instructions User’s Manual (U12326E).
3.3.1 Relative addressing
[Function]
The value obtained by adding 8-bit immediate data (displacement value: jdisp8) of an instruction code to the
start address of the following instruction is transferred to the program counter (PC) and branched. The
displacement value is treated as signed two’s complement data (−128 to +127) and bit 7 becomes a sign bit.
In other words, relative addressing consists of relative branching from the start address of the following
instruction to the −128 to +127 range.
This function is carried out when the BR $addr16 instruction or a conditional branch instruction is executed.
[Illustration]
150
PC
+
150
876
PC indicates the start address
...
of the instruction after the BR instruction.
α
150
PC
When S = 0, all bits of are 0.
When S = 1, all bits of are 1.
α
α
S
jdisp8
User’s Manual U17555EJ4V0UD
65
CHAPTER 3 CPU ARCHITECTURE
3.3.2 Immediate addressing
[Function]
Immediate data in the instruction word is transferred to the program counter (PC) and branched.
This function is carried out when the CALL !addr16 or BR !addr16 or CALLF !addr11 instruction is executed.
CALL !addr16 and BR !addr16 instructions can be branched to the entire memory space. The CALLF !addr11
instruction is branched to the 0800H to 0FFFH area.
[Illustration]
In the case of CALL !addr16 and BR !addr16 instructions
70
CALL or BR
Low Addr.
High Addr.
150
PC
In the case of CALLF !addr11 instruction
70
150
PC
00001
643
10–8
fa
CALLF
fa
7–0
11 10
87
87
66
User’s Manual U17555EJ4V0UD
CHAPTER 3 CPU ARCHITECTURE
3.3.3 Table indirect addressing
[Function]
Table contents (branch destination address) of the particular location to be addressed by bits 1 to 5 of the
immediate data of an operation code are transferred to the program counter (PC) and branched.
This function is carried out when the CALLT [addr5] instruction is executed.
This instruction references the address stored in the memory table from 40H to 7FH, and allows branching to
the entire memory space.
[Illustration]
76510
Operation code
ta
4–0
111
Effective address
Effective address+1
151
01
00000000
Memory (Table)
70
Low Addr.
High Addr.
150
PC
87
650
87
0
3.3.4 Register addressing
[Function]
Register pair (AX) contents to be specified with an instruction word are transferred to the program counter (PC)
and branched.
This function is carried out when the BR AX instruction is executed.
[Illustration]
70
07
rp
150
PC
AX
87
User’s Manual U17555EJ4V0UD
67
CHAPTER 3 CPU ARCHITECTURE
3.4 Operand Address Addressing
The following methods are available to specify the register and memory (addressing) to undergo manipulation
during instruction execution.
3.4.1 Implied addressing
[Function]
The register that functions as an accumulator (A and AX) among the general-purpose registers is automatically
(implicitly) addressed.
Of the 78K0/FC2 instruction words, the following instructions employ implied addressing.
Instruction Register to Be Specified by Implied Addressing
MULU A register for multiplicand and AX register for product storage
DIVUW AX register for dividend and quotient storage
ADJBA/ADJBS A register for storage of numeric values that become decimal correction targets
ROR4/ROL4 A register for storage of digit data that undergoes digit rotation
[Operand format]
Because implied addressing can be automatically employed with an instruction, no particular operand format is
necessary.
[Description example]
In the case of MULU X
With an 8-bit × 8-bit multiply instruction, the product of A register and X register is stored in AX. In this example,
the A and AX registers are specified by implied addressing.
68
User’s Manual U17555EJ4V0UD
CHAPTER 3 CPU ARCHITECTURE
3.4.2 Register addressing
[Function]
The general-purpose register to be specified is accessed as an operand with the register bank select flags
(RBS0 to RBS1) and the register specify codes (Rn and RPn) of an operation code.
Register addressing is carried out when an instruction with the following operand format is executed. When an
8-bit register is specified, one of the eight registers is specified with 3 bits in the operation code.
[Operand format]
Identifier Description
r X, A, C, B, E, D, L, H
rp AX, BC, DE, HL
‘r’ and ‘rp’ can be described by absolute names (R0 to R7 and RP0 to RP3) as well as function names (X, A, C,
B, E, D, L, H, AX, BC, DE, and HL).
[Description example]
MOV A, C; when selecting C register as r
Operation code 01100010
Register specify code
INCW DE; when selecting DE register pair as rp
Operation code 10000100
Register specify code
User’s Manual U17555EJ4V0UD
69
CHAPTER 3 CPU ARCHITECTURE
3.4.3 Direct addressing
[Function]
The memory to be manipulated is directly addressed with immediate data in an instruction word becoming an
operand address.
[Operand format]
Identifier Description
addr16 Label or 16-bit immediate data
[Description example]
MOV A, !0FE00H; when setting !addr16 to FE00H
Operation code 10001110 OP code
00000000 00H
11111110 FEH
[Illustration]
07
OP code
addr16 (lower)
addr16 (upper)
Memory
70
User’s Manual U17555EJ4V0UD
CHAPTER 3 CPU ARCHITECTURE
3.4.4 Short direct addressing
[Function]
The memory to be manipulated in the fixed space is directly addressed with 8-bit data in an instruction word.
This addressing is applied to the 256-byte space FE20H to FF1FH. Internal RAM and special function registers
(SFRs) are mapped at FE20H to FEFFH and FF00H to FF1FH, respectively.
The SFR area (FF00H to FF1FH) where short direct addressing is applied is a part of the overall SFR area.
Ports that are frequently accessed in a program and compare and capture registers of the timer/event counter
are mapped in this area, allowing SFRs to be manipulated with a small number of bytes and clocks.
When 8-bit immediate data is at 20H to FFH, bit 8 of an effective address is set to 0. When it is at 00H to 1FH,
bit 8 is set to 1. Refer to the [Illustration] shown below.
[Operand format]
Identifier Description
saddr Immediate data that indicate label or FE20H to FF1FH
saddrp Immediate data that indicate label or FE20H to FF1FH (even address only)
[Description example]
MOV 0FE30H, A; when transferring value of A register to saddr (FE30H)
Operation code 11110010 OP code
00110000 30H (saddr-offset)
[Illustration]
07
OP code
saddr-offset
15
Effective address
1
111111
When 8-bit immediate data is 20H to FFH,
When 8-bit immediate data is 00H to 1FH,
87
α
α
= 0
α
= 1
User’s Manual U17555EJ4V0UD
Short direct memory
0
71
CHAPTER 3 CPU ARCHITECTURE
3.4.5 Special function register (SFR) addressing
[Function]
A memory-mapped special function register (SFR) is addressed with 8-bit immediate data in an instruction word.
This addressing is applied to the 240-byte spaces FF00H to FFCFH and FFE0H to FFFFH. However, the SFRs
mapped at FF00H to FF1FH can be accessed with short direct addressing.
[Operand format]
Identifier Description
sfr Special function register name
sfrp
16-bit manipulatable special function register name (even address
only)
[Description example]
MOV PM0, A; when selecting PM0 (FF20H) as sfr
Operation code 1 1110110 OP code
0 0100000 20H (sfr-offset)
[Illustration]
07
Effective address
OP code
sfr-offset
15
1
111111
87
1
SFR
0
72
User’s Manual U17555EJ4V0UD
CHAPTER 3 CPU ARCHITECTURE
3.4.6 Register indirect addressing
[Function]
Register pair contents specified by a register pair specify code in an instruction word and by a register bank
select flag (RBS0 and RBS1) serve as an operand address for addressing the memory. This addressing can be
carried out for all the memory spaces.
[Operand format]
Identifier Description
[DE], [HL]
−
[Description example]
MOV A, [DE]; when selecting [DE] as register pair
Operation code 10000101
[Illustration]
1608D7
DE
The contents of the memory
addressed are transferred.
A
7 0
E
Memory
The memory address
07
specified with the
register pair DE
User’s Manual U17555EJ4V0UD
73
CHAPTER 3 CPU ARCHITECTURE
3.4.7 Based addressing
[Function]
8-bit immediate data is added as offset data to the contents of the base register, that is, the HL register pair in
the register bank specified by the register bank select flag (RBS0 and RBS1), and the sum is used to address
the memory. Addition is performed by expanding the offset data as a positive number to 16 bits. A carry from
the 16th bit is ignored. This addressing can be carried out for all the memory spaces.
[Operand format]
Identifier Description
[HL + byte]
−
[Description example]
MOV A, [HL + 10H]; when setting byte to 10H
Operation code 10101110
00010000
[Illustration]
1608H7
HL
The contents of the memory
addressed are transferred.
7 0
A
L
Memory
07
+10
74
User’s Manual U17555EJ4V0UD
CHAPTER 3 CPU ARCHITECTURE
3.4.8 Based indexed addressing
[Function]
The B or C register contents specified in an instruction word are added to the contents of the base register, that
is, the HL register pair in the register bank specified by the register bank select flag (RBS0 and RBS1), and the
sum is used to address the memory. Addition is performed by expanding the B or C register contents as a
positive number to 16 bits. A carry from the 16th bit is ignored. This addressing can be carried out for all the
memory spaces.
[Operand format]
Identifier Description
[HL + B], [HL + C]
−
[Description example]
In the case of MOV A, [HL + B]; (selecting B register)
Operation code 10101011
[Illustration]
160
78
HL
The contents of the memory
addressed are transferred.
7 0
A
H
+
L
B
Memory
07
07
User’s Manual U17555EJ4V0UD
75
CHAPTER 3 CPU ARCHITECTURE
3.4.9 Stack addressing
[Function]
The stack area is indirectly addressed with the stack pointer (SP) contents.
This addressing method is automatically employed when the PUSH, POP, subroutine call and return
instructions are executed or the register is saved/reset upon generation of an interrupt request.
With stack addressing, only the internal high-speed RAM area can be accessed.
[Description example]
In the case of PUSH DE; (saving DE register)
Operation code 10110101
[Illustration]
Memory07
SP
SP
FEE0H
FEDEH
FEE0H
FEDFH
FEDEH
D
E
76
User’s Manual U17555EJ4V0UD
CHAPTER 4 PORT FUNCTIONS
4.1 Port Functions
There are two types of pin I/O buffer power supplies: AV
supplies and the pins is shown below.
Table 4-1. Pin I/O Buffer Power Supplies
Power Supply Corresponding Pins
AVREFP80 to P87, P90
EVDD/VDD• Port pins other than P80 to P87, P90
• Non-port pins
Note
Note P90 is μPD78F0884, 78F0885, 78F0886 only.
78K0/FC2 products are provided with the ports shown in Figure 4-1 and 4-2, which enable variety of control
operations.
In addition to the function as digital I/O ports, these ports have several alternate functions. For details of the
alternate functions, refer to CHAPTER 2 PIN FUNCTIONS.
μ
PD78F0881, 78F0882, 78F0883 have a total of 37 I/O ports, ports 0, 1, 3, 4, 6 to 8, 12 and 13. The port
configuration is shown below.
Figure 4-1. Port Types (
μ
P70
Port 7
P73
REF, EVDD/VDD. The relationship between these power
Note
PD78F0881, 78F0882, 78F0883)
P00
P01
P10
Port 0
Port 8
Port 12
Port 13
P80
P87
P120
P124
P130
P17
P30
P33
P40
P41
P60
P62
Port 1
Port 3
Port 4
Port 6
User’s Manual U17555EJ4V0UD
77
CHAPTER 4 PORT FUNCTIONS
μ
PD78F0884, 78F0885, 78F0886 have a total of 41 I/O ports, ports 0, 1, 3, 4, 6 to 9, 12 and 13. The port
configuration is shown below.
μ
Figure 4-2. Port Types (
PD78F0884, 78F0885, 78F0886)
P00
P01
P06
P10
P17
P30
P33
P40
P41
P60
P63
Port 0
Port 1
Port 3
Port 4
Port 6
Port 7
Port 8
Port 12
Port 13
P70
P73
P80
P87
P90Port 9
P120
P124
P130
P131
4.2 Port Configuration
Ports include the following hardware.
Table 4-2. Port Configuration (
μ
PD78F0881, 78F0882, 78F0883)
Item Configuration
Control registers
Port Total: 37 (CMOS I/O: 33, CMOS output: 1, N-ch open drain I/O: 3)
Pull-up resistor Total: 21
Port mode register (PM0, PM1, PM3, PM4, PM6 to PM8, PM12, PM13)
Port register (P0, P1, P3, P4, P6 to P8, P12, P13)
Pull-up resistor option register (PU0, PU1, PU3, PU4, PU7, PU12)
Table 4-3. Port Configuration (μPD78F0884, 78F0885, 78F0886)
Item Configuration
Control registers
Port Total: 41 (CMOS I/O: 36, CMOS output: 1, N-ch open drain I/O: 4)
Pull-up resistor Total: 23
Port mode register (PM0, PM1, PM3, PM6 to PM9, PM12, PM13)
Port register (P0, P1, P3, P4 to P9, P12, P13)
Pull-up resistor option register (PU0, PU1, PU3, PU4, PU7, PU12, PU13)
78
User’s Manual U17555EJ4V0UD
CHAPTER 4 PORT FUNCTIONS
4.2.1 Port 0
Port 0 is a 3-bit I/O port with an output latch. Port 0 can be set to the input mode or output mode in 1-bit units
using port mode register 0 (PM0). When the P00, P01 and P06 pins are used as an input port, use of an on-chip pull-
up resistor can be specified in 1-bit units by pull-up resistor option register 0 (PU0).
This port can also be used for timer I/O.
Reset signal generation sets port 0 to input mode.
Figures 4-3 and 4-4 show block diagrams of port 0.
Caution P06 is
μ
PD78F0884, 78F0885, 78F0886 only.
Figure 4-3. Block Diagram of P00
EV
DD
WR
PU
PU0
PU00
Alternate function
RD
WR
PORT
Internal bus
WR
PM
P0
Output latch
(P00)
PM0
PM00
P0: Port register 0
PU0: Pull-up resistor option register 0
PM0: Port mode register 0
RD: Read signal
WR××: Write signal
P-ch
Selector
P00/TI000
User’s Manual U17555EJ4V0UD
79
CHAPTER 4 PORT FUNCTIONS
Figure 4-4. Block Diagram of P01 and P06
EVDD
WR
PU
PU0
RD
WR
PORT
Internal bus
WRPM
P0: Port register 0
PU0: Pull-up resistor option register 0
PM0: Port mode register 0
RD: Read signal
WR××: Write signal
Caution P06 is
PU01, PU06
Alternate
function
Selector
P0
Output latch
(P01, P06)
PM0
PM01, PM06
Alternate
function
μ
PD78F0884, 78F0885, 78F0886 only.
P-ch
P01/TI010/TO00,
P06/TI011/TO01
80
User’s Manual U17555EJ4V0UD
CHAPTER 4 PORT FUNCTIONS
4.2.2 Port 1
Port 1 is an 8-bit I/O port with an output latch. Port 1 can be set to the input mode or output mode in 1-bit units
using port mode register 1 (PM1). When the P10 to P17 pins are used as an input port, use of an on-chip pull-up
resistor can be specified in 1-bit units by pull-up resistor option register 1 (PU1).
This port can also be used for external interrupt request input, serial interface data I/O, clock I/O, and timer I/O.
Reset signal generation sets port 1 to input mode.
Figures 4-5 to 4-7 show block diagrams of port 1.
Caution To use P10/SCK10/TxD61, P11/SI10/RxD61 and P12/SO10 as general-purpose ports, set serial
operation mode register 10 (CSIM10) and serial clock selection register 10 (CSIC10) to the
default status (00H).
Figure 4-5. Block Diagram of P10, P16 and P17
EV
DD
WR
PU
PU1
PU10, PU16
and PU17
P-ch
Internal bus
Alternate
function
RD
WR
PORT
P1
Output latch
(P10, P16, P17)
WR
PM
PM1
PM10, PM16
and PM17
Alternate
function
P1: Port register 1
PU1: Pull-up resistor option register 1
PM1: Port mode register 1
RD: Read signal
WR××: Write signal
Selector
P10/SCK10/TxD61,
P16/TOH1/INTP5,
P17/TI50/TO50
User’s Manual U17555EJ4V0UD
81
CHAPTER 4 PORT FUNCTIONS
Figure 4-6. Block Diagram of P11 and P14
EV
DD
WR
PU
PU1
Internal bus
PU11, PU14
Alternate
function
RD
WR
PORT
P1
Output latch
(P11, P14)
WR
PM
PM1
PM11, PM14
P1: Port register 1
PU1: Pull-up resistor option register 1
PM1: Port mode register 1
RD: Read signal
WR××: Write signal
P-ch
Selector
P11/SI10/RxD61,
P14/RxD60
82
User’s Manual U17555EJ4V0UD
WR
RD
PORT
WR
Internal bus
WR
CHAPTER 4 PORT FUNCTIONS
Figure 4-7. Block Diagram of P12, P13 and P15
EV
DD
PU
PU1
PU12, ,PU13
and PU15
Selector
P1
Output latch
(P12, PU13, P15)
PM
PM1
PM12, PM13
and PM15
P-ch
P12/SO10,
P13/TxD60,
P15/TOH0
Alternate
function
P1: Port register 1
PU1: Pull-up resistor option register 1
PM1: Port mode register 1
RD: Read signal
WR××: Write signal
User’s Manual U17555EJ4V0UD
83
CHAPTER 4 PORT FUNCTIONS
4.2.3 Port 3
Port 3 is a 4-bit I/O port with an output latch. Port 3 can be set to the input mode or output mode in 1-bit units
using port mode register 3 (PM3). When used as an input port, use of an on-chip pull-up resistor can be specified in
1-bit units by pull-up resistor option register 3 (PU3).
This port can also be used for external interrupt request input and timer I/O.
Reset signal generation sets port 3 to input mode.
Figures 4-8 and 4-9 show block diagrams of port 3.
<R>
Cautions 1. Be sure to pull the P31 pin down before a reset release, to prevent malfunction.
2. Connect P31/INTP2 as follows when writing the flash memory with a flash programmer.
- P31/INTP2: Connect to EV
SS via a resistor (10 kΩ: recommended).
The above connection is not necessary when writing the flash memory by means of self
programming.
Remark P31/INTP2 and P32/INTP3 can be used for on-chip debug mode setting when the on-chip debug
function is used. For details, refer to CHAPTER 24 ON-CHIP DEBUG FUNCTION.
Figure 4-8. Block Diagram of P30 to P32
EV
DD
WR
PU
PU3
PU30 to PU32
Alternate
function
RD
Internal bus
WR
PORT
P3
Output latch
(P30 to P32)
WR
PM
PM3
PM30 to PM32
P3: Port register 3
PU3: Pull-up resistor option register 3
PM3: Port mode register 3
RD: Read signal
WR××: Write signal
P-ch
Selector
P30/INTP1,
P31/INTP2,
P32/INTP3
84
User’s Manual U17555EJ4V0UD
CHAPTER 4 PORT FUNCTIONS
Figure 4-9. Block Diagram of P33
EV
DD
PU
WR
PU3
Internal bus
PU33
Alternate
function
RD
WR
PORT
P3
Output latch
(P33)
WR
PM
PM3
PM33
Alternate
function
P3: Port register 3
PU3: Pull-up resistor option register 3
PM3: Port mode register 3
RD: Read signal
WR××: Write signal
P-ch
Selector
P33/INTP4/TI51/TO51
User’s Manual U17555EJ4V0UD
85
CHAPTER 4 PORT FUNCTIONS
4.2.4 Port 4
Port 4 is a 2-bit I/O port with an output latch. Port 4 can be set to the input mode or output mode in 1-bit units
using port mode register 4 (PM4). Use of an on-chip pull-up resistor can be specified in 1-bit units with pull-up resistor
option register 4 (PU4).
Reset signal generation sets port 4 to input mode.
Figure 4-10 shows a block diagram of port 4.
Figure 4-10. Block Diagram of P40, P41
EV
DD
WR
PU
PU4
RD
WR
PORT
Internal bus
WR
PM
PU40, PU41
Selector
P4
Output latch
(P40, P41)
PM4
PM40, PM41
P-ch
P40, P41
P4: Port register 4
PU4: Pull-up resistor option register 4
PM4: Port mode register 4
RD: Read signal
WR××: Write signal
86
User’s Manual U17555EJ4V0UD
CHAPTER 4 PORT FUNCTIONS
4.2.5 Port 6
Port 6 is a 4-bit I/O port with an output latch. Port 6 can be set to the input mode or output mode in 1-bit units
using port mode register 6 (PM6).
The P60 to P63 pins are N-ch open-drain pins (6 V tolerance).
Reset signal generation sets port 6 to input mode.
Figures 4-11 shows block diagrams of port 6.
Caution P63 is
μ
PD78F0884, 78F0885, 78F0886 only.
Figure 4-11. Block Diagram of P60 to P63
RD
Selector
WR
PORT
Internal bus
P6
Output latch
(P60 to P63)
P60 to P63
WR
PM
PM6
PM60 to PM63
P6: Port register 6
PM6: Port mode register 6
RD: Read signal
WR××: Write signal
User’s Manual U17555EJ4V0UD
87
CHAPTER 4 PORT FUNCTIONS
4.2.6 Port 7
Port 7 is a 4-bit I/O port with an output latch. Port 7 can be set to the input mode or output mode in 1-bit units
using port mode register 7 (PM7). When the P70 to P73 pins are used as an input port, use of an on-chip pull-up
resistor can be specified in 1-bit units by pull-up resistor option register 7 (PU7).
This port can also be used for external interrupt request input, and clock output pins, buzzer output pins, CAN I/F
I/O.
Reset signal generation sets port 7 to input mode.
Figures 4-12 and 4-13 show block diagrams of port 7.
<R>
Figure 4-12. Block Diagram of P70
EV
DD
WR
PU
PU7
PU70
RD
PORT
WR
P7
Internal bus
WR
PM
Output latch
(P70)
PM7
PM70
Alternate
function
P7: Port register 7
PU7: Pull-up resistor option register 7
PM7: Port mode register 7
RD: Read signal
WR××: Write signal
P-ch
Selector
P70/CTxD
88
User’s Manual U17555EJ4V0UD
CHAPTER 4 PORT FUNCTIONS
Figure 4-13. Block Diagram of P71
EV
DD
PU
WR
PU7
PU71
Alternate function
RD
WR
PORT
Internal bus
P7
Output latch
(P71)
WR
PM
PM7
PM71
P7: Port register 7
PU7: Pull-up resistor option register 7
PM7: Port mode register 7
RD: Read signal
WR××: Write signal
P-ch
Selector
P71/CRxD
User’s Manual U17555EJ4V0UD
89
CHAPTER 4 PORT FUNCTIONS
Figure 4-14. Block Diagram of P72 and P73
EV
DD
WR
PU
PU7
Internal bus
PU72 and PU73
Alternate
function
RD
WR
PORT
P7
Output latch
(P72 and P73)
WR
PM
PM7
PM72 and PM73
Alternate
function
P7: Port register 7
PU7: Pull-up resistor option register 7
PM7: Port mode register 7
RD: Read signal
WR××: Write signal
P-ch
Selector
P72/PCL/INTP6
P73/BUZ/INTP7
90
User’s Manual U17555EJ4V0UD
CHAPTER 4 PORT FUNCTIONS
4.2.7 Port 8
Port 8 is an 8-bit I/O port with an output latch. Port 8 can be set to the input mode or output mode in 1-bit units
using port mode register 8 (PM8).
This port can also be used for A/D converter analog input.
To use P80/ANI0 to P87/ANI7 as digital input pins, set them in the digital I/O mode by using the A/D port
configuration register (ADPC) and in the input mode by using PM8. Use these pins starting from the lower bit.
To use P80/ANI0 to P87/ANI7 as digital output pins, set them in the digital I/O mode by using ADPC and in the
output mode by using PM8 (for details, see 12.3 (5) A/D port configuration register (ADPC)).
Table 4-4. Setting Functions of P80/ANI0 to P87/ANI7 Pins
ADPC PM8 ADS P80/ANI0 to P87/ANI7 Pin
Analog input selection
Input mode
Output mode
Output mode
−
−
Selects ANI. Analog input (to be converted) Input mode
Does not select ANI. Analog input (not to be converted)
Selects ANI.
Does not select ANI.
Digital input Digital I/O selection
Digital output
Setting prohibited
All P80/ANI0 to P87/ANI7 are set in the analog input mode when the reset signal is generated.
Figure 4-15 shows a block diagram of port 8.
Caution Make the AV
REF pin the same potential as the VDD pin when port 8 is used as a digital port.
Figure 4-15. Block Diagram of P80 to P87
RD
Selector
PORT
WR
P8
Internal bus
WR
PM
Output latch
(P80 to P87)
PM8
PM80 to PM87
P80/ANI0 to
P87/ANI7
A/D converter
P8: Port register 8
PM8: Port mode register 8
RD: Read signal
WR××: Write signal
User’s Manual U17555EJ4V0UD
91
CHAPTER 4 PORT FUNCTIONS
4.2.8 Port 9
Port 9 is a 1-bit I/O port with an output latch. Port 9 can be set to the input mode or output mode in 1-bit units
using port mode register 9 (PM9).
This port can also be used for A/D converter analog input.
To use P90/ANI8 as digital input pin, set them in the digital I/O mode by using the A/D port configuration register
(ADPC) and in the input mode by using PM9. Use these pins starting from the lower bit.
To use P90/ANI8 as digital output pin, set them in the digital I/O mode by using ADPC and in the output mode by
using PM9 (for details, see 12.3 (5) A/D port configuration register (ADPC)).
Table 4-5. Setting Function of P90/ANI8 Pin
ADPC PM9 ADS P90/ANI8
Analog input selection
Input mode
Output mode
Output mode
−
−
Selects ANI. Analog input (to be converted) Input mode
Does not select ANI. Analog input (not to be converted)
Selects ANI.
Does not select ANI.
Digital input Digital I/O selection
Digital output
Setting prohibited
All P90/ANI8 are set in the analog input mode when the reset signal is generated.
Figure 4-16 shows a block diagram of port 9.
Cautions 1. P90 is
2. Make the AV
μ
PD78F0884, 78F0885, 78F0886 only.
REF pin the same potential as the VDD pin when port 9 is used as a digital port.
3. When using P90/ANI80 in the input mode, not only PM9 (input/output) but also the A/D port
configuration register (ADPC) (analog input/digital input)must be set (for details, see 12.3 (5)
A/D port configuration register (ADPC)). The reset value of ADPC is 00H (P90/ANI8 is
analog input pin).
92
User’s Manual U17555EJ4V0UD
CHAPTER 4 PORT FUNCTIONS
Figure 4-16. Block Diagram of P90
RD
Selector
PORT
WR
P9
Internal bus
WR
PM
Output latch
(P90)
PM9
PM90
P90/ANI8
A/D converter
P9: Port register 9
PM9: Port mode register 9
RD: Read signal
WR××: Write signal
User’s Manual U17555EJ4V0UD
93
CHAPTER 4 PORT FUNCTIONS
4.2.9 Port 12
Port 12 is a 5-bit I/O port with an output latch. Port 12 can be set to the input mode or output mode in 1-bit units
using port mode register 12 (PM12). When used as an input port only for P120, use of an on-chip pull-up resistor can
be specified by pull-up resistor option register 12 (PU12).
This port can also be used for external interrupt input, potential input for external low-voltage detector, connecting
resonator for main system clock, connecting resonator for subsystem clock, external clock input for main system clock,
external clock input for subsystem clock.
Reset signal generation sets port 12 to input mode.
Figures 4-17 and 4-18 show block diagrams of port 12.
Cautions 1. When using the P121 to P124 pins to connect a resonator for the main system clock (X1, X2)
or subsystem clock (XT1, XT2), or to input an external clock for the main system clock
(EXCLK) or subsystem clock (EXCLKS), the X1 oscillation mode, XT1 oscillation mode, or
external clock input mode must be set by using the clock operation mode select register
(OSCCTL) (for detail, see 5.3 (5) Clock operation mode select register (OSCCTL)). The reset
value of OSCCTL is 00H (all of the P121 to P124 pins are I/O port pins). At this time, setting
of the PM121 to PM124 and P121 to P124 pins is not necessary.
2. Connect P121/X1 as follows when writing the flash memory with a flash programmer.
- P121/X1: When using this pin as a port, connect it to V
SS via a resistor (10 kΩ:
recommended) (in the input mode) or leave it open (in the output mode).
The above connection is not necessary when writing the flash memory by means of self
programming.
94
User’s Manual U17555EJ4V0UD
CHAPTER 4 PORT FUNCTIONS
Figure 4-17. Block Diagram of P120
EVDD
WR
PU
PU12
Internal bus
PU120
Alternate
function
RD
WR
PORT
P12
Output latch
(P120)
WRPM
PM12
PM120
P12: Port register 12
PU12: Pull-up resistor option register 12
PM12: Port mode register 12
RD: Read signal
WR××: Write signal
P-ch
Selector
P120/INTP0/EXLVI
User’s Manual U17555EJ4V0UD
95
WR
WR
RD
PORT
PM
Figure 4-18. Block Diagram of P121 to P124
P12
Output latch
(P122/P124)
PM12
PM122/PM124
OSCCTL
OSCSEL/
OSCSELS
CHAPTER 4 PORT FUNCTIONS
OSCCTL
OSCSEL/
OSCSELS
Selector
P122/X2/EXCLK,
P124/XT2/EXCLKS
OSCCTL
EXCLK, OSCSEL/
EXCLKS, OSCSELS
Internal bus
RD
Selector
WR
PORT
WR
PM
OSCSEL/OSCSELS
EXCLK/EXCLKS
P12
Output latch
(P121/P123)
PM12
PM121/PM123
OSCCTL
OSCCTL
P121/X1,
P123/XT1
P12: Port register 12
PU12: Pull-up resistor option register 12
PM12: Port mode register 12
RD: Read signal
WR××: Write signal
96
User’s Manual U17555EJ4V0UD
CHAPTER 4 PORT FUNCTIONS
4.2.10 Port 13
Port 130 is a 1-bit output-only port.
Port 131 is 1-bit I/O port. P131 can be set to the input mode or output mode in 1-bit units using port mode register
13 (PM13). When used as an input port, use of an on-chip pull-up resistor can be specified in 1-bit units by pull-up
resistor option register 13 (PU13).
Figures 4-19 and 4-20 show block diagrams of port 13.
Caution P131 is
μ
PD78F0884, 78F0885, 78F0886 only.
Figure 4-19. Block Diagram of P130
RD
WR
PORT
Internal bus
P13
Output latch
(P130)
P130
P13: Port register 13
RD: Read signal
WR××: Write signal
Remark When reset is effected, P130 outputs a low level. If P130 is set to output a high level before reset is
effected, the output signal of P130 can be dummy-output as the CPU reset signal.
Reset signal
P130
Set by software
User’s Manual U17555EJ4V0UD
97
CHAPTER 4 PORT FUNCTIONS
Figure 4-20. Block Diagram of P131
EV
DD
WR
PU
PU13
Internal bus
P13: Port register 13
PU13: Pull-up resistor option register 13
PM13: Port mode register 13
RD: Read signal
WR××: Write signal
Caution P131 is
PU131
RD
WR
PORT
WR
PM
μ
PD78F0884, 78F0885, 78F0886 only.
P13
Output latch
(P131)
PM13
PM131
P-ch
Selector
P131
98
User’s Manual U17555EJ4V0UD
CHAPTER 4 PORT FUNCTIONS
4.3 Registers Controlling Port Function
Port functions are controlled by the following three types of registers.
• Port mode registers (PM0, PM1, PM3, PM4, PM6 to PM9, PM12, PM13)
• Port registers (P0, P1, P3, P4, P6 to P9, P12, P13)