AnsweredAssumed Answered

MCF52259 external oscillator Promblem

Question asked by Cathy chang on Mar 14, 2012
Latest reply on Mar 20, 2012 by Cathy chang

I used a  48 MHz crystal in my board MCF52259(Circuit connect as the same as the MCF52259EVB),I used the below code to PLL,but not successful , system clock is 16Mhz,and still is 16Mhz in EXTAL pin . why?

 

 

/*Required if booting with internal relaxation oscillator on, crystal off, & pll off, clkmod[1:0]=00 & xtal=1 */ 
  MCF_CLOCK_OCLR = 0xC0;    //turn on crystal  //0xF0
  MCF_CLOCK_CCLR = 0x00;     //switch to crystal
  MCF_CLOCK_OCHR = 0x00;    //turn off relaxation osc 
 /* The PLL pre divider - 48MHz / 6 = 8MHz */
 MCF_CLOCK_CCHR = 0x05; 

 /* The PLL pre-divider affects this!
  * Multiply 48Mhz reference crystal /CCHR+1 by 8 to acheive system clock of 64Mhz
  */ 
 MCF_CLOCK_SYNCR = 0x0;
 MCF_CLOCK_SYNCR |= MCF_CLOCK_SYNCR_CLKSRC | MCF_CLOCK_SYNCR_PLLMODE; 
 //48
 MCF_CLOCK_SYNCR |= MCF_CLOCK_SYNCR_MFD(4) | MCF_CLOCK_SYNCR_RFD(1);    
 MCF_CLOCK_SYNCR |= MCF_CLOCK_SYNCR_PLLEN;   
 while (!(MCF_CLOCK_SYNSR & MCF_CLOCK_SYNSR_LOCK))
 {
    ;
 }

 

I learned that it maybe has problem with external 48 MHz crystal ----" you use a 48Mhz crystal on 3rd overtone, you need a 48Mhz crystal working on fundamental frequency.", i dont know which crystal is 3rd overtone or not??

 

why system clock is not change when used the above code and modifed the parameters of MCF_CLOCK_SYNCR_MFD??

 

I see the table 7-1 and table 7-2, i want to know  what is the crystal oscillator ,Relaxation oscillator ,external oscillator and on-chip oscillator? what is the different of those?

 

Table 7-1. Clocking Modes

CLKMOD[1:0]     XTAL     Clocking Mode
00                          0           MHz crystal oscillator bypass with PLL disabled
00                         1            Relaxation oscillator with PLL disabled
01                       Not          applicable MHz crystal oscillator with PLL disabled

 

Table 7-4. Clocking Modes

CLKMOD[1:0]    XTAL     Clocking Mode

00                        0             PLL disabled, clock driven by external oscillator
00                       1              PLL disabled, clock driven by on-chip oscillator
01                        N/A         PLL disabled, clock driven by external crystal

 

I found Table 7-14 in MCF52259RM involves the external oscillator mode and the external crystal mode, what is the different between the external oscillator mode and external crystal mode?


Table 7-14. OCLR Field Descriptions

bit[6]--Reference Source bit.

0      External oscillator is running in external oscillator mode.
1      External oscillator is running in external crystal mode.

 

Thanks for you reading ,waiting for your answer ....

Outcomes