Sleep/wakeup problrem with mega1284p

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've used this method before on a couple of different megas and it worked fine.

 

I'm trying it on a mega1284p and it does not wakeup.

 

            //enable int0 for wake up
            EIMSK|=_BV(INT0);

 

            set_sleep_mode(SLEEP_MODE_PWR_DOWN);
            sleep_mode();

 

//sleeping here

 

            //disable int0
            EIMSK&=~_BV(INT0);

 

It goes to sleep just fine.  It is the wakeup that is not working.  The INT0 has its pullup enabled and it switched to ground with a momentary switch.  I can see that the switch/signal work as I use it for a button.  But once it falls asleep, it won't wake up.

 

ISC00/ISC01 in EICRA are untouched and default to zero.  low level of INT0 should generate the interrupt request.

 

Even when sleeping, the pullup is still enabled and I can see the line go low/high when I press the button.

 

Any ideas?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Figured out.  Have to enable interrupts for it to wake up.