English
Language : 

Z8F1680SH020SG Datasheet, PDF (149/412 Pages) Zilog, Inc. – High-Performance 8-Bit Microcontrollers
Z8 Encore! XP® F1680 Series
Product Specification
124
10.3. Capture/Compare Channel Operation
The Multi-Channel timer supports four Capture/Compare channels: CHA, CHB, CHC and
CHD. Each channel has the following features:
• A 16-bit Capture/Compare Register (MCTCHyH and MCTCHyL registers) used to
capture input event times or to generate time intervals. Any user software update of the
Capture/Compare Register value when the timer is running takes effect only at the end
of the counting cycle, not immediately. The end of the counting cycle is when the coun-
ter transitions from the reload value to 0 (count modulo mode) or from 1 to 0 (count up/
down mode).
• A dedicated bidirectional pin (T4CHA, T4CHB, T4CHC, or T4CHD) that can be con-
figured for the input capture function or to generate an output compare match or one-
shot pulse.
Each channel is configured to operate in ONE-SHOT COMPARE, CONTINUOUS
COMPARE, PWM OUTPUT, or INPUT CAPTURE mode.
10.3.1. One-Shot Compare Operation
In a ONE-SHOT COMPARE operation, a channel interrupt is generated when the channel
compare value matches the timer count. The channel event flag (CHyEF) is set in the
Channel Status 1 Register (MCTCHS1) to identify the responsible channel. The channel is
then automatically disabled. The timer continues counting according to the programmed
mode. If the timer channel output alternate function is enabled, the channel output pin
(T4CHA, T4CHB, T4CHC, or T4CHD) changes state for one system clock cycle upon
match (i.e., from Low to High, then back to Low or High to Low, then back to High as
determined by the CHPOL bit).
10.3.2. Continuous Compare Operation
In a CONTINUOUS COMPARE operation, a channel interrupt is generated when the
channel compare value matches the timer count. The channel event flag (CHyEF) is set in
the Channel Status 1 Register (MCTCHS1) and the channel remains enabled. The timer
continues counting according to the programmed mode. If the channel output alternate
function is enabled, the channel output pin (T4CHA, T4CHB, T4CHC, or T4CHD)
changes state upon match (i.e., from Low to High then back to Low; or High to Low then
back to High, as determined by the CHPOL bit).
PS025015-1212
PRELIMINARY
Multi-Channel Timer