LPC1769 Clock Source Select Not Working

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

LPC1769 Clock Source Select Not Working

806 Views
alexanderwashin
Contributor I

My debugger crashes when the main oscillator is connected to the PLL.

void SystemInit (void)
{
#if (CLOCK_SETUP) /* Clock Setup */
LPC_SC->SCS = SCS_Val;
LPC_SC->SCS = 0; /* Debug mode, Int. Oscillator */
if (SCS_Val & (1 << 5)) { /* If Main Oscillator is enabled */
while ((LPC_SC->SCS & (1<<6)) == 0);/* Wait for Oscillator to be ready */
}

LPC_SC->CCLKCFG = CCLKCFG_Val; /* Setup Clock Divider */

LPC_SC->PCLKSEL0 = PCLKSEL0_Val; /* Peripheral Clock Selection */
LPC_SC->PCLKSEL1 = PCLKSEL1_Val;

LPC_SC->CLKSRCSEL = CLKSRCSEL_Val; /* Select Clock Source for PLL0 */

The debugger crashes on the last line of code. I use an oscillator that generates a 12MHz clock. The schematic is shown below.

pastedImage_2.png

Any ideas of why it is crashing?

Labels (1)
0 Kudos
Reply
1 Reply

669 Views
alexanderwashin
Contributor I

It's suddenly working...  

0 Kudos
Reply