Real-time clock (RTC) operation
STFPC320
6.3
Watchdog timer
The watchdog timer can be used to detect an out of control microprocessor. The user
programs the watchdog timer by setting the desired amount of time-out into the Watchdog
Register, address 09h. Bits BMB4-BMB0 store a binary multiplier and the three bits RB2-
RB0 select the resolution where:
● 000 = 1/16 second (16Hz)
● 001 = 1/4 second (4Hz)
● 010 = 1 second (1Hz)
● 011 = 4 seconds (1/4Hz)
● 100 = 1 minute (1/60Hz)
Note:
Invalid combinations (101, 110, and 111) do NOT enable a watchdog time-out. Setting the
BMB4-BMB0 = 0 with any combination of RB2-RB0, other than 000, will result in an
immediate watchdog time-out. The amount of time-out is then determined to be the
multiplication of the five-bit multiplier value with the resolution. (For example: writing
00001110 in the Watchdog register = 3*1 or 3 seconds). If the processor does not reset the
timer within the specified period, the STFPC320 generates a watchdog output pulse on the
IRQ_N/SQW pin.
The watchdog timer can only be reset by having the microprocessor perform a WRITE of the
Watchdog register. The time-out period then starts over. Should the watchdog timer time-
out, any value may be written to the Watchdog Register in order to clear the IRQ_N/SQW
pin. A value of 00h will disable the watchdog function until it is again programmed to a new
value. A READ of the Flags Register will reset the Watchdog flag (Bit D7; Register 0Fh). The
watchdog function is automatically disabled upon power-up, and the Watchdog Register is
cleared.
6.4
Real-time clock (RTC)
The RTC keeps track of the date and time. Once the date and time are set, the clock works
when the STFPC320 is in normal operation and standby operation. The wake-up alarm
feature is included in the RTC module. The accuracy of the RTC is approximately 10 ppm
(±25 secs/month).
The wakeup alarm is programmed to wake up once the date and time set are met. This
feature is present in normal and standby mode of operation. Only one date and time is
available for setting.
The real-time clock (RTC) uses an external 32.768 kHz quartz crystal to maintain an
accurate internal representation of the second, minute, hour, day, date, month, and year.
The RTC has leap-year correction. The clock also corrects for months having fewer than 31
days.
24/78