
Microcomputer Technical Q&A
97
Q&A No.: QAH8S-223
Category: TPU
Subject: Two-Phase PWM Output
Question
Is it possible to obtain two-phase PWM output with a common cycle but different duty cycles and
a phase difference?
Answer
This is possible in PWM mode 1, using channels 0 and 3 (or synchronous operation of two
channels). The setting method for channel 0 is described below.
1. Set channel 0 to PWM mode.
2. Set TGRA and TGRB, and TGRC and TGRD, to different output with the timer I/O control
register (TIOR).
3. Set a common cycle in TGRD, and set counter clearing by a TGRD compare match.
4. Set the phase difference in TGRA. Also, set the TIOC output duty cycle in TGRC so that
TGRB – TGRA is the TIOCA output duty cycle.
TCNT value
TGR0D
TGR0B
TGR0C
TGR0A
H'0000
TIOCA0
TIOCC0
Time
Two-Phase PWM Output
Kommentare zu diesen Handbüchern