Professional Documents
Culture Documents
Z8681 Zilog
Z8681 Zilog
ROMless
Microcomputer
Product
Specification
March 1983
CoPyrighti983l;>yZilog, Inc. All rights reserved. No part of
this ..publication may be reproduced without the written
parmissien of Zilog, Inc.
The 1!>locmation in this publication is subject to change
withoUt notice.
Z8® Z8681/82
BOMless
Microcomputer
Product
Zilog Specification
March 1983
Features • Complete microcomputer, 24 I/O lines, and • Full-duplex UART and two programmable
up to 64K bytes of addressable external 8-bit counter/timers, each with a 6-bit pro-
space each for program and data memory. grammable prescaler.
• 143-byte register file, including 124 • Register Pointer so that short, fast instruc-
general-purpose registers, three I/O port tions can access anyone of the nine
registers, and 16 status and control working-register groups.
registers.
• Low-power standby option that retains
• Vectored, priority interrupts for I/O, contents of general-purpose registers.
counter/timers, and UART. • Single + 5 V power supply-all I/O pins
• On-chip oscillator that accepts crystal or TTL compatible.
external clock drive.
• Available in 8 and 12 MHz versions.
General The Z8681and Z8682 are ROMless versions of to be used in low volume applications or where
Description the Z8 single-chip microcomputer. The Z8682 code flexibility is required.
is usually more cost effective. These products The Z8681182 can provide up to 16 output
differ only slightly and can be used inter- address lines, thus permitting an address
changeably with proper system design to pro- space of up to 64K bytes of data or program
vide maximum flexibility in meeting price and memory. Eight address outputs (ADo-AD7) are
delivery needs. The Z8681182 offers all the provided by a multiplexed, 8-bit, Address/Data
outstanding features of the 28 family archi- bus. The remaining 8 bits can be provided by
tecture except an on-chip program ROM. Use the software configuration of Port 0 to output
of external memory rather than a prepro- address bits Ag-Al5.
grammed ROM enables this Z8 microcomputer
RESET
+5V P3.
TIMING f ---+- R/W
AND XTAl2 P3,
CONTROL 1 os } CLOCK XTAL1 P2,
AS XTAl2
P3, P2.
I
PO, P2,
P3, P2,
po, P2,
I
RESET P2,
PO, P2,
PORT 0 [ RIW P2,
PO, P2, PORTO
(NIBBLE
PROGRAMMABLE)
110 OR A"-A,,,
po, P2, j(BIT PRO·
GRAMMABLE)
110
DS
AS
P2,
P2,
PO s Z8681/82 P2 s
P3, P2,
PO. MCU P2.
GND P3,
PO, P2,
P3, P3,
P1, P3,
PO, Pl,
P1, P3,
PO, Pl.
Pl, P3, PORT 3
PORT1 [ (FOUR INPUT; PO, Pl,
(BYTE Pl, P3, FOUR OUTPUT)
PROGRAMMABLE)
AD -AD
j P1, P3, SERIAL AND
PARALLEL 110
PO,
PO,
P1,
Pl,
P1, P3, AND CONTROL
PO, Pl,
Pl. P3,
PO. Pl,
Pl, P3,
PO, Pl,
2194·001,002
General Available address space can be doubled (up registers, and three I/O port registers. This
Description to 128K bytes for the 28681 and 124K bytes for register file can be divided into nine groups of
(Continued) the 28682) by programming bit 4 of Port 3 16 working registers each. Configuring the
(P34) to act as a data memory select output register file in this manner allows the use of
(DM). The two states of DM together with the short format instructions; in addition, any of
16 address outputs can define separate data the individual registers may be accessed
and memory address spaces of up to directly.
64K/62Kbytes each. The pin functions and the pin assignments of
There are 143 bytes of RAM located on-chip the 28681/82 40-pin package are illustrated in
and organized as a register file of 124 general- Figures 1 and 2, respectively.
purpose registers, 16 control and status
Archi tecture 28681/82 architecture is characterized by a program memory, data memory and the
flexible I/O scheme, an efficient register and register file (internal). The 143-byte random-
address space structure and a number of access register file is composed of 124 general-
ancillary features that are helpful in many purpose registers, three I/O port registers, and
applications. 16 control and status registers.
Microcomputer applications demand power- To unburden the program from coping with
ful IIO capabilities. The 28681182 fulfills this real-time problems such as serial data com-
with 24 pins available for input and output. munication and counting/timing, an asynchro-
These lines are grouped into three ports of nous receiver/transmitter (UART) and two
eight lines each and are configurable under counter/timers with a large number of user-
software control to provide timing, status selectable modes are offered on-chip. Hard-
signals, serial or parallel I/O with or without ware support for the UART is minimized
handshake, and an Address bus for interfacing because one of the on-chip timers supplies the
external memory. bit rate. Figure 3 shows the 28681182 block
Three basic address spaces are available: diagram.
OUTPUT Vee GND XTAL AS
!!
'~----------~v~------------'
Z·BUS WHEN USED AS
ADDRESS/DATA BUS
Pin AS. Address Strobe (output, active Low). POo-po." P20-P27' P30-P3-,. I/O Port Lines
Description Address Strobe is pulsed once at the begin- (input/outputs, TTL-compatible). These 24
ning of each machine cycle. Addresses output lines are divided into three 8-bit I/O ports that
via Port 1 for all external program or data can be configured under program control for
memory transfers are valid at the trailing edge I/O or external memory interface (Figure 3).
of AS. P1o-PI7' Address/Data Port (bidirectional).
OS. Data Strobe (output, active Low). Data Multiplexed address (Ao-A7) and data (Do-D7)
Strobe is activated once for each external lines used to interface with program and data
memory transfer. memory.
2 2J94·003
Pin RESET.* Reset (input, active Low). RESET ini- the Z8681182 is writing to external program or
Description tializes the Z8681182. When RESET is deacti- data memory.
(Continued) vated, program execution begins from pro- XTALl. XTAL2. Crystal 1, Crystal 2 (time-base
gram location OOOCH for the Z8681 and 0812H input and output). These pins connect a
for the Z8682. parallel-resonant crystal to the on-chip clock
R/W. Read/Write (output). RlW is Low when oscillator and buffer.
Address Program Memory.* The Z8681182 addresses For the Z8681, the first 12 bytes of program
Spaces 64K/62K bytes of external program memory memory are reserved for the interrupt vectors.
space (Figure 4). These locations contain six 16- bi! vectors that
Z8681 Z8682
5536 6553
PROGRAM
MEMORY
LOCATION OF FIRST
PROGRAM BYTE OF INSTRUCTION
MEMORY EXECUTED AFTER
----- / RESET (Z8682)
f= IR05
= (811H ) 2065
f::: IR04
= ...- 3 BYTE INTERRUPT
f::: IR03
= JUMP INSTRUCTIONS
f::: tR02
=
==
IR01
=
= IROO
= (BOOH ) 2048
2047
LOCATION OF FIRST
BYTE OF INSTRUCTION
EXECUTED AFTER
RESET (Z8681) - i-
f-
I-
IROS
IR04
NOT
ADDRESSABLE
-
-
12
,.
11
9
8
INTERRUPT
VECTOR
(LOWER BYTE)
I- IR03 - 7
6
2 BYTE
...--INTERRUPT
~ IA02 - 5
4
VECTORS
INTERRUPT
VECTOR
(UPPER BYTE)
I- IR01 - 3
2
1
"- -
IROO
•
Figure 4. Z8681/82 Program Memory Map
3
Address correspond to the six available interrupts. Pro- These registers are assigned the address loca-
Spaces gram execution begins at location OOOCH after tions shown in Figure 5.
(Continued) a reset. Z8681182 instructions can access registers
The Z8682 has six 24-bit interrupt vectors directly or indirectly with an 8-bit address
beginning at address 0800H. The vectors con- field. This also allows short 4-bit register ad-
sist of Jump Absolute instructions. After a dressing using the Register Pointer (one of the
reset, program execution begins at location control registers). In the 4-bit mode, the
0812H for the Z8682. register file is divided into nine working-
Data Memory.* The Z8681/82 can address register groups, each occupying 16 contiguous
64K/62K bytes of external data memory. Exter- locations (Figure 5). The Register Pointer
nal data memory may be included with or addresses the starting location of the active
separated from the external program memory working-register group (Figure 6).
space. DM, an optional 1/0 function that can Stacks. Either the internal register file or the
be programmed to appear on pin P3 4 , is used external data memory can be used for the
to distinguish between data and program stack. A 16-bit Stack Pointer (R254 and R255)
memory space. is used for the external stack, which can reside
Register File. The 143-byte register file anywhere in data memory. An 8-bit Stack
~ncludes three 1/0 port registers (RO, R2, R3), Pointer (R255) is used for the internal stack
124 general-purpose registers (R4-RI27) and that resides within the 124 general-purpose
16 control and status registers (R240-R255). registers (R4-RI27).
LOCATION IDENTIFIERS
255 STACK POINTER (BITS 7-0) SPL
254 STACK POINTER (BITS 15-8) SPH
253 REGISTEA POINTER RP
252 PROGRAM CONTROL FLAGS FLAGS
251 INTERRUPT MASK REGISTER IMR
250 INTERRUPT REQUEST REGISTER IRQ The upper nibble ollhe register lile address
provided by the register pointer specifies
24. INTERRUPT PRIORITY REGISTER IPR the active working· register group.
--1
12
247 PORT 3 MODE P3M
246 PORT 2 MODE P2M
245 TO PRESCALER PREO
244
243
TIMERfCOUNTER 0
11 PRESCALER
TO
PRE1
--1
--1
242 TIMER/COUNTER 1 T1
241 TIMER MODE TMR
240 SERIAL 110 SID
127
NOT
IMPLEMENTED
--1 SPECIFIED WORKING·
The tower
nibble of
the register
file address
.,
specified
--(
GENERAL·PURPOSE
register.
REGISTERS
PORi 3 P3 --I 15
--I
PORT 2 P2
PORT 0
r----I/OPORTS----- 3
PO
0
1~1~1~1~1~1~1~1~1~lnl
1 LSTART BtT
' - - - - - - E I G H T DATA BITS
TWO STOP BITS
I LSTART BIT
L - - - - - E I G H T DATA BITS
L.- - - - - - - - - O N E STOP BrT
I~I~I pl~I~I~I~I~I~I~lsij
T 1,
_ _ LsTARTBIT
L - - - - - S E V E N DATA BITS
000 PARITY
TWO STOP BITS
II LSTART BIT
' - - - - - - S E V E N DATA BITS
'---------:::':~~::~TR FLAG
Counter/ The Z8681182 contains two 8-bit program- pass mode) or to automatically reload the
Timers mable counter/timers (To and TI ), each driven initial value and continue counting (modulo-n
by its own 6-bit programmable prescaler. The continuous mode). The counters, but not the
TI prescaler can be driven by internal or ex- prescalers, can be read any time without
ternal clock sources; however, the To prescaler disturbing their value or count mode.
is driven by the internal clock only. The clock source for TI is user-definable; it
The 6-bit prescalers can divide the input fre- can be either the internal microprocessor clock
quency of the clock source by any number divided by four, or an external signal input via
from I to 64. Each pres caler drives its counter, Port 3. The Timer Mode register configures the
which decrements the value (I to 256) that has external timer input as an external clock, a
been loaded into the counter. When the trigger input that can be retriggerable or non-
counter reaches the end of count, a timer retriggerable, or as a gate input for the inter-
interrupt request~IRQ4 (To) or IRQs (TI)~is nal clock. The counter/timers can be pro-
generated. grammably cascaded by connecting the To out-
The counters can be started, stopped, put to the input of T I. Port 3 line P36 also
restarted to continue, or restarted from the serves as a timer output (TOUT) through which
initial value. The counters can also be pro- To, TI or the internal clock can be output.
grammed to stop upon reaching zero (single-
I/O Ports The Z8681182 has 24 lines available for input vide address outputs, timing, status Signals,
and output. These lines are grouped into three serial I/O, and parallel I/O with or without
ports of eight lines each and are configurable handshake. All ports have active pull-ups and
as input, output or address. Under software pull-downs compatible with TTL loads.
control, the ports can be programmed to pro-
Port I is a dedicated Z-BUS compatible (Figure 8) and are multiplexed with data in/out
memory interface. The operations of Port I are (Do-D7). Instruction fetch and data memory
supportEld by the Address Strobe (AS) and read/write operations are done through this
Data Strobe (DS) lines, and by the Read/Write port.
(R/W) and Data Memory (DM) control lines. Port I cannot be used as a register nor can a
The low-order program and data memory handshake mode be used with this port.
addresses (Ao-A7) are output through Port I
2037-009 5
110 Ports Both the 28681 and 28682 wake up with the 8
(Continued) bits of Port I configured as address outputs for PORT 1
(110 OR ADo-AD7
external memory. If more than eight address
TO EXTERNAL
line are required with the 28681, additional MEMORY
lines can be obtained by programming Port 0
bits as address bits. The least-significant four
bits of Port 0 can be configured to supply ad-
dress bits Aa-All for 4K byte addressing or
both nibbles of Port 0 can be configured to
supply address bits Aa-AJ5 for 64K byte ad- Figure 8. Port I
dressing.
Port 0* can be programmed as a nibble I/O eliminate this extended timing mode.
port, or as an address port for interfacing The following example illustrates the manner
external memory (Figure 9). When used as an in which an initialization routine can be
I/O port, Port 0 may be placed under hand- mapped in a 28681 system with 4K of memory.
shake control. In this configuration, Port 3 Example. In Figure 10, the initialization
lines P32 and P35 are used as the handshake routine is mapped to the first 256 bytes of pro-
controls DAVo and RDYo. Handshake signal gram memory. Pull-down resistors maintain the
assignment is dictated by the I/O direction of address lines at a logic 0 level when these
the upper nibble P04-P07. lines are floating. The leakage current caused
For external memory references, Port 0 can by fanout must be taken into consideration
provide address bits AS-All (lower nibble) or when selecting the value of the pulldown
Aa-AJ5 (lower and upper nibbles) depending resistors. The resistor value must be large
on the required address space. If the address enough to allow the Port 0 output driver to pull
range requires 12 bits or less, the upper nibble the line to a logic one. Generally, pulldown
of Port 0 can be programmed independently as resistors are incompatible with TTL loads. If
I/O while the lower nibble is used for Port 0 drives into TTL input loads (ILOW = 1.6
addressing. rna) the external resistors should be tied to
In the Z8681 *, Port 0 lines float after reset; Vee and the initialization routine put in ad-
their logic state is unknown until the execu- dress space FFOOH-FFFFH.
tion of an initialization routine that configures In the Z8682 *, Port 0 lines are configured as
Port O. address lines Aa-AJ5 after a Reset. If one or
Such an initialization routine must reside both nibbles are needed for 1/0 operation,
within the first 256 bytes of executable code they must be configured by writing to the Port
and must be physically mapped into memory o Mode register. The 28682 is in the fast
by forcing the Port 0 address lines to a known memory timing mode after Reset, so the ini-
state. See Figure 10. The proper Port initializa- tialization routine must be in fast memory.
tion sequence is:
I. Write initial address (As-AJ5) of initializa-
tion routine to Port 0 address lines.
P04-PO, } PORT 0
2. Configure Port 0 Mode Register to output } POa-P03 (If 0 OR Aa-A15
I------++~------.I
(4K BYTES)
112 PORTO (
Interrupts· The 28681182 allows six different interrupts addresses 2048-2065, where 3-byte jump ab-
from eight sources: the four Port 3 lines solute instructions are located (See Figure 4).
P30-P33, Serial In, Serial Out, and the two These jump instructions each contain a I-byte
counter/timers. These interrupts are both opcode and a 2- byte starting address for the
maskable and prioritized. The Interrupt Mask interrupt service routine. The 28682 takes 36
register globally or individually enables or system clock cycles to enter an interrupt
disables the six interrupt requests. When more subroutine.
than one interrupt is pending, priorities are
resolved by a programmable priority encoder Table 1. Z8682 Interrupt Processing
that is controlled by the Interrupt Priority
register. Address Contains Jump Instruction and
All 28681 and 28682 interrupts are vectored (Hex) Subroutine Address For
through locations in program memory. When
800·802 IRQO
an interrupt request is granted, an interrupt
803-805 IRQ!
machine cycle is entered. This disables all
806-808 IRQ2
subsequent interrupts, saves the Program
809-80B IRQ3
Counter and status flags, and accesses the pro-
80C-80E IRQ4
gram memory vector location reserved for that 80F-811 IRQ5
interrupt. In the 28681, this memory location
and the next byte contain the 16-bit address of
the interrupt service routine for that particular Polled interrupt systems are also supported.
interrupt request. The 28681 takes 26 system To accommodate a polled structure, any or all
clock cycles to enter an interrupt subroutine. of the interrupt inputs can be masked and the
The 28682 has a small internal ROM that Interrupt Request register polled to determine
contains six 2-byte interrupt vectors pointing to which of the interrupt requests needs service.
2194~OIO, 011 7
Power Down The low-power standby mode allows power
Standby to be removed without losing the contents of +5 v O - - - - -......- - - l Voo
Option the 124 general-purpose registers. This mode
is available only to the user as a bonding Z8681/82
MCU
option whereby pin 2 (normally XTAL2) is
replaced by the VMM (standby) power supply
input. This necessitates the use of an external
clock generator (input = XTALl) rather than a
crystal source.
The removal of power, whether intended or
due to power failure, must be preceded by a Figure 13. Recommended Driver Circuit for
software routine that stores the appropriate Power-Down Operation
status into the register file. Figure 13 shows
the recommended circuit for a battery back-up
supply system.
Z86811Z8682 Although the 28681 and Z8682 have minor Initialization. The 28681 wakes up after reset
Inter- differences, a system can be designed for com- with Port 0 configured as an input, which
changeability patibility with both ROMless versions. To means Port 0 lines are floating in a high-
achieve interchangeability, the design must impedance state. Because of this pullup or
take into account the special requirements of pulldown, resistors must be attached to Port 0
each device in the external interface, in- lines to force them to a valid logic level until
itialization, and memory mapping. Port 0 is configured as an address port.
External Interface. The 28682 requires a Port 0 initialization is discussed in the sec-
7.5 V positive logic level on the RESET pin for tion on ports. An example of an initialization
at least 6 clock periods immediately following routine for 28681128682 compatibility is shown
reset, as shown in Figure 14. The 28681 re- in Table 2. Only the 28681 need execute this
quires a 3.8 Vor higher positive logic level, program.
but is compatible with the 28682 RESET Table 2. Initialization Routine
waveform. Figure 15 shows a simple circuit for
generating the 7.5 V level. Address Opcodes Instruction Comments
65536
APPLICATION
PROGRAM
4 6
~ ~r~~
MAX
.... .- ~r~~-.
MIN
2063 JP IRQS
2060 JP IRQ4
Figure 14. Z8682 RESET Pin Input Waveform Z8682 VECTORS
2057 JP IR03
JUMP INSTRUCTIONS
2054 JP IRQ2
2051 JP IRQ1
+V 2048 JP IROO
2047
NOT USED
21
15,
18 JP %0812
Z6681
15 LD P01M #%96 } INITIALIZATION
12 LD PO #%00
10 IRQS
IRQ4
Z8681
IRQ3
}----+----l RESET OR Z8681
7.35 - 8.0 V Z8682 IRQ2 VECTORS
OPEN
COLLECTOR
IRQl
TTL GATE IROO
Figure IS. RESET Circuit Figure 16. Z8681182. Logical Program Memory Mapping
APPLICATION
PROGRAM r---
1015
1014
NOT usee CHIP SELECT =(A12 + A11) • Al3 • ~ °A1s
1000 4K FFF
FFF
APPLICATION
PROGRAM
812 812
811 811
Z8682 VECTORS
800 2K 800
7FF 7FF
NOT USED ~
15 15
14 14
Z8681 VECTORS
AND INITIALIZATION
0
LOGICAL PHYSICAL
MEMORY MEMORY
FFF
APPLICATION
PROGRAM CHIP SELECT = A1i • A:;; . A13 . A14
83.
834
NOT USED Al0 ~ AsTC ROM
820
81F "
APPLICATION 7FF
PROGRAM
812
L.o.
811 3.
Z8682 VECTORS t-- 34
800
7FF
20
,.
14
NOT USED
~
IF
12
11
Z8681 veCTORS
AND INITIALIZATION r-
LOGICAL PHYSICAL
MEMORY MEMORY
Figure 17. Practical Schemes for Implementing Z8681 and Z8682 Compatible Memory Map
Instruction Addressing Modes. The following notation is used src Source location or contents
Set to describe the addressing modes and instruction cc Condition code (see list)
Notation operations as shown in the instruction summary. @ Indirect address prefix
SP Stack pointer (control registers 254-255)
IRR Indired register pair or indired working-register
PC Program counter
pair address
FLAGS Flag register (control register 252)
Irr Indired working-register pair only
RP Register pOinter (control register 253)
X Indexed address
IMR Interrupt mask register (control register 251)
DA Direct address
RA Relative address Assignment of a value is indicated by the symbol
1M Immediate "_". For example,
R Register or working-register address dst - dst + src
Working-register address only indicates that the source data is added to the
IR Indirect-register or indirect working-register destination data and the result is stored in the
ad?ress destination location. The notation "addr(n)" is used
Ir Indired working-register address only to refer to bit "n" of a given location. For example,
RR Register pair or working register pair address dst (7)
Symbols. The following symbols are used in refers to bit 7 of the destination operand.
describing the instruction set.
dst Destination location or contents
2194·016 9
Instruction Flags. Control Register R252 contains the following Affected flags are indicated by:
Set six flags:
o Cleared to zero
Notation C Carry flag Set to one
(Continued) Z Zero flag *' Set or cleared according to operation
S Sign flag Unaffected
V Overflow flag X Undefined
D Decimal-adjust flag
H Half-carry flag
One-Byte Instruction
ope MODE ClR, CPl, CA, DEC, ope MODE ADe, ADD, AND, CP,
LO, OR, sac, sua,
11 I dst/src I DECW, INC, INew, POP,
."
dst/sre OR 1 1 0 OR 1 1 1 0
PUSH, RL, RLe, RR, TCM, TM, XOR
RRC, SRA, SWAP d" OR t 1 1 0
ope
I 11 01
JP, CALL (Indirect)
ope
."
dS! OR 1 1 dS! MODE ADC, ADD, AND, CP,
LD, OR, sac, SUB,
d" OR 11 1 1 01 TCM, TM, XOR
VALUE
ope SRP
VALUE
MODE ope LD
OR 1 1 1 0
ope
dS!
MODE ADC, ADD, AND,
CP, OR, SBC, SUB,
rCM, TM, XOR
MODE
." ope
OR 1 1 1 0
." LD
MODE ope LD, LDE, LDEI,
dst/sre
dstlsrc src/dst LDC, LDCI
ADDRESS
10
Instruction IDlluuction Addr Mode Opcode Flags Affected IDlltruction Addr Mode Opcode Flags Allected
and Operation Byte and Operation Byte
Summary clst Irc (Hex) CZSVDH dBt orc (Hex) CZSVDH
ADC dst,src (Note I) 10 * * a* LDE dst,src r
Irr
Irr 82 ------
dst-dst + src + C dst - src 92
ADD dst,src (Note I) 00 * a* LDEI dst, src Ir Irr 83 ------
dst - dst + src dst - src Irr Ir 93
r - r + I; rr-rr+l
AND dst,src (Note I) 50 - * * a
dst - dst AND src NOP FF
CALL dst DA D6 ------ OR dst,src (Note I) 40 - * * a
SP-SP-2 IRR D4 dst - dst OR src
@SP - PC; PC - dst
POP dst R 50 ------
CCF EF * - - - - - dst - @SP IR 51
C - NOT C SP - SP +
CLR dst R BO PUSH src R 70 ------
dst - a IR BI SP - SP -I; @SP- src IR 71
COM dst R 60 - * * a RCF CF 0-- - - -
dst - NOT dst IR 61 C-O
CP dst,src (Note I) AD RET AF ------
dst - src PC-@SP; SP-SP+2
DA dst R 40 * X
I~
RL dst 90
dst - DA dst IR 41 0..I::DJ 91
~~
DEC dst R 00 -***-- RLC dst 10
dst-dst-I IR 01 II
RR dst
lczJ~I~
DECW dst - • *•- - EO
RR 80
dst-dst-I IR 81 EI
RRCdst~ R CO
DI o , • IR CI
IMR (7) - a 8F ------
SBC dst,src (Note I) 3D * * I *
dst-dst-src-C
DINZ r,dst RA rA ------
r - r- I r~O-F SCF DF I - - -
if r ". a C-I
PC-PC+dst
Range: + 127, -128 SRA dst
lczJ~I~
DO * * * a
DI
EI 9F ------ SRP src 1m 31 ------
IMR (7) - I RP - src
INC dst rE - * * * - - SUB dst,src (Note I) 20 I *
dst-dst+1 r~O-F dst - dst - src
R 20
IR 21 SWAPdst~ R Fa X * * x- -
IR FI
INCW dst RR AO - * * * - -
dst - dst + IR Al TCM dst,src (Note I) 60 - * * a
(NOT dst) AND src
!RET BF
FLAGS - @SP; SP - SP + I TM dst, src (Note I) 70 - * * a
PC - @ SP; SP - SP + 2; IMR (7) - I dst AND src
IP cC,dst DA cD ------ XOR dst,src (Note I) BO - * * 0 - -
if cc is true c~O-F dst - dst XOR src
PC - dst IRR 30
IR cC,dst RA cB ------ Note I
if cc is true, c~O-F
PC-PC+dst These instructions have an identical set of addressing
Range: + 127, -128 modes, which are encoded for brevity. The first opcode
nibble is found in the instruction set table above. The
LD dst,src 1m rC ------
second nibble is expressed symbolically by a 0 in this
dst - src r R r8 table, and its value is found in the following table to the
R r9
r~O-F
left of the applicable addressing mode pair.
r X C7 For example, to determine the opcode of an ADC
r D7 instruction using the addressing modes r (destination) and
X
r Ir E3 Ir (source) is 13.
Ir r F3
R R E4
R IR E5 Addr Mode Lower
R 1M E6 dst src Opcode Nibble
IR 1M E7
IR R F5 rn
LDC dst,src r Irr C2 ------ Ir rn
dst - src Irr D2 R R [II
LDCI dst, src Ir Irr C3 ------ R IR ~
dst - src Irr Ir D3
R 1M @]
r - r + 1; rr-rr+ 1
IR 1M rn
8085-003 11
Registers R240810 R244 TO
8eriall/0 Register Counter/Timer 0 Register
(FOH; Read!Write) (F4H; Read!Write)
INTERNAL
NOT T"",MODES
EXTERNAL CLOCK
Usr;D ,. 00
~o g~~
CLOC~ OUT
T
:= ~~
MODES
INPOT ,. 00
11
j
~ lS~o 1 :
= NO FUNCTION
LOAD To
0 = DISABLE To COUNT
1 ,. ENABLE To COUNT
0 ... NO FUNCTION
1 = LOAD T,
I~I~I~!~!~!~!~!~I
~L
COUNTMODE
o ... To SINGLE·PASS
1 = To MODULO-N
RESERVED (MUST BE 0)
E~
O1 PORT
~L
COUNTMODE
1 = T, MODULO.N
2 PULL·UPSOPEN DRAIN
PORT 2 PULL-UPS ACTIVE
o .. T1 SINGLE·PASS
RESERVED (MUST BE 0)
CLOCK SOURCE o P32 = INPUT P35 = OUTPUT
1 = T, INTERNAL
o = T, EXTERNAL 1 P32= DAVOIRDYO Pas = RDYOIDAVO
TIMING INPUT o0 P3a = INPUT P3.i = OUTPUT
~~}P33=
(TlwMODE
INPUT P3.i = OM
PRESCALER MODULO 11 PSa = DAV1/RDY1 P3.i = RD.Y1/DAYf
(RANGE: 1-64 DECIMAL
01-00 HEX) ' - -_ _ _ _ _ _ ~ :~ ~ ~~~Iq~ :~: ~~~~~UT)
12 2037·014
Registers R248 POIM R252 FLAGS
(Continued) Port 0 Register Flag Register
(F8H ; Write Only) (FC H ; ReadIWrite)
MODE:] ~-r
~~~
I
PO.-PO,... 00 ~
OUTPUT
INPUT .. 01
LOll,",= MODE POD-PO, OUTPUT
01 INPUT
LUSER FLAG F'
LUSER FLAG F2
4'2-A1& .. 1X 1X = A,-A'1 HALF CARRY FLAG
EXTERNAL STACK SELECTION DECIMAL ADJUST FLAG
MEMORY TIMING 0 .. EXTERNAL
NORMAL ... 0 1 ... INTERNAL OVERFLOW FLAG
·EXTENDED • 1 SIGN FLAG
ZERO FLAG
RESERVED (MUST BE 0)
CARRY FLAG
R2491PR R253 RP
Interrupt Priority Register Register Pointer
(F9H ; Write Only) (FDH; Read/Write)
I I III ,~""".-. ~
I~I~I~I~I~I~I~I~I
~.:J
IRQ3, IROS PRIORITY (GROUP A)
0=IRQ&>IRQ3
RESERVED = 000
C > A :> B = 001
A>I>C=010
REGISTER
POINTER
1 = IR03 > lAOS A > C > B = 011
IROO. IRQ2 PRIORITY (GROUP B)
o = IR02 > IROO
~~ g~ : : ~::
B> A> C = 110
1 = IROO :> IR02 RESERVED = 111
IRQ1, IRQ4 PRIORITY (GROUP C)
o = IROt :> IR04
1 = IR04 :> IRQ1
I~I~I~I~I~I~I~I~I
RESERVED (MUST BE O)::r- c::= tRoo
IRQ1
P32 INPUT (Do = IROO)
PSa INPUT
IRQ2 Pa, INPUT
IAQ3 P30 INPUT, SERIAL INPUT
IR04 To, SERIAL OUTPUT
IROS T,
Il___ C::=
___ (Do
' ENABLES'ROO-'RQ'
= IROO)
RESERVED (MUST BE 0)
2037-014 13
Z8681/82 Lower Nibble (Hex)
Opcode
Map o z 3 , 5 6 7 8 9 A B C D E F
6, S 6,S 6,S 6,S 1O,S 10,S 10,S 10,S 6,S 6,S 12/10,S 12110,0 6,S 12/10,0 6,S
o DEC DEC ADD ADD ADD ADD ADD ADD LD LD DJNZ JR LD JP INC
R, IR, II, rz Il,Irz R2,R, IR2,R, R"IM IR"IM Il,Hz I2,Rl II,RA cc,RA Il,IM cc,DA Il
6,S 6, S 6,S 6,S 10,S 1O,S 10,S 1O,S
I---
RLC RLC ADC ADC ADC ADC ADC ADC
R, lR, II, rz Il,lrZ Hz,Hl IR2,R, R"IM lR"IM
r---
6,S 6,S 6,S 6,S 10,S 10,S .1 O,S 10,S
Z INC INC SUB SUB SUB SUB SUB SUB
R, IR, II, 12 n,Ir2 Hz,Hl IR2,R, R"IM IR"IM
6,1 10,S 10,S 10, S 10,S
I---
8,0 6,S 6,S
3 JP SRP SBC SBC SBC SBC SBC SBC
lRR, 1M II. 12 II.Irz R2,R, IRZ,HI R"IM IR"IM
r---
, 8,S
DA
R,
8,S
DA
IR,
6,S
OR
6,S
OR
Il,lrz
10,S
OR
Hz,Hl
10, S
OR
IR2,R,
10,S
OR
10, S
OR
II, 12 R"IM IR"IM
: 10,S
I---
10,5- 1O,S 6,S 6,S 10,S 10, S 10, S
5 POP POP AND AND AND AND AND AND
R, IR, 11,(2 II, lIz R2,R, IR2,R, R"IM IR"IM
I---
6,S 6, S 6,S 6,S 1O,S 10, S 10,S 1O,S
8 COM COM TCM TCM TCM TCM TCM TCM
'i R, IR, Il,12 II, lIZ Hz,Hl lR2,R, R"IM IR"IM
is 10/12,1 12/14,1 6,S 6,S 10, S 10, S 10,S 10,S
I---
.!
..0 7 PUSH PUSH TM TM TM TM TN TM
:9 R2 IR2 Il, 12 ll/lrz R2,R, IR2,R, R"IM IR"IM
z I---
10, S 10, S 12,0 18,0
~ 6,1
8: 8 DECW DECW LDE LDEI DI
I:) RR, IR, Il,IIl2 !rI, Iru
18,0
I---
6,S 6,S 12,0
6,1
9 RL RL LDE LDEI EI
R, IR, 12, lIn lu, hIl
I---
10,S 10,5 6,S 6,S 10,S 10, S 10, S 10, S
14,0
A INCW INCW CP CP CP CP CP CP RET
RR, IR, n,I2 Il/hz R2,R, IR2,R, R"IM IR"1M
6,S 6,S 6,S 6,S 1O,S 1O,S 1O,S 10,S
r-----
16,0
B CLR CLR XOR XOR XOR XOR XOR XOR IRET
R, IR, II, 12 1l,Irz H2,Hl IR2,R, R"IM IR"IM
I---
6,S 6,S 12,0 18,0 10,S
6,S
C RRC RRC LDC LOCI LD RCF
R, IR, Il, rIt2 In,Irrz II, X, Hz
6,S 6,S 12,0 18,0 20,0 20,0 1O,S
r----
6,S
D SRA SRA LDC LDCI CALL· CALL LD SCF
R, IR, I2,IIII IIZ,IIII IRR, DA I2, X, Rl
"I .I '-________~~~---------'"I ~ ~
Byte. per
Instruction
'" V'
Z
"" V'
3
'" Z 3
Lower
Opcode
Nibble
Execution
Cycles
t PlpeUne
Cycles
Legend:
R = 8-Bit Address
r = 4-Bit Address
Upper R1 or fl = Dst Address
Opcode- A Mnemonic R1 or Il = Src Address
Nibble
Sequence:
Flnt Second Opcode, First Operand, Second Operand
Operand Operand
Note: The blank areas are not defined.
14 8085-002
Absolute Voltages on all pins' Stresses greater than those listed under Absolute Maxi·
Maximum with respect to GND .......... -O.3Vto +7.0V mum Ratings may cause permanent damage to the device.
This is a stress rating only; operation of the device at any
Ratings Operating Ambient condition above those indicated in the operational sections
Temperature ........ See Ordering Information of these specifications is not implied. Exposure to absolute
maximum rating conditions for extended periods may affect
Storage Temperature ........ -65°C to + 150°C device reliability.
2.1K
Uk 1.5k
7,!-S04 7:"LS04
CLf:.CK --.0
... 'O-~""""1p-...
l>o-.....- XTAL.
L -_ _ _ _ _ XTAL.
Figure 20. Test Load I Figure 21. External Clock Interface Circuit
VeL Clock Input Low Voltage -0.3 0.8 V Driven by External Clock Generator
8085·0313, 2037~015 15
External 110
or Memory
Read and
Write Timing
Do- D1 0UT
Z868l/82 Z868l/82
8 MHz 12 MHz
No. Symbol Parameter Min Max Min Max Notes*t
NOTES:
I. Test Load 1 5. All timing references use 2.0 V for a logic "1" and 0.8 V for a logic "0",
2. Timing numbers given are for minimum TpC. * All units in nanoseconds (ns).
3. Also see clock cycle time dependent characteristics table. t Timings are preliminary and subject to change.
4. When using extended memory timing add 2 TpC.
16 2194-017
Additional
Timing
Table
Z868l/82 Z868l/82
8MBz 12MBz
No. Symbol Parameter Min Max Min Max Notes**
NOTES:
1. Clock timing references uses 3.8 V for a logic "1" and 0.8 V for 3. Interrupt request via Port 3.
a logic "0". * Units in nanoseconds (ns),
2. Timing reference uses 2.0 V for a logic "}" and 0.8 V for t Timings are preliminary and subject to change.
a logic "0",
17
.\ ...----
Handshake
-~----:;;~="":
DATA IN
Timing
DAV
(INPUT)
ROY
(OUTPUT)
S.
Figure 24a. Input Handshake Timing
DATA OUT
~ DATA OUT VALID
--~~-------------.---
tiAV '\
(OUTPUT)
ROY
_________ ~C===~===fl==
(5) C17~
(INPUT)
Z8681182 Z8681/82
8 MHz 12 MHz
No. Symbol Parameter Min Max Min Max Notes*t
NOTES:
I. Test load I .. Units in nanoseconds (ns),
2. Input handshake l Timings are preliminary and subject to chao.Qe.
3. Output handshake
4. All timing regerences use 2.0 V for a logic "1" and 0.8 V for
a logic "0".
18 2194·019
Ordering Product Packagel Product Packagel
Information Number Temp Speed Description Number Temp Speed Description
Package
r
40 21
Dimensions
PIN 1
IDENTIFICATION t
~S:: Dra r.=============~
~~~==~~~~~~~~
20
I' 'I
t ~~~
t+--0.53O~
2.=
I MAX I
~ I
L---0.800
REF
c:J 0.010
...002
TYP
------J WJ 0.125
MIN
0.080
0.020
!
L ...
0.050
01580TH ENDS
!
--I L
!
0.100
±.010TYP --I L 0.018
±.OO3TYP
'~l
40 21
~~-rrT"rrTT"-rrT,,-rrr~-rrr"-rrrTT-nrr"-rrr,-J 20
2.080
MAX
I
0230 0.058
'HL~
.tjd ~:olrHMEANXDS
MIN
...=
0.040
~ I- : ~ ~I - : ~g
TYP TYP
NOTE: Package dimensions are given in inches. To convert to millimeters, multiply by 25.4.
19
Packages 40 21
Dimensions
(Continued)
T
0.555
I~r=r==r=;=n=:r~;=:;=;=:n=:;=;~::;::;::::;::;::;::;=;=l
20
I+-----------------------~~~----------------------~·I
I
-0.600
0.620:=j 0.150
MAX
~~
~ ~ ~r---------------------------------++----------__1~~
- 0.009 ~
U I
I-~::~-I -
to-pin Plastic Package
NOTE: Package dimensions are given in inches. To convert to millimeters, multiply by 25.4.
20
Zilog West Midwest East United Kingdom
Sales Sales & Technical Center Sales & Technical Center Sales & Technical Center Zilog (U.K.) Limited
Offices Zilog, Incorporated Zilog, Incorporated Zilog, Incorporated Zilog House
1315 Dell Avenue 951 North Plum Grove Road Corporate Place 43·53 Moorbridge Road
Campbell, CA 95008 Suite F 99 South Bedford SI. Maidenhead
Phone: (408) 370-8120 Schaumburg, IL 60195 Burlington, MA 01803 Berkshire, SL6 8PL England
TWX: 910-338-7621 Phone: (312) 885-8080 Phone: (617) 273-4222 Phone: 0628-39200
TWX: 910-291-1064 TWX: 710-332-1726 Telex: 848609
Sales & Technical Center
Zilog, Incorporated Sales & Technical Center Sales & Technical Center France
18023 Sky Park Circle Zilog, Incorporated Zilog, Incorporated
Suite J 28349 Chagrin Blvd. 240 Cedar Knolls Rd. Zilog, Incorporated
Irvine, CA 92714 Suite 109 Cedar Knolls, NJ 07927 Cedex 31
Phone: (714) 549-2891 Woodmere,OH 44122 Phone: (201) 540-1671 92098 Paris La Defense
TWX: 910-595-2803 Phone: (216) 831-7040 France
FAX: 216-831-2957 Technical Center
Phone: (!) 334-60-09
Sales & Technical Center Zilog, Incorporated
TWX: 611445F
Zilog, Incorporated South 3300 Buckeye Rd.
15643 Sherman Way Suite 401
West Germany
Suite 430 Sales & Technical Center Atlanta, GA 30341
Van Nuys, CA 91406 Zilog, Incorporated Phone: (404) 451-8425 ZilogGmbH
Phone: (213) 989-7485 4851 Keller Springs Road, Eschenstrasse 8
TWX: 910-495-1765 Suite 211 Sales & Technical Center
D-8028 TAUFKIRCHEN
Dallas, TX 75248 Zilog, Incorporated
Munich, West Germany
Sales & Technical Center Phone: (214) 931-9090 1442 U.S. Hwy 19 South
Phone: 89-612-6046
Zilog, Incorporated TWX: 910-860-5850 Suite 135
Telex: 529110 Zilog d.
1750 112th Ave. N.E. Clearwater, FL 33516
Suite D161 Zilog, Incorporated Phone: (813) 535-5571
Japan
Bellevue, WA 98004 7113 Burnet Rd.
Phone: (206) 454-5597 Suite 207 Zilog, Incorporated
Zilog, Japan K.K.
Austin, TX 78757 613-B Pit! SI.
Konparu Bldg. 5F
Phone: (512) 453-3216 Cornwall, Ontario
2-8 Akasaka 4-Chome
Canada K6J 3R8
Minato-Ku, Tokyo 107
Phone: (613) 938-1121
Japan
Phone: (81) (03) 587-0528
Telex: 2422024 AlB: Zilog J
Zilog, Inc. 1315 Dell Ave., Campbell, California 95008 Telephone (408)370-8000 TWX 910-338-7621
00·2194·02 Printed in USA