English
Language : 

SH7137_09 Datasheet, PDF (13/24 Pages) Renesas Technology Corp – Output of Complementary Pairs of PWM Signals in Three Phases
SH7280 Group
MTU2: Output of Complementary Pairs of PWM Signals in Three Phases
(Complementary PWM Mode)
2.3 Configuration of the Sample Program
2.3.1 Description of Functions
Table 5 lists functions used in this sample program.
Table 5 Functions Used
Function Name
Main
Label
main ()
Standby setting
stbcr_init ()
Initialization of MTU2 mtu2_init ()
Initialization of PFC pfc_init ()
TGRA_3 interrupt
int_mtu2_tgia3 ()
Description
Initializes other modules and makes settings for timers of
MTU2
Makes setting to release MTU2 from standby
Initializes MTU2 (channels 3 and 4)
Places channels 3 and 4 in complementary PWM mode 3
Initializes the pin function controller (PFC)
Selects the required MTU2-related pin functions, so that
the pins function as timer pins
Handles the TGRA_3 compare match interrupt from
MTU2 (channel 3)
Increments or decrements the setting to control the three-
phase PWM duty cycle
Generates an interrupt for every cycle of the PWM carrier
cycle (400 μs)
2.3.2 Variable Usage
Table 6 gives a list of variables used in the sample program.
Table 6 Variable Usage
Label Name
Description
Dead_time
C_cycle
Pul_cycle
Pul_pwm_duty1
Pul_pwm_duty2
Pul_pwm_duty3
Setting for dead time
(value set in the TDDR)
1/2 the PWM carrier cycle
(value set in the TCBR)
1/2 the PWM carrier cycle + value of dead time
(value set in the TGRC_3)
PWM duty-cycle setting for the PWM1 output (pins TIOC3B and
TIOC3D)
(value set in the TGRD_3)
PWM duty-cycle setting for the PWM2 output (pins TIOC4A and
TIOC4C)
(value set in the TGRC_4)
PWM duty-cycle setting for the PWM3 output (pins TIOC4B and
TIOC4D)
(value set in the TGRD_4)
Name of
Employing
Module
mtu2_init ()
mtu2_init ()
int_mtu2_tgia3 ()
REJ06B0887-0100/Rev.1.00
June 2009
Page 13 of 24