Resonator, LC, or External Clock Drive
Clock-Free WDT Reset
Low-Power Consumption (40 mw)
Fast Instruction Pointer (1.5 µ s @ 8 MHz)
Fourteen Digital Inputs at CMOS Levels;
Schmitt-Triggered
1
GENERAL DESCRIPTION
Zilog's Z86L04/L08 microcontrollers (MCUs) are members
of the Z8 single-chip MCU family, which offer easy software/hardware system expansion.
For applications demanding powerful I/O capabilities, the
MCU's dedicated input and output lines are grouped into
three ports, and are configurable under software control to
provide timing, status signals, or parallel I/O.
DS97LVO0901
P R E L I M I N A R Y
One on-chip counter/timer, with a large number of user-selectable modes, off-load the system of administering realtime tasks such as counting/timing and I/O data communications. Additionally, two on-board comparators process
analog signals with a common reference voltage (Figure
Ambient Temperature under Bias–40+105
Storage Temperature–65+150
Voltage on any Pin with Respect to V
Voltage on V
Pin with Respect to V
DD
Voltage on Pin 7 with Respect to V
Voltage on Pin 7,8,9,10 with Respect to V
[Note 1]–0.7+12V
SS
SS
[Note 2] (Z86C02/L02)–0.7V
SS
[Note 2] (Z86E02)–0.7V
SS
–0.3+7V
+1V
DD
+1V
DD
Total Power Dissipation462mW
Maximum Allowed Current out of V
Maximum Allowed Current into V
DD
SS
300mA
270mA
Maximum Allowed Current into an Input Pin [Note 3]–600+600
Maximum Allowed Current into an Open-Drain Pin [Note 4]–600+600
Maximum Allowed Output Current Sinked by Any I/O Pin20mA
Maximum Allowed Output Current Sourced by Any I/O Pin20mA
Maximum Allowed Output Current Sinked by Port 2, Port 080mA
Maximum Allowed Output Current Sourced by Port 2, Port 080mA
C
C
A
A
Notes:
Stresses greater than those listed under Absolute
Maximum Ratings may cause permanent damage to the
device. This is a stress rating only; functional operation of
the device at any condition above those indicated in the
operational sections of these specifications is not implied.
Exposure to absolute maximum rating conditions for an
extended period may affect device reliability.
Total power dissipation should not exceed 462 mW for the
package. Power dissipation is calculated as follows:
Total Power dissipation = V
DD
x [I
– (sum of I
DD
)] + sum of [(V
OH
STANDARD TEST CONDITIONS
The characteristics listed below apply for standard test
conditions as noted. All voltages are referenced to
Ground. Positive current flows into the referenced pin (Figure 5).
1. This applies to all pins except where otherwise noted.
2. Maximum current into pin must be ± 600 µ A.
There is no input protection diode from pin to V
DD
.
3. This excludes Pin 6 and Pin 7.
4. Device pin is not at an output Low state.
– V
) x I
DD
OH
From Output
Under T est
] + sum of (V
OH
0L
x I
0L
)
150 pF
T
= 25 ° C, V
A
= GND = 0V, f = 1.0 MHz, unmeasured pins returned to GND.
XTAL1, XTAL2 Crystal In, Crystal Out (time-based input
and output, respectively). These pins connect a parallelresonant crystal, LC, RC, or an external single-phase
clock (8 MHz max) to the on-chip clock oscillator and buffer.
Port 0, P02-P00. Port 0 is a 3-bit bidirectional, Schmitt-triggered CMOS compatible I/O port. These three I/O lines
can be globally configured under software control to be inputs or outputs (Figure 7).
Z8
Auto Latch. The Auto Latch puts valid CMOS levels on all
CMOS inputs (except P33, P32, P31) that are not externally driven. A valid CMOS level, rather than a floating node,
reduces excessive supply current flow in the input buffer.
On Power-up and Reset, the Auto Latch will set the ports
to an undetermined state of 0 or 1. Default condition is
Auto Latches enabled.
Port 0 (I/O)
Open
Out
In
PAD
Auto Latch Option
R 500 kΩ
Figure 7. Port 0 Configuration
10P R E L I M I N A R YDS97LVO0901
Z86L04/L08
1
ZilogZ8 8-Bit Cost-Effective Microcontrollers
Port 2, P27-P20. Port 2 is an 8-bit, bit-programmable, bi-
directional, Schmitt-triggered, CMOS, compatible I/O port.
These eight I/O lines can be configured under software
Z8
Port 2
control to be inputs or outputs, independently. Bits programmed as outputs can be globally programmed as either push-pull or open-drain (Figure 8).
Port 3, P33-P31. Port 3 is a 3-bit, CMOS, compatible port
with three fixed input (P33-P31) lines. These three input
lines can be configured under software control as digital
Schmitt-trigger inputs or analog inputs.
Z8
0 = Digital
1 = Analog
D1
DIG.
AN.
PAD
P31 (AN1)
R247 = P3M
+
-
These three input lines are also used as the interrupt
sources IRQ0-IRQ3 and as the timer input signal TIN (Figure 9).
ZilogZ8 8-Bit Cost-Effective Microcontrollers
Comparator Inputs. Two analog comparators are added
to input of Port 3, P31 and P32, for interface flexibility. The
comparators reference voltage P33 (REF) is common to
both comparators.
Typical applications for the on-board comparators; Zero
crossing detection, A/D conversion, voltage scaling, and
threshold detection. In analog mode, P33 input functions
serve as a reference voltage to the comparators.
FUNCTIONAL DESCRIPTION
The following special functions have been incorporated
into the Z86L04/L08 devices to enhance the standard Z8
core architecture to provide the user with increased design
flexibility.
INT OSC
POR
(Cold Start)
Delay Line
T
POR
P27
(Stop Mode)
The dual comparator (common inverting terminal) features
a single power supply which discontinues power in STOP
mode. The common voltage range is 0-4V when the V
is 5.0V; the power supply and common mode rejection ratios are 90 dB and 60 dB, respectively.
Interrupts are generated on either edge of Comparator 2's
output, or on the falling edge of Comparator 1's output.
The comparator output is used for interrupt generation,
Port 3 data inputs, or TIN through P31. Alternatively, the
comparators can be disabled, freeing the reference input
(P33) for use as IRQ1 and/or P33 input.
RESET. This function is accomplished by means of a Power-On Reset or a Watch-Dog Timer Reset. Upon powerup, the Power-On Reset circuit waits for T
POR
clock cycles, then starts program execution at address
000C (Hex) (Figure 10). The control registers' reset values
are shown in Table 3.
Power-On Reset (POR). A timer circuit clocked by a ded-
icated on-board RC oscillator is used for a POR timer function. The POR time allows V
and the oscillator circuit to
CC
stabilize before instruction execution begins. The POR
timer circuit is a one-shot timer triggered by one of the five
following conditions:
■Power bad to power good status
■Stop-Mode Recovery
■WDT time-out
■WDT time-out (in HALT Mode)
■WDT time-out (in STOP Mode)
Watch-Dog Timer Reset. The WDT is a retriggerable
one-shot timer that resets the Z8 if it reaches its terminal
count. The WDT is initially enabled by executing the WDT
instruction and is retriggered on subsequent execution of
the WDT instruction. The timer circuit is driven by an onboard RC oscillator. If the permanent WDT option is selected then the WDT is enabled after reset and operates in
RUN Mode, HALT mode, STOP mode and cannot be disabled. If the permanent WDT option is not selected then
the WDT, when enabled by the user's software, does not
operate in STOP Mode, but it can operate in HALT Mode
by using a WDH instruction.
Table 3. Control Register Reset Values
Reset Condition
Addr Reg.D7 D6 D5 D4 D3 D2 D1 D0 Comments
FF SPL00000000
FE GPR 00000000
FDRP00000000
FC FLAGSUUUUUUUU
FB IMR0UUUUUUU
FA IRQ UU000000IRQ3 is used
for positive
edge
detection
F9 IPRUUUUUUUU
F8*P01MU U U0U U01
F7*P3M UUUUUU0 0P2 open-drain
F6*P2M 11111111Inputs after
reset
F5PRE0UUUUUUU0
F4 T0UUUUUUUU
F3PRE1UUUUUU00
F2 T1UUUUUUUU
F1 TMR 00000000
Notes:
*Registers are not reset after a STOP-Mode Recovery using P27
pin. A subsequent reset will cause these control registers to be
reconfigured as shown in Table 4 and the user must avoid bus
contention on the port pins or it may affect device reliability.
14P R E L I M I N A R YDS97LVO0901
Z86L04/L08
1
ZilogZ8 8-Bit Cost-Effective Microcontrollers
Program Memory. The Z8 addresses up to 1024,2048
bytes of internal program memory (Figure 11). The first 12
bytes of program memory are reserved for the interrupt
vectors. These locations contain six 16-bit vectors that correspond to the six available interrupts. Bytes
0-1023/0-2047 are on-chip mask programmable ROM.
1024/2047
Location of
First Byte of
On-Chip
ROM
Instruction
Executed
After RESET
Interrupt
Vector
(Lower Byte)
Interrupt
Vector
(Upper Byte)
12
11
10
IRQ5
IRQ5
9
8
7
6
5
4
3
2
1
0
IRQ4
IRQ4
IRQ3
IRQ3
IRQ2
IRQ2
IRQ1
IRQ1
IRQ0
IRQ0
Figure 11. Program Memory Map
Register File. The Register File consists of three I/O port
registers, 61 general-purpose registers, and 12 control
and status registers R0-R3, R4-R127 and R241-R255, respectively (Figure 12). General-purpose registers occupy
the 04H to 7FH address space. I/O ports are mapped as
per the existing CMOS Z8. The instructions can access
registers directly or indirectly through an 8-bit address
field. This allows short 4-bit register addressing using the
Register Pointer. In the 4-bit mode, the register file is divided into eight working register groups, each occupying 16
continuous locations. The Register Pointer (Figure 13) addresses the starting location of the active working-register
group.
General-Purpose Registers (GPR). These registers are
undefined after the device is powered up. The registers
keep their last value after any reset, as long as the reset
r7 r6 r5 r4R253
The upper nibble of the register file address
provided by the register pointer specifies
the active working-register group.
FF
F0
Register Group F
r3 r2 r1 r0
(Register Pointer)
R15 to R0
occurs in the V
Register R254 has been designated as a general-purpose
register. But is set to 00Hex after any reset.
Counter/Timer. There are two 8-bit programmable
counter/timers (T0 and T1), each driven by its 6-bit programmable prescaler. The T1 prescaler is driven by internal or external clock sources. (Figure 14).
voltage-specified operating range. Note:
CC
7F
70
6F
60
5F
50
4F
40
3F
30
2F
20
1F
10
0F
00
Specified Working
Register Group
Register Group 1
Register Group 0
I/O Ports
The lower nibble
of the register
file address
provided by the
instruction points
to the specified
register.
R15 to R0
R15 to R4
R3 to R0
Figure 13. Register Pointer
Stack Pointer. The Z8 has an 8-bit Stack Pointer (R255)
used for the internal stack that resides within the 60 general-purpose registers. It is set to 00Hex after any reset.
The 6-bit prescaler divide the input frequency of the clock
source by any integer number from 1 to 64. Each prescaler
drives its counter, which decrements the value (1 to 256)
that has been loaded into the counter. When both counter
and prescaler reach the end of count, a timer interrupt request IRQ5 (T1 or IRQ4 (T0) is generated.
The counter can be programmed to start, stop, restart to
continue, or restart from the initial value. The counters are
also programmed to stop upon reaching zero (Single-Pass
mode) or to automatically reload the initial value and continue counting (Modulo-N Continuous Mode).
The counters, but not the prescaler, are read at any time
without disturbing their value or count mode. The clock
source for T1 is user-definable and is either the internal microprocessor clock divided by four, or an external signal input through Port 3. The Timer Mode register configures the
external timer input (P31) as an external clock, a trigger input that is retriggerable or non-retriggerable, or used as a
gate input for the internal clock.
Interrupts. The Z8 has five interrupts from four different
sources. These interrupts are maskable and prioritized
(Figure 15). The sources are divided as follows: the falling
edge of P31 (AN1), P32 (AN2), P33 (REF), the rising edge
of P32 (AN2), and one counter/timer. The Interrupt Mask
Register globally or individually enables or disables the
five interrupt requests (Table 4).
When more than one interrupt is pending, priorities are resolved by a programmable priority encoder that is controlled by the Interrupt Priority register. All Z8 interrupts are
vectored through locations in program memory. When an
Interrupt machine cycle is activated, an Interrupt Request
is granted. This disables all subsequent interrupts, saves
the Program Counter and Status Flags, and then branches
to the program memory vector location reserved for that interrupt. This memory location and the next byte contain the
16-bit starting address of the interrupt service routine for
that particular interrupt request.
To accommodate polled interrupt systems, interrupt inputs
are masked and the interrupt request register is polled to
determine which of the interrupt requests needs service.
User must select any Z86E08 mode in Zilog's C12 ICEBOX™ emulator. The rising edge interrupt is not directly
supported on the Z86CCP00ZEM emulator.
F = Falling edge triggered
R = Rising edge triggered
Interrupt
Request
IRQ0 - IRQ5
IRQ
IMR
Global
Interrupt
Enable
IPR
Priority
Logic
Vector Select
Figure 15. Interrupt Block Diagram
6
18P R E L I M I N A R YDS97LVO0901
Z86L04/L08
1
ZilogZ8 8-Bit Cost-Effective Microcontrollers
Clock. The Z8 on-chip oscillator has a high-gain, parallel-
resonant amplifier for connection to a crystal, ceramic resonator, or any suitable external clock source (XTAL1 = INPUT, XTAL2 = OUTPUT). The crystal should be AT cut,
8 MHz max, with a series resistance (RS) of less than or
equal to 100 Ohms.
XTAL1
C1
C1
**
C2
Ceramic
Resonator
or Crystal †
† Note: If 32 KHz oscillator is selected then an external 10 Megohm resistor must be connected between XTAL1 and
XTAL2 pins.
XTAL2
C2
Vss *Vss *
LC Clock
XTAL1
L
XTAL2
=Device Ground Pin
*
The crystal or ceramic resonator should be connected
across XTAL1 and XTAL2 using the vendors crystal or ceramic resonator recommended capacitors from each pin
directly to device ground pin 14 (Figure 16). Note that the
crystal capacitor loads should be connected to VSS, Pin 14
to reduce Ground noise injection.
HALT Mode. This instruction turns off the internal CPU
clock but not the crystal oscillation. The counter/timer and
external interrupts IRQ0, IRQ1, IRQ2 and IRQ3 remain active. The device is recovered by interrupts, either externally or internally generated. An interrupt request must be executed (enabled) to exit HALT mode. After the interrupt
service routine, the program continues from the instruction
after the HALT.
STOP Mode. This instruction turns off the internal clock
and external crystal oscillation and reduces the standby
current to 10 µA. The STOP mode is released by a RESET
through a Stop-Mode Recovery (pin P27). A Low condition
on pin P27 releases the STOP mode even if P27 is an output. Program execution begins at location 000C(Hex).
However, when P27 is used to release the STOP mode,
the I/O port mode registers are not reconfigured to their default power-on conditions. This prevents any I/O, configured as output when the STOP instruction was executed,
from glitching to an unknown state. To use the P27 release
approach with STOP mode, use the following instruction:
LDP2M, #1XXX XXXXB
NOP
STOP
Notes:
X = Dependent on user’s application.
Stop-Mode Recovery pin P27 is not edge triggered.
In order to enter STOP or HALT mode, it is necessary to
first flush the instruction pipeline to avoid suspending execution in mid-instruction. To do this, the user executes a
NOP (opcode=FFH) immediately before the appropriate
SLEEP instruction, such as:
FFNOP; clear the pipeline
6FSTOP; enter STOP mode
or
FFNOP; clear the pipeline
7FHALT; enter HALT mode
Watch-Dog Timer (WDT). The Watch-Dog Timer is enabled by instruction WDT. When the WDT is enabled, it
cannot be stopped by the instruction. With the WDT instruction, the WDT is refreshed when it is enabled within
every 1 Twdt period; otherwise, the controller resets itself,
The WDT instruction affects the flags accordingly; Z=1,
S=0, V=0. WDT = 5F (Hex)
Opcode WDT (5FH). The first time opcode 5FH is executed, the WDT is enabled and subsequent execution clears
the WDT counter. This must be done at least every T
WDT
otherwise, the WDT times out and generates a reset. The
generated reset is the same as a power-on reset of T
POR
plus 18 XTAL clock cycles. The internal RC driven WDT
does not run in stop mode, unless the permanent WDT enable option is selected. The WDT does not run in halt
mode unless WDH instruction is executed or permanent
WDT enable option is selected.
Opcode WDH (4FH). When this instruction is executed it
enables the WDT during HALT. If not, the WDT stops
when entering HALT. This instruction does not clear the
counters, it just makes it possible to have the WDT running
during HALT mode. A WDH instruction executed without
executing WDT (5FH) has no effect.
Note: Opcode WDH and permanently enabled WDT is
not directly supported by the Z86CCP00ZEM.
WDT Clock Source. The WDT clock source option selects
the clock source for the WDT. It can be the internal onboard RC oscillator or the internal system clock (SCLK). If
the SCLK is selected, then the WDT time out (T
130,416 x SCLK and the T
is 16,362 x SCLK. Also, if
POR
WDT
) is
the permanent WDT option is selected in this case; the
WDT will not run in STOP mode. (Z86L04 only)
Auto Reset Voltage (VLV). The Z8 has an auto-reset built-
in. The auto-reset circuit resets the Z8 when it detects the
VCC below VLV. Figure 17 shows the Auto Reset Voltage
versus temperature.
;
,
20P R E L I M I N A R YDS97LVO0901
Z86L04/L08
1
ZilogZ8 8-Bit Cost-Effective Microcontrollers
Vcc
(Volts)
3.2
3.1
3.0
2.9
2.8
2.7
2.6
2.5
2.4
2.3
2.2
2.1
2.0
1.9
1.8
1.7
1.6
–20°C0°C20°C
–40°C
40°C
60°C80°C
100°C
Temp
Figure 17. Typical Auto Reset Voltage (V
OPTIONS
ROM protect, Low Noise, Auto Latch Disable, RC Oscillator, 32 kHz Crystal and Permanent WDT enable features
as options and must be selected at the time of ROM code
submissions.
ROM Protect. ROM Protect fully protects the Z8 ROM
code from being read externally. When ROM Protect is selected, the instructions LDC and LDCI are supported.
(However, instructions LDE and LDEI are not supported.)
Auto Latch Disable. Auto Latch Disable option when Selected will globally disable all Auto Latches.
RC. RC Oscillator option when selected will allow using a
resistor (R) and a capacitor (C) as a clock source.
WDT Clock Source. This selects the clock source of the
WDT and POR counter chain to be driven by either the internal system clock or the internal on-board RC oscillator.
(Z86L04 only).
) vs. Temperature
LV
WDT Enable. WDT Enable option bit when selected will
have the WDT permanently enabled in all modes and can
not be stopped in HALT or STOP Mode, if the internal RC
oscillator is selected as the clock source. If the system
clock (SCLK) is the clock source, the WDT will be stopped
in STOP mode.
Please note that when using the device in a noisy environment, it is suggested that the voltages on the EPM and CE
pins be clamped to V
through a diode to VCC to prevent
CC
accidentally entering the OTP mode. The VPP requires
both a diode and a 100 pF capacitor.
32 kHz Crystal. This disables the internal feedback resistor on the crystal oscillator circuit (not for RC oscillator circuit) so that a 32 kHz crystal can be connected to the
XTAL1 and XTAL2 pins.
Low EMI. The Low EMI (Low noise) mode by passes the
divide by two clock circuit (SCLK = XTAL/1) and lowers the
output sink and drive currents by 75 percent. The maximum oscillator frequency at XTAL pins is 1MHz.
Zilog’s products are not authorized for use as critical
components in life support devices or systems unless a
specific written agreement pertaining to such intended use
is executed between the customer and Zilog prior to use.
Life support devices or systems are those which are
intended for surgical implantation into the body, or which
sustains life whose failure to perform, when properly used
in accordance with instructions for use provided in the
labeling, can be reasonably expected to result in
significant injury to the user.
Zilog, Inc. 210 East Hacienda Ave.
Campbell, CA 95008-6600
Telephone (408) 370-8000
FAX 408 370-8056
Internet: http://www.zilog.com