
TIMER A
7721 Group User’s Manual
8–40
8.6 Pulse width modulation (PWM) mode
8.6.1 Setting for PWM mode
Figures 8.6.2 and 8.6.3 show an initial setting example for registers relevant to the PWM mode.
Note that when using interrupts, set up to enable the interrupts. For details, refer to
“CHAPTER 7.
INTERRUPTS.”
Fig. 8.6.2 Initial setting example for registers relevant to PWM mode (1)
Note: When operating as 8-bit pulse width modulator
fi : Frequency of count source
However, if n = “0016”, the pulse width modulator
does not operate and the TAjOUT pin outputs “L”
level. At this time, no timer Aj interrupt request
occurs.
b7
b0
Count source select bits
0 0 : f2
0 1 : f16
1 0 : f64
1 1 : f512
11
Selecting PWM mode and each function
Timer Aj mode register (j = 2 to 4) (Addresses 5816 to 5A16)
b7 b6
1
16/8-bit PWM mode select bit
0 : Operates as 16-bit pulse width modulator
1 : Operates as 8-bit pulse width modulator
Continue to Figure 8.6.3.
Trigger select bits
0 0 :
0 1 :
1 0 : Falling edge of TAjIN pin’s input signal
1 1 : Rising edge of TAjIN pin’s input signal
b3
b4
Selection of PWM mode
Setting PWM pulse’s period and “H” level width
b7
b0
Can be set to “000016” to “FFFE16” (n)
(b15)
(b8)
b7
b0
Timer A2 register (Addresses 4B16, 4A16)
Timer A3 register (Addresses 4D16, 4C16)
Timer A4 register (Addresses 4F16, 4E16)
Note: When operating as 16-bit pulse width modulator
fi : Frequency of count source
However, if n = “000016”, the pulse width modulator does
not operate and the TAjOUT pin outputs “L” level. At this time,
no timer Aj interrupt request occurs.
q When operating as 16-bit pulse width modulator
b7
b0
Can be set to “0016” to “FF16” (m)
(b15)
(b8)
b7
b0
q When operating as 8-bit pulse width modulator
Can be set to “0016” to “FE16” (n)
Timer A2 register (Addresses 4B16, 4A16)
Timer A3 register (Addresses 4D16, 4C16)
Timer A4 register (Addresses 4F16, 4E16)
Writing “1” to count start bit: Internal trigger
: External trigger
“H” level width =
Period =
“H” level width =
Period =
216 – 1
fi
n
fi
(m+1) (28 –1 )
fi
n(m+1)
fi