I have measured the time spent in deep sleep after calling server.sleepfor() [… as an aside, why is this a server method and not an imp method?]. Here are my results:
sleepfor(duration) Actual
10 14
8 12
6 10
4 8
2 6
0 4
And yes, 0.0 did work. A negative value bricked my imp though, until I power cycled it. There appears to be a +4 second offset applied to the sleepfor duration (for positive values only).
I have an April board powered from an external 3.5V power supply. I am measuring about 2 mA during deep sleep. This is considerably more than the 6 uA that the IMP should be drawing, even after adding in the operating current for the TPS62172 and efficiency losses. Any ideas?
The reason it’s called “server.sleepfor” is because before going to sleep, it tells the server how long it’ll be sleeping for (so the server knows when it should expect it to come back, at the latest). This allows the server to be cleverer about buffering messages and to be able to tell clients when buffered messages should be delivered to the imp.
Just looked a bit deeper here. I can replicate the higher current draw at 3.5v, and even higher (2.2mA) at 3.6v, but at 3.7v it drops to the twenty-something microamp range.
the load current. The device maintains output regulation in PWM mode. "
Thanks for the info. I can confirm that in the area of 3.7V the current draw drops to about 25 uA. I should have read the TI data sheet more carefully.
And I like the use of the FET for the power input reverse-polarity protection. Very clever.
…though, that’s probably not the best FET for that use (Vgs is max +/-12v, but the buck is ~16v). Should really have been a DMG2307 in there which has a 20v max Vgs.