
MC68331
USER’S MANUAL
GENERAL-PURPOSE TIMER
MOTOROLA
7-1
7
SECTION 7GENERAL-PURPOSE TIMER
This section is an overview of GPT function. Refer to the GPT Reference Manual(GP-
TRM/AD) for complete information about the GPT module.
7.1 General
The 11-channel general-purpose timer (GPT) is used in systems where a moderate
level of CPU control is required. The GPT consists of a capture/compare unit, a pulse
accumulator, and two pulse-width modulators. A bus interface unit connects the GPT
to the intermodule bus (IMB).
The capture/compare unit features three input capture channels, four output compare
channels, and one channel that can be selected as an input capture or output compare
channel. These channels share a 16-bit free-running counter which derives its clock
from a nine-stage prescaler or from the external clock input signal, PCLK.
Pulse accumulator channel logic includes an 8-bit counter; the pulse accumulator can
operate in either event counting mode or gated time accumulation mode.
Pulse-width modulator outputs are periodic waveforms whose duty cycles can be in-
dependently selected and modified by user software. The PWM circuits share a 16-bit
free-running counter that can be clocked by the same nine-stage prescaler used by
the capture/compare unit or by the PCLK input.
All GPT pins can also be used for general-purpose input/output. The input capture and
output compare pins form a bidirectional 8-bit parallel port (PORTGP). PWM pins are
outputs only. PAI and PCLK pins are inputs only.