Figure 8.26 Setup Procedure For Pwm Mode (Example) - Hitachi H8/3062 Hardware Manual

Single-chip microcomputer h8/3062 series; h8/3062b series; h8/3062f-ztat series; h8/3064f-ztat series
Hide thumbs Also See for H8/3062:
Table of Contents

Advertisement

Sample Setup Procedure for PWM Mode: Figure 8.26 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.26 Setup Procedure for PWM Mode (Example)

262
1.
Set bits TPSC2 to TPSC0 in 16TCR to
select the counter clock source. If an
external clock source is selected, set
bits CKEG1 and CKEG0 in 16TCR to
1
select the desired edge(s) of the
external clock signal.
2.
Set bits CCLR1 and CCLR0 in 16TCR
to select the counter clear source.
2
3.
Set the time at which the PWM
waveform should go to 1 in GRA.
3
4.
Set the time at which the PWM
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
5
the times at which the PWM output
goes to 1 and 0. The TIOCA pin
automatically becomes the PWM
output pin. The TIOCB pin conforms
6
to the settings of bits IOB1 and IOB0
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.

Advertisement

Table of Contents
loading

Table of Contents