Chapter 16 Timer/PWM Module (S08TPMV3)
MC9S08SG8 MCU Series Data Sheet, Rev. 6
256
Freescale Semiconductor
16.5
Reset Overview
16.5.1
General
The TPM is reset whenever any MCU reset occurs.
16.5.2
Description of Reset Operation
Reset clears the TPMxSC register which disables clocks to the TPM and disables timer overow interrupts
(TOIE=0). CPWMS, MSnB, MSnA, ELSnB, and ELSnA are all cleared which congures all TPM
channels for input-capture operation with the associated pins disconnected from I/O pin logic (so all MCU
pins related to the TPM revert to general purpose I/O pins).
16.6
Interrupts
16.6.1
General
The TPM generates an optional interrupt for the main counter overow and an interrupt for each channel.
The meaning of channel interrupts depends on each channel’s mode of operation. If the channel is
congured for input capture, the interrupt ag is set each time the selected input capture edge is
recognized. If the channel is congured for output compare or PWM modes, the interrupt ag is set each
time the main timer counter matches the value in the 16-bit channel value register.
All TPM interrupts are listed in
Table 16-9 which shows the interrupt name, the name of any local enable
that can block the interrupt request from leaving the TPM and getting recognized by the separate interrupt
processing logic.
The TPM module will provide a high-true interrupt signal. Vectors and priorities are determined at chip
integration time in the interrupt module so refer to the user’s guide for the interrupt module or to the chip’s
complete documentation for details.
16.6.2
Description of Interrupt Operation
For each interrupt source in the TPM, a ag bit is set upon recognition of the interrupt condition such as
timer overow, channel-input capture, or output-compare events. This ag may be read (polled) by
software to determine that the action has occurred, or an associated enable bit (TOIE or CHnIE) can be set
Table 16-9. Interrupt Summary
Interrupt
Local
Enable
Source
Description
TOF
TOIE
Counter overow
Set each time the timer counter reaches its terminal
count (at transition to next count value which is
usually 0x0000)
CHnF
CHnIE
Channel event
An input capture or output compare event took
place on channel n