Content originally posted in LPCWare by funbotix on Wed Mar 02 21:54:48 MST 2016
According to paragraph 3.7.1 on page 29 in rev 3.1 of the LPC176x/5x User Manual, bit 5 of the System Control and Status register may be used to enable the main oscillator. The description says that when bit 5 is set
Quote:
The main oscillator is enabled, and will start up if the correct external circuitry is connected to the XTAL1 and XTAL2 pins.
My question is, then, does that mean if an application is using the internal RC oscillator, and it wants to use the PLL to get a faster CPU clock, should it NOT set bit 5 (since there will be no circuitry connected to the XTAL1 and XTAL2 pins)?
If I set bit 5 in that register using the internal RC oscillator as my clock source, sometimes bit 6 in that register (main oscillator status) will get set, indicating the main oscillator is ready for use, but sometimes it won't (and the startup code will hang forever waiting for bit 6 to get set), and sometimes after a few to many seconds bit 6 will eventually get set.
Should I NOT be enabling the main oscillator if I want to use the PLL with the internal RC oscillator? If the answer to that is no, can someone give me an idea as to why the main oscillator "ready" status bit behaves so unpredictably, and sometimes never gets set?
Thanks.