Keil™, An ARM® Company

µVision® IDE & Debugger

This feature works with...
ARMC166C251C51Eval

Power-Saving Modes

The µVision Debugger simulates the Idle, Power Down, and Brownout Modes found on many 8051, 251, 166, and ARM devices. Typically, there is no dialog support for these power-saving modes.

On the 8051, set Bit 0 of the PCON register to enable Idle Mode. For example:

PCON |= 0x01;

On the 8051, set Bit 1 of the PCON register to enable the Power-Down Mode. For example:

PCON |= 0x02;

On the 8051, you may check the status of the Power Off Flag by looking at Bit 4 of the PCON register. For example:

if (PCON &= 0x10)           /* if POF is set */
  {
  printf ("COLD Start\n");
  PCON &= ~0x10;            /* CLR POF */
  }
else                        /* if POF is clear */
  {
  printf ("WARM Start\n");
  }

Brownouts are simulated using a virtual target register named BROWNOUT. When you set the BROWNOUT VTREG to a value of 1, the µVision Debugger simulates a brownout condition (a drop of the power supply below the trip point and its return to normal). For example:

BROWNOUT = 1

A brownout typically triggers a reset or interrupt.

Notes Note

Be sure to refer to the datasheet for the device you use to determine how to enable Idle and Power-Down Modes.