lpcware

Problem with RTC Oscilator

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Albert on Mon Jan 31 06:53:39 MST 2011
Hi!

I have a doubt about the use of RTC oscillator.

I tried to use the RTC oscillator to provide sinal clock to the CPU and USB, but my code din't work.

I tested this code in the LPCXpresso IDE with the LPCXpresso with LPC1768 target.

Somebody can point the problem with my code? Here it is.

LPC_SC->CLKSRCSEL = 2;//RTC -> PLL0
LPC_SC->PLL0CFG   = 5126; // Fcc0 = 480MHz
LPC_SC->PLL0FEED  = 0xAA; //Feed sequence
LPC_SC->PLL0FEED  = 0x55; //Feed sequence
LPC_SC->PLL0CON   = 0x01; //PLL0 Enable
LPC_SC->PLL0FEED  = 0xAA; //Feed sequence
LPC_SC->PLL0FEED  = 0x55; //Feed sequence
while ((LPC_SC->PLL0STAT & (1<<26))==0);  //Wait until stable. PROBLEM IT IS NEVER STABLE.

LPC_SC->PLL0CON   = 0x03;  //PLL0 Enable and Conect
LPC_SC->PLL0FEED  = 0xAA;//Feed sequence
LPC_SC->PLL0FEED  = 0x55;//Feed sequence
while ((LPC_SC->PLL0STAT & ((1<<25) | (1<<24)))==0); //Wait until stable.

Thanks!

Outcomes