
T IME R A
7751 Group User’s Manual
5–41
5.6 Pulse width modulation (PWM) mode
Note:
When operating as 8-bit pulse width modulator
(m+1) (2
8
– 1)
Period =
fi
n(m+1)
“H” level width =
fi
fi : Frequency of count source
However, if n = “00
16
”, the pulse width modulator
does not operate and the TAi
OUT
pin outputs “L”
level. At this time, no timer Ai request occurs.
b7
b0
1
Count source select bits
2
/f
4
0 1 : f
16
/f
32
1 0 : f
64
/f
128
1 1 : f
512
/f
1024
1
Selecting PWM mode and each function
Timer Ai mode register (i = 0 to 4) (Addresses 56
16
to 5A
16
)
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 5.6.3
.
Trigger select bits
b3
b4
0 0 :
0 1 :
1 0 : Falling of TAi
IN
pin’s input signal
1 1 : Rising of TAi
IN
pin’s input signal
Selection of PWM mode
Setting PWM pulse’s period and “H” level width
b7
b0
Can be set to “0000
16
” to “FFFE
16
” (n)
(b15)
(b8)
b7
b0
Timer A0 register (Addresses 47
16
, 46
16
)
Timer A1 register (Addresses 49
16
, 48
16
)
Timer A2 register (Addresses 4B
16
, 4A
16
)
Timer A3 register (Addresses 4D
16
, 4C
16
)
Timer A4 register (Addresses 4F
16
, 4E
16
)
Note:
When operating as 16-bit pulse width modulator
16
– 1)
(2
fi
“H n
fi
fi : Frequency of count source
However, if n = “0000
16
”, the pulse width modulator does
not operate and the TAi
OUT
pin outputs “L” level. At this time,
no timer Ai request occurs.
G
When operating as 16-bit pulse width modulator
b7
b0
Can be set to “00
16
” to “FF
16
” (m)
(b15)
(b8)
b7
b0
G
When operating as 8-bit pulse width modulator
Can be set to “00
16
” to “FE
16
” (n)
Timer A0 register (Addresses 47
16
, 46
16
)
Timer A1 register (Addresses 49
16
, 48
16
)
Timer A2 register (Addresses 4B
16
, 4A
16
)
Timer A3 register (Addresses 4D
16
, 4C
16
)
Timer A4 register (Addresses 4F
16
, 4E
16
)
Writing “1” to count start bit: Internal trigger
: External trigger
: External trigger
5.6.1 Setting for PWM mode
Figures 5.6.2 and 5.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 4. INTERRUPTS.”
Fig. 5.6.2 Initial setting example for registers relevant to PWM mode (1)