11-4 MC68VZ328 User’s Manual
RTC Overview
11.1.4 Watchdog Timer
The watchdog timer is an added check that a program is running and sequencing properly. When the
application software is running, it is responsible for keeping the 2-seco nd watchd og timer fr om timin g out.
If the watchdog timer times out, it is an indication that the software is no longer being executed in the
intended sequence. At this time the watchdog timer generates either an interrupt or a reset signal to the
system.
Programming the watchdog timer (WATCHDOG) register determines if the 2-second rollover produces a
watchdog interrupt or a system reset. At reset, the watchdog timer is enabled and generates a syst em re set.
The watchdog timer is clocked by the 1Hz clock from the prescaler and therefore has 1-second resolution.
It is recommended that the watchdog timer be periodically cleared by software once it is enabled.
Otherwise, either a software reset or watchdog interrupt will be generated when the timer reaches a binary
value of 10. The timer can be reset by writing any value into it.
11.1.5 Real-Time Interrupt Timer
There is a real-time interrupt available to the user. This interrupt will occur at one of eight different
selected rates. Applications for the real-time interrupt can include digitizer sampling, keyboard
debouncing, or communication polling.
Each of the eight real-time interrupts operates at a fixed frequency. The frequencies of the real-time
interrupts are shown in Table11-9 on page 11-12. Bits RTE0–RTE7 in the RTC interrupt enable register
(RTCIENR) enable each of the eight different predefined rates. When the real-time interrupt occurs, it
applies a level 4 interrupt to the MC68VZ328 interrupt controller. The real-time clock (RTCEN bit in the
RTCCTL) or the watchdog timer (EN bit in the watchdog register) must be enabled for the real-time
interrupt timer to operate. If the RTC and watchd og timer are disabled, the real-time interrupt stops.
11.1.6 Minute Stopwatch
When enabled, the minute stopwatch performs a countdown that has a 1-minute resolution. The minute
stopwatch counts down and remains at decimal -1 until it is reprogrammed. The minute stopwatch can be
used to generate an interrupt after a certain number of minutes h ave el apsed. If the SW b it in t he RTCIENR
register is enabled with -1 (decimal) in the STPWCH register, an interrupt will be posted on the next
minute tick.

11.1.6.1 Minute Stopwatch Application Example

The minute stopwatch can be used to turn off the LCD controller after 5 minutes of inactivity. To
accomplish this, the minute stopwatch is programmed with a value of 5 minutes, and then the stopwatch
interrupt (SW bit) in the RTCIENR is enabled. At consecutive minute increments, the minute stopwatch
value is decremented. An SW interrupt is generated when the count er c ounts to - 1. The s topwatc h int erru pt
(SW bit) in the RTCISR occurs after 5 minutes. In a ddition to the 5 minutes of the stopwatch, there is an
unknown number of seconds from the time the stopwatch is set until the first minute.