4126F–CAN–12/03
Reset Recomme nd ation
to Prevent Flash
Corruption
When a Flash program memory is embedded on-chip, it is strongly recommended to
use an external reset chip (brown out device) to apply a reset (Figure 7). It prevents sys-
tem malfunction during periods o f insufficient power-supply voltage (p ower-su pply
failure, power supply switched off, etc.).
Idle Mode Idle mode is a power reduction mode that reduces the power consumption. In this mode,
program exec ution halts. Idle mode freezes the clock to the CPU at known states while
the peripherals continue to be clocked. The CPU status before entering Idle mode is
pr eserved, i .e., the p rogram c ounter a nd pro gram stat us word regi ster retai n their data
for the duration of Idle mode. The contents of the SFRs and RAM are also retained. The
status of the Port pins during Idle mode is detailed in T able 13.
Ente ring Idle Mode To enter Idle mode, set the I DL bit in PCO N regi ster (See Table 1 5). The T 89C51CC02
enters Idle mode upon execut ion of t he i nstruction that se ts IDL bit. The in struction that
sets IDL bit is the last instruction executed.
Note: If IDL bit and PD bit are set simultaneously, the T89C51CC02 enters Power-down m ode.
Then it does not go in Idle mode when exiting Power-down mode.
Exi t ing Idle Mode T here are two ways to exit Idle mode:
1. Generate an enabled interrupt.
Hardware clears IDL bit in PCON register which restores the clock to the CPU. Exe-
cution resu mes with the interrupt service routine. U pon completion of the interrupt
service rou tine, p rogram execution res um es with t he i nstruction imm edia tely follow-
ing the instruction that activated Idle mode. The general purpose flags (GF1 and
GF0 in PCON regist er) may be u sed to ind icate whether an i nterrupt occurred dur-
ing norm al o peration or during Idle m ode . W hen I dle mode is exited by an interrupt,
the interrupt service routine may exam ine GF 1 and GF0.
2. Generate a reset.
A l ogic hi gh on the R ST pi n clears I DL bit i n PCO N regist er direc tly and asynch ro-
nously. This restores the clock to the CPU. Program execution momentarily
resumes with the instruction imme diately following the instruction th at ac tivated the
Idle mode and may continue for a number of clo ck cycles before the internal reset
algo rithm take s contro l. Rese t initializes t he T8 9C51CC 02 a nd vecto rs the CPU to
addres s C:0000h.
Notes: 1. During the time that execution resumes, the internal RAM cannot be accessed; how-
ever, it is possible for the Port pins to be accessed. To avoid unexpected outputs at
the Port pins, the instruction immediately following the instruction that activated Idle
mode should not write to a Port pin or to the external RAM.
2. If Id le mode i s invoked by ADC Idle, the ADC conversi on com pletion will e xi t Id le .
Power-d own Mode The Power-down mode places the T89C51CC02 in a very low power state. Power-down
mo de stops the oscillator, fre ezes all cloc k at known states. The CPU status prior t o
entering Power-down mode is preserved, i.e., the program counter, program status
word register retain their data for the duration of Power-down mode. In addition, the
SF Rs and RA M contents are preserv ed. T he s tatus of th e Port pins during Powe r-d own
mode is detailed in Table 13.
Entering Power-d own Mode To enter Power-down mode, set PD bit i n PC ON register. The T89 C51CC02 enters the
Power-down mode upon execution of the instruction that sets PD bit . The instruction
that sets PD bit is the last instruction executed.