Datasheet
Section 16 Timer RD
Page 566 of 982 REJ09B0465-0300 Rev. 3.00
Sep 17, 2010
H8S/20103, H8S/20203, H8S/20223, H8S/20115, H8S/20215, H8S/20235 Group
[1] Clear bits STR0 and STR1 in TRDSTR
to 0, and stop the counter operation of
TRDCNT_0. Stop TRDCNT_0 and
TRDCNT_1 and set complementary
PWM mode.
[2] Use bits TPSC2 to TPSC0 in TRDCR to
select the same counter clock for
channels 0 and 1. When an external
clock is selected, select the edge of the
external clock by bits CKEG1 and
CKEG0 in TRDCR. Set bits CCLR2 to
CCLR0 in TRDCR so that the counter is
not cleared.
[3] Use bits CMD1 and CMD0 in TRDFCR
to set complementary PWM mode.
FTIOB0 to FTIOD0 and FTIOA1 to
FTIOD1 automatically become PWM
output pins.
[4] TRDCNT_1 must be H'0000. Set a non-
overlapped period to TRDCNT_0.
[5] GRA_0 is a cycle register. Set the cycle
to GRA_0. Set the timing to change the
PWM output waveform to GRB_0,
GRA_1, and GRB_1. The settings must
be set so that a compare match occurs
on TRDCNT_0 and TRDCNT_1. T ≤ X
(X: Initial value in GRB_0, GRA_1, or
GRB_1).
[6] Use TRDOER1 to enable or disable the
timer output.
[7] Set the STR0 and STR1 bits in TRDSTR
to 1 to start the count operation.
[1]
Complementary PWM mode
Stop counter operation
Note: To modify the settings for the complementary PWM mode, clear settings other
than those for the mode. After that, repeat setting from step [1].
[2]
[3]
Select counter clock
[4]
Set complementary
PWM mode
[5]
<Complementary PWM mode>
[6]
Set TCNT
[7]
Set GR
Enable waveform output
Start counter operation
Figure 16.29 Example of Complementary PWM Mode Setting Procedure
(1) Canceling Procedure of Complementary PWM Mode
Figure 16.30 shows the complementary PWM mode canceling procedure.
[1] Clear bit CMD1 in TRDFCR to 0, and set
channels 0 and 1 to normal operation.
[2] After setting channels 0 and 1 to normal
operation, clear bits STR0 and STR1 in
TRDSTR to 0 and stop TRDCNT_0 and
TRDCNT_1.
[1]
[2]
Complementary PWM mode
Stop counter operation
Cancel complementary
PWM mode
<Normal operation>
Figure 16.30 Canceling Procedure of Complementary PWM Mode