Special Considerations
5-2
AVR ICE 200 User Guide
5.2
SLEEP
Instruction
If a SLEEP instruction is executed and sleep is enabled the AVR emulator chip will enter
one of the AVR low-power modes (power-down, power-save or idle). The power con-
sumption 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.
©
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()
#endif
5.3
Watchdog Timer
(WDT)
The watchdog timer operates asynchronously (it has its own clock) to the rest of the
system. The watchdog timer reset instruction is therefore repeatedly issued in stopped
mode to avoid false resets if the watchdog timer is enabled. Debugging the exact timing
of the WDT behavior while doing single-stepping or when stopping the program execu-
tion, is therefore not supported by the ICE 200.
Disabling WDT is secured by the WDTTOE (WDT turn-off enable) bit. Following is an
assembly program example that shows a WDT disable sequence:
disableWDT:
( cli )
; (only needed if any interrupts are in
; use)
ldi
r16, (1<<(1<<WDE)
; Set the WDT turn-off enable bit and
; the WDE bit
out
WDTCR, r16
ldi
r16, (0<<WDE)
; Within 4 cycles, clear the WDEbit
out
WDTCR, r16
done:
( sei )
; (only needed if any interrupts are in use)
The four cycle time-out for the WDT disabling is not supported by the AVR emulator chip
when in stopped mode. This means that single-stepping this sequence will not disable
the WDT.
©
Tip!
You can use the run to cursor to the instruction after the WDT enable bit is
cleared (labelled done in the example above), instead of doing single-step-
ping. Or use the following macro (for AVR assembler only).
MACRO:
.macro disableWDT
( cli )
ldi
r16, (1<<(1<<WDE)
out
WDTCR, r16
ldi
r16, (0<<WDE)
out
WDTCR, r16
( sei )
.endmacro
USAGE:
disableWDT
Содержание AVR ICE 200
Страница 1: ...ICE 200 User Guide ...
Страница 2: ......
Страница 6: ...Preface Read this First 1 2 AVR ICE 200 User Guide ...
Страница 10: ...Introduction 2 4 AVR ICE 200 User Guide ...
Страница 16: ...General Description 3 6 AVR ICE 200 User Guide ...
Страница 36: ...Appendix 6 4 AVR ICE 200 User Guide ...
Страница 37: ...Appendix AVR ICE 200 User Guide 6 5 ...
Страница 38: ...Appendix 6 6 AVR ICE 200 User Guide ...
Страница 39: ......