English
Language : 

HD6413003RF Datasheet, PDF (353/715 Pages) Renesas Technology Corp – Microcontroller (MCU)
Sample Setup Procedure for PWM Mode: Figure 10-28 shows a sample procedure for setting
up PWM mode.
PWM mode
Select counter clock
Select counter clear source
Set GRA
Set GRB
Select PWM mode
Start counter
PWM mode
1. Set bits TPSC2 to TPSC0 in TCR to
select the counter clock source. If an
external clock source is selected, set
bits CKEG1 and CKEG0 in TCR to
1
select the desired edge(s) of the
external clock signal.
2. Set bits CCLR1 and CCLR0 in TCR
2
to select the counter clear source.
3. Set the time at which the PWM
waveform should go to 1 in GRA.
4. Set the time at which the PWM
3
waveform should go to 0 in GRB.
5. Set the PWM bit in TMDR to select
PWM mode. When PWM mode is
4
selected, regardless of the TIOR
contents, GRA and GRB become
output compare registers specifying
the times at which the PWM
5
goes to 1 and 0. The TIOCA pin
automatically becomes the PWM
output pin. The TIOCB pin conforms
to the settings of bits IOB1 and IOB0
6
in TIOR. If TIOCB output is not
desired, clear both IOB1 and IOB0 to 0.
6. Set the STR bit to 1 in TSTR to start
the timer counter.
Figure 10-28 Setup Procedure for PWM Mode (Example)
335