Datasheet

Chapter 10 Timer/Pulse-Width Modulator (S08TPMV2)
MC9S08AW60 Data Sheet, Rev 2
168 Freescale Semiconductor
Figure 10-2. TPM Block Diagram
The central component of the TPM is the 16-bit counter that can operate as a free-running counter, a
modulo counter, or an up-/down-counter when the TPM is configured for center-aligned PWM. The TPM
counter (when operating in normal up-counting mode) provides the timing reference for the input capture,
output compare, and edge-aligned PWM functions. The timer counter modulo registers,
TPMxMODH:TPMxMODL, control the modulo value of the counter. (The values 0x0000 or 0xFFFF
effectively make the counter free running.) Software can read the counter value at any time without
affecting the counting sequence. Any write to either byte of the TPMxCNT counter resets the counter
regardless of the data value written.
PRESCALE AND SELECT
16-BIT COMPARATOR
MAIN 16-BIT COUNTER
16-BIT COMPARATOR
16-BIT LATCH
PORT
16-BIT COMPARATOR
16-BIT LATCH
CHANNEL 0
CHANNEL 1
INTERNAL BUS
LOGIC
INTERRUPT
PORT
LOGIC
16-BIT COMPARATOR
16-BIT LATCH
CHANNEL n
PORT
LOGIC
COUNTER RESET
DIVIDE BY
CLOCK SOURCE
OFF, BUS, XCLK, EXT
BUSCLK
XCLK
SELECT
SYNC
INTERRUPT
INTERRUPT
INTERRUPT
1, 2, 4, 8, 16, 32, 64, or 128
LOGIC
LOGIC
LOGIC
LOGIC
CLKSA
CLKSB
PS2 PS1 PS0
CPWMS
TOIE
TOF
ELS0A
CH0F
ELS0B
ELS1B ELS1A
ELSnB ELSnA
CH1F
CHnF
CH0IE
CH1IE
CHnIE
MS1B
MS0B
MSnB
MS0A
MS1A
MSnA
. . .
. . .
. . .
TPMxMODH:TPMxMODL
TPMxC0VH:TPMxC0VL
TPMxC1VH:TPMxC1VL
TPMxCnVH:TPMxCnVL
TPMxCHn
TPMxCH1
TPMxCH0
TPMxCLK