
MOTOROLA
CONFIGURABLE TIMER MODULE 4
MC68336/376
10-14
USER’S MANUAL
10.9.3 PWMSM Counter
The 16-bit up counter in the PWMSM provides the time base for the PWM output sig-
nal. The counter is held in the $0001 state after reset or when the PWMSM is disabled.
When the PWMSM is enabled, the counter begins counting at the rate selected by
CLK[2:0] in PWMSIC. Each time the counter matches the contents of the period reg-
ister, the counter is preset to $0001 and starts to count from that value. The counter
can be read at any time from the PWMC register without affecting its value. Writing to
the counter has no effect.
10.9.4 PWMSM Period Registers and Comparator
The period section of the PWMSM consists of two 16-bit period registers (PWMA1 and
PWMA2) and one 16-bit comparator. PWMA2 holds the current PWM period value,
and PWMA1 holds the next PWM period value. The next period of the output PWM
signal is established by writing a value into PWMA1. PWMA2 acts as a double buffer
for PWMA1, allowing the contents of PWMA1 to be changed at any time without af-
fecting the period of the current output signal. PWMA2 is not user accessible. PWMA1
can be read or written at any time. The new value in PWMA1 is transferred to PWMA2
on the next full cycle of the PWM output or when a one is written to the LOAD bit in
PWMSIC.
The comparator continuously compares the contents of PWMA2 with the value in the
PWMSM counter. When a match occurs, the state sequencer sets the output flip-flop
and resets the counter to $0001.
Period values $0000 and $0001 are special cases. When PWMA2 contains $0000, an
output period of 65536 PWM clock periods is generated.
When PWMA2 contains $0001, a period match occurs on every PWM clock period.
The counter never increments beyond $0001, and the output level never changes.
NOTE
Values of $0002 in the period register (PWMA2) and $0001 in the
pulse width register (PWMB2) result in the maximum possible output
frequency for a given PWM counter clock frequency.
Table 10-4 PWMSM Divide By Options
CLK2
CLK1
CLK0
PCLK1 = fsys ÷ 2
(CPCR DIV23 = 0)
PCLK1 = fsys ÷ 3
(CPCR DIV23 = 0)
000
fsys ÷ 2fsys ÷ 3
001
fsys ÷ 4fsys ÷ 6
010
fsys ÷ 8fsys ÷ 12
011
fsys ÷ 16
fsys ÷ 24
100
fsys ÷ 32
fsys ÷ 48
101
fsys ÷ 64
fsys ÷ 96
110
fsys ÷ 128
fsys ÷ 192
111
fsys ÷ 512
fsys ÷ 768
336376UMBook Page 14 Friday, November 15, 1996 2:09 PM