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?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

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?

932 次查看
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.

标签 (2)
标记 (2)
0 项奖励
回复
0 回复数