lpcware

LPC1768 using internal clock, SPI problems

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by Jonno on Wed Feb 24 05:42:29 MST 2016
Hi All,

I have a prototype circuit using an LPC1768 which communinicates with other devices using SPI. This works fine when using an external 12MHz oscillator to drive the LPC1768.

However, I typically use the internal oscillator for production boards, to save on cost. When I change to use the internal oscillator the code hangs when it does an SPI write.

The code I change for system_LPC17xx.c to use the internal oscillator is (in part):

// Use internal clock instead of external oscillator
#define CLOCK_SETUP           1
//#define SCS_Val               0x00000020
#define SCS_Val               0x00000000
// original value
//#define CLKSRCSEL_Val         0x00000001
#define CLKSRCSEL_Val         0x00000000
#define PLL0_SETUP            1
//#define PLL0CFG_Val           0x00050063
#define PLL0CFG_Val           0x00050066
#define PLL1_SETUP            0
#define PLL1CFG_Val           0x00000023
#define CCLKCFG_Val           0x00000003
#define USBCLKCFG_Val         0x00000000
#define PCLKSEL0_Val          0x00000000
#define PCLKSEL1_Val          0x00000000
#define PCONP_Val             0x042887DE
#define CLKOUTCFG_Val         0x00000000

Any suggestions on how I can get the SPI working again?

Outcomes