system
September 16, 2010, 12:25am
1
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).
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.
system
September 16, 2010, 1:03pm
3
ok
i often need to sleep for about 2usec (280(=72 20) 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
system
September 16, 2010, 2:00pm
4
ohoh
now i understand:
from standby it takes "extra 6 cycles"?
but an interrupt is still necessary?
i thought it would just wait for 6 clocks and then wake up...
-arne
system
September 20, 2010, 4:14pm
5
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
system
September 20, 2010, 8:24pm
6
i forgot to set bit 5 in ASSR... now TCNT2 overflow wakes the part up... -arne
Thanks for following up. I'm glad you got it working.