Prev Previous Post   Next Post Next
Old 12-24-2011, 02:34 PM
fireandfuel fireandfuel is offline
Junior Member
Join Date: Sep 2011
Location: Germany, Berlin
Posts: 15

It's cool that the yp-r0 patch is now in the repo. \o/

And it's time to add it to the Under Development device list.

I think the battery voltage should be checked every 1 -5 minute(s). The first step is to force rockbox to shutdown the player when the voltage is under 3.450 V - simply read it from /sys/devices/platform/afe.0/adc.

I though about how to calculate the percentage of battery charge.

My first idea was this:
([current_voltage] - [shutdown_voltage]) / ([maximum_voltage] - [shutdown_voltage])
But I know that the battery voltage decreases not linear over time - especially when the CPU governor is "ondemand".

My second idea:
A battery benchmark should be run at least one time with 200 MHz, 400 MHz and 532 MHz CPU frequency. I expect a specific voltage/time curve for each CPU frequency. A benchmark app running under rb can create a file which contains the voltage datasets recorded every minute.

A good Computer Algebra System (CAS) can find a functions which approximatively fits the data points for one CPU frequency (voltage on abscissa and time on ordinate). Transforming these functions in one function (CPU frequency and voltage as parameters and returns the time) and divide it with the maximum run time at the CPU frequency. This quotient is the percentage of battery charge!
Reply With Quote


r0, rockbox, samsung yp-r0

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 04:43 PM.