MCF548x Reference Manual, Rev. 3
Freescale Semiconductor 11-1

Chapter 11

General Purpose Timers (GPT)

11.1 Introduction

This chapter describes the operation of the MCF548x general purpose timers.

11.1.1 Overview

The MCF548x has four general-purpose timers (GPT[0:3]) that are configurable for the following
functions:
Input capture
Output capture
Pulse width modulation (PWM) output
•Simple GPIO
Internal CPU timer
Watchdog timer (on GPT0 only)
Timer modules run off the internal peripheral bus clock. Each timer is associated to a single I/O signal.
Each timer has a 16-bit prescaler and 16-bit counter, thus achieving a 32-bit range (but only 16-bit
resolution).

11.1.2 Modes of Operation

The following gives a brief description of the available GPT modes:
1. Input Capture—When enabled in this mode, the counters run until the specified capture event
occurs (rise, fall, or pulse) on TIN[3:0]. At the capture event, the counter value is latched in the
status register. When this occurs, a CPU interrupt is generated.
2. Output Capture—When enabled in this mode, the counters run until they reach the programmed
terminal count value. At this point, the specified output event is generated (toggle, pulse high, or
pulse low) on TOUT[3:0]. When this occurs, a CPU interrupt is generated.
3. PWM (pulse width modulation)—In this mode the user can program period and width values to
create an adjustable, repeating output waveform on TOUT[3:0]. A CPU interrupt can be
generated at the beginning of each PWM period, at which time a new width value can be loaded.
The new width value, which represents “ON time,” is automatically applied at the beginning of
the next period. This mode is suitable for PWM audio encoding.
4. Simple GPIO—In this mode TOUT[3:0] and TIN[3:0] operate as a GPIO. Either TOUT[3:0] or
TIN[3:0] are specified, according to the programmable GPIO field. GPIO mode is mutually
exclusive of modes 1 through 3 (listed above). In GPIO mode, modes 5 through 6 (listed below)
remain available.
5. CPU Timer—The I/O signal is not used in this mode. Once enabled, the counters run until they
reach a programmed terminal count. When this occurs, an interrupt can be generated to the CPU.
This timer mode can be used simultaneously with the simple GPIO mode.