English
Language : 

Z8FMC16100 Datasheet, PDF (119/402 Pages) Zilog, Inc. – Z8 Encore-R Motor Control Flash MCUs
Z8FMC16100 Series Flash MCU
Product Specification
97
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.
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.
The steps for configuring a timer for COUNTER and COMPARATOR COUNTER modes
and initiating the count are as follows:
1. Write to the Timer Control registers to:
a. Disable the timer.
b. Configure the timer for COUNTER or COMPARATOR COUNTER mode.
c. Select either the rising edge or falling edge of the Timer Input or comparator out-
put signal for the count. This choice also sets the initial logic level (High or Low)
for the Timer Output alternate function. However, the Timer Output function does
not have to be enabled.
2. Write to the Timer High and Low Byte registers to set the starting count value. This
setting only affects the first pass in the counter modes. After the first timer reload,
counting begins at the reset value of 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
(COUNTER mode).
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 1 Register to enable the timer.
PWM Single and Dual Output Modes
In PWM SINGLE OUTPUT mode, the timer outputs a Pulse-Width Modulator (PWM)
output signal through a GPIO port pin. In PWM DUAL OUTPUT mode, the timer outputs
a Pulse-Width Modulator (PWM) output signal and also its complement through two
GPIO port pins. The timer first counts up to the 16-bit PWM match value stored in the
Timer PWM High and Low Byte registers. When the timer count value matches the PWM
value, the Timer Output toggles. The timer continues counting until it reaches the reload
value stored in the Timer Reload High and Low Byte registers. Upon reaching the reload
value, the timer generates an interrupt, the count value in the Timer High and Low Byte
registers is reset to 0001h, and counting resumes.
PS024604-1005
PRELIMINARY
Timer Operating Modes