I appreciate your comments and suggestions
You asked for it... ![]()
You have to follow the instructions in the almighty datasheet when you mess around with the WDTCSR
Which you haven't done. You need to save+disable interrupts before mucking with the WDT configuration and restore interrupts afterwards.
DDRB = 0x00; // set ports to intput to save power
DDRD = 0x00; // set ports to intput to save power
The datasheet and my testing are contradictory on this matter.
By my testing, a digital input is the worst choice. Without a pull-up (or pull-down) resistor, the input can (and does) float. Relatively speakinga, a floating pin is a power sponge...
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1243213127/2
My understanding from the ATtiny84 datasheet is that Power Down Sleep disables pins that have not been configured to perform "special" functions. If this is true then it is not necessary to make any changes before sleeping.
The best course is to connect a long wire to an unused pin, put the processor to sleep, and measure the current while waving your hand near the wire. If the current changes, the pin is floating and is going to be a power drain.
What happens inside the sleep_mode() command?
A sleep instruction is executed. I think the latest version: enables sleep, sleeps, disables sleep. But that's about it.
I have gone ahead and placed all my pins as inputs
INPUT w/ PULLUP, OUTPUT, or INPUT w/ external pull-whatever are better choices. Unless you want to turn off all digital outputs, you only need to worry about UNUSED pins.
and saved the peripheral fuses with dummy bytes
This is probably not necessary.
put the extra clocks into shutdown
This is definately not necessary. Power Down Sleep shuts off ALL clocks.
Finally, THANK YOU for publishing your work!
![]()