📄 pwm2.mdl
字号:
SrcPort 1
DstBlock "Out"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "Pulse width modulation1"
Ports [1, 1]
Position [390, 190, 520, 270]
AncestorBlock "mc9S12tool/Pulse width modulation"
FontSize 12
TreatAsAtomicUnit off
MaskHelp "helpview('C:\\Documents and Settings\\fwornle\\"
"My Documents\\frank\\_cProgs\\Motorola\\rtmc9S12_CW_R13\\bin\\mc9S12.map', 'm"
"c9S12_PWM_In_blkref')"
MaskPromptString "Sample time|Resolution |PWM period (8"
"-bit : up to 0.699 s, 16-bit : up to 179 s)|Pulse pin (PTP) |Sign port "
" |Sign pin |Saturation input level [simulated voltag"
"e]|Signal monitoring"
MaskStyleString "edit,popup(8 bit|16 bit),edit,popup(0 (8-bit)|"
"1 (8-bit / 16-bit)|2 (8-bit)|3 (8-bit / 16-bit)|4 (8-bit)|5 (8-bit / 16-"
"bit)|6 (8-bit)|7 (8-bit / 16-bit)),popup(PORTA|PORTB|PTH|PTJ|PTM|PTP|PTT|PT"
"S),popup(0|1|2|3|4|5|6|7),edit,checkbox"
MaskTunableValueString "on,on,on,off,off,off,on,on"
MaskCallbackString "|||||||"
MaskEnableString "on,on,on,on,on,on,on,on"
MaskVisibilityString "on,on,on,on,on,on,on,on"
MaskToolTipString "on,on,on,on,on,on,on,on"
MaskVarAliasString ",,,,,,,"
MaskVariables "sampletime=@1;resolution=@2;PWMper=@3;pulse_pin"
"=@4;sign_port=@5;sign_pin=@6;Vmax=@7;sig_mon=@8;"
MaskInitialization "[pulsepinstr, signportstr, signpinstr, periodst"
"r, clkABstr, resstr] = mbc_pwmoutput(sampletime, resolution, PWMper, pulse_pi"
"n, sign_port, sign_pin, Vmax, sig_mon);"
MaskDisplay "fprintf('PWM-%s, %s-bit\\nPulse pin: PTP.%s\\nS"
"ign pin: %s.%s\\nPeriod: %s (s)\\nSaturation: %d', clkABstr, resstr, pulsepin"
"str, signportstr, signpinstr, periodstr, Vmax)"
MaskSelfModifiable on
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "0.01 |16 bit|0.5|3 (8-bit / 16-bit)|PTH|2|5|on"
System {
Name "Pulse width modulation1"
Location [440, 403, 875, 514]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "In1"
Position [50, 40, 70, 60]
FontSize 12
}
Block {
BlockType "S-Function"
Name "MC"
Tag "MC9S12target_pwm"
Ports [1, 1]
Position [140, 30, 255, 70]
List {
ListType RTWdata
pulsepinStr "3"
pulsepinMask "8"
signportStr "PTH"
signportddrStr "DDRH"
signpinMask "4"
signpinStr "2"
resolutionStr "16"
CLKselectStr "1"
useSCLStr "1"
PCKStr "0"
PWMSCLStr "92"
PERIODStr "65217"
}
FontSize 12
FunctionName "pwm_sfcn_9S12"
Parameters "sampletime, PWMper, pulse_pin, sign_port, s"
"ign_pin, Vmax, sig_mon"
}
Block {
BlockType Outport
Name "Out1"
Position [300, 40, 320, 60]
}
Line {
SrcBlock "MC"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "MC"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "Pulse width modulation2"
Ports [1, 1]
Position [390, 75, 520, 155]
AncestorBlock "mc9S12tool/Pulse width modulation"
FontSize 12
TreatAsAtomicUnit off
MaskHelp "helpview('C:\\Documents and Settings\\fwornle\\"
"My Documents\\frank\\_cProgs\\Motorola\\rtmc9S12_CW_R13\\bin\\mc9S12.map', 'm"
"c9S12_PWM_In_blkref')"
MaskPromptString "Sample time|Resolution |PWM period (8"
"-bit : up to 0.699 s, 16-bit : up to 179 s)|Pulse pin (PTP) |Sign port "
" |Sign pin |Saturation input level [simulated voltag"
"e]|Signal monitoring"
MaskStyleString "edit,popup(8 bit|16 bit),edit,popup(0 (8-bit)|"
"1 (8-bit / 16-bit)|2 (8-bit)|3 (8-bit / 16-bit)|4 (8-bit)|5 (8-bit / 16-"
"bit)|6 (8-bit)|7 (8-bit / 16-bit)),popup(PORTA|PORTB|PTH|PTJ|PTM|PTP|PTT|PT"
"S),popup(0|1|2|3|4|5|6|7),edit,checkbox"
MaskTunableValueString "on,on,on,off,off,off,on,on"
MaskCallbackString "|||||||"
MaskEnableString "on,on,on,on,on,on,on,on"
MaskVisibilityString "on,on,on,on,on,on,on,on"
MaskToolTipString "on,on,on,on,on,on,on,on"
MaskVarAliasString ",,,,,,,"
MaskVariables "sampletime=@1;resolution=@2;PWMper=@3;pulse_pin"
"=@4;sign_port=@5;sign_pin=@6;Vmax=@7;sig_mon=@8;"
MaskInitialization "[pulsepinstr, signportstr, signpinstr, periodst"
"r, clkABstr, resstr] = mbc_pwmoutput(sampletime, resolution, PWMper, pulse_pi"
"n, sign_port, sign_pin, Vmax, sig_mon);"
MaskDisplay "fprintf('PWM-%s, %s-bit\\nPulse pin: PTP.%s\\nS"
"ign pin: %s.%s\\nPeriod: %s (s)\\nSaturation: %d', clkABstr, resstr, pulsepin"
"str, signportstr, signpinstr, periodstr, Vmax)"
MaskSelfModifiable on
MaskIconFrame on
MaskIconOpaque on
MaskIconRotate "none"
MaskIconUnits "autoscale"
MaskValueString "0.01 |16 bit|0.5|1 (8-bit / 16-bit)|PTH|1|5|on"
System {
Name "Pulse width modulation2"
Location [440, 403, 875, 514]
Open off
ModelBrowserVisibility off
ModelBrowserWidth 200
ScreenColor "white"
PaperOrientation "landscape"
PaperPositionMode "auto"
PaperType "A4"
PaperUnits "centimeters"
ZoomFactor "100"
Block {
BlockType Inport
Name "In1"
Position [50, 40, 70, 60]
FontSize 12
}
Block {
BlockType "S-Function"
Name "MC"
Tag "MC9S12target_pwm"
Ports [1, 1]
Position [140, 30, 255, 70]
List {
ListType RTWdata
pulsepinStr "1"
pulsepinMask "2"
signportStr "PTH"
signportddrStr "DDRH"
signpinMask "2"
signpinStr "1"
resolutionStr "16"
CLKselectStr "0"
useSCLStr "1"
PCKStr "0"
PWMSCLStr "92"
PERIODStr "65217"
}
FontSize 12
FunctionName "pwm_sfcn_9S12"
Parameters "sampletime, PWMper, pulse_pin, sign_port, s"
"ign_pin, Vmax, sig_mon"
}
Block {
BlockType Outport
Name "Out1"
Position [300, 40, 320, 60]
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "MC"
DstPort 1
}
Line {
SrcBlock "MC"
SrcPort 1
DstBlock "Out1"
DstPort 1
}
}
}
Block {
BlockType Scope
Name "Scope"
Ports [1]
Position [405, 289, 435, 321]
Location [648, 430, 971, 685]
Open on
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
List {
ListType SelectedSignals
axes1 ""
}
TimeRange "10"
YMin "-6"
YMax "6"
DataFormat "StructureWithTime"
}
Block {
BlockType Scope
Name "Scope1"
Ports [1]
Position [400, 24, 430, 56]
Location [648, 97, 972, 352]
Open on
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
List {
ListType SelectedSignals
axes1 ""
}
TimeRange "10"
YMin "-6"
YMax "6"
SaveName "ScopeData1"
DataFormat "StructureWithTime"
}
Block {
BlockType Scope
Name "Scope2"
Ports [1]
Position [560, 99, 590, 131]
Location [317, 98, 639, 352]
Open on
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
List {
ListType SelectedSignals
axes1 ""
}
TimeRange "0.5"
YMin "-6"
YMax "6"
SaveName "ScopeData2"
DataFormat "StructureWithTime"
}
Block {
BlockType Scope
Name "Scope3"
Ports [1]
Position [560, 214, 590, 246]
Location [314, 431, 639, 685]
Open on
NumInputPorts "1"
List {
ListType AxesTitles
axes1 "%<SignalLabel>"
}
List {
ListType SelectedSignals
axes1 ""
}
TimeRange "0.5"
YMin "-6"
YMax "6"
SaveName "ScopeData3"
DataFormat "StructureWithTime"
}
Block {
BlockType ZeroOrderHold
Name "Zero-Order\nHold"
Position [295, 96, 330, 134]
SampleTime "0.01"
}
Block {
BlockType ZeroOrderHold
Name "Zero-Order\nHold1"
Position [295, 211, 330, 249]
SampleTime "0.01"
}
Line {
SrcBlock "Zero-Order\nHold"
SrcPort 1
Points [0, 0; 15, 0]
Branch {
Points [0, -75]
DstBlock "Scope1"
DstPort 1
}
Branch {
DstBlock "Pulse width modulation2"
DstPort 1
}
}
Line {
SrcBlock "Zero-Order\nHold1"
SrcPort 1
Points [0, 0; 15, 0]
Branch {
Points [0, 75]
DstBlock "Scope"
DstPort 1
}
Branch {
DstBlock "Pulse width modulation1"
DstPort 1
}
}
Line {
SrcBlock "FreePortComms_RX"
SrcPort 1
DstBlock "Demux"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 1
Points [45, 0; 0, -50]
DstBlock "Zero-Order\nHold"
DstPort 1
}
Line {
SrcBlock "Demux"
SrcPort 2
Points [45, 0; 0, 45]
DstBlock "Zero-Order\nHold1"
DstPort 1
}
Line {
SrcBlock "Pulse width modulation1"
SrcPort 1
DstBlock "Scope3"
DstPort 1
}
Line {
SrcBlock "Pulse width modulation2"
SrcPort 1
DstBlock "Scope2"
DstPort 1
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -