Mini / sleep mode / standby

Hi!

Today I got an Arduino Mini.

I try to use not so much power...

The power regulator seems to be not so important:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1284564128/2#2

But sleep modes promise huge savings...

I would like to use "sleep mode standby" whenever i would normally use "delayMicroseconds"... The datasheet says "From Standby mode, the device wakes up in six clock cycles." (page 42, 9.6). :sunglasses:

But when I try it, like this:

SMCR = 13; asm("sleep\n");

the Mini just freezes... much longer than just 6 cycles... :o

How can I sleep for just 6 cycles?

Thx.

Bye
Arne

How can I sleep for just 6 cycles?

There's no reason to sleep for that short of a time. Your application will consume more time than that going to bed and then waking up.

ok

i often need to sleep for about 2usec (280(=7220) times per msec)...
and about 7 times per msec i need to sleep for 20usec...

i hoped that 6 cycles sleep + tuck-in + wake-up would be 1usec...

any ideas?

-arne

ohoh

now i understand:
from standby it takes "extra 6 cycles"?
but an interrupt is still necessary? :wink:

i thought it would just wait for 6 clocks and then wake up...

-arne

with setting TCNT2 and SLEEP_MODE_IDLE i was able to save 3mA of 20mA...

why doesnt the overflow of TIMER2's TCNT2 cause a wake up from SLEEP_MODE_POWER_SAVE?

-arne

i forgot to set bit 5 in ASSR... now TCNT2 overflow wakes the part up... -arne :smiley:

Thanks for following up. I'm glad you got it working.