Document No. U10676EJ3V0UM00 (3rd edition)
Date Published November 2002 N CP(K)
Printed in Japan
1997
[MEMO]
2User’s Manual U10676EJ3V0UM
NOTES FOR CMOS DEVICES
1PRECAUTION AGAINST ESD FOR SEMICONDUCTORS
Note:
Strong electric field, when exposed to a MOS device, can cause destruction of the gate oxide and
ultimately degrade the device operation. Steps must be taken to stop generation of static electricity
as much as possible, and quickly dissipate it once, when it has occurred. Environmental control
must be adequate. When it is dry, humidifier should be used. It is recommended to avoid using
insulators that easily build static electricity. Semiconductor devices must be stored and transported
in an anti-static container, static shielding bag or conductive material. All test and measurement
tools including work bench and floor should be grounded. The operator should be grounded using
wrist strap. Semiconductor devices must not be touched with bare hands. Similar precautions need
to be taken for PW boards with semiconductor devices on it.
2HANDLING OF UNUSED INPUT PINS FOR CMOS
Note:
No connection for CMOS device inputs can be cause of malfunction. If no connection is provided
to the input pins, it is possible that an internal input level may be generated due to noise, etc., hence
causing malfunction. CMOS devices behave differently than Bipolar or NMOS devices. Input levels
of CMOS devices must be fixed high or low by using a pull-up or pull-down circuitry. Each unused
pin should be connected to V
DD
or GND with a resistor, if it is considered to have a possibility of
being an output pin. All handling related to the unused pins must be judged device by device and
related specifications governing the devices.
3STATUS BEFORE INITIALIZATION OF MOS DEVICES
Note:
Power-on does not necessarily define initial status of MOS device. Production process of MOS
does not define the initial operation status of the device. Immediately after the power source is
turned ON, the devices with reset function have not yet been initialized. Hence, power-on does
not guarantee out-pin levels, I/O settings or contents of registers. Device is not initialized until the
reset signal is received. Reset operation must be executed immediately after power-on for devices
having reset function.
This product cannot be used for an IC card (SMART CARD).
EEPROM is a trademark of NEC Electronics Corporation.
MS-DOS is either a registered trademark or a trademark of Microsoft Corporation in the United
States and/or other countries.
IBM DOS, PC/AT, and PC DOS are trademarks of International Business Machines Corporation.
User’s Manual U10676EJ3V0UM
3
These commodities, technology or software, must be exported in accordance
with the export administration regulations of the exporting country.
Diversion contrary to the law of that country is prohibited.
•
The information in this document is current as of July, 2002. 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 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 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 NEC Electronics 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 customer's equipment shall be done under the full
responsibility of 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 NEC
Electronics product depend on its quality grade, as indicated below. Customers must check the quality grade of
each NEC Electronics product before using it in a particular application.
"Standard": Computers, office equipment, communications equipment, test and measurement equipment, audio
and visual equipment, home electronic appliances, machine tools, personal electronic equipment
and industrial robots.
systems, anti-crime systems, safety equipment and medical equipment (not specifically designed
for life support).
"Specific": Aircraft, aerospace equipment, submersible repeaters, nuclear reactor control systems, life
support systems and medical equipment for life support, etc.
The quality grade of NEC Electronics products is "Standard" unless otherwise expressly specified in NEC
Electronics data sheets or data books, etc. If customers wish to use NEC Electronics products in applications
not intended by NEC Electronics, they must contact NEC Electronics sales representative in advance to
determine NEC Electronics's willingness to support a given application.
(Note)
(1) "NEC Electronics" as used in this statement means NEC Electronics Corporation and also includes its
majority-owned subsidiaries.
(2) "NEC Electronics products" means any product developed or manufactured by or for NEC Electronics
(as defined above).
M8E 02. 11
4User’s Manual U10676EJ3V0UM
Regional Information
Some information contained in this document may vary from country to country. Before using any NEC
Electronics product in your application, pIease contact the NEC Electronics office in your country to
obtain a list of authorized representatives and distributors. They will verify:
•
Device availability
•
Ordering information
•
Product release schedule
•
Availability of related technical literature
•
Development environment specifications (for example, specifications for third-party tools and
components, host computers, power plugs, AC supply voltages, and so forth)
•
Network requirements
In addition, trademarks, registered trademarks, export restrictions, and other legal issues may also vary
from country to country.
NEC Electronics America, Inc. (U.S.)
Santa Clara, California
Tel: 408-588-6000
800-366-9782
Fax: 408-588-6130
800-729-9288
PD754144 is upwardly-compatible with the 75X Series.
µ
PD754144 is not compatible with the 75X Series.
MkI ModeMkII Mode
Caution The MkII mode supports a program area exceeding 16 KB for the 75X and 75XL Series. This mode
µ
enhances software compatibility of the
PD754244 with a product with a program area of more
than 16 KB.
When the MkII mode is selected, The number of stack bytes increases by one byte per stack, as
compared with the MkI mode, when the subroutine call instruction is executed. When the CALL
!addr or CALLF !faddr instruction is used, the machine cycle is extended by 1 cycle. To
emphasize the use efficiency of the RAM or processing capability more than software compat-
ibility, therefore, use the MkI mode.
60User’s Manual U10676EJ3V0UM
CHAPTER 4 INTERNAL CPU FUNCTION
4.1.2 Setting stack bank select register (SBS)
The MkI mode or MkII mode is selected by using the stack bank select register (SBS). Figure 4-1 shows the format
of this register.
The stack bank select register is set by using a 4-bit memory manipulation instruction. To use the MkI mode, be
sure to initialize the stack bank select register to 1000B at the beginning of the program. To use the MkII mode, initialize
the register to 0000B.
Figure 4-1. Format of Stack Bank Select Register
32Address
10
SBS0F84HSBS1SBS3 SBS2
Symbol
SBS
Specifies stack area
0
0
Memory bank 0
Other than above, setting prohibited
0
Be sure to set bit 2 to 0.
Selects mode
0
Mkll mode
1
Mkl mode
Caution The SBS.3 bit is set to “1” after the RESET signal has been asserted. Therefore, the CPU operates
in the MkI mode. To use the instructions in the MkII mode, clear SBS.3 to “0” to set the MkII mode.
User’s Manual U10676EJ3V0UM
61
CHAPTER 4 INTERNAL CPU FUNCTION
4.2 Program Counter (PC) ··· 12 bits
This is a binary counter that holds an address of the program memory.
Figure 4-2. Configuration of Program Counter
PC11 PC10PC9PC8PC7PC6PC5PC4PC3PC2PC1PC0
The value of the program counter (PC) is usually automatically incremented by the number of bytes of an instruction
each time that instruction has been executed.
When a branch instruction (BR, BRA, or BRCB) is executed, immediate data indicating the branch destination
address or the contents of a register pair are loaded to all or some bits of the PC.
When a subroutine call instruction (CALL, CALLA, or CALLF) is executed or when a vector interrupt occurs, the
contents of the PC (a return address already incremented to fetch the next instruction) are saved to the stack memory
(data memory specified by the stack pointer). Then, the jump destination address is loaded to the PC.
When the return instruction (RET, RETS, or RETI) instruction is executed, the contents of the stack memory are
set to the PC.
When the RESET signal is asserted, the contents of the program counter (PC) are initialized to the contents of
address 0000H and 0001H of the program memory, and the program can be started from any address according to
the contents.
11-8← (0000H)3-0, PC7-0← (0001H)7-0
PC
62User’s Manual U10676EJ3V0UM
CHAPTER 4 INTERNAL CPU FUNCTION
4.3 Program Memory (ROM) ··· 4096 × 8 bits
The program memory stores a program, interrupt vector table, the reference table of the GETI instruction, and table
data.
The program memory is addressed by the program counter. The table data can be referenced by using a table
reference instruction (MOVT).
Figure 4-3 shows address ranges in which execution can be branched by a branch or subroutine call instruction.
A relative branch instruction (BR $addr1 instruction) can branch execution to an address of [contents of PC –15 to
–1 or +2 to +16], regardless of the block boundary.
The address range of the program memory of each model is 0000H to 0FFFH, and among them, special functions
are assigned to the following addresses. All the addresses other than 0000H and 0001H can be used as normal
program memory addresses.
•Addresses 0000H and 0001H
These addresses store the start address from which program execution is to be started when the RESET signal
is asserted, and the vector table to which the set values of RBE and MBE are written. Program execution
can be reset and started from any address.
•Addresses 0002H to 000FH
These addresses store the start address from which program execution is to be started when a vector interrupt
occurs, and the vector table to which the set values of RBE and MBE are written. Interrupt servicing can be
started from any address.
•Addresses 0020H to 007FH
Note
These addresses constitute a table area that can be referenced by the GETI instruction
.
Note The GETI instruction implements any 2- or 3-byte instruction, or two 1-byte instructions with 1 byte. It is
used to decrease the number of program steps (refer to 11.1.1 GETI instruction).
User’s Manual U10676EJ3V0UM
63
CHAPTER 4 INTERNAL CPU FUNCTION
Figure 4-3. Program Memory Map
Address5
0000H
0001H
0002H
0003H
0004H
0005H
0006H
0007H
0008H
0009H
000AH
000BH
000CH
760
MBERBEInternal reset start address(higher 4 bits)
MBERBEINTBT start address(higher 4 bits)
MBERBEINT0 start address(higher 4 bits)
MBERBEINTT0 start address(higher 4 bits)
MBERBEINTT1/INTT2 start address(higher 4 bits)
4
0
0
Internal reset start address(lower 8 bits)
0
0
INTBT start address(lower 8 bits)
0
0
INT0 start address(lower 8 bits)
0
0
INTT0 start address(lower 8 bits)
0
0
CALLF !faddr instruction
entry address
Branch address of
BR !addr
BRCB !caddr
BR BCDE
BR BCXA
BRA !addr1
CALL !addr
CALLA !addr1
instructions
Note
Note
000DH
000EH
000FH
0020H
007FH
0080H
07FFH
0800H
0FFFH
MBERBEINTEE start address(higher 4 bits)
0
INTT1/INTT2 start address(lower 8 bits)
0
INTEE start address(lower 8 bits)
GET instruction reference table
Note Can be used in the MkII mode only.
GETI Branch/call
Addresses
BR $addr instruction
relative branch address
(–15 to –1, +2 to +16)
Remark In addition to the above, a branch can be made to an address with the lower 8-bits only of the PC changed
by means of a BR PCDE or BR PCXA instruction.
64User’s Manual U10676EJ3V0UM
CHAPTER 4 INTERNAL CPU FUNCTION
4.4 Data Memory (RAM) ... 128 words × 4 bits
The data memory consists of data areas and a peripheral hardware area as shown in Figure 4-4.
The data memory consists the following banks with each bank made up of 256 words × 4 bits.
• Memory bank 0 (data areas)
• Memory bank 4 (EEPROM)
• Memory bank 15 (peripheral hardware area)
4.4.1 Configuration of data memory
(1) Data area
A data area consists of a static RAM and is used to store data, and as a stack memory when a subroutine
or interrupt is executed. The contents of this area can be retained for a long time by battery backup even
when the CPU is halted in standby mode. The data area is manipulated by using memory manipulation
instructions.
Static RAM is mapped to memory bank 0 in units of 128 words × 4 bits only. Although bank 0 is mapped as
a data area, it can also be used as a general-purpose register area (000H to 01FH) and as a stack area (000H
to 07FH).
One address of the static RAM consists of 4 bits. However, it can be manipulated in 8-bit units by using an
8-bit memory manipulation instruction or in 1-bit units by using a bit manipulation instruction. To use an 8-
bit manipulation instruction, specify an even address.
•General-purpose register area
This area can be manipulated by using a general-purpose register manipulation instruction or memory
manipulation instruction. Up to eight 4-bit registers can be used. The registers not used by the program
can be used as part of the data area or stack area.
•Stack area
The stack area is set by an instruction and is used as a saving area when a subroutine or interrupt service
is executed.
(2) EEPROM (Electrically Erasable PROM)
In EEPROM memory bank 4 (400H to 4FFH), only 16 words × 8 bits at 400H to 41FH are mapped.
Reading/writing of EEPROM is performed in 8-bit units.
Since 420H to 4FFH of memory bank 4 is an unmounted area, any value written to this area is ignored and
the read value becomes undefined.
(3) Peripheral hardware area
The peripheral hardware area is mapped to addresses F80H to FFFH of memory bank 15.
This area is manipulated by using a memory manipulation instruction, in the same manner as the static RAM.
Note, however, that the bit units in which the peripheral hardware units can be manipulated differ depending
on the address. The addresses to which no peripheral hardware unit is allocated cannot be accessed because
these addresses are not provided to the data memory.
User’s Manual U10676EJ3V0UM
65
CHAPTER 4 INTERNAL CPU FUNCTION
4.4.2 Specifying bank of data memory
A memory bank is specified by a 4-bit memory bank select register (MBS) when bank specification is enabled by
setting a memory bank enable flag (MBE) to 1 (MBS = 0, 4, or 15). When bank specification is disabled (MBS = 0),
bank 0 or 15 is automatically specified depending on the addressing mode selected at that time. The addresses in
the bank are specified by 8-bit immediate data or a register pair.
For the details of memory bank selection and addressing, refer to 3.1 Bank Configuration of Data Memory and
Addressing Mode.
For how to use a specific area of the data memory, refer to the following.
• General-purpose register area .... 4.5 General-Purpose Registers
• Stack area .................................... 4.7 Stack Pointer (SP) and Stack Bank Select Register (SBS)
Figure 4-10. Data Restored from Stack Memory (MkI Mode)
POP instruction
Stack
RET, RETS instruction
Stack
SP – 5MBE RBE
SP – 4
SP – 3
SP – 2
SP – 1
SP
Interrupt
Stack
PC11-PC8
MBE RBE
PC3-PC0
PC7-PC4
IST0IST1
PSW
CY SK2
RETI instruction
Stack
00
MBE RBE
SK1 SK0
SP
SP + 1
SP + 2
Register pair, low
Register pair, high
SP
SP + 1
SP + 2
SP + 3
SP + 4
PC11-PC8
00
PC3-PC0
PC7-PC4
SP
SP + 1MBE RBE
SP + 2
SP + 3
SP + 4
SP + 5
SP + 6
PC11-PC8
MBE RBE
PC3-PC0
PC7-PC4
IST0IST1
CY SK2
00
MBE RBE
PSW
SK1 SK0
72User’s Manual U10676EJ3V0UM
CHAPTER 4 INTERNAL CPU FUNCTION
Figure 4-11. Data Saved to Stack Memory (MkII Mode)
SP – 2
SP – 1
SP
PUSH instruction
Stack
Register pair, low
Register pair, high
CALL, CALLA, CALLF instruction
Stack
SP – 6SP – 6
SP – 5
SP – 4
SP – 3
SP – 2
SP – 1
SP
PC11-PC8
PC3-PC0
PC7-PC4
**
**
00
MBE RBE
Note
**
Figure 4-12. Data Restored from Stack Memory (MkII Mode)
POP instruction
Stack
RET, RETS instruction
Stack
SP – 500
SP – 4
SP – 3
SP – 2
SP – 1
SP
Interrupt
Stack
PC11-PC8
00
PC3-PC0
PC7-PC4
IST0IST1
MBE RBE
PSW
CY SK2
RETI instruction
SK1 SK0
Stack
00
SP
SP + 1
SP + 2
Register pair, low
Register pair, high
SP
SP + 1
SP + 2
SP + 3
SP + 4
SP + 5
SP + 6
PC11-PC8
PC3-PC0
PC7-PC4
**
**
00
MBE RBE
**
SP
SP + 100
SP + 2
SP + 3
SP + 4
Note
SP + 5
SP + 6
Note The contents of PSW other than MBE and RBE are not saved or restored.
Remark *: Undefined
PC11-PC8
00
PC3-PC0
PC7-PC4
IST0IST1
PSW
CY SK2
00
MBE RBE
SK1 SK0
User’s Manual U10676EJ3V0UM
73
CHAPTER 4 INTERNAL CPU FUNCTION
y
4.8 Program Status Word (PSW) ... 8 Bits
The program status word (PSW) consists of flags closely related to the operations of the processor.
PSW is mapped to addresses FB0H and FB1H of the data memory space, and the 4 bits of address FB0H can
be manipulated by using a memory manipulation instruction.
Figure 4-13. Configuration of Program Status Word
Address
FB0H
Note
Note
(SK2)
(CY)
Can be manipulated
b
dedicated instruction
Note
(SK0)
(SK1)
Cannot be
manipulated
Note
FB0HFB1H
Can be
manipulated
Symbol
RBEMBEIST0IST1
PSW
Note Not reserved as a reserved word.
Table 4-3. PSW Flags Saved/Restored to/from Stack
Flag Saved or Restored
SaveWhen CALL, CALLA, or CALLF instruction is executedMBE and RBE are saved
When hardware interrupt occursAll PSW bits are saved
RestoreWhen RET or RETS instruction is executedMBE and RBE are restored
When RETI instruction is executedAll PSW bits are restored
(1) Carry flag (CY)
The carry flag records the occurrence of an overflow or underflow when an operation instruction with a carry
(ADDC or SUBC) is executed.
The carry flag also functions as a bit accumulator and can store the result of a Boolean operation performed
between a specified bit address and data memory.
The carry flag is manipulated by using a dedicated instruction and is independent of the other PSW bits.
The carry flag becomes undefined when the RESET signal is asserted.
74User’s Manual U10676EJ3V0UM
CHAPTER 4 INTERNAL CPU FUNCTION
Table 4-4. Carry Flag Manipulation Instruction
Instruction (Mnemonic)Operation and Processing of Carry Flag
Carry flag manipulationSET1CYSets CY to 1
instructionCLR1CYClears CY to 0
NOT1CYInverts content of CY
SKTCYSkips if content of CY is 1
Bit transfer instructionMOV1mem*.bit, CYTransfers content of CY to specified bit
MOV1 CY, mem*.bitTransfers content of specified bit to CY
Bit Boolean instructionAND1CY, mem*.bitTakes ANDs, ORs, or XORs content of specified bit
OR1CY, mem*.bitwith content of CY and sets result to CY
XOR1CY, mem*.bit
Interrupt serviceIn interrupt executionSaved to stack memory in parallel with other PSW
The skip flags record the skip status, and are automatically set or reset when the CPU executes an instruction.
These flags cannot be manipulated directly by the user as operands.
User’s Manual U10676EJ3V0UM
75
CHAPTER 4 INTERNAL CPU FUNCTION
(3) Interrupt status flags (IST1 and IST0)
The interrupt status flags record the status of the processing under execution (for details, refer to Table 7-3 IST,
IST0, and Interrupt Servicing).
Table 4-5. Contents of Interrupt Status Flags
IST1IST0 Status of Processing Being ExecutedProcessing and Interrupt Control
00Status 0Normal program is being executed.
All interrupts can be acknowledged
01Status 1Interrupt with lower or higher priority is serviced.
Only an interrupt with higher priority can be acknowledged
10Status 2Interrupt with higher priority is serviced.
All interrupts are disabled from being acknowledged
11—Setting prohibited
The interrupt priority controller (refer to Figure 7-1 Block Diagram of Interrupt Control Circuit) identifies the
contents of these flags and controls the nesting of interrupts.
The contents of IST1 and 0 are saved to the stack along with the other bits of PSW when an interrupt is
acknowledged, and the status is automatically updated by one. When the RETI instruction is executed, the values
before the interrupt was acknowledged are restored to the interrupt status flags.
These flags can be manipulated by using a memory manipulation instruction, and the processing status under
execution can be changed by program.
Caution To manipulate these flags, be sure to execute the DI instruction to disable the interrupts before
manipulation. After manipulation, execute the EI instruction to enable the interrupts.
(4) Memory bank enable flag (MBE)
This flag specifies the address information generation mode of the higher 4 bits of the 12 bits of a data memory
address.
MBE can be set or reset at any time by using a bit manipulation instruction, regardless of the setting of the
memory bank.
When this flag is set to “1”, the data memory address space is expanded, and the entire data memory space
can be addressed.
When MBE is reset to “0”, the data memory address space is fixed, regardless of MBS (refer to Figure 3-2
Configuration of Data Memory and Addressing Ranges of Respective Addressing Modes).
When the RESET signal is asserted, the contents of bit 7 of program memory address 0 are set. Also, MBE
is automatically initialized.
When a vector interrupt is serviced, bit 7 of the corresponding vector address table is set. Also, the status
of MBE when the interrupt is serviced is automatically set.
Usually, MBE is reset to 0 for interrupt servicing, and the static RAM in memory bank 0 is used.
76User’s Manual U10676EJ3V0UM
CHAPTER 4 INTERNAL CPU FUNCTION
(5) Register bank enable flag (RBE)
This flag specifies whether the register bank of the general-purpose registers is expanded or not.
RBE can be set or reset at any time by using a bit manipulation instruction, regardless of the setting of the
memory bank.
When this flag is set to “1”, one of four general-purpose register banks 0 to 3 can be selected depending on
the contents of the register bank select register (RBS).
When RBE is reset to “0”, register bank 0 is always selected, regardless of the contents of the register bank
select register (RBS).
When the RESET signal is asserted, the contents of bit 6 of program memory address 0 are set to RBE, and
RBE is automatically initialized.
When a vector interrupt occurs, the contents of bit 6 of the corresponding vector address table are set to RBE.
Also, the status of RBE when the interrupt is serviced is automatically set. Usually, RBE is reset to 0 during
interrupt servicing. Register bank 0 is selected for 4-bit processing, and register banks 0 and 1 are selected
for 8-bit processing.
User’s Manual U10676EJ3V0UM
77
CHAPTER 4 INTERNAL CPU FUNCTION
4.9 Bank Select Register (BS)
The bank select register (BS) consists of a register bank select register (RBS) and a memory bank select register
(MBS) which specify the register bank and the memory bank to be used, respectively.
RBS and MBS are set by the SEL RBn and SEL MBn instructions, respectively.
BS can be saved to or restored from the stack area in 8-bit units by the PUSH BS or POP BS instruction.
Figure 4-14. Configuration of Bank Select Register
Address
F82H
F82HF83H
RBS0RBS100MBS0MBS1MBS2MBS3
Symbol
BS
(1) Memory bank select register (MBS)
The memory bank select register is a 4-bit register that records the higher 4 bits of a 12-bit data memory
µ
address. This register specifies the memory bank to be accessed. With the
PD754244, however, only banks
0, 4 and 15 can be specified.
MBS is set by the SEL MBn instruction (n = 0, 4, 15).
The address range specified by MBE and MBS is as shown in Figure 3-2.
When the RESET signal is asserted, MBS is initialized to “0”.
Table 4-6. MBE, MBS, and Memory Bank Selected
MBEMBSMemory Bank
3210
0××××Fixed to memory bank 0
1 0000Selects memory bank 0
0100Selects memory bank 4
1111Selects memory bank 15
Other than aboveSetting prohibited
× = don’t care
78User’s Manual U10676EJ3V0UM
CHAPTER 4 INTERNAL CPU FUNCTION
(2) Register bank select register (RBS)
The register bank select register specifies a register bank to be used as general-purpose registers. It can
select bank 0 to 3.
RBS is set by the SEL RBn instruction (n = 0-3).
When the RESET signal is asserted, RBS is initialized to “0”.
Table 4-7. RBE, RBS, and Register Bank Selected
RBERegister Bank
3210
000××Fixed to bank 0
1 0000Selects bank 0
01Selects bank 1
10Selects bank 2
11Selects bank 3
Fixed to 0
× = don’t care
RBS
User’s Manual U10676EJ3V0UM
79
CHAPTER 5 EEPROM
The µPD754244 incorporates not only a 128-word × 4-bit static RAM but also a 16-word × 8-bit EEPROM
(Electrically Erasable PROM) as data memory.
EEPROM, unlike static RAM, can retain its contents when the power is turned off.
Unlike EPROM, contents can electrically be erased without using ultraviolet rays.
It is, therefore, suitable for application fields such as keyless entry and as a data carrier.
EEPROM is mapped onto memory bank 4 of the data memory. EEPROM is manipulated by an 8-bit memory
manipulation instruction.
5.1 EEPROM Configuration
EEPROM consists of the EEPROM main unit at memory bank 4 of the data memory and the EEPROM control
block.
The EEPROM control block consists of an EEPROM write control register (EWC) that controls manipulation of
EEPROM and a block that detects write completion and generates an interrupt signal.
5.2 EEPROM Features
(1) Once data is written to EEPROM, it can retain the contents, even if the power is turned off.
(2) As with the static RAM, manipulation (automatic erasure/automatic writing) is possible using an 8-bit memory
manipulation instruction.
However, there are restrictions on the instructions that can be executed. Refer to 5.5.1 EEPROM manipu-
lation instructions.
(3) EEPROM performs automatic erasure/automatic writing within the time set by the dedicated EEPROM write
timer clock selection bit (EWTC). Therefore, the load on the software that controls the write time can be
alleviated.
• Write time ··· Set EWTC4 to EWTC6 so that the write time is as follows.
µ
PD754144 ··· 18 × 28/fCC (4.6 ms: fCC = 1.0 MHz)
With
With µPD754244 ··· 4.0 ms MIN., 10.0 ms MAX.
Clear the EEPROM write enable/disable control bit (EWE) to 0 after writing.
Any instruction other than one related to EEPROM writing can be executed even in an EEPROM write
operation.
• Number of writes
A = –40 to +70°C ··· 100,000 times/byte
T
TA = –40 to +85°C ··· 80,000 times/byte
(4) When writing is completed, an EEPROM write end interrupt is generated.
(5) EEPROM can independently check whether writing is possible or not using the write status flag. A bit
manipulation instruction is used for this check (refer to 5.3 EEPROM Write Control Register (EWC).
80User’s Manual U10676EJ3V0UM
CHAPTER 5 EEPROM
5.3 EEPROM Write Control Register (EWC)
The EEPROM write control register (EWC) is an 8-bit register used to control manipulation of EEPROM. Figure
5-1 shows its configuration.
Figure 5-1. Format of EEPROM Write Control Register
Address
FCEH
4
ERE7EWTC66EWTC55EWTC4
EEPROM read enable flag
EREEEPROM
0EEPROM read disabled (suppresses current)
1EEPROM read enabled (after 15 µs)
Dedicated EEPROM write timer clock selection bit
EWTC6 EWTC5 EWTC4Selection of count clock
00018 × 213/fX
00118 × 212/fX
01018 × 211/fX
01118 × 210/fX
10018 × 29/fX
10118 × 28/fX
Other than aboveSetting prohibited
fX = system clock oscillation frequency
EWE3EWST2–
1
0
Symbol
–
EWC
EEPROM write enable/disable control bit
EWEEEPROM write operation
0Disable
1Enable
EEPROM write status flag
EWSTWrite status
0EEPROM write enable
1EEPROM being written (EEPROM writing is not possible. If writing
is attempted, it is ignored.)
User’s Manual U10676EJ3V0UM
81
CHAPTER 5 EEPROM
Cautions 1. The write time depends on the system clock oscillation frequency.
2. Set EWTC4-EWTC6 so that the write time is as follows.
µ
PD754144 ··· 18 × 28/fCC (4.6 ms: fCC = 1.0 MHz)
With
With
µ
PD754244 ··· 4.0 ms MIN., 10.0 ms MAX.
Clear EWE to 0 after writing.
3. Be sure to clear (0) the ERE flag before executing a STOP instruction to disable reading. If
µ
the ERE flag is set (1), a current of approximately 10
A always flows in the read circuit.
Therefore, be sure to clear (0) the ERE flag before executing a STOP instruction to stop the
current supply to the read circuit.
4. Be sure to clear (0) the EWE flag before executing a STOP instruction to disable writing.
EWC is set by an 8-bit memory manipulation instruction.
Bits 4 to 6 of EWC are the dedicated EEPROM write timer clock selection bits (EWTC).
EWTC sets the count clock when EEPROM automatic erasure/automatic writing is performed. EEPROM performs
automatic erasure/automatic writing for each time set by EWTC.
Bit 2 of EWC is a write status flag (EWST). This flag can be used to check in 1-bit units whether writing is currently
performed or writing is possible. When writing is started, EWST is automatically write disabled (1). A bit memory
manipulation instruction is used to check this.
RESET input clears all EWC bits to 0.
8
Example EEPROM is write enabled and the write time is set to 18 × 2
/fX.
SELMB15
MOVXA, #01011000B
MOVEWC, XA
5.4 Interrupt Related to EEPROM Control
Table 5-5 shows the interrupt related to EEPROM control.
For the details of the interrupt function, refer to CHAPTER 7 INTERRUPT AND TEST FUNCTIONS.
Table 5-1. Interrupt Related to EEPROM Control
Interrupt Source
INTEEIRQEEIEEEVRQ7When the write time set by
EEPROM write(000EH)EWC has elapsed.
end interrupt
Caution The INTOW interrupt (EEPROM overwrite interrupt) used in the µPD75048 is not provided.
EEPROM Interrupt EEPROM InterruptVector TableInterrupt Request Flag
Request FlagRequest FlagAddressSetting Source
82User’s Manual U10676EJ3V0UM
CHAPTER 5 EEPROM
5.5 EEPROM Manipulation Method
5.5.1 EEPROM manipulation instructions
Instructions that can be used to manipulate the EEPROM are shown below, divided into read instructions and
write instructions.
(1) Read manipulation instructions
Instruction GroupMnemonicOperand
Transfer instructionMOVXA, @HL
MOVXA, mem
Compare instructionSKEXA, @HL
Remark Operation instruction such as ADDS, AND, etc., cannot be used.
(2) Write manipulation instructions
Instruction GroupMnemonicOperand
Transfer instructionMOV@HL, XA
MOVmem, XA
XCHXA, @HL
XCHXA, mem
Remark INCS (increment/decrement instruction) cannot be used.
An 8-bit memory manipulation instruction is used to manipulate EEPROM. Furthermore, a bit memory
manipulation instruction can be used to check EWST.
A 4-bit memory manipulation instruction cannot be used.
User’s Manual U10676EJ3V0UM
83
CHAPTER 5 EEPROM
5.5.2 Read manipulation
The following procedure is used to read EEPROM.
EWST, ERE and EWE can be set simultaneously by an 8-bit memory manipulation instruction to EWC.
<1> Check that the write status flag (EWST) is 0 (write enabled = writing is currently not being performed).
<2> Set the write enable/disable control bit (EWE) to 0 (write disabled).
<3> Execute the read instruction.
Figure 5-2. EEPROM Write Control Register in EEPROM Read Manipulation
Address
FCEH
4
ERE7EWTC66EWTC55EWTC4
Operating mode selection bit
EREEWE EWSTMode
100EEPROM read enable mode
EWE3EWST2–
1
0
Symbol
–
EWC
Cautions 1. Be sure to check that EWST is 0 before reading. If an EEPROM read instruction is executed
during an EEPROM write operation, the value read becomes undefined.
2. There are restrictions on the read instruction. Refer to 5.5.1 EEPROM manipulation
instructions for details.
3. Setting ERE to 1 enables EEPROM read and increases the current consumption. Therefore,
set ERE to 0 when EEPROM is not being read.
µ
4. Execute the read instruction approximately 15
s or more after setting ERE.
5. Setting EWE to 1 enables EEPROM write and increases the current consumption.
Therefore, set EWE to 0 when EEPROM is not being written to.
Example After checking the write status flag (EWST), 8-bit data (0A, 0BH of memory bank 4) is read.
SET1MBE
SELMB15
SKFEWST
BRA2
SELMB4
MOVXA, #0AH
MOVHL, @HL
84User’s Manual U10676EJ3V0UM
CHAPTER 5 EEPROM
5.5.3 Write manipulation
Use the following procedure to write to EEPROM.
Any instruction other than one related to EEPROM writing can be executed even during an EEPROM write
operation.
EWST, EWTC and EWE can be set simultaneously by an 8-bit memory manipulation instruction to EWC.
<1> Check that the read status (EWST) is 0 (write enabled = currently not being written).
<2> Use EWTC4 to EWTC6 to set write time.
<3> Set the write enable/disable control bit (EWE) to 1 (write enabled).
<4> Execute the write instruction.
Figure 5-3. EEPROM Write Control Register in EEPROM Write Manipulation
Address
FCEH
4
ERE7EWTC66EWTC55EWTC4
Operating mode selection bit
EREEWE EWSTMode
010EEPROM write enabled mode
Dedicated EEPROM write timer clock selection bit
EWTC6 EWTC5 EWTC4Count clock selection
00018 × 213/fX
00118 × 212/fX
01018 × 211/fX
01118 × 210/fX
10018 × 29/fX
10118 × 28/fX
Other than aboveSetting prohibited
fX = System clock oscillation frequency
EWE3EWST2–
1
0
Symbol
–
EWC
User’s Manual U10676EJ3V0UM
85
CHAPTER 5 EEPROM
ExampleSet the write time to 18 × 28/fX and after checking the EEPROM write status flag (EWST), write 8-bit
data (0AH) at 08H of memory bank 4.
SET1MBE
SELMB15; Selection of bank 15
MOVXA, #01011000B; Write enable
8
MOVEWC, XA; Set the write time to 18 × 2
/fX
SKFEWST
BRA1
SELMB4
MOVXA, #0AH
MOV08H, XA; Write
CLR1MBE
WAIT;SKFEWST <A>
BRWAIT
CLR1EWE
Caution The development tool simulates writing data to EEPROM by writing the data to RAM. Therefore,
it seems as if EEPROM was normally written even if the wait time <A> is not long enough.
However, data cannot be written correctly to the device unless the wait time <A> is long enough
(4.0 ms MIN., 10.0 ms MAX.) (the contents written to the EEPROM are undefined). After writing
the data, clear EWE to 0.
Cautions on EEPROM writing are shown below. Be sure to read them before writing to EEPROM. When performing
consecutive writing, write once after the current write operation is finished. Set EWTC4 to EWTC6 so that data can
be written to the EEPROM once within the following time.
µ
• With
• With
PD754144 ... 18 × 28/fCC (4.6 ms: fCC = 1.0 MHz)
µ
PD754244 ... 4.0 ms MIN., 10.0 ms MAX.
Clear EWE to 0 after writing.
Writing can be completed and time can be managed in the following ways.
(1) Using write end interrupt
After one data item is written, wait for generation of a write end interrupt, while performing processing other
than writing. When a write end interrupt is generated, start the next write operation.
(2) Using write status flag
Execute polling on the write status flag and wait until it becomes 0.
When the write status flag becomes 0, it indicates the write end, and so start the next write operation.
(3) Using timer
Note
Use the timer counter or basic interval timer to wait
for the write time set by EWTC4 to EWTC6.
(4) Using software
Note
Use the software timer to wait
for the write time set by EWTC4 to EWTC6.
Note Make sure that a wait time longer than the write time specified by EWTC4 to EWTC6 elapses. If EWE is
cleared within the time set by EWTC4 to EWTC6, the contents written to the EEPROM are undefined.
86User’s Manual U10676EJ3V0UM
CHAPTER 5 EEPROM
5.6 Cautions on EEPROM Writing
Cautions on EEPROM writing are shown below.
Be sure to read these before writing to EEPROM.
Cautions 1.Before writing, make sure that EWST is 0. While EEPROM is being written, if a write
instruction is executed again, the instruction executed later is ignored.
2.There are restrictions on the write instruction. Refer to 5.5.1 EEPROM manipulation
instructions for details.
3.Set EWTC4 to EWTC6 so that the write time is as follows.
µ
PD754144 ... 18 × 28/fCC (4.6 ms: fCC = 1.0 MHz)
With
µ
PD754244 ... 4.0 ms MIN., 10.0 ms MAX.
With
Clear EWE to 0 after writing.
4.When performing write operations consecutively, be sure to wait until the current write is
finished before executing the next one.
5.Even if the HALT mode is set while EEPROM is being written, the write operation continues.
However, hardware which is stopped by the CPU or in HALT mode stops.
Be careful about how you control the write time.
6.If STOP mode is set during an EEPROM operation, writing is stopped.
The address data being written becomes undefined.
7.If writing is disabled by EWE during an EEPROM write operation, writing is stopped.
The address data being written becomes 0.
µ
8.The
9.Setting EWE to 1 enables EEPROM writing and increases the current consumption.
10. Setting ERE to 1 enables EEPROM reading and increases the current consumption.
11. The development tool simulates writing data to EEPROM by writing the data to RAM.
PD754244 is shipped with the EEPROM contents set to 0.
Therefore, set EWE to 0 when EEPROM writing is not being performed.
Therefore, set ERE to 0 when EEPROM reading is not being performed.
Therefore, it seems as if EEPROM was normally written even if the write time is not long
enough. However, data cannot be written correctly to the device unless the write time is
long enough (4.0 ms MIN., 10.0 ms MAX.) (the contents written to the EEPROM are
undefined). After writing the data, clear EWE to 0.
User’s Manual U10676EJ3V0UM
87
CHAPTER 6 PERIPHERAL HARDWARE FUNCTION
6.1 Digital I/O Ports
The µPD754244 uses memory mapped I/O, and all the I/O ports are mapped to the data memory space.
Figure 6-1. Data Memory Address of Digital Ports
Address3
FF0H
FF1H
FF2H
FF3H
FF4H
FF5H
FF6H
FF7H
FF8H
P33
P63
P73
2
1
0
—
—
—
P32
P31
P30
Port 3
—
—
P62
P61
P60
Port 6
P72
P71
P70
Port 7
–
–
–
P80
Port 8
Table 6-2 lists the instructions that manipulate the I/O ports. Ports 3 and 6 can be manipulated in 4-I/O
1-bit units. They are used for various control operations.
Examples 1. To test the status of P73 and outputs different values to port 3 depending on the result
SKTPORT7.3; Skips if bit 3 of port 7 is 1
MOVXA, #8H; XA ← 8H
String effect
MOVXA, #4H; XA ← 4H
SELMB15; or CLR1 MBE
OUTPORT3, A; Port 3 ← A
2. SET1PORT6.@L ; Sets the bits of port 6 specified by the L register to “1”
and
88User’s Manual U10676EJ3V0UM
CHAPTER 6 PERIPHERAL HARDWARE FUNCTION
6.1.1 Types, features, and configurations of digital I/O ports
Table 6-1 shows the types of digital I/O ports.
Figures 6-2 to 6-9 show the configuration of each port.
Table 6-1. Types and Features of Digital Ports
PortFunctionOperation and FeaturesRemarks
PORT34-bit I/OCan be set to input or output mode in 1-bit units.Also used for PTO0 to PTO2
pins.
PORT6Also used for AVREF, INT0,
PTH00, and PTH01 pins.
PORT74-bit input4-bit input only portAlso used for KR4 to KR7 pins.
On-chip pull-up resistor can be specified by mask option
in 1-bits units.
PORT81-bit I/OCan be set to input or output mode in 1-bit units.–
P61 is shared with an external vector interrupt input pin and a noise eliminator is selectable (for details, refer to
7.3 Hardware Controlling Interrupt Function).
When the RESET signal is asserted, the output latches of ports 3, 6, and 8 are cleared to 0, the output buffers
are turned off, and the ports are set to the input mode.
User’s Manual U10676EJ3V0UM
89
Input buffer
CHAPTER 6 PERIPHERAL HARDWARE FUNCTION
Figure 6-2. P3n Configuration (n = 0 to 2)
POGA bit 3
MPX
Output buffer
Input buffer
V
DD
Pull-up resistor
P-ch
Internal bus
Input buffer
Output latch
PM3n
PTOn
Figure 6-3. P33 Configuration
POGA bit 3
MPX
Input buffer
Output buffer
P3n/PTOn
DD
V
Pull-up resistor
P-ch
Output latch
Internal bus
PM33
90User’s Manual U10676EJ3V0UM
P33
CHAPTER 6 PERIPHERAL HARDWARE FUNCTION
Figure 6-4. P60 Configuration
POGA bit 6
V
DD
Input buffer
Internal bus
Internal bus
Output latch
PM60
Input buffer with
hysteresis characteristics
MPX
Output buffer
Figure 6-5. P61 Configuration
INT0
Input buffer with
hysteresis characteristics
POGA bit 6
AV
REF
Pull-up resistor
P-ch
P60/AV
V
DD
Pull-up resistor
REF
Internal bus
P-ch
MPX
Output buffer
Output latch
P61/INT0
PM61
User’s Manual U10676EJ3V0UM
91
Input buffer
CHAPTER 6 PERIPHERAL HARDWARE FUNCTION
Figure 6-6. P62 Configuration
POGA bit 6
Input buffer with
hysteresis characteristics
MPX
Output buffer
V
DD
Pull-up resistor
P-ch
Internal bus
Input buffer
Internal bus
Output latch
PM62
Output latch
Figure 6-7. P63 Configuration
POGA bit 6
Input buffer with
hysteresis characteristics
MPX
Output buffer
PTH00
P62/PTH00
V
DD
Pull-up resistor
P-ch
P63/PTH01
PM63
92User’s Manual U10676EJ3V0UM
PTH01
CHAPTER 6 PERIPHERAL HARDWARE FUNCTION
Figure 6-8. P7n Configuration (n = 0 to 3)
Key return reset
Interrupt control
Internal bus
One-shot pulse generator
Falling edge detector
Input buffer
Figure 6-9. P80 Configuration
Input buffer with
hysteresis characteristics
POGA bit 0
V
DD
Pull-up resistor
(mask option)
P70/KR4
P71/KR5
P72/KR6
P73/KR7
V
DD
Input buffer
Output latch
Internal bus
PM8
Port mode register group C bit 0
MPX
Input buffer with
hysteresis characteristics
Output buffer
Pull-up resistor
P-ch
P80
User’s Manual U10676EJ3V0UM
93
CHAPTER 6 PERIPHERAL HARDWARE FUNCTION
6.1.2 Setting I/O mode
The input or output mode of each I/O port is set by the corresponding port mode register as shown in Figure 6-
10. Ports 3 and 6 can be set to the input or output mode in 1-bit units by using port mode register group A (PMGA).
Port 8 is set to the input or output mode by using port mode register group C (PMGC).
Each port is set to the input mode when the corresponding port mode register bit is “0” and in the output mode
when the corresponding register bit is “1”.
When a port is set to the output mode by the corresponding port mode register, the contents of the output latch
are output to the output pin(s). Before setting the output mode, therefore, the necessary value must be written to
the output latch.
Port mode register groups A and C are set by using an 8-bit memory manipulation instruction.
When the RESET signal is asserted, all the bits of each port mode register are cleared to 0, the output buffer is
turned off, and the corresponding port is set to the input mode.
ExampleTo use P30, 31, 62, and 63 as input pins and P32, 33, 60, and 61 as output pins
CLR1MBE; or SEL MB15
MOVXA, #3CH
MOVPMGA, XA
94User’s Manual U10676EJ3V0UM
Port mode register group A
CHAPTER 6 PERIPHERAL HARDWARE FUNCTION
Figure 6-10. Format of Each Port Mode Register
Specification
0Input mode (output buffer off)
1Output mode (output buffer on)
Address
FE8H
765432
Port mode register group C
Address
FEEH
765432
10
PM30PM31PM33 PM32PM60PM61PM62PM63
10
PM8–––––––
Symbol
PMGA
Sets P30 to input or output mode
Sets P31 to input or output mode
Sets P32 to input or output mode
Sets P33 to input or output mode
Sets P60 to input or output mode
Sets P61 to input or output mode
Sets P62 to input or output mode
Sets P63 to input or output mode
Symbol
PMGC
Sets port 8 (P80) to input or output mode
User’s Manual U10676EJ3V0UM
95
CHAPTER 6 PERIPHERAL HARDWARE FUNCTION
6.1.3 Digital I/O port manipulation instruction
Because all the I/O ports of the µPD754244 are mapped to the data memory space, they can be manipulated by
using data memory manipulation instructions. Table 6-2 shows these data memory manipulation instructions, which
are considered to be especially useful for manipulating the I/O pins and their range of applications.
(1) Bit manipulation instruction
Because specific address bit direct addressing (fmem.bit) and specific address bit register indirect addressing
(pmem.@L) are applicable to digital I/O ports 3, 6, and 8, the bits of these ports can be manipulated regardless
of the specifications by MBE and MBS.
ExampleTo OR P30 and P61 and output to P80
MOV1CY, PORT3.0 ; CY ← P30
OR1CY, PORT6.1 ; CY ← CY P61
MOV1PORT8.0, CY ; P80 ← CY
(2) 4-bit manipulation instruction
In addition to the IN and OUT instructions, all the 4-bit memory manipulation instructions such as MOV, XCH,
ADDS, and INCS can be used to manipulate the ports in 4-bit units. Before executing these instructions,
however, memory bank 15 must be selected.
Examples 1. To output the contents of the accumulator to port 3
SET1MBE
SELMB15; or CLR1 MBE
OUTPORT3, A
2. To add the value of the accumulator to the data output to port 6
SET1MBE
SELMB15
MOVHL, #PORT6
ADDSA, @HL ; A ← A+PORT6
NOP
MOV@HL, A ; PORT6 ← A
3. To test whether the data of port 3 is greater than the value of the accumulator
SET1MBE
SELMB15
MOVHL, #PORT3
SUBSA, @HL ; A<PORT3
BRNO; NO
; YES
96User’s Manual U10676EJ3V0UM
CHAPTER 6 PERIPHERAL HARDWARE FUNCTION
Table 6-2. I/O Pin Manipulation Instructions
PORTPORT3PORT6PORT7PORT8
Instruction
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 1
Note 2
Note 2
Note 2
Note 2
Note 2
–
–
–
–
–
Note 2
Note 2
Note 2
Note 2
Note 2
INA, PORTn
INXA, PORTn
OUTPORTn, A
OUTPORTn, XA
MOVA, PORTn
MOVXA, PORTn
MOVPORTn, A
MOVPORTn, XA
XCHA, PORTn
XCHXA, PORTn
MOV1CY, PORTn. bit
MOV1CY, PORTn. @L
MOV1PORTn. bit, CY–
MOV1PORTn. @L, CY
INCSPORTn
SET1PORTn. bit
SET1PORTn. @L
CLR1PORTn. bit
CLR1PORTn. @L
SKTPORTn. bit
SKTPORTn. @L
SKFPORTn. bit
SKTCLR PORTn. bit
SKTCLR PORTn. @L
SKFPORTn. @L
AND1CY, PORTn. bit
AND1CY, PORTn. @L
OR1CY, PORTn. bit
OR1CY, PORTn. @L
XOR1CY, PORTn. bit
XOR1CY, PORTn. @L
–
–
Notes 1.Must be MBE = 0 or (MBE = 1, MBS = 15) before execution.
2. The lower 2 bits and the bit addresses of the address must be indirectly specified by the L register.
User’s Manual U10676EJ3V0UM
97
CHAPTER 6 PERIPHERAL HARDWARE FUNCTION
6.1.4 Operation of digital I/O port
The operations of each port and port pin when a data memory manipulation instruction is executed to manipulate
a digital I/O port differ depending on whether the port is set to the input or output mode (refer to Table 6-3). This
is because, as can be seen from the configuration of the I/O port, the data of each pin is loaded to the internal bus
in the input mode, and the data of the output latch is loaded to the internal bus in the output mode.
(1) Operation in input mode
When a test instruction such as SKT, a bit input instruction such as MOV1, or an instruction that loads port
data to the internal bus in 4-bit units such as IN, MOV, operation, or comparison instructions, is executed,
the data of each pin is manipulated.
When an instruction that transfers the contents of the accumulator in 4-bit units, such as OUT or MOV, is
executed, the data of the accumulator is latched to the output latch. The output buffer remains off.
When the XCH instruction is executed, the data of each pin is input to the accumulator, and the data of the
accumulator is latched to the output latch. The output buffer remains off.
When the INCS instruction is executed, the data (4 bits) of each pin incremented by one (+1) is latched to
the output latch. The output buffer remains off.
When an instruction that rewrites the data memory contents in 1-bit units, such as SET1, CLR1, MOV1, or
SKTCLR, is executed, the contents of the output latch of the specified bit can be rewritten as specified by the
instruction, but the contents of the output latches of the other bits are undefined.
(2) Operation in output mode
When a test instruction, bit input instruction, or an instruction in 4-bit units that loads port data to the internal
bus is executed, the contents of the output latch are manipulated.
When an instruction that transfers the contents of the accumulator in 4-bit units is executed, the data of the
output latch is rewritten and at the same time output from the port pins.
When the XCH instruction is executed, the contents of the output latch are transferred to the accumulator.
The contents of the accumulator are latched to the output latches of the specified port and output from the
port pins.
When the INCS instruction is executed, the contents of the output latches of the specified port are incremented
by 1 and output from the port pins.
When a bit output instruction is executed, the specified bit of the output latch is rewritten and output from the
pin.
98User’s Manual U10676EJ3V0UM
CHAPTER 6 PERIPHERAL HARDWARE FUNCTION
Table 6-3. Operation When I/O Port Is Manipulated
Instruction Executed
SKT<1>Tests pin dataTests output latch data
SKF<1>
MOV1 CY, <1>Transfers pin data to CYTransfers output latch data to CY
AND1 CY, <1>Performs operation between pin data and CYPerforms operation between output latch data
OR1CY, <1>and CY
XOR1 CY, <1>
INA, PORTnTransfers pin data to accumulatorTransfers output latch data to accumulator
MOVA, PORTn
MOVA, @HL
MOVXA, @HL
ADDS A, @HLPerforms operation between pin data andPerforms operation between output latch data
ADDC A, @HLaccumulatorand accumulator
SUBS A, @HL
SUBC A, @HL
ANDA, @HL
ORA, @HL
XORA, @HL
SKEA, @HLCompares pin data with accumulatorCompares output latch data with accumulator
SKEXA, @HL
OUTPORTn, ATransfers accumulator data to output latchTransfers accumulator data to output latch and
MOVPORTn, A(output buffer remains off)outputs data from pins
MOV@HL, A
MOV@HL, XA
XCHA, PORTn
XCHA, @HLdata to output latch (output buffer remains off)accumulator
XCHXA, @HL
INCSPORTIncrements pin data by 1 and latches it to outputIncrements output latch contents by 1
INCS@HLlatch
SET1<1>Rewrites output latch contents of specified bit asChanges status of output pin as specified by
CLR1<1>specified by instruction. However, output latchinstruction
MOV1<1> , CY contents of other bits are undefined
SKTCLR <1>
Transfers pin data to accumulator and accumulator
Input modeOutput mode
Operation of Port and Pin
Exchanges data between output latch and
Remark <1> : Indicates two addressing modes: PORTn, bit and PORTn.@L.
User’s Manual U10676EJ3V0UM
99
CHAPTER 6 PERIPHERAL HARDWARE FUNCTION
(
)
6.1.5 Connecting pull-up resistor
Each port pin of the µPD754244 can be connected to a pull-up resistor. Some pins can be connected to a pull-
up resistor via software and others can be connected by a mask option.
Table 6-4 shows how to specify the connection of the pull-up resistor to each port pin. The pull-up resistor is
connected via software in the format shown in Figure 6-11.
The pull-up resistor can be connected only to the pins of ports 3, 6, and 8 in the input mode. When the pins are
set to the output mode, the pull-up resistor cannot be connected regardless of the setting of POGA and POGB.
Table 6-4. Specifying Connection of Pull-up Resistor
Port (Pin Name)Specifying Connection of Pull-up ResistorSpecified Bit
Port 3 (P30-P33)Connection of pull-up resistor specified in 4-bitPOGA.3
Port 6 (P60-P63)
units via software
POGA.6
Port 7 (P70-P73)Connection of pull-up resistor specified in 1-bit—
units by mask option
Port 8 (P80-P83)Connection of pull-up resistor specified in 1-bitPOGB.0
units via software
Figure 6-11. Format of Pull-up Resistor Specification Register
0Pull-up resistor not connected
1Pull-up resistor connected
Pull-up resistor specification register group A
Address
FDCH
765432
Pull-up resistor specification register group B
Address
FDEH
765432
Specification
10
––PO3–––PO6–
10
PO8–––––––
Symbol
POGA
Port 3 (P30 to P33)
Port 6 (P60 to P63)
Symbol
POGB
Port 8
P80
100User’s Manual U10676EJ3V0UM
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.