lpcware

Debug connection crashes when setting SYSOSCCTRL

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by ben1976de on Thu Jul 01 03:58:21 MST 2010
Hello,

when I am setting up the clock configuration for LPC1343 the debug connection crashes.
The manual says that setting SYSOSCCTRL to 0x1 means using external crystal from XTAL to fed PLL.

Here are my settings:
//set src to xtal
[SIZE=2]    LPC_SYSCON->SYSPLLCLKSEL = 0x1;               
    LPC_SYSCON->SYSPLLCLKUEN  = 0x01;              
    LPC_SYSCON->SYSPLLCLKUEN  = 0x00;
    LPC_SYSCON->SYSPLLCLKUEN  = 0x01;
    while (!(LPC_SYSCON->SYSPLLCLKUEN & 0x01));[/SIZE]

[SIZE=2]//set 48MHz
LPC_SYSCON->SYSPLLCTRL = 0x03;

//apply clock to main bus
    LPC_SYSCON->MAINCLKSEL = 0x03;                  
    LPC_SYSCON->MAINCLKUEN = 0x01;                
    LPC_SYSCON->MAINCLKUEN = 0x00;
    LPC_SYSCON->MAINCLKUEN = 0x01;
    while (!(LPC_SYSCON->MAINCLKUEN & 0x01));

//bypass IRC
    LPC_SYSCON->SYSOSCCTRL    = 0x01; //this is the place where it crashes

I want to use external crystal on the LPC board and simultanously SWD. Is that not possible?

Thanks

[/SIZE]

Original Attachment has been moved to: 1100506_LPCXpresso.zip

Outcomes