![Toshiba TMP91C824F Data Book Download Page 109](http://html.mh-extra.com/html/toshiba/tmp91c824f/tmp91c824f_data-book_428625109.webp)
TMP91C824
91C824-106
In this mode, the value of the register buffer will be shifted into TA0REG if 2
n
−
1 overflow is
detected when the TA0REG double buffer is enabled.
Use of the double buffer facilitates the handling of low duty ratio waves.
Q
2
Up-counter = Q
2
Up-counter = Q
1
Q
1
Q
2
Q
3
Shift into TA0REG
Match with TA0REG
2
n
-1 overflow
TA0REG
(value to be compared)
Register buffer
TA0REG (register buffer)
write
Figure 3.7.17 Register buffer operation
Example: To output the following PWM waves on the TA1OUT pin at fc = 16 MHz:
36.0
µ
sec
63.5
µ
sec
∗
Clock state
System clock: High frequency (fc)
Clock gear: 1 (fc)
Prescaler clock: f
FPH
To achieve a 63.5-
µ
s PWM cycle by setting
φ
T1 to 0.5
µ
sec (at fc = 16 MHz):
63.5
µ
sec / 0.5
µ
sec = 127=2
n
−
1
Therefore n should be set to 7.
Since the low-level period is 36.0
µ
sec when
φ
T1 = 0.5
µ
sec,
set the following value for TA0REG:
36.0
µ
sec / 0.5
µ
sec = 72 = 48H
MSB
LSB
7 6
5
4 3 2
1
0
TA01RUN
←
–
X X
X
–
–
–
0
Stop TMRA0 and clear it to 0.
TA01MOD
←
1 1
1
0 – –
0
1
Select 8-Bit PWM Mode (cycle: 2
7
−
1) and select
φ
T1 as the
input clock.
TA0REG
←
0 1
0
0 1 0
0
0
Write
48H.
TA1FFCR
←
X
X X
X
1
0
1
X
Clear TA1FF to 0, enable the inversion and double buffer.
PBCR
←
X –
–
– – –
1
–
PBFC
←
X –
–
– – –
1
X
Set PB1 and the TA1OUT pin.
TA01RUN
←
1 X X X – 1
-
1
Start
TMRA0
counting.
(note): X = Don’t care; “
−
” = No change