mc68hc916y3 Freescale Semiconductor, Inc, mc68hc916y3 Datasheet - Page 299

no-image

mc68hc916y3

Manufacturer Part Number
mc68hc916y3
Description
Mc68hc16y3 16 Bit Microcontroller
Manufacturer
Freescale Semiconductor, Inc
Datasheet
13.8 Capture/Compare Unit
13.8.1 Timer Counter
13.8.2 Input Capture Functions
MC68HC16Y3/916Y3
USER’S MANUAL
The capture/compare unit contains the timer counter (TCNT), the input capture (IC)
functions and the output compare (OC) functions. Figure 13-3 is a block diagram of
the capture/compare unit.
The timer counter (TCNT) is the key timing component in the capture/compare unit.
The timer counter is a 16-bit free-running counter that starts counting after the
processor comes out of reset. The counter cannot be stopped during normal
operation. After reset, the GPT is configured to use the system clock divided by four
as the input to the counter. The prescaler divides the system clock and provides
selectable input frequencies. User software can configure the system to use one of
seven prescaler outputs or an external clock.
The counter can be read any time without affecting its value. Because the GPT is
interfaced to the IMB, and the IMB supports a 16-bit bus, a word read gives a coherent
value. If coherency is not needed, byte accesses can be made. The counter is set to
$0000 during reset and is normally a read-only register. In test mode and freeze mode,
any value can be written to the timer counter.
When the counter rolls over from $FFFF to $0000, the timer overflow flag (TOF) in tim-
er interrupt flag register 2 (TFLG2) is set. An interrupt can be enabled by setting the
corresponding interrupt enable bit (TOI) in timer interrupt mask register 2 (TMSK2).
Refer to 13.4.2 GPT Interrupts for more information.
All GPT input capture functions use the same 16-bit timer counter (TCNT). Each input
capture pin has a dedicated 16-bit latch and input edge-detection/selection logic. Each
input capture function has an associated status /selection logic. Each input capture
function has an associated status flag, and can cause the GPT to make an interrupt
service request.
When a selected edge transition occurs on an input capture pin, the associated 16-bit
latch captures the content of TCNT and sets the appropriate status flag. An interrupt
request can be generated when the transition is detected.
Freescale Semiconductor, Inc.
For More Information On This Product,
GENERAL-PURPOSE TIMER
Go to: www.freescale.com
MOTOROLA
13-11

Related parts for mc68hc916y3