Is "Battery" intentionally misspelled there to fit into the MessageBox popup? Smile Thanks for sharing the screenshots; I'm excited about your continued progress. Any inspiration about how or where the OS might mark the current battery type? Is there a relevant syscall we could disassemble?
KermMartian wrote:
Is "Battery" intentionally misspelled there to fit into the MessageBox popup? Smile Thanks for sharing the screenshots; I'm excited about your continued progress. Any inspiration about how or where the OS might mark the current battery type? Is there a relevant syscall we could disassemble?

Yup, that is intentional. I didn't want to have the text line on 2 lines as the code would just expand. Best to shave off one byte to save many more.

No idea on where the OS stores the battery type. Insight knows, but not Simon's chm.

<edit>

New version is out! Try it out once the upload is accepted!
KermMartian wrote:
I'm also interested in the fact that it seems to combine the power from USB and the batteries somehow rather than doing a binary switch between the two sources.


Even if it combines the power from the two sources, it runs perfectly fine without batteries and just with USB. Just make sure the OS isn't watching the battery level, take out the batteries, and there you have: a Prizm running fully on USB. You can do this in most add-ins which don't use the GetKey syscall or use it in such a way that it blocks access to the system Menu.

In fact, it seems the Prizm CPU likes USB power better than batteries, because you can overclock it higher when USB is connected.

KermMartian wrote:
Any inspiration about how or where the OS might mark the current battery type?

It's stored in the Main Memory for sure. Insight has something called "Setup" which shows a lot of information in hexadecimal, I'm not sure if that's the system settings. I'll try to get to a conclusion (my main internet connection is broken and I got plenty of offline time to spend Wink ).

AHelper:
Instead of mispelling "battery", just display "Battery voltage:" instead of "Battry voltage is". It uses the same two lines, even less bytes, and no abbreviations.

Insight doesn't know what's the battery setting of the OS either, at least AFAIK. What it knows is if the calc is running from batteries or USB (batteries: 0008, USB: 000A). Insight is open source (it comes with miniSDK IIRC), but of course it is not made to compile with Cemetech's SDK.
I said my NiMH batteries are bad because they can't hold charge properly, however, I figured out they would still allow me to check the lower limits for voltage.

So when the batteries are low to the point where the OS starts showing the blocking "Low batteries please replace" message, the value is 482. The OS shuts down compulsorily at around 450 (I got to this value by gradually increasing the CPU clock and/or the backlight level, which influence the value on the meter because the calculator needs more power).

I'm yet to know the maximum... if only these batteries would fully charge, or the Prizm accepted AA batteries...
Hi guys, if you have the complete range of min and max voltages per battery type I would love to try and implement percentage indicator in the next release of one of my add-ins.
That's... not really straightforward. The voltage depends on a lot of variables, like batter manufacturer, battery type, temperature, current draw, etc.. You'd need to ask the specific battery type to get accurate readings. Also, how are you going to display percentage? Battery discharge doesn't have a linear falloff, they follow a negative cubic curve generally. Are you going to convert all of these curves into a linear percentage?

If you want to get accurate battery voltage curves, I'd recommend going to all battery manufacturers and getting the datasheet for all AAA batteries in order to not provide misleading max voltages and discharge rates. They vary in what their voltages are. Some are 1.6V, some are 1.3-1.4V, some have steeper discharge curves than others. Example, here's duracell's datasheets.

The min voltage, however, depends on presumably software-defined values *when it checks*, different from the hardware's min voltage (ex, running at 0.00V is perfectly fine if the calc doesn't check the voltage reading since it doesn't take into account that it is running off of USB power).
AHelper wrote:
That's... not really straightforward. The voltage depends on a lot of variables, like batter manufacturer, battery type, temperature, current draw, etc.. You'd need to ask the specific battery type to get accurate readings. Also, how are you going to display percentage? Battery discharge doesn't have a linear falloff, they follow a negative cubic curve generally. Are you going to convert all of these curves into a linear percentage?

If you want to get accurate battery voltage curves, I'd recommend going to all battery manufacturers and getting the datasheet for all AAA batteries in order to not provide misleading max voltages and discharge rates. They vary in what their voltages are. Some are 1.6V, some are 1.3-1.4V, some have steeper discharge curves than others. Example, here's duracell's datasheets.

The min voltage, however, depends on presumably software-defined values *when it checks*, different from the hardware's min voltage (ex, running at 0.00V is perfectly fine if the calc doesn't check the voltage reading since it doesn't take into account that it is running off of USB power).


Thanks for the links - I will try to do what I can but may be limited by how much I can do because I wish to fit it into my Lock add-in and planning to have it not exceed certain size.

I uploaded one of the charts from the datasheets into software converting them into corresponding values and polynomial equation of higher orders looked very close fit with high R squared but rounding equation coefficients and voltage values a bit did throw the results off more than I liked. Although visually or trend wise it was not too bad I started wondering if fancy calculations like this would be still somewhat misleading.

Maybe some table of threshold voltages for particular percentage would be better but I doubt the add-in would have space for this unless I consider having them in a separate file... this could give the users flexibility to adjust it for their particular batteries... but maybe it's an overkill.

I probably will try conversion via cotangent calculation if not to difficult to implement in g3a add-in - again don't want the size of the add-in to grow too much. So will see what will happen but I cannot stop thinking that everything like this could be misleading by disregarding temperatures, loads or changes thereof... So perhaps linear way we would at least not claim what charge remains but simply show at what percentage of voltage range the batteries are.

So help me decide and I will try to implement it. One thing just jumped into my head: how does duracell's PowerCheck compute what the strip indicates - linearly or not or based on some predefined voltages... I imagine they have a simple solution - or is it some chemical properties of the strip dependent on the battery voltage so no computation as such?
Duracell's PowerCheck isn't that accurate, and yes, it's based on the chemical properties of the strip, more specifically that it changes color depending on temperature. What makes it change temperature? Behind the strip there's kind of a small resistance; when the two dots are pressed, a circuit with this resistance is closed. The more charge the battery has, the hotter the resistance will get, and the strip will change color accordingly.

There's really no "computation"; I guess the economics of fitting Turing-completeness on batteries do not play out that well yet.
I hope someone can explain to me prizm's ni-mh settings - i have just put 4 rechargeable energiser nimh 1000mah aaa batteries each measuring above 1.2v and 5.0v in total. Prizm went through setup and i specified ni-mh in settings but as soon as main menu appears the battery icon shows low red status. What am I doing wrong please and what voltage is required for ni-mh to show as full charge by prizm? Thanks
Are you sure the batteries are not damaged? Also, the discharge curve varies from Ni-MH to Ni-MH. If the battery icon shows red but the calculator works fine for a long period of time, I would not bother and just ignore it.
Thanks, gbl08ma. I will try some others once they are charged to see what is going on. The only reason I was trying them on was because I thought of looking again at integrating lipo batteries into prizm with the help of someting like this: https://shop.pimoroni.com/products/powerboost-500-charger-rechargeable-5v-lipo-usb-boost-500ma?utm_medium=cpc&utm_source=googlepla&variant=821043285&gclid=Cj0KEQjwuZvIBRD-8Z6B2M2Sy68BEiQAtjYS3A1LXy-dGrdBbjqEmn-uVEemtOIJ55qNintSuQdTu_EaAqei8P8HAQ which if I understand correctly can charge 3.7v battery and boost that battery's output to 5.2v - so it is important for me to understand if 5 - 5.2v on ni-mh settings for battery will work well with prizm
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement