English
Language : 

HD6433044 Datasheet, PDF (361/867 Pages) Hitachi Semiconductor – Hitachi Single-Chip Microcomputer
Sample Setup Procedure for PWM Mode: Figure 10-28 shows a sample procedure for setting
up PWM mode.
PWM mode
1. Set bits TPSC2 to TPSC0 in TCR to
select the counter clock source. If an
external clock source is selected, set
Select counter clock
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
Select counter clear source
2
to select the counter clear source.
3. Set the time at which the PWM
waveform should go to 1 in GRA.
Set 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
Set GRB
4
selected, regardless of the TIOR
contents, GRA and GRB become
output compare registers specifying
the times at which the PWM output
Select PWM mode
5
goes to 1 and 0. The TIOCA pin
automatically becomes the PWM
output pin. The TIOCB pin conforms
Start counter
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
PWM mode
the timer counter.
Figure 10-28 Setup Procedure for PWM Mode (Example)
349