WDT oscillator is selected).
•The contents of the on-chip RAM and regis-
ters remain unchanged.
•The WDT and WDT prescaler are cleared and
re-counted (if the clock of WDT is from the
WDT oscillator).
•All the I/O ports m ai nta in thei r ori gin al stat-
uses.
•The PD flag is set and the TO flag cleared.
The system can quit the HALT mode by an exter-
nal reset, interrupt, external falling edge signal
on port A or WDT overflow . An external reset leads
to device initialization and a WD T overflow per-
forms a “warm reset”. The reason for chip reset
can then be determined after examining the TO
and PD flags. The PD flag is cleared when the
system powers up or executes the “CLR WDT”
instruction and set when the “HALT” instruction
is executed. The TO flag is set if the WDT time-out
occurs, and causes a wake-up that resets only PC
and SP. The others maintain their original stat-
uses.
The port A wake-up and interrupt methods can be
considered as a continuation of normal execution.
Each bit in port A can be independently selected
to wake up the device by mask option. Awakening
from an I/O port stimulus, the program resumes
execution of the next instruction. However, if it is
awakening from an interrupt, two sequences may
happen. The program will resume execution at
the next instruction if the related interrupt(s) is
disabled or the interrupt(s) is enabled but the
stack is full. Nonetheless, if the interrupt is en-
abled and the stack is not full, a regular interrupt
response takes place.
Once the wake- up event(s) occurs, and t he system
clock comes fr om crystal, it t akes 1024 tSYS (sys-
tem clock period) to resume a normal operation.
That is to say, the HT827XX series will insert a
dummy period after the wake-up. If the system
clock, on the other h and, is from an RC type of
oscillator, it will continue operation. The actual
interrup t subrouti ne execution will be delayed
by one or more cycles if the wake-up results
from an interrupt acknowledge. It, on the other
hand, will be executed immediately after the
dummy period is finished if the wake-up results
in the next instruction execution.
To minimize power consumption, all the I/O
pins should be carefully man aged before enter-
ing the HALT mode.
Reset
There are three ways in which a reset can occur:
•RES reset during normal operation
•RES reset duri ng HALT
•WDT time-out reset during a normal operation
The WDT time-out during HALT is different
from other chip reset conditions, since it can
perform a “warm reset” that resets only PC and
SP, leaving the other circuits remain in their
origina l states. Som e registers will remain un -
changed during reset conditions. Most registers
are reset to the “initial condition” once the reset
conditions are met. The program can distin-
guish be tween differen t “chip res ets” by e xam-
ining the PD flag and TO flag.
TO P D RESET Conditions
00RES reset duri ng power -up
uu
RES reset duri ng normal
operation
01
RES wake-up HALT
1u
WDT time-out during normal
operation
1 1 WDT wake-up HALT
Note: “u” means “unchanged”.
To guarantee that the crystal oscillator is
started and stabilized, XST (Crystal Start-up
Timer) provides an extra-delay by an OSC mask
option. The extra-delay delays 1024 system
clock pulses when th e system awakes from the
HALT state or from system power-up and the
RES transforms low to high. XST is automat-
ically selected if the crystal oscillator is in-
voked. It, on the other hand, is disabled when
the RC oscillator is chosen. The XST delay is
added after XST is chosen and awakening from
the HALT state or the system powers up.
The reset duration comes only from RES if an
RC oscillator is selected. An extra delay, on the
other hand, is added during the power-up pe-
riod and any wakeup from HALT only if a crys-
tal oscillator is chosen instead.
HT827XX
20 4th Jan ’97