
Timer Interface Module (TIM2)
Data Sheet
MC68HC908GR60A MC68HC908GR48A MC68HC908GR32A
282
Timer Interface Module (TIM2)
MOTOROLA
4.
In TIM2 channel x status and control register (T2SCx):
a.
Write 0:1 (for unbuffered output compare or PWM signals) or 1:0 (for
buffered output compare or PWM signals) to the mode select bits,
b.
Write 1 to the toggle-on-overflow bit, TOVx.
c.
Write 1:0 (polarity 1 — to clear output on compare) or 1:1 (polarity 0 —
to set output on compare) to the edge/level select bits, ELSxB:ELSxA.
The output action on compare must force the output to the complement
NOTE:
In PWM signal generation, do not program the PWM channel to toggle on output
compare. Toggling on output compare prevents reliable 0% duty cycle generation
and removes the ability of the channel to self-correct in the event of software error
or noise. Toggling on output compare can also cause incorrect PWM signal
generation when changing the PWM pulse width to a new, much larger value.
5.
In the TIM2 status control register (T2SC), clear the TIM2 stop bit, TSTOP.
Setting MS0B links channels 0 and 1 and configures them for buffered PWM
operation. The TIM2 channel 0 registers (T2CH0H:T2CH0L) initially control the
buffered PWM output. TIM2 status control register 0 (T2SC0) controls and
monitors the PWM signal from the linked channels. MS0B takes priority over
MS0A.
Setting MS2B links channels 2 and 3 and configures them for buffered PWM
operation. The TIM2 channel 2 registers (T2CH2H:T2CH2L) initially control the
buffered PWM output. TIM2 status control register 2 (T2SC2) controls and
monitors the PWM signal from the linked channels. MS2B takes priority over
MS2A.
Setting MS4B links channels 4 and 5 and configures them for buffered PWM
operation. The TIM2 channel 4 registers (T2CH4H:T2CH4L) initially control the
buffered PWM output. TIM2 status control register 4 (T2SC4) controls and
monitors the PWM signal from the linked channels. MS4B takes priority over
MS4A.
Clearing the toggle-on-overflow bit, TOVx, inhibits output toggles on TIM2
overflows. Subsequent output compares try to force the output to a state it is
already in and have no effect. The result is a 0% duty cycle output.
Setting the channel x maximum duty cycle bit (CHxMAX) and setting the TOVx bit