LPC1769 Clock Source Select Not Working
02-22-2018
03:40 PM
806 Views
alexanderwashin
Contributor I
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Any ideas of why it is crashing?
1 Reply
02-24-2018
05:42 AM
669 Views
alexanderwashin
Contributor I
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's suddenly working...
