Datasheet
78K0/Ix2 CHAPTER 6 16-BIT TIMERS X0 AND X1
R01UH0010EJ0500 Rev.5.00 216
Feb 28, 2012
6.5 Operation of PWM output operation of 16-Bit Timers X0 and X1
(1) PWM output operation (TMXn-only mode, single output)
PWM output is started from TOXn0 if bit 7 (TXnTMC) of TXnCTL0 is set to 1 after setting the count value of the
inverted output to TXnCR0 and the count value of the cycle to TXnCR1.
Pulse cycle = (Set value of TXnCR1 + 1) Count clock cycle
Duty = (Set value of TXnCR1
Note 1
Set value of TXnCR0
Note 1
) / (Set value of TXnCR1 + 1)
TXnCR0 and TXnCR1 can be rewritten while the timers are operating, and the duty and the pulse cycle can be
changed. When rewriting both TXnCR0 and TXnCR1, be sure to rewrite TXnCR0 before rewriting TXnCR1. If only
TXnCR1 needs to be changed, there is no need to rewrite TXnCR0. If only TXnCR0 needs to be changed, rewrite
TXnCR0 and then write the same value to TXnCR1.
The output is changed when the INTTMXn interrupt is generated immediately after TXnCR1 is written. However, if
TXnCR1 is rewritten during the clock
Note 2
cycle in which the INTTMXn interrupt was generated, or during the previous
two clock
Note 2
cycles, the output will be changed when the INTTMXn interrupt subsequent to this INTTMXn interrupt
is generated. Note also that if TXnCR0 or TXnCR1 is written with a different value in the period between when
TXnCR1 is written and when the output changes, the output will be changed to this different value, not the originally
specified value.
To specify PWM output from TOXn0, set TXnCR0 and TXnCR1 to a value in the following range:
0000H TXnCR0 TXnCR1 FFFFH
If TXnCR0 = TXnCR1 is specified, the output will be set to the default status (fixed).
Notes 1. The output is inverted when the counter reaches TXnCRm + 1.
2. Count clock of 16-bit timer Xn
Figure 6-27. Example of Register Settings for PWM Output Operation (Single Mode) (1/2)
(a) 16-bit timer Xn operation control register 0
1TXnCTL0 0 0 0 0
TXnCKS2TXnTMC TXnCKS1 TXnCKS0
Selects count clock
0/1 0/1 0/1
Starts timer count operation
Remark n = 0, 1
<R>
<R>