Chapter 13 PWM.docx
- 文档编号:2807546
- 上传时间:2022-11-15
- 格式:DOCX
- 页数:25
- 大小:615.90KB
Chapter 13 PWM.docx
《Chapter 13 PWM.docx》由会员分享,可在线阅读,更多相关《Chapter 13 PWM.docx(25页珍藏版)》请在冰豆网上搜索。
Chapter13PWM
Chapter13
Pulse-WidthModulator(S12PWM8B8CV1)
中心对齐输出模式和4个可用的时钟源
该PWM模块有8个独立控制中心和左对齐输出的通道。
独立控制周期、占空比、计数器。
ThePWMdefinitionisbasedontheHC12PWMdefinitions.ItcontainsthebasicfeaturesfromtheHC11withsomeoftheenhancementsincorporatedontheHC12:
centeralignedoutputmodeandfouravailableclocksources.ThePWMmodulehaseightchannelswithindependentcontrolofleftandcenteralignedoutputsoneachchannel.
Eachoftheeightchannelshasaprogrammableperiodanddutycycleaswellasadedicatedcounter.Aflexibleclockselectschemeallowsatotaloffourdifferentclocksourcestobeusedwiththecounters.Eachofthemodulatorscancreateindependentcontinuouswaveformswithsoftware-selectabledutyratesfrom0%to100%.ThePWMoutputscanbeprogrammedasleftalignedoutputsorcenteralignedoutputs.
13.1.1Features
周期和占空比双缓冲
在有效周期的末尾或通道被禁用,更改才会有效(PWM计数器归零)
8个8位或4个16位PWM通道
Fourclocksources(A,B,SA,andSB)provideforawiderangeoffrequencies
4个时钟源(A,B,SA和SB)提供了广泛的频率
紧急关闭
ThePWMblockincludesthesedistinctivefeatures:
•EightindependentPWMchannelswithprogrammableperiodanddutycycle
•DedicatedcounterforeachPWMchannel
•ProgrammablePWMenable/disableforeachchannel
•SoftwareselectionofPWMdutypulsepolarityforeachchannel
•Periodanddutycyclearedoublebuffered.Changetakeseffectwhentheendoftheeffectiveperiodisreached(PWMcounterreacheszero)orwhenthechannelisdisabled.
•Programmablecenterorleftalignedoutputsonindividualchannels
•Eight8-bitchannelorfour16-bitchannelPWMresolution
•Fourclocksources(A,B,SA,andSB)provideforawiderangeoffrequencies
•Programmableclockselectlogic
•Emergencyshutdown
13.1.2运行模式
可编程禁止时钟进入分频器,以进入低功耗的等待模式。
Freeze模式中有一个软件可编程选项禁止时钟输入分频器。
这对仿真是有益的
Thereisasoftwareprogrammableoptionforlowpowerconsumptioninwaitmodethatdisablestheinputclocktotheprescaler.
Infreezemodethereisasoftwareprogrammableoptiontodisabletheinputclocktotheprescaler.Thisisusefulforemulation.
13.2外部信号描述13.2ExternalSignalDescription
ThePWMmodulehasatotalof8externalpins.该PWM模块共有8外部引脚。
13.2.1PWM7—PWMChannel7
ThispinservesaswaveformoutputofPWMchannel7andPWM通道7作为输入的紧急关断功能
13.2.1PWM7—PWMChannel7
ThispinservesaswaveformoutputofPWMchannel7andasaninputfortheemergencyshutdownfeature.
13.2.2PWM6—PWMChannel6
ThispinservesaswaveformoutputofPWMchannel6.
13.2.3PWM5—PWMChannel5
ThispinservesaswaveformoutputofPWMchannel5.
13.2.4PWM4—PWMChannel4
ThispinservesaswaveformoutputofPWMchannel4.
13.2.5PWM3—PWMChannel3
ThispinservesaswaveformoutputofPWMchannel3.
13.2.6PWM3—PWMChannel2
ThispinservesaswaveformoutputofPWMchannel2.
13.2.7PWM3—PWMChannel1
ThispinservesaswaveformoutputofPWMchannel1.
13.2.8PWM3—PWMChannel0
ThispinservesaswaveformoutputofPWMchannel0.
寄存器中的保留位总是为0
13.3.2RegisterDescriptions
13.3.2.1PWMEnableRegister(PWME)
EachPWMchannelhasanenablebit(PWMEx)tostartitswaveformoutput.WhenanyofthePWMExbitsareset(PWMEx=1),theassociatedPWMoutputisenabledimmediately.However,theactualPWMwaveformisnotavailableontheassociatedPWMoutputuntilitsclocksourcebeginsitsnextcycleduetothesynchronizationofPWMExandtheclocksource.
NOTE
ThefirstPWMcycleafterenablingthechannelcanbeirregular.Anexceptiontothisiswhenchannelsareconcatenated.Onceconcatenatedmodeisenabled(CONxxbitssetinPWMCTLregister),enabling/disablingthecorresponding16-bitPWMchanneliscontrolledbytheloworderPWMExbit.Inthiscase,thehighorderbytesPWMExbitshavenoeffectandtheircorrespondingPWMoutputlinesaredisabled.Whileinrunmode,ifalleightPWMchannelsaredisabled(PWME7–0=0),theprescalercountershutsoffforpowersavings.
1=通道x使能.下一个时钟开始输出PWM
0=通道x禁止
当在16位模式时,使能控制由1;3;5;7位决定。
在16位模式时0,2,4,6位将没有用。
在运行过程中,如果8个通道被关掉,那么预分频记数器也将关掉,为了省电。
PWMEPWME_PWME0-----》PWME_PWME7
IfCON67=1,thenbithasnoeffectandPWMoutputline6isdisabled.
IfCON45=1,thenbithasnoeffectandPWMoutputbit4isdisabled
IfCON23=1,thenbithasnoeffectandPWMoutputbit2isdisabled.
IfCON01=1,thenbithasnoeffectandPWMoutputline0isdisabled.
PWME7:
PulseWidthChannel7Enable
0Pulsewidthchannel7isdisabled.
1Pulsewidthchannel7isenabled.ThepulsemodulatedsignalbecomesavailableatPWMoutputbit7whenitsclocksourcebeginsitsnextcycle.
PWME6:
PulseWidthChannel6Enable
0Pulsewidthchannel6isdisabled.
1Pulsewidthchannel6isenabled.ThepulsemodulatedsignalbecomesavailableatPWMoutputbit6whenitsclocksourcebeginsitsnextcycle.IfCON67=1,thenbithasnoeffectandPWMoutputline6isdisabled.
PWME5:
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- Chapter 13 PWM