TIMER A
7902 Group User’s Manual
9-39
9.6 Pulse width modulation (PWM) mode
9.6.3 Operation in PWM mode
When the PWM mode is selected with the operating mode select bits, the TAiOUT pin outputs “L” level.
When a trigger is generated, the counter (pulse width modulator) starts counting and the TAiOUT pin
outputs a PWM pulse (Notes 1 and 2).
The timer Ai 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 until 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 cleared to “0,” the counter operates as a 16-bit pulse width
modulator. Figures 9.6.4 and 9.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 9.6.6 and 9.6.7 show operation examples of the 8-bit pulse width modulator.
Notes 1: If a value “000016” is set into the timer Ai register when the counter operates as a 16-bit
pulse width modulator, the pulse width modulator does not operate and the output from the
TAiOUT pin remains “L” level. The timer Ai interrupt request does not occur. Similarly, if a
value “0016” is set into the high-order 8 bits of the timer Ai 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 TAiOUT pin outputs “L” level for a period of (1 / fi) ! (m + 1) ! (n + 1). After that, the
PWM pulse output will start.
In order to make the TA2OUT and TA3OUT pins serve as pulse output pins, be sure not to select the key input
interrupt pins (KI0 and KI2 pins), which are multiplexed with the above pins. (Refer to “CHAPTER 8. KEY
INPUT INTERRUPT.”)