Martin Dusek

Can't make clock driven by crystal working on MCF52210

Discussion created by Martin Dusek on Mar 8, 2011
Latest reply on Mar 10, 2011 by Martin Dusek

Hello,

I have 8 MHz crystal ( http://uk.farnell.com/jsp/search/productdetail.jsp?CMP=i-ddd7-00001003&sku=1611765 ) and want to drive clock in my MCF52210 by it. System clock should be 48 MHz. I try to run this code:

 

 

    MCF_CLOCK_OCLR  = 0xf0;    MCF_CLOCK_CCHR  = 0;    MCF_CLOCK_SYNCR = MCF_CLOCK_SYNCR_RFD(0) |                      MCF_CLOCK_SYNCR_MFD(1) |                      MCF_CLOCK_SYNCR_PLLMODE|                      MCF_CLOCK_SYNCR_PLLEN;        /* wait for PLL locks before switching clock source */    while (!(MCF_CLOCK_SYNSR & MCF_CLOCK_SYNSR_LOCK)) {}    /* now changing clock source is possible */    MCF_CLOCK_CCLR  = 0;    MCF_CLOCK_SYNCR |= MCF_CLOCK_SYNCR_CLKSRC;          /* wait for PLL lock again */    while (!(MCF_CLOCK_SYNSR & MCF_CLOCK_SYNSR_LOCK)) {}

 

 

 but all the time I get 0x48 value in SYNSR register. It means that clock is not driven by crystal but by on-chip oscillator. How to make crystal driven clock working on MCF52210?

 

Thank you for your advice.

 

Martin

Outcomes