
22
4126L–CAN–01/08
Reset Re commendation
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 of insufficient power-supply voltage (power-supply
failure, power supply switched off, etc.).
Idle Mode Idle mode is a power reduction mode that reduces the power consumption. In this mode,
progra m execution halts . Idle mode freezes the clock to the CPU at kn own states while
the peripherals continue to be clocked. The CPU status before entering Idle mode is
preserved, i.e., the program counter and program status word register retain 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 Table 15.
Entering Idle Mode To enter Idle mode, set the IDL bit in PCON register (See Table 16). The
A/T89C51CC02 enters Idle mode upon execution of the instruction that sets IDL bit. The
instruction that sets IDL bit is the last instruction executed.
Note: If IDL bit and PD bit are set simultaneously, the A/T89C51CC02 enters Power-down
mode. Then it does not go in Idle mode when exiting Power-down mode.
Exiting Idle Mode There 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 resumes with the interrupt service routine. Upon completion of the interrupt
service r out ine , pr o gram ex ec uti on re sumes wi th the in struc ti on im med iat ely f oll ow-
ing the instruction that activated Idle mode. The general purpose flags (GF1 and
GF0 in PCON register) may be used to indicate whether an interrupt occurred dur-
ing no rmal op er ation or duri ng I dle mo de. When Idle mo de i s ex ite d b y a n i nte rrup t,
the interrupt service routine may examine GF1 and GF0.
2. Generate a reset.
A logic high on the RST pin clears IDL bit in PCON register directly and asynchro-
nously. This restores the clock to the CPU. Program execution momentarily
resum es with the in structio n immed iately foll owing t he instruc tion that ac tivated the
Idle mode and may continue for a number of clock cycles before the internal reset
algorithm takes control. Reset initializes the A/T89C51CC02 and vectors the CPU to
address C:0000h.
Note s : 1. D ur i ng the t im e th at ex ec uti o n re su me s, th e i nte r na l R AM ca n no t be ac ce ss ed ; ho w -
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 Idle mode is invoked by ADC Idle, the ADC conversion completion will exit Idle.
Power-down Mode The Power-dow n mode pla ces the A/T 89C51CC02 in a very lo w power state. Power-
down m ode st ops t he oscill ator , freez es a ll c lock at k nown s tate s. The CPU st atus p rior
to 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
SFRs a nd RAM c on tents are pres er ved. T h e s tatu s o f the Po rt pins dur in g P ower -do w n
mode is detailed in Table 15.
Entering Power-down Mode To enter Power-down mode, set PD bit in PCON register. The A/T89C51CC02 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.