📄 c2407pwmtest.mdl
字号:
RTWFcnNameOpts "Auto"
RTWFileNameOpts "Auto"
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
SimViewingDevice off
DataTypeOverride "UseLocalSettings"
MinMaxOverflowLogging "UseLocalSettings"
}
Block {
BlockType Sum
IconShape "rectangular"
Inputs "++"
CollapseMode "all elements"
CollapseDim "1"
InputSameDT on
OutDataTypeMode "Same as first input"
OutDataType "sfix(16)"
OutScaling "2^0"
LockScale off
RndMeth "Floor"
SaturateOnIntegerOverflow on
SampleTime "-1"
}
}
AnnotationDefaults {
HorizontalAlignment "center"
VerticalAlignment "middle"
ForegroundColor "black"
BackgroundColor "white"
DropShadow off
FontName "Helvetica"
FontSize 10
FontWeight "normal"
FontAngle "normal"
}
LineDefaults {
FontName "Helvetica"
FontSize 9
FontWeight "normal"
FontAngle "normal"
}
System {
Name "c2407pwmtest"
Location [153, 166, 832, 509]
Open on
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
ReportName "simulink-default.rpt"
Block {
BlockType SubSystem
Name " Info"
Ports []
Position [140, 260, 227, 304]
BackgroundColor "lightBlue"
DropShadow on
ShowName off
FontName "Arial"
FontSize 14
FontWeight "bold"
ShowPortLabels off
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
FunctionWithSeparateData off
MaskHideContents off
MaskDisplay "disp('Info')"
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
System {
Name " Info"
Location [196, 400, 737, 796]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
Annotation {
Name "Demo Description:"
Position [29, 163]
HorizontalAlignment "left"
UseDisplayTextAsClickCallback off
FontName "Arial"
FontSize 12
FontWeight "bold"
}
Annotation {
Name "Setup:"
Position [51, 28]
UseDisplayTextAsClickCallback off
FontName "Arial"
FontSize 12
FontWeight "bold"
}
Annotation {
Name "The code generation portion of this demo re"
"quires the following hardware:\n\nSpectrum Digital eZdsp LF2407\nOscilloscope"
" and probes\n\nConnect the output of PWM1 on the eZdsp LF2407 to the analog i"
"nput of the oscilloscope."
Position [30, 95]
HorizontalAlignment "left"
UseDisplayTextAsClickCallback off
FontName "Arial"
FontSize 12
}
Annotation {
Name "This example demonstrates the use of the c2"
"407 PWM block in generating the pulse \nwaveform. \n\n\"Pulse Period Source"
"\" controls the period of the pulse waveform generated by the PWM1\nand PWM2 "
"of the eZdsp. The period is changing between 16000 and 32000 clock cycles. "
"\n\n\"Pulse Width Source\" controls the width of the pulse waveform generated"
" by the PWM1\nand PWM2 of the eZdsp. The width is fixed to 8000 clock cycles."
"\n\nThe duty cycle of the generated pulse waveform is determined by the relat"
"ive ratio of the\npulse width and the pulse period. In this example, the duty"
" cycle toggles between 50%\nand 75% every 1.6 s. This effect can be observed "
"on the oscilloscope."
Position [31, 283]
HorizontalAlignment "left"
UseDisplayTextAsClickCallback off
FontName "Arial"
FontSize 12
}
}
}
Block {
BlockType Reference
Name "C24x PWM"
Ports [2]
Position [520, 102, 620, 153]
BackgroundColor "orange"
UserDataPersistent on
UserData "DataTag0"
SourceBlock "c2400dspchiplib/C24x PWM"
SourceType "C24x PWM"
useModule "A"
timerSource "Input port"
timerPeriod "37500"
waveformType "Asymmetric"
periodUnits "Clock cycles"
unit1Status on
unit1Source "Input port"
unit1Value "18500"
unit2Status off
unit2Source "Specify via dialog"
unit2Value "18500"
unit3Status off
unit3Source "Specify via dialog"
unit3Value "18500"
dutyCycleUnits "Clock cycles"
logicSource "Specify via dialog"
unit1_1Logic "Active high"
unit1_2Logic "Active low"
unit2_1Logic "Active high"
unit2_2Logic "Active low"
unit3_1Logic "Active high"
unit3_2Logic "Active low"
enableDeadband1 off
enableDeadband2 off
enableDeadband3 off
deadbandPrescaler "1"
deadbandPeriodSource "Specify via dialog"
deadbandPeriod "1"
adcstartEvent "None"
}
Block {
BlockType Scope
Name "Duty Cycle\n(%)"
Ports [1]
Position [450, 174, 480, 206]
ForegroundColor "gray"
Floating off
Location [609, 299, 874, 462]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
YMin "0"
YMax "100"
SaveName "ScopeData2"
DataFormat "StructureWithTime"
SampleTime "0"
}
Block {
BlockType Reference
Name "LF2407 eZdsp"
Tag "ccslinktgtpref"
Ports []
Position [450, 255, 516, 300]
UserDataPersistent on
UserData "DataTag1"
SourceBlock "c2000tgtpreflib/LF2407 eZdsp"
SourceType "Target Preferences"
ShowPortLabels on
SystemSampleTime "-1"
FunctionWithSeparateData off
RTWMemSecFuncInitTerm "Inherit from model"
RTWMemSecFuncExecute "Inherit from model"
RTWMemSecDataConstants "Inherit from model"
RTWMemSecDataInternal "Inherit from model"
RTWMemSecDataParameters "Inherit from model"
}
Block {
BlockType Scope
Name "Period"
Ports [1]
Position [205, 179, 235, 211]
ForegroundColor "gray"
Floating off
Location [331, 517, 599, 681]
Open off
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
YMin "8000"
YMax "40000"
DataFormat "StructureWithTime"
SampleTime "0"
}
Block {
BlockType SubSystem
Name "Pulse Period\nSource"
Ports [0, 1]
Position [55, 65, 95, 105]
MinAlgLoopOccurrences off
RTWSystemCode "Auto"
FunctionWithSeparateData off
MaskHideContents off
System {
Name "Pulse Period\nSource"
Location [413, 538, 862, 761]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "usletter"
PaperUnits "inches"
TiledPaperMargins [0.500000, 0.500000, 0.500000, 0.500000]
TiledPageScale 1
ShowPageBoundaries off
ZoomFactor "100"
Block {
BlockType Sum
Name "Add"
Ports [2, 1]
Position [310, 95, 350, 135]
InputSameDT off
OutDataTypeMode "uint16"
OutScaling "2^-10"
SaturateOnIntegerOverflow off
}
Block {
BlockType Constant
Name "Constant"
Position [45, 140, 85, 180]
Value "16000"
OutDataTypeMode "uint16"
ConRadixGroup "Best Precision: Vector-wise"
OutScaling "2^-10"
}
Block {
BlockType DataTypeConversion
Name "Data Type Conversion"
Position [135, 56, 190, 84]
OutDataTypeMode "uint16"
}
Block {
BlockType DiscretePulseGenerator
Name "Pulse\nGenerator"
Ports [0, 1]
Position [40, 53, 85, 87]
Amplitude "16000"
Period "4000"
PulseWidth "2000"
SampleTime "64/80000"
}
Block {
BlockType Outport
Name "Period"
Position [375, 108, 405, 122]
IconDisplay "Port number"
BusOutputAsStruct off
}
Line {
SrcBlock "Pulse\nGenerator"
SrcPort 1
DstBlock "Data Type Conversion"
DstPort 1
}
Line {
SrcBlock "Data Type Conversion"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -