<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>

新聞中心

EEPW首頁(yè) > 嵌入式系統 > 設計應用 > 飛思卡爾單片機PLL時(shí)鐘總線(xiàn)模塊

飛思卡爾單片機PLL時(shí)鐘總線(xiàn)模塊

作者: 時(shí)間:2016-11-22 來(lái)源:網(wǎng)絡(luò ) 收藏
要設定PWM模塊首先要確定片內總線(xiàn)時(shí)鐘,MC9S12XS系列單片機增加了時(shí)鐘產(chǎn)生器模塊,鎖定內部頻率更高的壓控振蕩器VCO頻率,作為系統時(shí)鐘,單片機的內部時(shí)鐘可達80MHz,片內總線(xiàn)時(shí)鐘可達40MHz。

本文引用地址:http://dyxdggzs.com/article/201611/319683.htm

先給出一段例程

Code:
  1. REFDV=0x07;//REFDIV=7
  2. SYNR=0x53;//SYNDIV=19
  3. while(LOCK!=1);//等待VCO穩定
  4. POSTDIV=0;//POSTDIV=0,VCO時(shí)鐘=80MHz
  5. CLKSEL_PLLSEL=1;//選擇由Fpll產(chǎn)生總線(xiàn)時(shí)鐘,Fbus=Fpll/2=40MHz

注:LOCK之前省去了寄存器名,這里是屏蔽不給發(fā)出來(lái)。

下面開(kāi)始簡(jiǎn)單分析一下寄存器

(1)時(shí)鐘分頻寄存器(CRG Reference Divider Register,REFDV)

REFDV

Bit7

Bit6

Bit5

Bit4

Bit3

Bit2

Bit1

Bit0

REFFRQ1

REFFRQ0

REFDV5

REFDV4

REFDV3

REFDV2

REFDV1

REFDV0

復位時(shí):

0

0

0

0

0

0

0

0

REFDV寄存器的高兩位REFFRQ[ 1:0 ]表示參考時(shí)鐘范圍

REFFRQ1

REFFRQ0

參考時(shí)鐘范圍

0

0

1~2MHz(默認)

0

1

2~6MHz

1

0

6~12MHz

1

1

大于12MHz

REFDV的低六位為分頻因子REFDV的值,有效值的范圍為0~63.

(2)時(shí)鐘合成寄存器(CRG Synthesizer Register , SYNR)

SYNR

Bit7

Bit6

Bit5

Bit4

Bit3

Bit2

Bit1

Bit0

VCOFRQ1

VCOFRQ0

SYNR5

SYNR4

SYNR3

SYNR2

SYNR1

SYNR0

復位時(shí)

0

0

0

0

0

0

0

0

SYNR高兩位控制壓控振動(dòng)器VCO的增益

VCOFRQ1

VCOFRQ0

VOC頻率

0

0

默認,32~48MHz

0

1

48~80MHz

1

0

冗余

1

1

80~120MHz

SYNR寄存器的低六位可寫(xiě)入0~63.可將鎖相環(huán)時(shí)鐘倍頻1~64倍。

鎖相環(huán)產(chǎn)生的時(shí)鐘頻率可由下面的公式得到

PLLCLK=2 * OSCCLK* ( SYNR+1 ) / ( REFDV+1 )

(3)鎖相環(huán)寄存器(PLL Control Register , PLLCTL)

PLLCTL

Bit7

Bit6

Bit5

Bit4

Bit3

Bit2

Bit1

Bit0

CME

PLLON

FM1

FM0

PSTWKP

PRE

PCE

SCME

復位時(shí):

1

1

0

0

0

0

0

1

CME:時(shí)鐘監控允許位。

PLLON:鎖相環(huán)電路允許位。

FM [ 1 : 0 ]:選擇附加調頻濾波器以降低VCO噪聲,默認值表示不使用該濾波器,可寫(xiě)入01,10或11,表示參考頻率相對于VCO偏高1%,2%,4%時(shí)自動(dòng)調整。

FSTWKP:時(shí)鐘快速喚醒CPU功能位。

PRE:CPU偽停止狀態(tài)時(shí),實(shí)時(shí)中斷(RT1)允許位。

PCE:CPU虛擬停止時(shí),看門(mén)狗(COP)允許位。

SCEM:自時(shí)鐘方式允許位,默認為1,探測到外部晶振停振時(shí)進(jìn)入自時(shí)鐘模式,為0時(shí),禁止自時(shí)鐘模式,探測到外部晶振停振時(shí)復位。

(4)時(shí)鐘產(chǎn)生標志寄存器(CRG Flag Register

Bit7

Bit6

Bit5

Bit4

Bit3

Bit2

Bit1

Bit0

RTIF

PORF

LVRF

LOCKIF

LOCK

ILAF

SCMIF

SCM

復位時(shí):

0

0

0

0

0

0

0

0

LOCK:鎖相環(huán)頻率鎖定標志,為1表示時(shí)鐘頻率已穩定,鎖相環(huán)頻率已鎖定。

(5)時(shí)鐘選擇寄存器(Clock Select Register , CLKSEL)

CLKSEL

Bit7

Bit6

Bit5

Bit4

Bit3

Bit2

Bit1

Bit0

PLLSEL

PSTF

SYSWA

ROAWA

PLLWAI

CWA

RTIWA

COPWA

復位時(shí):

0

0

0

0

0

0

0

0

PLLSEL:選定鎖相環(huán)(PLL Select)位,置1為選定鎖相環(huán)時(shí)鐘。




評論


技術(shù)專(zhuān)區

關(guān)閉
国产精品自在自线亚洲|国产精品无圣光一区二区|国产日产欧洲无码视频|久久久一本精品99久久K精品66|欧美人与动牲交片免费播放
<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>