English
Language : 

Z8F1680SH020SG Datasheet, PDF (113/412 Pages) Zilog, Inc. – High-Performance 8-Bit Microcontrollers
Z8 Encore! XP® F1680 Series
Product Specification
88
One-Shot time-out. First set the TPOL bit in the Timer Control 1 Register to the start value
before beginning ONE-SHOT Mode. Then, after starting the timer, set TPOL to the oppo-
site bit value.
Observe the following steps to configure a timer for ONE-SHOT Mode and to initiate the
count:
1. Write to the Timer Control 1 Register to:
– Disable the timer
– Configure the timer for ONE-SHOT Mode
– Set the prescale value
– If using the Timer Output alternate function, set the initial output level (High or
Low)
2. Write to the Timer Control 2 Register to choose the timer clock source.
3. Write to the Timer Control 0 Register to set the timer interrupt configuration field
TICONFIG.
4. Write to the Timer High and Low Byte registers to set the starting count value.
5. Write to the Timer Reload High and Low Byte registers to set the reload value.
6. If required, enable the timer interrupt and set the timer interrupt priority by writing to
the relevant interrupt registers.
7. If using the Timer Output function, configure the associated GPIO port pin for the
Timer Output alternate function.
8. Write to the Timer Control 1 Register to enable the timer and initiate counting.
In ONE-SHOT Mode, the timer clock always provides the timer input. The timer period is
calculated using the following equation:
ONE-SHOT Mode Time-Out Period (s) = R----e---l--o---a--d-----V----a---l--u---e---------S---t--a--r--t----V----a---l-u---e------x---P----r--e--s---c--a---l--e-
Timer Clock Frequency (Hz)
9.2.3.2. TRIGGERED ONE-SHOT Mode
In TRIGGERED ONE-SHOT Mode, the timer operates in the following sequence:
1. The Timer idles until a trigger is received. The Timer trigger is taken from the GPIO
port pin timer input alternate function. The TPOL bit in the Timer Control 1 Register
selects whether the trigger occurs on the rising edge or the falling edge of the timer
input signal.
2. Following the trigger event, the Timer counts timer clocks up to the 16-bit reload
value stored in the Timer Reload High and Low Byte registers.
PS025015-1212
PRELIMINARY
Timers