MC9S12DT128 CRG problem

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

MC9S12DT128 CRG problem

1,317 次查看
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 回复数

1,038 次查看
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.

1,038 次查看
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 项奖励
回复

1,038 次查看
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 项奖励
回复