English
Language : 

Z8F1680SH020SG Datasheet, PDF (121/412 Pages) Zilog, Inc. – High-Performance 8-Bit Microcontrollers
Z8 Encore! XP® F1680 Series
Product Specification
96
transitions from a Low to High. This configuration ensures a time gap between the
removal of one PWM output and the assertion of its complement.
Observe the following steps to configure a timer for PWM DUAL OUTPUT Mode and
initiate the PWM operation:
1. Write to the Timer Control 1 Register to:
– Disable the timer
– Configure the timer for PWM DUAL OUTPUT Mode. Setting the mode also
involves writing to TMODE[3] bit in the TxCTL0 Register
– Set the prescale value
– Set the initial logic level (High or Low) and PWM High/Low transition for the
Timer Output Alternate Function
2. Write to the Timer High and Low Byte registers to set the starting count value (typi-
cally 0001H). This value only affects the first pass in PWM mode. After the first timer
reset in PWM mode, counting always begins at the reset value of 0001H.
3. Write to the Timer PWM0 High and Low Byte registers to set the PWM value.
4. Write to the Timer Control 0 Register:
– To set the PWM deadband delay value
– To choose the timer clock source
5. Write to the Timer Control 0 Register to set the timer interrupt configuration field
TICONFIG.
6. Write to the Timer Reload High and Low Byte registers to set the reload value (PWM
period). The reload value must be greater than the PWM value.
7. If appropriate, enable the timer interrupt and set the timer interrupt priority by writing
to the relevant interrupt registers.
8. Configure the associated GPIO port pin for the Timer Output and Timer Output Com-
plement alternate functions.
9. Write to the Timer Control 1 Register to enable the timer and initiate counting.
The PWM period is calculated using the following equation:
If an initial starting value other than 0001H is loaded into the Timer High and Low Byte
registers, the ONE-SHOT Mode equation must be used to determine the first PWM time-
out period.
If TPOL is set to 0, the ratio of the PWM output High time to the total period is calculated
using the following equation:
PS025015-1212
PRELIMINARY
Timers