TIMER A
7902 Group User’s Manual
9-35
9.6 Pulse width modulation (PWM) mode
RW
0
1
2
3
4
5
6
7
Timer Ai mode register (i = 0 to 4) (Addresses 5616 to 5A16)
Operating mode select bits
Fix this bit to “1” in PWM mode.
Trigger select bits
16/8-bit PWM mode select bit
Count source select bits
b7 b6 b5 b4 b3 b2 b1 b0
1 1 : PWM mode
b1 b0
11
0 0 :
Writing “1” to count start bit
0 1 :
(TAiIN pin functions as a programmable I/O
port pin.)
1 0 : Falling edge of TAiIN pin’s input signal
1 1 : Rising edge of TAiIN pin’s input signal
b4 b3
1
0 : 16-bit pulse width modulator
1 : 8-bit pulse width modulator
0
See Table 9.2.3.
Timer A0 register (Addresses 4716, 4616)
Timer A1 register (Addresses 4916, 4816)
Timer A2 register (Addresses 4B16, 4A16)
Timer A3 register (Addresses 4D16, 4C16)
Timer A4 register (Addresses 4F16, 4E16)
Undefined
15 to 0
These bits can be set to “000016” to “FFFE16.”
Assuming that the set value = n, the “H” level width of the PWM pulse which is output
from the TAiOUT pin is expressed as follows :
(PWM pulse period =
)
WO
b0
b7
b0
b7
(b15)
(b8)
fi: Frequency of count source
Note: Use the MOVM or STA(STAD) instruction for writing to this register.
Writing to this register must be performed in a unit of 16 bits.
n
fi
216–1
fi
<When operating as a 16-bit pulse width modulator>
Timer A0 register (Addresses 4716, 4616)
Timer A1 register (Addresses 4916, 4816)
Timer A2 register (Addresses 4B16, 4A16)
Timer A3 register (Addresses 4D16, 4C16)
Timer A4 register (Addresses 4F16, 4E16)
Undefined
7 to 0
15 to 8
These bits can be set to “0016” to “FF16.”
Assuming that the set value = m, the period of the PWM pulse which is output from the
TAiOUT pin is expressed as follows:
WO
b0
b7
b0
b7
(b15)
(b8)
(m + 1) (28 – 1)
fi
<When operating as an 8-bit pulse width modulator>
These bits can be set to “0016” to “FF16.”
Assuming that the set value = n, the “H” level width of the PWM pulse which is output
from the TAiOUT pin is expressed as follows: n(m + 1)
fi
fi: Frequency of count source
Note: Use the MOVM or STA(STAD) instruction for writing to this register.
Writing to this register must be performed in a unit of 16 bits.
Bit
Function
At reset
R/W
Bit name
Bit
Function
At reset
R/W
Bit
Function
At reset
R/W
Fig. 9.6.1 Structures of timer Ai registers and timer Ai mode registers in PWM mode.