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)
Count
clock
TMnEN
bit
Compare
register 1
Compare
register 2
Binary
0000 0001
counter
TMnIO output
(PWM output)
(A)
(Compare registser 2 setting value + 1)
{Count time:(Compare registser 1 setting value + 1)}
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.
M-1
M
M+1 M+2
(B)
Count time:
PWM basic waveform
16-bit High-Precision PWM Output (with Continuously Variable Period/Duty)
N
M
N-1
N
0000 0001
(C)
Chapter 9
16-bit Timer
M-1
M
M+1
IX - 35