How can software detect that the external oscillator does not work, and it should use the internal RC oscillator instead, and report this as an error?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can software detect that the external oscillator does not work, and it should use the internal RC oscillator instead, and report this as an error?

924 Views
lpcware-support
Senior Contributor I

At Power On Reset (POR) the IRC is the default clock source. Before switching to the XTAL oscillator, your code should wait for the PLL to lock with the XTAL before switching from the IRC.

Using a timer, wait for a defined period of time and if the PLL does not lock with the XTAL as the input clock source, switch the PLL clock source to the IRC.

During application code execution the WDT can be use to recover the device if the XTAL fails, resetting the device.

The startup code should check if the reset was due to the WDT timeout and if the XTAL will not lock, revert to the IRC. The Reset Source Identification Register (RSID) in the LPC17xx identifies the source of the reset.

Labels (2)
Tags (2)
0 Kudos
Reply
0 Replies