Professional Documents
Culture Documents
2.0
Infineon Technologies Corp.
June 99
1
F
PWMmax
=
1
2
8
x 50ns
= 78 kHz
Pulse Width Modulation Unit (PWM)
(2 M!")
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99
E
?)er)ie+ Port 0tructure
;ll Po#t lines a#e indi>id"all< add#essa!le and all (.0 lines a#e
independentl< p#o5#amma!le ?o# inp"t o# o"tp"t
'!Cecti>e8
# :enerate an edge(aligned 2$G dut* c*cle PWM 0ignal using PWM
channel 1 (PeriodC 1's)
# :enerate an edge(aligned $G dut* c*cle PWM 0ignal using PWM
channel = (PeriodC 1's)
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99
9
H C1E.C0 not *et supported -* 97)6 D1. C9 4?M. 0ee I!ints regarding 97)6.J
6Bercise .PWMF1( 97)6 Configurations
4ta#t @;>:
P#oCect 4ettin5s8
# :eneralC
( 0elect /eil Co'piler1 0M788 'odel
# 0*ste' Cloc@C
( 6Bternal ?scillator 3re,uenc*C 0et to $ M!"
# 0tartup ConfigurationC
( 2us T*pe after 4esetC 0et to 1E -it 96MUM
( Write ConfigurationC Pin NW4 and N2!6 operates as NW48 and
NW4!
# 0a)e O close
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99
1
6Bercise .PWMF1 ( 97)6 Configurations (cont.)
)on?i5"#e PWM8
# ControlC
( Configure Channel 1C
( :eneralC Use PWM Channel 1
( PWM Channel Mode ControlC 0tandard PWM (edge aligned)
( Channel ?utput 6na-leC 6na-le Channel 1 output signal
( PWM Ti'er 0tart ControlC 0tart PWM Ti'er 1 after init
( PeriodC 4e,uired PeriodC 1 us
( 9ut* C*cleC 4e,uired 9ut* C*cleC 2$G
( 0a)e O Close
( Configure Channel =C
( :eneralC Use PWM Channel =
( PWM Channel Mode ControlC 0tandard PWM (edge aligned)
( Channel ?utput 6na-leC 6na-le Channel = output signal
( PWM Ti'er 0tart ControlC 0tart PWM Ti'er = after init
( PeriodC 4e,uired PeriodC 1 us
( 9ut* C*cleC 4e,uired 9ut* C*cleC $G
( 0a)e O Close
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99
11
6Bercise .PWMF1 ( 97)6 Configurations (cont.)
)on?i5"#e Po#t 78
# Port .C
( 97)6 has reser)ed P..1 and P..= for the PWM alternate
functions +ith as initial output
( 9onPt ena-le general purpose I?Q
# 3unctionsC
( Include port initiali"ation function I?F)Init
# 0a)e O close
Eene#ate )ode
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99
12
6Bercise .PWMF1 ( &Dision2 Configurations
4ta#t 1Bision2
6ew P#oCect
;dd Files8
# :o to ProKect R Targets1 :roups1 3ilesS
# Clic@ T:roups A 7dd 3ilesP
# 0elect T0ource :roup 1P
# Clic@ T7dd 3iles to :roupP
# 0elect all C files and clic@ TaddP
# Enter file name start.asm, click add (Assembler Startup File)
# Clic@ TCloseP and T?/P
# 9ou-le(clic@ all files in the ProKect Windo+ to open the'
:dit M;(60)8
# include endless loop in 'ain()C
// USER CODE BEGIN (Main,2)
while(1) {};
// USER CODE END
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99
1>
6Bercise .PWMF1 ( 4unning the Progra'
'!Cecti>e8
# :enerate a center(aligned 2$G dut* c*cle PWM 0ignal using PWM
channel 1 (PeriodC 2$ us)
# :enerate a center(aligned $G dut* c*cle PWM 0ignal using PWM
channel = (PeriodC 2$us)
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99
1E
H C1E.C0 not *et supported -* 97)6 D1. C9 4?M. 0ee I!ints regarding 97)6.J
6Bercise .PWMF2 ( 97)6 Configurations
4ta#t @;>:
P#oCect 4ettin5s8
# :eneralC
( 0elect /eil Co'piler1 0M788 'odel
# 0*ste' Cloc@C
( 6Bternal ?scillator 3re,uenc*C 0et to $ M!"
# 0tartup ConfigurationC
( 2us T*pe after 4esetC 0et to 1E -it 96MUM
( Write ConfigurationC Pin NW4 and N2!6 operates as NW48 and
NW4!
# 0a)e O close
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99
1.
6Bercise .PWMF2 ( 97)6 Configurations (cont.)
)on?i5"#e PWM8
# ControlC
( Configure Channel 1C
( :eneralC Use PWM Channel 1
( PWM Channel Mode ControlC 0*''etrical PWM
(center aligned)
( Channel ?utput 6na-leC 6na-le Channel 1 output signal
( PWM Ti'er 0tart ControlC 0tart PWM Ti'er 1 after init
( PeriodC 4e,uired PeriodC 2$ us
( 9ut* C*cleC 4e,uired 9ut* C*cleC 2$G
( 0a)e O Close
( Configure Channel =C
( :eneralC Use PWM Channel =
( PWM Channel Mode ControlC 0*''etrical PWM
(center aligned)
( Channel ?utput 6na-leC 6na-le Channel = output signal
( PWM Ti'er 0tart ControlC 0tart PWM Ti'er = after init
( PeriodC 4e,uired PeriodC 2$ us
( 9ut* C*cleC 4e,uired 9ut* C*cleC $G
( 0a)e O Close
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99
1%
6Bercise .PWMF2 ( 97)6 Configurations (cont.)
)on?i5"#e Po#t 78
# Port .C
( 97)6 has reser)ed P..1 and P..= for the PWM alternate
functions +ith as initial output
# 3unctionsC
( Include port initiali"ation function I?F)Init
# 0a)e O close
Eene#ate )ode
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99
19
6Bercise .PWMF2 ( &Dision2 Configurations
4ta#t 1Bision2
;dd Files8
# :o to ProKect R Targets1 :roups1 3ilesS
# Clic@ T:roups A 7dd 3ilesP
# 0elect T0ource :roup 1P
# Clic@ T7dd 3iles to :roupP
# 0elect all C files and clic@ TaddP
# 6nter file na'e Tstart.as'P1 clic@ TaddP (7sse'-ler 0tartup 3ile)
# Clic@ TCloseP and T?/P
# 9ou-le(clic@ all files in the ProKect Windo+ to open the'
:dit M;(60)8
# include endless loop in 'ain()C
// USER CODE BEGIN (Main,2)
while(1) {};
// USER CODE END
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99
21
6Bercise .PWMF2 ( 4unning the Progra'