The RTC input allows the chip to operate from a 32 kHz external clock crystal in either power down with only the RTC running or to clock the CPU in active mode if it is fed into the PLL. The RTC has calendar functionality and 2 KB of SRAM that can be kept alive during power down states to retain key data. Finally, the WDT is a programmable 32-bit timer with an internal prescaler. The purpose of the WDT is to reset the microcontroller within a reasonable amount of time if it enters an erroneous state. When enabled, the WDT will generate a system reset if the user program fails to reload the WDT within a predetermined amount of time. This timer can be sourced from RTC clock crystal, the IRC, or the APB peripheral clock.