Timer/Pulse-Width Modulator (S08TPMV2)
MC9S08AW60 Data Sheet, Rev.1.0
Freescale Semiconductor
167
A 16-bit channel value register (TPMxCnVH:TPMxCnVL)
Refer to the direct-page register summary in the Memory chapter of this data sheet for the absolute address
assignments for all TPM registers. This section refers to registers and control bits only by their names. A
Freescale-provided equate or header le is used to translate these names into the appropriate absolute
addresses.
Some MCU systems have more than one TPM, so register names include placeholder characters to identify
which TPM and which channel is being referenced. For example, TPMxCnSC refers to timer (TPM) x,
channel n and TPM1C2SC is the status and control register for timer 1, channel 2.
10.4.1
Timer x Status and Control Register (TPMxSC)
TPMxSC contains the overow status ag and control bits that are used to congure the interrupt enable,
TPM conguration, clock source, and prescale divisor. These controls relate to all channels within this
timer module.
76543210
RTOF
TOIE
CPWMS
CLKSB
CLKSA
PS2
PS1
PS0
W
Reset
00000000
= Unimplemented or Reserved
Figure 10-3. Timer x Status and Control Register (TPMxSC)
Table 10-1. TPMxSC Register Field Descriptions
Field
Description
7
TOF
Timer Overow Flag — This ag is set when the TPM counter changes to 0x0000 after reaching the modulo
value programmed in the TPM counter modulo registers. When the TPM is congured for CPWM, TOF is set
after the counter has reached the value in the modulo register, at the transition to the next lower count value.
Clear TOF by reading the TPM status and control register when TOF is set and then writing a 0 to TOF. If another
TPM overow occurs before the clearing sequence is complete, the sequence is reset so TOF would remain set
after the clear sequence was completed for the earlier TOF. Reset clears TOF. Writing a 1 to TOF has no effect.
0 TPM counter has not reached modulo value or overow
1 TPM counter has overowed
6
TOIE
Timer Overow Interrupt Enable — This read/write bit enables TPM overow interrupts. If TOIE is set, an
interrupt is generated when TOF equals 1. Reset clears TOIE.
0 TOF interrupts inhibited (use software polling)
1 TOF interrupts enabled
5
CPWMS
Center-Aligned PWM Select — This read/write bit selects CPWM operating mode. Reset clears this bit so the
TPM operates in up-counting mode for input capture, output compare, and edge-aligned PWM functions. Setting
CPWMS recongures the TPM to operate in up-/down-counting mode for CPWM functions. Reset clears
CPWMS.
0 All TPMx channels operate as input capture, output compare, or edge-aligned PWM mode as selected by the
MSnB:MSnA control bits in each channel’s status and control register
1 All TPMx channels operate in center-aligned PWM mode