How is the Real Time Clock (RTC) function implemented?
Answer First, the Internal RC Oscillator + RTC mode must be chosen, and an external 32768Hz Crystal connected to OSC1 and OSC2. Internally, the Timer/Counter should be selected to be in the Timer Mode with its clock sourced from the RTC OSC. This ensures that the timer keeps operating and generates a wake-up signal through an internal interrupt when in the HALT mode.