MOTOROLA
MC68349 USER'S MANUAL
4- 7
4.2.2.5 SOFTWARE WATCHDOG. The SIM49 provides a software watchdog option to
prevent system lock-up in case the software becomes trapped in loops with no controlled
exit. Once enabled by the SWE bit in the SYPCR, the software watchdog requires a
special service sequence to be executed on a periodic basis. If this periodic servicing
action does not occur, the software watchdog times out and issues a reset or a level 7
interrupt (as programmed by the SWRI bit in the SYPCR). The address of the interrupt
service routine for the software watchdog interrupt is stored in the software interrupt vector
register (SWIV). Figure 4-3 shows a block diagram of the software watchdog as well as
the clock control circuits for the periodic interrupt timer.
The watchdog clock rate is determined by the SWP bit in the periodic interrupt timing
register (PITR) and the SWT bits in the SYPCR. See Table 4-7 for a list of watchdog
timeout periods.
The software watchdog service sequence consists of the following steps: 1) write $55 to
the software service register (SWSR) and 2) write $AA to the SWSR. Both writes must
occur in the order listed prior to the watchdog timeout, but any number of instructions or
accesses to the SWSR can be executed between the two writes.
CLOCK
DISABLE
PRESCALER (2 )
CLOCK
MUX
EXTAL
15 STAGE DIVIDER CHAIN (2 )
LPSTOP
SWP
PTP
FREEZE
SWCLK
PITCLK
PRECLK
9
15
.
22
9
11
13
15
RESET
4
MODULUS COUNTER
PIT
INTERRUPT
PITR
Figure 4-3. Software Watchdog Block Diagram
4.2.2.6 PERIODIC INTERRUPT TIMER. The periodic interrupt timer consists of an 8-bit
modulus counter that is loaded with the value contained in the periodic interrupt timing
register (see Figure 4-3). The modulus counter is clocked by a signal derived from the
EXTAL input pin unless an external frequency source is used. When an external
frequency source is used (MODCK low during reset), the default state of the prescaler
control bits (SWP and PTP) in the PITR is changed to enable both prescalers.
Either clock source (EXTAL or EXTAL
÷ 512) is divided by 4 before driving the modulus
counter (PITCLK). When the modulus counter value reaches zero, an interrupt is
generated. The level of the generated interrupt is programmed into the PIRQL bits in the
periodic interrupt control register (PICR). During the IACK cycle, the SIM49 places the
periodic interrupt vector, programmed into the PIV bits in the PICR, onto the internal bus.
The value of bits 7–0 in the PITR is then loaded again into the modulus counter, and the