P2 Powering Down
I often use my P2 hooked up to batteries, I hate being tethered to the outlet.
I do a lot of test code and the last line in my program is wait forever.
I was thinking, way am I running around in circles at 200Mhz in rabbit mode when I could be crawling around doing nothing in turtle mode.
The docs say it use 130ua in slooow mode so this would be great to keep my batteries charged longer.
So how does one switch to slow mode. Well, it turns out all you need to do is exclusive or bit 2 and your there.
New = _clkmode ^ 2; hubset(New);
Now my testing shows that when running normally with nothing attached it uses about 80ma of current at 8 volts or 400mw. In slow mode it about 2.5ma at 8 volts or 20mw, this is with both LED's (56, 57) off.
Not quite the low power in the spec sheet but there are LDO's to keep happy.
And if you use the Wifi module and get completely untethered it only need 15ma of current with intermittent burst of 30ma when it needs to check-in with the router.
This should keep my battery happy a little bit longer.
I suppose I should just unplug the battery while I'm testing then I can get that intermittent propeller not found when I upload my program.
Mike
Comments
for lowest power, also stop all the cogs...
Are you sure this wouldn't be the way to go, assuming you're running from cog 0?
No,
Okay, I see what you're doing (coffee hasn't quite kicked in). I did a P1 badge for DEF CON some years ago that shut down all cogs except 0 if there was no activity for 15 minutes. At this point, cog 0 would run in RC mode in a loop that that monitored the IR sensor for a signal; when detected a reboot command was issued to restart the badge.
Somebody I don't remember at the moment has found out that the P2 draws less power when all cogs execute a waitx command in a loop. Mysteriously, stopping all cogs draws more. In RCSLOW mode the difference should be barely noticable, though.