If the FOS bit is set to 1, it automatically changes to the RC oscillator when the XT oscillator fails. Conversely, when the operation of the XT oscillator returns to normal, will it be automatically changed to the XT oscillator? If we need to manually return to the XT oscillator, please let us know the flow.
Yes. If the FOS bit is set to 1, it automatically changes to the RC oscillator when the XT oscillator fails. It will also automatically change back to XT if XT oscillator oscillation returns to normal. This can be demonstrated by reading the Oscilltion Status Register (address 0x7D). Bit #4 of the Oscillation Status Register indicates if XT or RC is currently being used.
1.) Configure RTC to use XT and set FOS bit
2.) Read the Oscillation status register periodically. Bit #4 should be "0" indicating XT is being used.
3.) Short one of the XO or XI pins to ground. Crystal will stop and auto-switch to RC should occur
4.) Oscillation status register bit #4 should change to "1" indicating RC osillator active 5. Stop shorting XO / XI pin. XT oscillation should restart within a couple seconds 6. Once XT oscllation resumes, bit #4 of Oscillation Status register will change back to "0" indicating XT is being used.