Intersting - didn't know that. Check out the following from the data sheet though:
14.2.6 Unconnected Pins
If some pins are unused, it is recommended to ensure that these pins have a defined level. Even though most of the digital inputs are disabled in the deep sleep modes as described above, floating inputs should be avoided to reduce current consumption in all other modes where the digital inputs are enabled (Reset, Active mode and Idle mode).
Seems that INPUT without pullup is ok during sleep and probably still better than OUTPUT in that case.
Putting the INPUT pin to pinMode(pin,INPUT_PULLUP) does set the pin to "a defined level". Leaving them float (as in INPUT mode) is 'undefined' and the wrong thing to do. Also, if the OUTPUT is not pulling current (due to resistive or bipolar load) then it takes NO current to keep it at that state.
I checked out a couple more of my Moteinos: not all of the flash chip equipped ones have the problem. In fact after refreshing all moteinos I can only reproduce the problem with one of them.
This Moteino is used as outside hygrometer. Now I've had one similar problem with another outside Moteino: I had one on the top of the sewage container unprotected and since it got very humid in there it stopped working after a while due to shorts. When I recovered it, the moteino still worked, but now used >1ma of sleep power. This problem was fixed by potting the electronics in epoxy for the next version.
So maybe outside weather causes subtle defects in the atmega chip causing these problems? Anybody seen anything like that before?
Yeah, unfortunately, I have. And it was similar condition, I had a soil moisture sensor that I hadn't assembled properly and was humid inside the enclosure. It stopped working after a day and, when I took it apart, found that the ATmega328P had 'hair' growing on half of its pins, the beginnings of some serious corrosion!
I removed the circuit board, thoroughly cleaned with 91% IPA, let it dry and then dipped the whole thing in spar varnish. I think cleaning was the secret because I am now 'religious' about cleaning all my Moteinos and haven't had a problem since. I suspect, but haven't confirmed with Felix, that there is 'no clean' flux residue on the board and it's reacting to the high humidity. Washing with IPA is highly recommended, especially if it's an outdoor circuit.
Tom