lpcware

Did I brick my 1768 Xpresso board?

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by dbrunell on Fri Sep 03 13:53:59 MST 2010
I have an application where I need to run the CPU clock at 104 MHz in order to get the correct ADC timing. I know that the 1768 is rated at 100 MHz, and I will have to use the 1769 in production, but I was hoping to stretch the 1768 a little for prototyping purposes.  I inserted the following code at the beginning of my program to adjust the CPU clock frequency:
int main(void) {
   
    LPC_SC->PLL0CFG = 0x0005004E;
    LPC_SC->PLL0FEED = 0xAA;
    LPC_SC->PLL0FEED = 0x55;

    LPC_SC->CCLKCFG = 2;    // Change divisor to 3
...
I first tested the first three lines, prior to the CCLKCFG assignment, and it worked as expected (M=78, N=6, Fcco=312 MHz, CCLK=78 MHz).  Then I added the line to change the CCLK divisor from 4 to 3 (value to assign is n-1),  and the board stopped responding to the debugger.  I get the following error now when I try to debug:
02: Failed on connect: Em(12). System rejected access at location 0xE000EDF0 
  - verify Population of memory and peripherals
Is there a way to recover from this?

I think there should be better documentation on how best to change the clock frequency.  I can't find any source code examples for the LPCXpresso environment.  I didn't want to modify system_LPC17xx.c, since changing part the CMSIS library seems like bad programming form.

Outcomes