You are on page 1of 21

HOT167-1 Version

2.0
Infineon Technologies Corp.
June 99

1
F
PWMmax
=
1
2
8
x 50ns
= 78 kHz
Pulse Width Modulation Unit (PWM)
(2 M!")

4 independent PWM channels each with its own time!ase


# $ns or 12.%&s ti'er(resolution pro)ides a )er* +ide fre,uenc* range
to generate PWM signals
# Progra''a-le output polarit*
# Up to .% /!" at %(-it PWM resolution

Fo"# ope#ation modes


# 0tandard1 edge(aligned PWM
# 0*''etrical1 center(aligned PWM for as*nchronous 'otor control
# 2urst('ode for 'odulated PWM signals
# 0ingle(shot 'ode
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99

2
PWM unit
3re,uencies and 4esolution
PMW $nit F#e%"encies and &esol"tion in Mode 1 'pe#ation (05MM6T4IC78)
PMW $nit F#e%"encies and &esol"tion in Mode 0 'pe#ation (69:6(78I:;69)
&esol"tion
(np"t )lock (CPU < 2 M!")
8 *it 10 *it 12 *it 14 *it 1+ *it
)P$ )lock ,50ns &esol"tion-
)P$ )lock . +4 ,/021s &es0-
/201 3Hz
+10 Hz
2077 3Hz
1520+ Hz
2044 3Hz
/8015 Hz
+10 Hz
2054 Hz
1520+ Hz
204 Hz
4esolution
(np"t )lock (CPU < 2 M!")
8 *it 10 *it 12 *it 14 *it 1+ *it
)P$ )lock ,50ns &esol"tion-
)P$ )lock . +4 ,/021s &es0-
7801 3Hz
1022 3Hz
1205 3Hz
/05 Hz
4088 3Hz
7+0/ Hz
1022 3Hz
1/01 Hz
/05 Hz
4077 Hz
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99

=
4un
6na-le
4un
6na-le
Timer PT0-PT3
)ompa#ato#
4hadow &e5iste#
(67& (67&
Fla5 Fla5
(67& (67&
Fla5 Fla5
PWM unit
3unction 9iagra'
Input
Mode
Control
Pulse Width Reg. PW0-PW3
4hadow &e5iste#
> identical PWM Channels +ith co''on Interrupt Control 4egister
Period Register PP0-PP3
?utput Polarit*
6na-le
?utput Polarit*
6na-le
2 M!"
.% /!"
at 2 M!" CPU Cloc@
PWM
'"tp"ts
)ompa#ato#
upAdo+n1clear
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99

>
PWM unit ( Mode and 1
Contents of the
PWB 4egister
Interrupt 4e,uest and
8atch of the 0hado+ 4egister
Contents of the PWB
4egister
I4 and 8atch of the
0hado+ 4egister
T
i'
e
r

P
e
r
io
d
T
i
'
e
r

P
e
r
io
d
T
i
'
e
r

P
e
r
i
o
d
Contents of the Period 4egister (PPB)
PWM Mode 08
4tanda#d PWM9s o# :d5e;li5ned PWM9s
PWM Mode 18
4<mmet#ical o# )ente#;li5ned PWM9s
PWM 0ignal
If all channels are progra''ed to mode 01
ed5eali5ned PWM signals +ill -e generated.
7 dut* c*cle fro' 0 to 100= is progra''a-le
If all channels are progra''ed to mode 11
cente#ali5ned PWM signals +ill -e generated.
7 dut* c*cle fro' 0 to 100= is progra''a-le
PWM 0ignal
Possi-le PWM 0ignals fro' other channels progra''ed to the sa'e 'odeC
PWMB
PWM*
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99

$
PWM unit ( 2urst Mode A
0ingle 0hot Mode
*"#st Mode 8
*"#st 4e%"ence !< com!inin5
PWM channel 0 and 1
4in5le 4hot 8
'nl< one PWM P"lse is 5ene#ated
Mode a>aila!le ?o# channel 2 and /
Period Dalue Period Dalue
Pulse +idth
Dalue
Period
Dalue
(nte#nal 4i5nal
o? )hannel 0
Period of
Ti'er PT1
Int. 0ignal
of Channel 1
'"tp"t &es"lt8 )hannel 1 is mod"lated !< )hannel 0
'"tp"t
4i5nal
Ti'er is
auto'aticall*
stopped
Ti'er is
released -*
0oft+are again
The Ti'er can -e d*na'icall* changed to
lengthen (retrigger) or shorten the output pulse

T
i
'
e
r

P
e
r
i
o
d
T
i'
e
r

P
e
r
io
d

P
T

HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99

E
?)er)ie+ Port 0tructure

7he Po#t lines p#o>ide the connection to the exte#nal wo#ld


# 111 Port lines on the C1E.

;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

:ach Po#t line is dedicated to one o# mo#e pe#iphe#al ?"nctions

:ach Po#t is p#otected with ?ast diodes

P#o5#amma!le open d#ain !"??e#s


# P21 =1 E1 .1 % on the C1E.
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99

.
@i#ection
&e5iste#
'"tp"t
Aatch
;lte#nate
'"tp"t
;lte#nate
:na!le
&ead @i#ection
W#ite
)lock
;lte#nate (np"t
(
n
t
e
#
n
a
l

*
"
s
?)er)ie+ Port 0tructure
*"??e#
M"x
M"x
*"??e#
(np"t
Aatch
'pen @#ain
)ont#ol
B))
Bss
Po#t
Pin
ESD structure
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99

