English
Language : 

Z8F4822AR020SG Datasheet, PDF (88/323 Pages) Zilog, Inc. – High Performance 8-Bit Microcontrollers
Z8 Encore! XP® F64xx Series
Product Specification
68
If TPOL is set to 0, the ratio of the PWM output High time to the total period is calculated
using the following equation:
PWM Output High Time Ratio (%)
=
R-----e--l--o---a---d----V----a---l--u---e----–----P----W-----M-------V-----a--l--u---e-
Reload Value

100
If TPOL is set to 1, the ratio of the PWM output High time to the total period is calculated
using the following equation:
PWM Output High Time Ratio (%)
=
--P---W------M-------V----a---l-u---e---
Reload Value

100
CAPTURE Mode
In CAPTURE Mode, the current timer count value is recorded when the appropriate exter-
nal timer input transition occurs. The Capture count value is written to the Timer PWM
High and Low Byte Registers. The timer input is the system clock. 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. When the capture event occurs, an interrupt is generated
and the timer continues counting.
The timer continues counting up to the 16-bit reload value stored in the Timer Reload
High and Low Byte registers. Upon reaching the reload value, the timer generates an inter-
rupt and continues counting.
Observe the following procedure for configuring a timer for CAPTURE Mode and initiat-
ing the count:
1. Write to the Timer Control 1 Register to:
– Disable the timer
– Configure the timer for CAPTURE Mode
– Set the prescale value
– Set the Capture edge (rising or falling) for the timer input
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. Clear the Timer PWM High and Low Byte registers to 0000H. This allows the soft-
ware to determine if interrupts were generated by either a capture event or a reload. If
the PWM High and Low Byte registers still contain 0000H after the interrupt, then the
interrupt was generated by a reload.
5. If appropriate, enable the timer interrupt and set the timer interrupt priority by writing
to the relevant interrupt registers.
PS019924-0113
PRELIMINARY
Operation