English
Language : 

Z8FMC16100 Datasheet, PDF (122/402 Pages) Zilog, Inc. – Z8 Encore-R Motor Control Flash MCUs
Z8 Encore!® Motor Control Flash MCUs
Product Specification
100
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.
Capture/Compare Mode. CAPTURE/COMPARE mode is identical to CAPTURE
RESTART mode, except that counting does not start until the first external Timer Input
transition occurs. Every subsequent transition (after the first) of the Timer Input signal
captures the current count value. When the capture event occurs, an interrupt is generated,
the count value in the Timer High and Low Byte registers is reset to 0001h, and counting
resumes. If no capture event occurs, upon reaching the compare value, the timer generates
an interrupt, the count value in the Timer High and Low Byte registers is reset to 0001h,
and counting resumes.
The steps for configuring a timer for one of these capture 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 the selected capture mode.
c. Set the prescale value.
d. Set the capture edge (rising or falling) for the Timer Input.
e. Configure the timer interrupt to be generated at the input capture event, the reload
event, or both, by setting the TICONFIG field.
2. Write to the Timer High and Low Byte registers to set the starting count value (typi-
cally 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. Write to the Timer Control 1 Register to enable the timer. In CAPTURE and CAP-
TURE RESTART modes, the timer begins counting. In CAPTURE COMPARE
mode, the timer does not start counting until the first input transition occurs.
In capture modes, the elapsed time from a timer start to a capture event can be calculated
using the following equation (Start Value is typically = 1):
(Capture Value – Start Value +1) x Prescale
Capture Elapsed Time (s) =
System Clock Frequency (Hz)
General-Purpose Timer
PRELIMINARY
PS024604-1005