MOTOROLA
7-6
GENERAL-PURPOSE TIMER
MC68331
USER’S MANUAL
7
At reset, IVBA is initialized to $0. To enable interrupt-driven timer operation, the upper
nibble ($4–$F) of a user-defined vector number ($40–$FF) must be written to IVBA,
and interrupt handler routines must be located at the addresses pointed to by the cor-
responding vector. Note that IVBA must be written before GPT interrupts are enabled,
or the GPT could supply a vector number ($00 to $0F) that corresponds to an assigned
or reserved exception vector.
The internal GPT interrupt priority hierarchy is shown in
Table 7-2
. The lower the in-
terrupt source number, the higher the priority. A single GPT interrupt source can be
given priority over all other GPT interrupt sources by assigning the priority adjust field
(PAB) in the ICR a value equal to its source number.
Interrupt requests are asserted until associated status flags are cleared. Status flags
must be cleared in a particular sequence. The status register must first be read for set
flags, then zeros must be written to the flags that are to be cleared. If a new event oc-
curs between the time that the register is read and the time that it is written, the asso-
ciated flag is not cleared.
Refer to
SECTION 5 CENTRAL PROCESSING UNIT
and
SECTION 4 SYSTEM IN-
TEGRATION MODULE
for more information about exceptions and interrupts.
7.5 Pin Descriptions
The GPT uses 12 pins. Each pin can perform more than one function. Descriptions of
GPT pins divided into functional groups follow.
7.5.1 Input Capture Pins (IC[1:3])
Each of these pins is associated with a single GPT input capture function. Each pin
has hysteresis. Any pulse longer than two system clocks is guaranteed to be valid and
any pulse shorter than one system clock is ignored. Each pin has an associated 16-bit
capture register that holds the captured counter value. These pins can also be used
for general-purpose I/O. Refer to
7.8.2 Input Capture Functions
for more informa-
tion.
7.5.2 Input Capture/Output Compare Pin (IC4/OC5)
This pin can be configured for use by either an input capture or an output compare
function. It has an associated 16-bit register that is used for holding either the input
capture value or the output match value. When used for input capture the pin has the
same hysteresis as other input capture pins. The pin can be used for general-purpose
I/O. Refer to
7.8.2 Input Capture Functions
and
7.8.3 Output Compare Functions
for more information.
7.5.3 Output Compare Pins (OC[1:4])
These pins are used for GPT output compare functions. Each pin has an associated
16-bit compare register and a 16-bit comparator. Pins OC2, OC3, and OC4 are asso-
ciated with a specific output compare function. The OC1 function can affect the output
of all compare pins. If the OC1 pin is not needed for an output compare function it can