![](http://datasheet.mmic.net.cn/30000/M30956FKTGP_datasheet_2359453/M30956FKTGP_183.png)
14.1.4
Pulse Width Modulation Mode
In pulse width modulation mode, the timer outputs pulse signals of a given width repeatedly. The counter
functions as an 8-bit pulse width modulator or 16-bit pulse width modulator.
to 4) in pulse width modulation mode. Figures
14.18 and
14.19 show examples of a 16-bit pulse width
modulator and 8-bit pulse width modulator operations.
Table 14.7
Specifications of Pulse Width Modulation Mode
NOTE:
1. Bits CNT3 to CNT0 in the TCSPR register select no division (n = 0) or divide-by-2n (n = 1 to 15).
Item
Specification
Count sources
Counting operations
The timer decrements a counter value
(The counter functions as the 8-bit or 16-bit pulse width modulator.)
The contents of the reload register are reloaded at the rising edge of the PWM
pulse and the counter is decremented. The count continues even if the
re-trigger occurs while counting.
16-bit PWM
“H” width = n / fj
n: setting value of the TAi register (i = 0 to 4), 0000h to FFFEh
fj: count source frequency
Cycle = (216 - 1) / fj fixed
8-bit PWM
“H” width = n x (m + 1) / fj
Cycle = (28 - 1) x (m + 1) / fj fixed
m: setting value of low-order bit address of the TAi register, 00h to FFh
n: setting value of high-order bit address of the TAi register, 00h to FEh
Count start condition
When not using a trigger
Set the TAiS bit in the TABSR register to 1
When using a trigger
A trigger, selectable from the following occurs while the TAiS bit in the TABSR
register is set to 1(count starts):
an external trigger is applied to TAiIN pin
timer B2 overflows or underflows
timer Aj overflows or underflows (j = i - 1, except j = 4 if i = 0)
timer Ak overflows or underflows (k = i + 1, except k = 0 if i = 4)
Count stop condition
The TAiS bit is set to 0 (count stops)
Interrupt request generation timing At the falling edge of the PWM pulse
TAiIN pin function
Trigger input
TAiOUT pin function
Pulse output
Read from timer
The TAi register cannot be read
Write to timer
When a value is written to the TAi register while the count is stopped, the value
is written to both the reload register and the counter.
When a value is written to the TAi register while counting, the value is written to
the reload register (It is transferred to the counter at the next reload timing).