PPC5606 external clock problems

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

PPC5606 external clock problems

Jump to solution
658 Views
Oliver
Contributor III

Hi everyone, I am having trouble switching a PPC5606 to external clock.

I'm basically trying to run the demo code CW_FTF_V3 from "Demo code to test functionality of Spectrum Cluster Board". Now, the demo code is 3 years old, and my CPU has mask set 1M25V, maybe there has been some change in the clock module? I checked the code against the MPC5606RM, and I haven't found what may be the problem. Anyway, here's the code:

// disable watchdog SWT.SR.R = 0x0000c520; /* key */ SWT.SR.R = 0x0000d928; /* key */ SWT.CR.R = 0x8000010A; /* disable WEN */ /* Enbable all peripheral clocks */ CGM.SCDC.R = 0x80808080; /* Setting RUN Configuration Register ME_RUN_PC[0] */ ME.RUNPC[0].R=0x000000FE; /* Peripheral ON in every mode */ CGM.OCDSSC.B.SELCTL=1; //Select Fast IRC (16 MHz) as clock output /* Re-enter in DRUN mode to update */ ME.MCTL.R = 0x30005AF0; /* Mode & Key */ ME.MCTL.R = 0x3000A50F; /* Mode & Key */ ME.DRUN.B.XOSC0ON=1; /* Switch on external osc */ ME.DRUN.B.SYSCLK=3; /* Select external osc */ /* RE enter the drun mode, to update the configuration */ ME.MCTL.R = 0x30005AF0; /* Mode & Key */ ME.MCTL.R = 0x3000A50F; /* Mode & Key inverted */ while(ME.GS.B.S_OSC==0) ; /* Wait for external osc to stabilize */      ;

...and this is where it hangs. External osc never comes up. However, it's a simple 8 MHz crystal with a pair of 20p caps to ground, about 5mm from the CPU pins. I don't see why it wouldn't oscillate. Am I missing something? Is there some sort of external requirement to switch the osc on? Or is there a bit that needs to be set somewhere to enable it?

Any help would be appreciated!

Best regards, Oliver

0 Kudos
Reply
1 Solution
481 Views
Oliver
Contributor III
Problem solved, well sort of. The code was okay, everything works fine with an external oscillator.

The problem was getting the oscillator to run. I tried two different 8 MHz and 16 MHz crystals - both refused to start up, the capacitor selection must be critical. So I did myself a favor and designed a crystal osc can into my design, and now it's working reliably.

View solution in original post

0 Kudos
Reply
1 Reply
482 Views
Oliver
Contributor III
Problem solved, well sort of. The code was okay, everything works fine with an external oscillator.

The problem was getting the oscillator to run. I tried two different 8 MHz and 16 MHz crystals - both refused to start up, the capacitor selection must be critical. So I did myself a favor and designed a crystal osc can into my design, and now it's working reliably.

0 Kudos
Reply