Chapter 9
16-bit Timer
16-bit High-Precision PWM Output (with Continuously Variable Period/Duty) IX - 35
9.7 16-bit High-Precision PWM Output
(with
Continuously Variable
Period/Duty)
9.7.1 Operation
In the high-precision PWM output function, a PWM waveform with a given period and duty cycle can be gener-
ated and output from TMnIO pin.
16-bit High-Precision PWM Output Operation
PWM waveform with a given period and duty cycle is generated by setting TMnOC1 to the PWM period and set-
ting TMnOC2 to "High" period of the PWM duty.
Count Timing of High-Precision PWM Output (at Normal)
Figure:9.7.1 Count Timing of High Precision PWM Output (at Normal)
PWM output waveform:
• (A) PWM output is "High" while the binary counter counts up from "0x0000" to the setting value of the com-
pare register 2.
• (B) PWM output changes to "Low" when the binary counter matches the setting value of the compare register
2, then the binary counter continues counting up until the binary counter is cleared by the TMnOC1 com-
pare match.
• (C) PWM output returns to "High" when the binary counter is cleared.
N
M+1 M+2 N-1
N
ount
lock
MnEN
it
ompare
egister 1
inary
ounter
0000 0001 M+
M-1
M
0000 0001 M-1
M
MnIO output
PWM output)
PWM basic waveform
{Count time:(Compare registser 1 setting value + 1)}
(A)
(B)
(C)
M
ompare
egister 2
Count time:
(Compare registser 2 setting value + 1)