
TIMER A
7721 Group User’s Manual
8–43
8.6 Pulse width modulation (PWM) mode
8.6.4 Operation in PWM mode
When the PWM mode is selected with the operating mode select bits, the TAjOUT pin outputs “L” level.
When a trigger is generated, the counter (pulse width modulator) starts counting and the TAjOUT pin
outputs a PWM pulse (Notes 1 and 2).
The timer Aj interrupt request bit is set to “1” each time the PWM pulse level goes from “H” to “L.”
The interrupt request bit remains set to “1” until the interrupt request is accepted or the interrupt request
bit is cleared to “0” by software.
Each time a PWM pulse has been output for one period, the reload register’s contents are reloaded and
the counter continues counting.
The following explains operations of the pulse width modulator.
(1)
16-bit pulse width modulator
When the 16/8-bit PWM mode select bit is set to “0,” the counter operates as a 16-bit pulse width
modulator. Figures 8.6.4 and 8.6.5 show operation examples of the 16-bit pulse width modulator.
(2)
8-bit pulse width modulator
When the 16/8-bit PWM mode select bit is set to “1,” the counter is divided into 8-bit halves. Then,
the high-order 8 bits operate as an 8-bit pulse width modulator, and the low-order 8 bits operate as
an 8-bit prescaler. Figures 8.6.6 and 8.6.7 show operation examples of the 8-bit pulse width modulator.
Notes 1: If a value “000016” is set into the timer Aj register when the counter operates as a 16-bit
pulse width modulator, the pulse width modulator does not operate and the output from the
TAjOUT pin remains “L” level. The timer Aj interrupt request does not occur. Similarly, if a
value “0016” is set into the high-order 8 bits of the timer Aj register when the counter
operates as an 8-bit pulse width modulator, the same is performed.
2: When the counter operates as an 8-bit pulse width modulator, after a trigger is generated,
the TAjOUT pin outputs “L” level which has the same width as “H” level width of the PWM
pulse, which was set. After that, the PWM pulse output starts from the TAjOUT pin.