%
6Bercise .PWMF1 ( T+o edge(aligned
PWM 0ignals +ith the PWM unit

'!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 @;>:

)#eate new P#oCect with mic#ocont#olle# )1+7)&.)4D


# ProKect na'eC .p+'F1
# 0elect proKect pathC cCLhot1E.F1L.p+'F1

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 PWM ,cont0-


# 3unctionsC
( Include PWM initiali"ation function PWMF)Init
# 0a)e O Close

)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'

4elect 7a#5et Ha#dwa#e ,kit)'61+7-8


# :o to ProKect R ?ptions for Target TTarget 1P
# :o to T9e-ugP ta-
# Clic@ T0ettingsP (upper right hand corner)
# Monitor configurationC select TPh*tec /C1E.P
# Clic@ T?/P t+ice
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99

1=
6Bercise .PWMF1 (
&Dision2 Configurations (cont.)

: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'

&eset 7a#5et Ha#dwa#e ,P#ess &eset *"tton on 4ta#te# 3it-

*"ild P#oCect ,P#oCect F &e!"ild 7a#5et-

&"n inte5#ated @e!"55e# ?#om within 1Bision2


# 9e-ug R 0tart A 0top 9e-ug 0ession (clic@ T?/P +hen pro'pted)
# The 9e-ugger +ill load the /eil Monitor into the @itC?;(1E.Ps 47M
)ia -ootstrap loader
# ?-Kect file cCLhot1E.F1L.p+'F1L.p+'F1 +ill -e loaded auto'aticall*
and the de-ugger +ill go to 'ain().

EoG ,@e!"5 F Eo-

P#o5#am Be#i?ication8 )onnect 4cope to


# P..1 A P?UT1 (connector M= pin 121)
# P..= A P?UT= (connector M= pin 122)
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99

1$
6Bercise .PWMF2 ( T+o center(aligned
PWM 0ignals +ith the PWM unit

'!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 @;>:

)#eate new P#oCect with mic#ocont#olle# )1+7)&.)4D


# ProKect na'eC .p+'F2
# 0elect proKect pathC cCLhot1E.F1L.p+'F2

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 PWM ,cont0-


# 3unctionsC
( Include PWM initiali"ation function PWMF)Init
# 0a)e O Close

)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

'pen P#oCect c8Hhot1+7I1H7pwmI1H7pwmI10">2 ,P#oCect F 'pen P#0-

;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'

4elect 7a#5et Ha#dwa#e ,kit)'61+7-8


# :o to ProKect R ?ptions for Target TTarget 1P
# :o to T9e-ugP ta-
# Clic@ T0ettingsP (upper right hand corner)
# Monitor configurationC select TPh*tec /C1E.P
# Clic@ T?/P t+ice
HOT167-1 Version
2.0
Infineon Technologies Corp.
June 99

2
6Bercise .PWMF2 (
&Dision2 Configurations (cont.)

: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'

&eset 7a#5et Ha#dwa#e ,P#ess &eset *"tton on 4ta#te# 3it-

*"ild P#oCect ,P#oCect F &e!"ild 7a#5et-

&"n inte5#ated @e!"55e# ?#om within 1Bision2


# 9e-ug R 0tart A 0top 9e-ug 0ession (clic@ T?/P +hen pro'pted)
# The 9e-ugger +ill load the /eil Monitor into the @itC?;(1E.Ps 47M
)ia -ootstrap loader
# ?-Kect file cCLhot1E.F1L.p+'F1L.p+'F1 +ill -e loaded auto'aticall*
and the de-ugger +ill go to 'ain().

EoG ,@e!"5 F Eo-

P#o5#am Be#i?ication8 )onnect 4cope to


# P..1 A P?UT2 (connector M= pin 121)
# P..= A P?UT> (connector M= pin 12=)

You might also like