📄 pwm3.mdl
字号:
" |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|2|3 (8-bit / 16-bit)|PTH|4|100|of"
"f"
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]
Position [140, 30, 255, 70]
List {
ListType RTWdata
pulsepinStr "3"
pulsepinMask "8"
signportStr "PTH"
signportddrStr "DDRH"
signpinMask "16"
signpinStr "4"
resolutionStr "16"
CLKselectStr "1"
useSCLStr "1"
PCKStr "1"
PWMSCLStr "184"
PERIODStr "65217"
}
FontSize 12
FunctionName "pwm_sfcn_9S12"
Parameters "sampletime, PWMper, pulse_pin, sign_port, s"
"ign_pin, Vmax, sig_mon"
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "MC"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "Pulse width modulation2"
Ports [1]
Position [395, 117, 525, 193]
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 |8 bit|0.5|4 (8-bit)|PTH|2|100|off"
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]
Position [140, 30, 255, 70]
List {
ListType RTWdata
pulsepinStr "4"
pulsepinMask "16"
signportStr "PTH"
signportddrStr "DDRH"
signpinMask "4"
signpinStr "2"
resolutionStr "8"
CLKselectStr "0"
useSCLStr "1"
PCKStr "7"
PWMSCLStr "184"
PERIODStr "255"
}
FontSize 12
FunctionName "pwm_sfcn_9S12"
Parameters "sampletime, PWMper, pulse_pin, sign_port, s"
"ign_pin, Vmax, sig_mon"
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "MC"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "Pulse width modulation3"
Ports [1]
Position [395, 215, 525, 295]
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 |8 bit|0.01|5 (8-bit / 16-bit)|PTH|3|100|"
"off"
System {
Name "Pulse width modulation3"
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]
Position [140, 30, 255, 70]
List {
ListType RTWdata
pulsepinStr "5"
pulsepinMask "32"
signportStr "PTH"
signportddrStr "DDRH"
signpinMask "8"
signpinStr "3"
resolutionStr "8"
CLKselectStr "0"
useSCLStr "1"
PCKStr "7"
PWMSCLStr "184"
PERIODStr "5"
}
FontSize 12
FunctionName "pwm_sfcn_9S12"
Parameters "sampletime, PWMper, pulse_pin, sign_port, s"
"ign_pin, Vmax, sig_mon"
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "MC"
DstPort 1
}
}
}
Block {
BlockType SubSystem
Name "Pulse width modulation4"
Ports [1]
Position [395, 510, 525, 590]
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|2|7 (8-bit / 16-bit)|PTH|5|100|of"
"f"
System {
Name "Pulse width modulation4"
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]
Position [140, 30, 255, 70]
List {
ListType RTWdata
pulsepinStr "7"
pulsepinMask "128"
signportStr "PTH"
signportddrStr "DDRH"
signpinMask "32"
signpinStr "5"
resolutionStr "16"
CLKselectStr "1"
useSCLStr "1"
PCKStr "1"
PWMSCLStr "184"
PERIODStr "65217"
}
FontSize 12
FunctionName "pwm_sfcn_9S12"
Parameters "sampletime, PWMper, pulse_pin, sign_port, s"
"ign_pin, Vmax, sig_mon"
}
Line {
SrcBlock "In1"
SrcPort 1
DstBlock "MC"
DstPort 1
}
}
}
Line {
SrcBlock "Gain"
SrcPort 1
DstBlock "Pulse width modulation"
DstPort 1
}
Line {
SrcBlock "Constant"
SrcPort 1
DstBlock "Gain"
DstPort 1
}
Line {
SrcBlock "Gain1"
SrcPort 1
DstBlock "Pulse width modulation1"
DstPort 1
}
Line {
SrcBlock "Constant1"
SrcPort 1
DstBlock "Gain1"
DstPort 1
}
Line {
SrcBlock "Gain2"
SrcPort 1
DstBlock "Pulse width modulation2"
DstPort 1
}
Line {
SrcBlock "Constant2"
SrcPort 1
DstBlock "Gain2"
DstPort 1
}
Line {
SrcBlock "Gain3"
SrcPort 1
DstBlock "Pulse width modulation3"
DstPort 1
}
Line {
SrcBlock "Constant3"
SrcPort 1
DstBlock "Gain3"
DstPort 1
}
Line {
SrcBlock "Gain4"
SrcPort 1
DstBlock "Pulse width modulation4"
DstPort 1
}
Line {
SrcBlock "Constant4"
SrcPort 1
DstBlock "Gain4"
DstPort 1
}
Annotation {
Name "bad idea: relatively short period and only 8-b"
"it resolution"
Position [223, 223]
FontName "Arial"
FontSize 12
FontWeight "bold"
}
Annotation {
Name "should assign all slow periods (1 x '1 sec', 2 "
"x '2 sec') to one of the two \nPWM clock generators (e.g. PWM-B); this way th"
"e reduced resolution (now \nneed to have at least 2 of the 4 B-channels runni"
"ng as 8-bit PWMs) has less\nof an impact: the slowest period of 2 seconds is "
"resolved in 256 steps, the\nother B-period (1 second) is still resolved in 12"
"8 steps. On the other hand, \nthe A-channels (0.5 sec, 0.01 sec) are now both"
" resolved with 65536 steps"
Position [263, 363]
FontName "Arial"
FontSize 12
FontWeight "bold"
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -