Opierałem się na programie z projektu pilota na podczerwień.
Zaglądałem do noty katalogowej na stronie 33 jest opis trybu uśpienia dla atmegi16.
Taka jest jego treść:
Cytuj:
When the SM2..0 bits are written to 010, the SLEEP instruction makes the MCU enter Powerdown
mode. In this mode, the External Oscillator is stopped, while the External interrupts, the
Two-wire Serial Interface address watch, and the Watchdog continue operating (if enabled).
Only an External Reset, a Watchdog Reset, a Brown-out Reset, a Two-wire Serial Interface
address match interrupt, an External level interrupt on INT0 or INT1, or an External interrupt on
INT2 can wake up the MCU. This sleep mode basically halts all generated clocks, allowing operation
of asynchronous modules only.
Note that if a level triggered interrupt is used for wake-up from Power-down mode, the changed
level must be held for some time to wake up the MCU. Refer to “External Interrupts” on page 68
for details.
When waking up from Power-down mode, there is a delay from the wake-up condition occurs
until the wake-up becomes effective. This allows the clock to restart and become stable after
having been stopped. The wake-up period is defined by the same CKSEL Fuses that define the
reset time-out period, as described in “Clock Sources” on page 25.
I tu nie widzę że wybudzanie jest poziomem niskim. Jedynie INT0 i INT1 zewnętrznym poziomem przerwania (co do końca nie wiem o co tu chodzi) lub zewnętrznym przerwaniem INT2.
Krauser napisał(a):
Nie zgodzę się z Mirkiem. INT2 jest w stanie wybudzić procesor z PowerDown. A co do programu to w funkcji obsługi przerwania kasowanie flagi nie jest potrzebne, bo w momencie wywołania procedury obsługi przerwania flaga jest sprzętowo zerowana. Proponuje za to wstawić tam tymczasowo mignięcie LEDem.
Jeżeli jest taka możliwość to gdzie zrobiłem błąd że nie wybudza mi?
W układzie nie mam możliwości w tej chwili podłączyć diody LED spróbuję mrugnąć podświetleniem LCD, efekt powinien być ten sam?