Recently I started working with an LPC1768 development board and successfully programmed the board with a few different programs but when I wrote a program that switched the clock source from the internal clock to the main (12 Mhz) clock, the whole core became unresponsive. Any attempts to program or erase memory with J-Link have failed with error message stating no core found. I believe that the external oscillator may be faulty since the program worked fine before I changed the clock source.
Is there any way to program the device if it does not have a working clock (I know it boots to internal clock but very first line of code changes it to main oscillator) or will I have to fix the oscillator to get it running again?
Any help would be appreciated, thanks!
The user manual for the chip tells you the boot steps used.
Unless you have turn on ISP flash protection, you can keep one of the processor pins low when it boots, to force it to stay in the boot loader. The boot loader will then wait for serial transfer using FlashMagic.
One thing to remember when experimenting with the PLL, oscillator or similar, is that you should consider adding a delay loop before you do the "dangerous" tests. Then you get an extra window for the JTAG interface to pick up the processor.
Thank you!
I tied the ISP pin to ground and it worked.
That is really good advice. I will definitely do that from now on, I just did not know that the JTAG interface required a clock on the device. I realized I had just stupidly missed the part about enabling the main oscillator before switching the clock source.