mcf52259 oscillator question

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

mcf52259 oscillator question

Jump to solution
595 Views
anvaya
Contributor II

Hi all:

I want to design a board with mcf52259 and need some advice.

The clock will be generated from an ic chip.The chip should be configed via i2c before working.

If I want to use the internal clock to boot the system,and then config the ic chip, swith the internal  clock to the external clock,which clock mod should i choose?I mean the CLKMOD[1:0] and the XTAL pin.I have confused on the description of the three pin. Are they just only useful in booting sequecne?

 

Thanks. Best regards.

HuQi

Labels (1)
0 Kudos
1 Solution
451 Views
TomE
Specialist II

> I think you mean the procedure should be internal clock ->external oscillator->external oscillator with PLL


Yes, you are correct. I thought it was possible to run the CPU from the Reference Clock while running the PLL from the External clock, but that's not possible. I think that you have to run on PLL Bypass, start the PLL and then don't switch over to it until the registers say it is OK or you can crash the CPU.

> Is there any way other than"wait a while" to realize it?


I meant to say that you would have to read the Data Sheet for the external oscillator that you're using, and then do whatever it says. it may have a "maximum startup time" or a "maximum stabilization time" after you program it that you will have to guarantee in your programming of the MCF52259. It may have some registers that you can read back to check its state. In the simplest case you'll have to wait for the "Data Sheet Guaranteed Maximum", but rather than type in over 80 words (like I've just done now) I decided to summarize that as "wait a while".


Tom

View solution in original post

0 Kudos
3 Replies
451 Views
TomE
Specialist II

> .I have confused on the description of the three pin. Are they just only useful in booting sequecne?

MCF52259 Reference Manual:

7.3.5 Clock Mode Selection (CLKMOD[1:0])

These digital inputs are sampled during reset (all resets including cold and warm resets) and determine

which clock source should be used as the system clock, as illustrated in Table 7-1.

CLKMOD[1:0]     XTAL     Clocking Mode

Yes, they are only sampled at reset, which for you is when you boot. After that your code can change the clock setup by writing to control registers.

You should wire it to start in "PLL disabled, clock driven by on-chip oscillator". CLKMOD [0:1] are dedicated pins on this chip so you can tie them both to ground.

The XTAL pin needs to be pulled high. I'd pull it high with a 1k to 10k resistor in case it gets enabled as an output somehow.

Start up on the internal clock, start the external oscillator, wait a while for it to stabilise and then switch to the external clock.

Then you should look for some example code that shows how to enable the PLL and switch over to it (if you are using the PLL). I suspect you have to start the PLL while in PLL Bypass mode, then you have to WAIT until the PLL is stable (SYNSR[LOCK] bit and maybe others) and only then switch over to the PLL.

Tom

451 Views
anvaya
Contributor II

Thank you ,Tom.

I think you mean the procedure should be internal clock ->external oscillator->external oscillator with PLL.It is just what i want.

Another question, you said"start the external oscillator, wait a while for it to stabilise and then switch to the external clock".

I want to check out the working status of the external oscillator.If it works well,the system will run under external oscillator,else the system will still run under internal clock.Is there any way other than"wait a while" to realize it?You know,if the external oscillator not exist,the system can't work again!

0 Kudos
452 Views
TomE
Specialist II

> I think you mean the procedure should be internal clock ->external oscillator->external oscillator with PLL


Yes, you are correct. I thought it was possible to run the CPU from the Reference Clock while running the PLL from the External clock, but that's not possible. I think that you have to run on PLL Bypass, start the PLL and then don't switch over to it until the registers say it is OK or you can crash the CPU.

> Is there any way other than"wait a while" to realize it?


I meant to say that you would have to read the Data Sheet for the external oscillator that you're using, and then do whatever it says. it may have a "maximum startup time" or a "maximum stabilization time" after you program it that you will have to guarantee in your programming of the MCF52259. It may have some registers that you can read back to check its state. In the simplest case you'll have to wait for the "Data Sheet Guaranteed Maximum", but rather than type in over 80 words (like I've just done now) I decided to summarize that as "wait a while".


Tom

0 Kudos