Hitachi F-ZTAT H8/3039 Series Hardware Manual page 249

Single-chip microcomputer
Table of Contents

Advertisement

Sample Setup Procedure for PWM Mode: Figure 8-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
Figure 8-28 Setup Procedure for PWM Mode (Example)
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
to select the counter clear source.
2
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
selected, regardless of the TIOR
4
contents, GRA and GRB become
output compare registers specifying
the times at which the PWM
goes to 1 and 0. The TIOCA pin
5
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.
239

Advertisement

Table of Contents
loading

This manual is also suitable for:

F-ztat h8/3039F-ztat h8/3038F-ztat h8/3037F-ztat h8/3036

Table of Contents