Datasheet

V850ES/JG3-H, V850ES/JH3-H CHAPTER 9 16-BIT TIMER/EVENT COUNTER T (TMT)
R01UH0042EJ0500 Rev.5.00 Page 541 of 1513
Aug 12, 2011
Figure 9-44. Basic Timing in Triangular-Wave PWM Output Mode
FFFFH
16-bit counter
0000H
TT0CE bit
TT0CCR0 register
CCR0 buffer register
INTTT0CC0 signal
TOT00 pin output
TT0CCR1 register
CCR1 buffer register
INTTT0CC1 signal
TOT01 pin output
INTTT0OV signal
D
10
D
00
D
01
D
02
D
00
D
01
D
10
D
11
D
12
D
10
D
11
D
12
D
02
D
10
D
00
D
12
D
12
D
11
D
11
D
01
D
02
The 16-bit counter is cleared from FFFFH and 0000H and starts counting when the TT0CE bit is set to 1. The triangular
PWM waveform is output from the TOT01 pin.
In the triangular-wave PWM output mode, the counter counts up or down. When the 16-bit counter reaches 0000H
while it is counting down, an overflow interrupt request signal (INTTT0OV) is generated. At this time, the
TT0OPT0.TT0OVF bit is not set to 1. If the count value of the 16-bit counter matches the value of the CCR0 buffer register
while the counter is counting up, a compare match interrupt request signal (INTTT0CC0) is generated.
The counting direction is changed from up to down when the value of the 16-bit counter matches that of the CCR0
buffer register, and from down to up when the counter is cleared to 0000H.
The PWM waveform can be changed by rewriting the TT0CCRn register during operation. To change the PWM
waveform during operation, write the TT0CCR1 register last.
The cycle of the triangular PWM waveform is set by the TT0CCR0 register and its duty factor is set by the TT0CCR1
register. Set a value to the TT0CCR0 register in a range of “0 TT0CCR0 FFFEH”. The rewritten value is reflected
when the 16-bit counter reaches 0000H while it is counting down.
Even when changing only the cycle of the PWM waveform, first set a period to the TT0CCR0 register, and then write
the same value (value same as that set to the TT0CCR1 register) to the TT0CCR1 register.
To transfer data from the TT0CCRn register to the CCRn buffer register, the data must be written to the TT0CCR1
register (n = 0, 1).