English
Language : 

Z8F0830HH020SG Datasheet, PDF (91/257 Pages) Zilog, Inc. – High-Performance 8-Bit Microcontrollers
Z8 Encore!® F0830 Series
Product Specification
73
Caution: The frequency of the comparator output signal must not exceed one-fourth the system
clock frequency.
After reaching the reload value stored in the Timer Reload High and Low Byte registers,
the timer generates an interrupt, the count value in the Timer High and Low Byte registers
is reset to 0001H and counting resumes. Additionally, if the timer output alternate function
is enabled, the timer output pin changes state (from Low to High or from High to Low) at
timer reload.
Observe the following steps for configuring a timer for COMPARATOR COUNTER
Mode and for initiating the count:
1. Write to the Timer Control Register to:
– Disable the timer
– Configure the timer for COMPARATOR COUNTER Mode.
– Select either the rising edge or falling edge of the comparator output signal for the
count. This also sets the initial logic level (High or Low) for the timer output alter-
nate 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
action only affects the first pass in COMPARATOR COUNTER Mode. After the first
timer reload in COMPARATOR COUNTER Mode, counting always begins at the
reset value 0001H. Generally, in COMPARATOR 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. If using the timer output function, configure the associated GPIO port pin for the timer
output alternate function.
6. Write to the Timer Control Register to enable the timer.
In COMPARATOR COUNTER Mode, the number of comparator output transitions is cal-
culated with the following equation:
Comparator Output Transitions = Current Count Value – Start Value
PS025113-1212
Operation