MC9S12DT128 CRG problem

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MC9S12DT128 CRG problem

1,053件の閲覧回数
BMSwei
Contributor I

void INIT_PLL(void)

{

    CRGINT = 0;         

    CLKSEL_PLLSEL = 0;       

      PLLCTL_PLLON = 0;          

    SYNR = 0x03;

    REFDV = 0xc2;                 

    PLLCTL_PLLON = 1;     

    PLLCTL_AUTO = 1;           

    while (CRGFLG_LOCK == 0);   

    CLKSEL_PLLSEL = 1;        

}

 

this is the code of the Initialization of PLL in MC9s12DT128 ,but the program is not working.Please help...

 

ラベル(1)
タグ(3)
0 件の賞賛
返信
3 返答(返信)

774件の閲覧回数
kef
Specialist I

You should first explain what is relation between "program is not working" and "CRG problem". Does your INIT_PLL() hang waiting forever for LOCK==1? If so, then probably something is wrong with PLL filter circuit. It could be no PLL components installed, soldering problems or bad PLL filter components.

774件の閲覧回数
BMSwei
Contributor I

yeah   yeah ,the problem is the INIT_PLL() hang waiting forever for LOCK==1,program can not continue to run ,and if CLKSEL_PLLSEL = 0,not use the PLL ,the program can run normally. 

0 件の賞賛
返信

774件の閲覧回数
RadekS
NXP Employee
NXP Employee

Your INIT_PLL function looks more-less correct, however:

Your value of REFDV is strange. REFDV register contains bits in lower half of byte.

Could you please specify oscillator/crystal frequency, expected bus clock, Oscillator connection (page 66 in RM), XCLKS (PE7) pin level and XFC loop filter connection (page 64 in RM)?

  In attachment you can find PLL calculator and PLL filter calculator for S12 MCUs (with CRG module).

0 件の賞賛
返信