English
Language : 

Z8F0113HJ005EG Datasheet, PDF (88/245 Pages) Zilog, Inc. – High-Performance 8-Bit Microcontrollers
Z8 Encore! XP® F0823 Series
Product Specification
73
enabled, the Timer Output pin changes state (from Low to High or from High to Low) at
timer reload.
Observe the following steps to configure a timer for COUNTER Mode and initiating the
count:
1. Write to the Timer Control Register to:
– Disable the timer.
– Configure the timer for COUNTER Mode.
– Select either the rising edge or falling edge of the Timer Input signal for the count.
This selection also sets the initial logic level (High or Low) for the Timer Output
alternate function. However, the Timer Output function is not required to be
enabled.
2. Write to the Timer High and Low Byte registers to set the starting count value. This
only affects the first pass in COUNTER Mode. After the first timer reload in COUN-
TER Mode, counting always begins at the reset value of 0001H. In COUNTER Mode
the Timer High and Low Byte registers must be written with the value 0001H.
3. Write to the Timer Reload High and Low Byte registers to set the reload value.
4. If appropriate, enable the timer interrupt and set the timer interrupt priority by writing
to the relevant interrupt registers.
5. Configure the associated GPIO port pin for the Timer Input alternate function.
6. If using the Timer Output function, configure the associated GPIO port pin for the
Timer Output alternate function.
7. Write to the Timer Control Register to enable the timer.
In COUNTER Mode, the number of timer input transitions since the timer start is com-
puted via the following equation:
COUNTER Mode Timer Input Transitions = Current Count Value – Start Value
COMPARATOR COUNTER Mode
In COMPARATOR COUNTER Mode, the timer counts input transitions from the analog
comparator output. The TPOL bit in the Timer Control Register selects whether the count
occurs on the rising edge or the falling edge of the comparator output signal. In COMPAR-
ATOR COUNTER Mode, the prescaler is disabled.
PS024315-1011
PRELIMINARY
Operation