English
Language : 

MC68HC08GZ32 Datasheet, PDF (237/320 Pages) Freescale Semiconductor, Inc – Microcontrollers
Chapter 17
Timebase Module (TBM)
17.1 Introduction
This section describes the timebase module (TBM). The TBM will generate periodic interrupts at user
selectable rates using a counter clocked by the external clock source. This TBM version uses 15 divider
stages, eight of which are user selectable. A mask option bit to select an additional 128 divide of the
external clock source can be selected. See Chapter 5 Mask Options.
17.2 Features
Features of the TBM module include:
• External clock or an additional divide-by-128 selected by mask option bit as clock source
• Software configurable periodic interrupts with divide-by: 8, 16, 32, 64, 128, 2048, 8192, and 32768
taps of the selected clock source
• Configurable for operation during stop mode to allow periodic wakeup from stop
17.3 Functional Description
This module can generate a periodic interrupt by dividing the clock source supplied from the clock
generator module, CGMXCLK.
The counter is initialized to all 0s when TBON bit is cleared. The counter, shown in Figure 17-1, starts
counting when the TBON bit is set. When the counter overflows at the tap selected by TBR2–TBR0, the
TBIF bit gets set. If the TBIE bit is set, an interrupt request is sent to the CPU. The TBIF flag is cleared
by writing a 1 to the TACK bit. The first time the TBIF flag is set after enabling the timebase module, the
interrupt is generated at approximately half of the overflow period. Subsequent events occur at the exact
period.
The timebase module may remain active after execution of the STOP instruction if the crystal oscillator
has been enabled to operate during stop mode through the OSCENINSTOP bit in the mask option
register. The timebase module can be used in this mode to generate a periodic wakeup from stop mode.
17.4 Interrupts
The timebase module can periodically interrupt the CPU with a rate defined by the selected TBMCLK and
the select bits TBR2–TBR0. When the timebase counter chain rolls over, the TBIF flag is set. If the TBIE
bit is set, enabling the timebase interrupt, the counter chain overflow will generate a CPU interrupt
request.
NOTE
Interrupts must be acknowledged by writing a 1 to the TACK bit.
MC68HC08GZ32 Data Sheet, Rev. 3
Freescale Semiconductor
237