gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > GBA battery consumption

#113942 - doynax - Mon Jan 01, 2007 3:32 pm

I'm working on a small book reader application for the GBA. And, yes, I'm aware of the one from Crowe Workshop, but it's got all sorts of small annoyances and limitations.

Perhaps not so surprisingly one of my main goals is to conserve as much battery power as much as possible.
Optimizing the code and letting the CPU sleep whenever possible as well as shutting down any unused hardware units seems obvious. But beyond that should I be aware of any useful tricks (say, place things in any particular type of memory, display the text in white-on-black rather than black-on-white, or use some odd graphics mode) or is it all diminishing returns after doing the basics?
(Note that attempting to measure things empirically won't be much of an option on my three year old SP with an already half dead battery.)

Anyway, thanks in advance for your input. And in the unlikely event that I actually manage to finish something this time around I promise to publish the source.

#113944 - tepples - Mon Jan 01, 2007 6:15 pm

doynax wrote:
Perhaps not so surprisingly one of my main goals is to conserve as much battery power as much as possible.
Optimizing the code and letting the CPU sleep whenever possible as well as shutting down any unused hardware units seems obvious. But beyond that should I be aware of any useful tricks (say, place things in any particular type of memory

When the CPU isn't sleeping, it should usually be running code in EWRAM rather than ROM (use -specs=gba_mb.specs to force this for all code). Accessing GBA ROM takes more battery power than accessing RAM.

Quote:
(Note that attempting to measure things empirically won't be much of an option on my three year old SP with an already half dead battery.)

Do you have a multimeter? If so, you can configure it as an ammeter and stick it between the battery's + terminal and the SP's + terminal.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#113950 - doynax - Mon Jan 01, 2007 7:18 pm

tepples wrote:
When the CPU isn't sleeping, it should usually be running code in EWRAM rather than ROM (use -specs=gba_mb.specs to force this for all code). Accessing GBA ROM takes more battery power than accessing RAM.
I'll keep that in mind. And I suppose IWRAM (filled with ARM code) works just as well, it's not as if there's much risk of filling it up for a simple text reader after all.

tepples wrote:
Do you have a multimeter? If so, you can configure it as an ammeter and stick it between the battery's + terminal and the SP's + terminal.
Good idea (and obvious in retrospect..)! I'll see if I can borrow one at school or from a less electronically challenged friend ;)
If nothing else it'd be interesting to see just how much the back light costs.

I'm going to assume that a simple 16-color text mode consumes the least power for now, after all it should need the least VRAM I/O.

#113993 - gb_feedback - Tue Jan 02, 2007 1:22 pm

You may be interested in some measurements I once did. http://forum.gbadev.org/viewtopic.php?t=3880&highlight=

Good luck with your project!
_________________
http://www.bookreader.co.uk/

#114002 - Ant6n - Tue Jan 02, 2007 4:57 pm

you could turn off the video hardware for evey second frame or so, or maybe using the blanking bit makes the video hardware use less power.
you could set memory waitstaes verry high http://nocash.emubase.de/gbatek.htm#systemcontrol

#114005 - doynax - Tue Jan 02, 2007 5:08 pm

gb_feedback wrote:
You may be interested in some measurements I once did. http://forum.gbadev.org/viewtopic.php?t=3880&highlight=

Good luck with your project!
Thank you.
So I guess I'll just display a big disclaimer on the splash screen recommending against the use of the backlight.
At any rate there seems to be quite a lot of battery time to save compared to a regular game =)

Ant6n wrote:
you could turn off the video hardware for evey second frame or so, or maybe using the blanking bit makes the video hardware use less power.
you could set memory waitstaes verry high http://nocash.emubase.de/gbatek.htm#systemcontrol
Interesting idea, I wonder if continually powering/shutting down the LCD will have any adverse effects (on the power consumption or otherwise).
I doubt increasing the wait-states would make much of a difference since just about everything except the text itself should fit in IWRAM.


Now if I could only get this damned font blitter to work properly.. ;)