AVR SLEEP Mode Help
Discussion in "AVR Discussion Forum" started by compaq Jan 29, 2013.
Tue Jan 29 2013, 03:36 pm
hi
i am using AVR atmega128 , i want to use the sleep mode for power saving
and i want to wake up device on the basis of external interrupt 5,
the interrupt works ok if i am using it in normal mode,
but when i turn the MCU to sleep mode the external interrupt does not work
please help
thank you
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
sleep_enable();
sei();
sleep_mode();
// code stucks here and interrupt does now work
sleep_disable();
i am using AVR atmega128 , i want to use the sleep mode for power saving
and i want to wake up device on the basis of external interrupt 5,
the interrupt works ok if i am using it in normal mode,
but when i turn the MCU to sleep mode the external interrupt does not work
please help
thank you
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
sleep_enable();
sei();
sleep_mode();
// code stucks here and interrupt does now work
sleep_disable();
Wed Jan 30 2013, 03:14 pm
Wed Jan 30 2013, 03:23 pm
hi
i have seen this document before, thanks for sharing, but the problem is this i am unable to wake up device using interrupt 5, it only wakes up using interrup 0 so this was the issue.
thank you
i have seen this document before, thanks for sharing, but the problem is this i am unable to wake up device using interrupt 5, it only wakes up using interrup 0 so this was the issue.
thank you
Sun Feb 03 2013, 04:06 am
is interrupt 5 enabled? and ATmega128 only get enabled if interrupt 5 is configured for level interrupt. check page 56 of datasheet for info on wakeup sources.
Powered by e107 Forum System