Prescalers and counter/timers – Zilog Z86193 User Manual
Page 88

Z8
®
CPU
User Manual
UM001604-0108
Counters and Timers
81
(T
IN
) using P31. Port 3 line P36 can serve as a timer output (T
OUT
) through which T0, T1,
or the internal clock can be output. The timer output toggles at the end-of-count.
The counter/timer, prescaler, and associated mode registers are mapped into the register
file as displayed in
. This allows the software to treat the counter/timers as gen-
eral-purpose registers, and eliminates the requirement for special instructions.
Prescalers and Counter/Timers
The prescalers,
PRE0
(F5h)
and
PRE1
(F3h)
, each consists of an 8-bit register and a 6-
bit down-counter as displayed in
on page 80. The prescaler registers are write-
only registers. Reading the prescalers returns the value
FFh
.
and
displays the prescaler registers.
The six most significant bits (D2–D7) of PRE0 or PRE1 hold the prescalers count modulo,
a value from 1 to 64 decimal. The prescaler registers also contain control bits that specify
T0 and T1 counting modes. These bits also indicate whether the clock source for T
1
is
internal or external. These control bits will be discussed in detail throughout this chapter.
The counter/timer registers, T0 (
F4h
) and T1 (
F2h
), each consists of an 8-bit down-
counter, a write-only register that holds the initial count value, and a read-only register
that holds the current count value (see
on page 80). The initial value can range
from 1 to 256 decimal (
01h
,
02h
,..,
00h
).
displays the counter/timer
registers.
Figure 69. Counter/Timer Register Map
HEX Identifiers
T0 Prescaler
F7
Timer/Counter0
Port 3 Mode
T1 Prescaler
Time/Counter1
Timer Mode
F5
F4
F3
F2
F1
DEC
247
245
244
243
242
241
- Z86233 Z86243 Z86733 Z86743 Z86C02 Z86C04 Z86C08 Z86C15 Z86C21 Z86C30 Z86C31 Z86C33 Z86C36 Z86C40 Z86C43 Z86C61 Z86C62 Z86C63 Z86C65 Z86C83 Z86C90 Z86C91 Z86C93 Z86C96 Z86E02 Z86E03 Z86E04 Z86E06 Z86E07 Z86E08 Z86E15 Z86E21 Z86E30 Z86E31 Z86E33 Z86E34 Z86E40 Z86E43 Z86E44 Z86E61 Z86E63 Z86E83 Z86K15 Z86L02 Z86L04 Z86L08 Z86L16 Z8E000 Z8E001 Z8PE003