mc68331cpv20b1 Freescale Semiconductor, Inc, mc68331cpv20b1 Datasheet - Page 162

no-image

mc68331cpv20b1

Manufacturer Part Number
mc68331cpv20b1
Description
Mc68331 32 Bit Microcontroller
Manufacturer
Freescale Semiconductor, Inc
Datasheet
7
7.3.4 Test Mode
7.4 Polled and Interrupt-Driven Operation
7.4.1 Polled Operation
7-4
Test mode is used during Freescale factory testing. The GPT has no dedicated test-
mode control register; all GPT testing is done under control of the system integration
module.
Normal GPT function can be polled or interrupt-driven. All GPT functions have an as-
sociated status flag and an associated interrupt. The timer interrupt flag registers
(TFLG1 and TFLG2) contain status flags used for polled and interrupt-driven opera-
tion. The timer mask registers (TMSK1 and TMSK2) contain interrupt control bits. Con-
trol routines can monitor GPT operation by polling the status registers. When an event
occurs, the control routine transfers control to a service routine that handles that event.
If interrupts are enabled for an event, the GPT requests interrupt service when the
event occurs. Using interrupts does not require continuously polling the status flags to
see if an event has taken place. However, status flags must be cleared after an inter-
rupt is serviced, in order to disable the interrupt request.
When an event occurs in the GPT, that event sets a status flag in TFLG1 or TFLG2.
The GPT sets the flags; they cannot be set by the CPU. TFLG1 and TFLG2 are 8-bit
registers that can be accessed individually or as one 16-bit register. The registers are
initialized to zero at reset. Table 7-1 shows status flag assignment.
For each bit in TFLG1 and TFLG2 there is a corresponding bit in TMSK1 and TMSK2
in the same bit position. If a mask bit is set and an associated event occurs, a hardware
interrupt request is generated.
To re-enable a status flag after an event occurs, the status flags must be cleared. Sta-
tus registers are cleared in a particular sequence. The 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
occurs between the time that the register is read and the time that it is written, the as-
sociated flag is not cleared.
Mnemonic
PAOVF
I4/O5F
OC1F
OC2F
OC3F
OC4F
PAIF
Flag
IC1F
IC2F
IC3F
TOF
Freescale Semiconductor, Inc.
For More Information On This Product,
Assignment
Register
TFLG1
TFLG1
TFLG1
TFLG1
TFLG1
TFLG1
TFLG1
TFLG1
TFLG2
TFLG2
TFLG2
Table 7-1 GPT Status Flags
GENERAL-PURPOSE TIMER
Go to: www.freescale.com
Input Capture 4/Output Compare 5
Pulse Accumulator Overflow
Pulse Accumulator Input
Output Compare 1
Output Compare 2
Output Compare 3
Output Compare 4
Input Capture 1
Input Capture 2
Input Capture 3
Timer Overflow
Source
USER’S MANUAL
MC68331

Related parts for mc68331cpv20b1