English
Language : 

Z8F1680SH020SG Datasheet, PDF (128/412 Pages) Zilog, Inc. – High-Performance 8-Bit Microcontrollers
Z8 Encore! XP® F1680 Series
Product Specification
103
9. Counting begins on the first transition of the Timer Input signal. No interrupt is gener-
ated by this first edge.
In CAPTURE/COMPARE Mode, the elapsed time from timer start to Capture event is cal-
culated using the following equation:
Capture Elapsed Time (s) = ---C----a---p---t-u---r--e----V-----a--l--u---e---------S---t--a--r--t----V----a---l-u---e------------P---r--e---s--c---a--l--e-
Timer Clock Frequency (Hz)
9.2.3.13. DEMODULATION Mode
In DEMODULATION Mode, the timer begins counting on the first external Timer Input
transition. The appropriate transition (rising edge or falling edge or both) is set by the
TPOL bit in the Timer Control 1 Register and TPOLHI bit in the Timer Control 2 Register.
The Timer counts timer clocks up to the 16-bit reload value.
Every subsequent appropriate transition (after the first) of the Timer Input signal captures
the current count value. The Capture value is written to the Timer PWM0 High and Low
Byte registers for rising input edges of the timer input signal. For falling edges the capture
count value is written to the Timer PWM1 High and Low Byte registers. The TPOL bit in
the Timer Control 1 Register determines if the Capture occurs on a rising edge or a falling
edge of the Timer Input signal. If the TPOLHI bit in the Timer Control 2 Register is set, a
Capture is executed on both the rising and falling edges of the input signal.
Whenever the Capture event occurs, an interrupt is generated and the timer continues
counting. The corresponding event flag bit in the Timer Status Register, PWMxEF, is set
to indicate that the timer interrupt is due to an input Capture event.
The timer counts up to the 16-bit Compare 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. The RTOEF event flag bit in the Timer Status Register is set to indicate that the
timer interrupt is due to a Reload event. Software can use this bit to determine if a Reload
occurred prior to a Capture.
Observe the following steps to configure a timer for DEMODULATION Mode and initiate
the count:
1. Write to the Timer Control 1 Register to:
– Disable the timer
PS025015-1212
PRELIMINARY
Timers