Sleep Instrucion (Special Considerations)
If a SLEEP instruction is executed the AT90EM04 will enter one of the AVR low power modes (power down, power save or idle). The power consumption will be slightly higher compared to the real chip due to the higher complexity of the emulator chip. In room temperature (25°C) this is not significant.

When the AT90EM04 enters a low power mode it can be waked up only by an external interrupt source from the target application, from peripherals giving interrupt (does not apply to power down), or by doing a reset, either from AVR Studio or via the reset pin. This might be a problem while debugging an unfinished system that does not yet generate any interrupts.

Note! The frequency view in AVR Studio use the cycle counter to calculate the target frequency. When the emulator enters one of the low power modes (sleep) the cycle counter is stopped and therefore the displayed frequency will be wrong.

Tip!
When debugging your application, you can replace the SLEEP instruction with a NOP by using macros.

IAR C example :

#ifdef SLEEPEMU
   #define SLEEP() _SLEEP()
#else
   #define SLEEP() _NOP()


See Also