Z08617 NMOS Z8
®
8-B
IT
MCU
K
EYBOARD
C
ONTROLLER
12
Stack.
The Z08617 internal register files are used for the
stack. An 8-bit Stack Pointer (R255) is used for the internal
stack that resides within the 124 general-purpose regis-
ters.
Counter/Timers.
There are two 8-bit programmable
counter/timers (T0-T1), each driven by its own 6-bit
programmable prescaler. The T1 prescaler can be
driven by internal or external clock sources, however,
the T0 prescaler is driven by the internal clock only
(Figure 12).
The 6-bit prescalers can further divide the input
frequency of the clock source by any integer number
from 1 to 64. Each prescaler drives its own counter,
which decrements the value (1 to 256) that has been
loaded into the counter. When both the counter and
prescaler reach the end of count, a timer interrupt
request, IRQ4 (T0) or IRQ5 (T1), is generated.
The counter can be programmed to start, stop,
restart to continue, or restart from the initial value.
The counters can also be 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 prescalers, are read at any
time without disturbing their value or count mode.
The clock source for T1 is user-definable and are
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 as an external clock, a trigger input that can be
retriggerable or non-triggerable, or as a gate input for
the internal clock. The counter/timers can be pro-
grammable cascaded by connecting the T0 output to
the input of T1. Port 3 lines P36 also serves as a timer
output (T
OUT
) through which T0, T1 or the internal
clock are output.
Figure 12. Counter/Timers Block Diagram
PRE0
Initial Value
Register
T0
Initial Value
Register
T0
Current Value
Register
6-Bit
Down
Counter
8-bit
Down
Counter
÷
4
6-Bit
Down
Counter
8-Bit
Down
Counter
PRE1
Initial Value
Register
T1
Initial Value
Register
T1
Current Value
Register
Clock
Logic
IRQ4
T
P36
OUT
IRQ5
Internal Data Bus
Write
Write
Read
Internal Clock
Gated Clock
Triggered Clock
T P31
Write
Write
Read
Internal Data Bus
External Clock
Internal Clock
÷
4
÷
2
IN
CLK
Out
RC
OSC
÷
2