English
Language : 

SH7137_09 Datasheet, PDF (14/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.4 Procedure for Setting the Module Used
The following subsections describe the flow of processing by the sample program.
2.4.1 Main Function
Figure 11 shows the flow of processing by the main function.
main()
0→Duty_select
[1]
Initialization: release from standby
stbcr_init()
[2]
Initialization: MTU2
mtu2_init()
[3]
Set interrupt priority register E
(IPRE)
[4]
Initialization: PFC
pfc_init()
[5]
Set timer start register (TSTR)
[6]
Release interrupt mask
set_imask(0)
[7]
[1] Variable initialization
Flag (Duty_select) to judge the need to update the PWM duty
cycle is initialized.
[2] On-chip peripheral modules are released from standby
[3] Initialization of multi-function timer pulse unit 2 (MTU2)
[4] Interrupt controller (INTC) setting
Interrupt priority level of the interrupt sources (TGI3A to TGI3D)
from MTU2 is set to D'15 (H'F).
[5] Initialization of pin function controller (PFC)
[6] Setting for timer start register (TSTR) of MTU2
• CST4 bit = B'1: Specifies counting by timer counter
TCNT_4.
• CST3 bit = B'1: Specifies counting by timer counter
TCNT_3.
The CST3 and CST4 bits are set simultaneously.
[7] Setting the interrupt mask bit to 0
CPU interrupts at all interrupt priority levels are enabled.
Figure 11 Processing by Function main
2.4.2 Initialization for Standby
Figure 12 shows the flow of processing for standby processing.
stbcr_init()
Set standby control register 3
(STBCR3)
[1]
[1] Release of the module from standby
• MSTP35 bit = B'0: Clock supply to MTU2 is enabled.
END
Figure 12 Initialization: Release from Standby
REJ06B0887-0100/Rev.1.00
June 2009
Page 14 of 24