CHAPTER 8 8-BIT TIMER H1
Preliminary User’s Manual U19014EJ1V0UD
205
<5> By performing procedures <3> and <4> repeatedly, a pulse with an arbitrary duty can be obtained.
<6> To stop the count operation, set TMHE1 = 0.
If the setting value of the CMP01 register is N, the setting value of the CMP11 register is M, and the count
clock frequency is f
CNT
, the PWM pulse output cycle and duty are as follows.
•
PWM pulse output cycle = (N + 1)/f
CNT
•
Duty = (M + 1)/(N + 1)
Cautions 1. The set value of the CMP11 register can be changed while the timer counter is operating.
However, this takes a duration of three operating clocks (signal selected by the CKS12 to
CKS10 bits of the TMHMD1 register) from when the value of the CMP11 register is changed
until the value is transferred to the register.
2. Be sure to set the CMP11 register when starting the timer count operation (TMHE1 = 1) after
the timer count operation was stopped (TMHE1 = 0) (be sure to set again even if setting the
same value to the CMP11 register).
3. Make sure that the CMP11 register setting value (M) and CMP01 register setting value (N) are
within the following range.
00H
≤
CMP11 (M) < CMP01 (N)
≤
FFH
Remarks 1.
For the setting of the output pin, see
8.3 (3) Port mode register 1 (PM1)
.
2.
For details on how to enable the INTTMH1 signal interrupt, see
CHAPTER 13 INTERRUPT
FUNCTIONS
.
electronic components distributor