[Solved!]SLEEPING ATmega328 in my case scenario!

I'm using i2c and SPI peripherals and switching off the UART, TIMER1 and TIMER2 along with ADC and BOD in the IDLE mode! I cannot achieve powerDown mode because Im not able to wake up from it! and maybe thats because I don't have a Oscillator aboard as I'm running ATmega328p on 8Mhz internal oscillator.

millis() depends on that TIMER0 so can't switch it off as I'm also using it, but this poses another overhead that the uC wakes up every millisecond.

If I power Down it then interrupts wake the uC but...but.. for some time , I think the power down deads all clocks and because of that the millis() etc elements that my code uses workout till getting overfload!!!!!

So if you put it to sleep, you don't have millis() or any other timer. Obviously.

What is the question?

Use the Watchdog timer to wake up.

There are plenty of forum examples. Food tiny85, I have one here:
http://www.hackster.io/rayburne/hot-yet

Ray

Wont use the watchdog ,need to wake through interrupt only already used watchdog not fine for my case.

If i powerdown the system then The interrupts keep on firing for some time but then after some seconds they dont fire ,im using pin 3 for it.

I'm using a interrupt from MMA8452Q on pin 3 ,I think may be I'll have to reinitialize the acc. when I wake up, trying that......

Reinitialization won't work.

So it seems now to work.

but still it maybecome a bit undependable in case the Interrupt source registers aren't cleared all fine, although I cleared it but ppl seem to have problem of INT1 or INT2 pin being high even when no interrupt is there and also the Source registers are cleared up.