Login [Register]
Don't have an account? Register now to chat, post, use our tools, and much more.


Power Utils is an addin that lets you manually enter the timeouts for the backlight and power off. This is a great way to save on battery life. The OS only lets you have the power off timeout as low as 10 minutes. With this addin, you can set it down to 1 minute.

You can find this addin here.

Features:
  • Main menu is very similar to the Settings addin on the Prizm.
  • Lets you enter in the timeout from 1-999 minutes (+30 sec)
  • Warns you if you try to set it to an invalid timeout

Possible bugs:
  • I haven't tested all timeouts, mainly because I don't have a week to test all timeout values
  • Large backlight values will not work due to a smaller max value.

Great job, Ahelper! This is a perfect showcase of your continued hard work tracking down system calls and creating documentation. As noted on IRC, I love the icon. I'm curious what qualifies as an invalid timeout, since you mention that: is it a timeout where the auto power off time is less than the backlight duration?
I just make sure that the timeouts aren't zero, as seen here:

Awesome work! I had already suspected there was a way to fine-tune the inactivity timeouts, after reading Simon's syscall list, but never got around to experimenting them (also, the syscalls there were still "unconfirmed").

By the way, do plan on finishing your clock add-in some day?
Based on his comments on IRC, I believe he may already have begun amending it based on his new discoveries.
I will be working on it considering what I found out Very Happy
Things that can be interesting to add to this add-in IMO:
- Brightness adjustment (even though as far as I know, only the 1~5 steps provided by the OS are selectable through syscalls)
- Battery voltage checking and battery power in percentage (not just the four steps of the statusbar icon)
- CPU clock adjustment (??? I leave this with many question marks, but that's related to power too...)
I like the brightness thing. I was actually looking at it since casio has the lowest level at 0x1C or something, meaning I can make it lower (range is 0x00 - 0xff)

Battery voltage checking, sure, I can do that.

I want to stay away from the CPU clock adjustments. I adjust the clock in a different way than Pover and such. I change the FLL, PLL, and divisors. I would leave that to another addin to handle. The fewer ways that addins change the CPG, the better (to prevent addins from changing it different incompatible ways).
Have you tested to see that you can actually set the brightness everywhere in that range? I think you have a good point about the overclocking, especially given the instability possible if not done carefully and our previous discussions about add-ins' responsibility to be polite to users.
You now see why I left so many question marks on the overclocking point Wink
Yup. Fun fact, if you change up the CPG to have you run at the same speed it currently runs at, you can have Pover/CG-clock (w/e) display that you are underclocking. When you try to go back up to normal speed according to the addins, you will overclock your calc too far and it will halt. Smile

Maybe having a callback registered on one of the timers that will manage the clock speed at all times? If it is possible, then you can have it overclock/underclock for user-specified addins. (This would also stop addins from changing the CPG by changing it right back) -- This is only an idea, no idea if it is possible.

<edit>

The backlight (main and sub) are controlled by using the display registers. You have a range of 0x000-0x1FF (lowest by the OS is 0x032)
I can't wait to see how the lowest backlight level looks like - I think the OS level 1 (0x032) is still too high for a "backlight turned off" situation. I also wonder if it is possible to turn off the backlight completely (it would be useful if the LCD performed better under sunlight/the case was not so reflective).
I have enough research to add in a nicer-looking interface. Sadly, the code is very hackish for display stuff now :-\

However:
gbl08ma wrote:
Things that can be interesting to add to this add-in IMO:
- Brightness adjustment (even though as far as I know, only the 1~5 steps provided by the OS are selectable through syscalls)
I can adjust the brightness by accessing the LCD hardware directly. I can change the brightness on the range of 0x000-0x1FF and has been confirmed to work.
Quote:
- Battery voltage checking and battery power in percentage (not just the four steps of the statusbar icon)
Well, at first, this sounds easy, just check the battery. Well, not as easy as that. The battery reports itself in volts. I don't know the levels that the Prizm uses for Ok and what is empty. On top of that, the Prizm's OS checks it with different levels depending on the battery, so I would have to find out how to read the system configs (I have docs, never tried to touch it).

Here is what will happen: I will be able to tell you what voltage your batteries are at (constant ~5.6V on USB), but not a percent. If anyone reports back their voltage when the prizm dies, I will add it in for that battery type.

Besides that, I am using a bunch of new syscalls, like the scrollbar, LCD register selection, progressbar2, and others. It should look even better.

Todo:
  • Let the user store/restore 5 user power settings using a menubar.
  • If the OS changes your settings, rerunning the addin will ask if you want to reapply the last settings


@Anyone, let me know if you want something else added (besides CPG changing) Very Happy
AHelper wrote:
Well, at first, this sounds easy, just check the battery. Well, not as easy as that. The battery reports itself in volts. I don't know the levels that the Prizm uses for Ok and what is empty. On top of that, the Prizm's OS checks it with different levels depending on the battery, so I would have to find out how to read the system configs (I have docs, never tried to touch it).

Here is what will happen: I will be able to tell you what voltage your batteries are at (constant ~5.6V on USB), but not a percent. If anyone reports back their voltage when the prizm dies, I will add it in for that battery type.


Planning on making a battery checking add-in myself (which I'm not planning to make anymore, BTW), I took note of the values at which my Prizm dies, and stored them in a paper I can't find now. I think that when (ideal) new batteries are put in, and assuming the meter is accurate, it should report 600. I think that when the batteries are almost empty (and the OS constantly tells you to replace), the value is below 400 but I don't remember exactly what it is. I have some almost-dead batteries at home which I can use for checking the value again. Wait until Monday and let's hope I don't forget to do it Smile
Does it adjust those numbers based on the battery type, since NiMH produce 1.2V fully charged, and Alkaline produce 1.5V fully charged (hence the selection screen at boot)? Or is there a flag somewhere that stores the battery type, and you have to adjust yourself. Four new Alkaline AAAs should produce >=6.00V, so I wonder if that register you're quoting is in 10s of mV.
The number reported by the meter is the raw voltage of the batteries. The OS does not adjust that number, you need to adjust it yourself. The OS adjusts the number for its simple meter at the top of the screen and also to decide if the battery is so low that the system is compulsory shut down (without Casio logo). (I believe it tolerates lower values when it thinks NiMH batteries are in)

6V = 600 reported by the meter.

The value reported when USB is in is not always 5.6V IIRC, it also changes with battery level. It is always higher than the value with battery, though. On the Insight add-in there's also a value which is 0008 when the calc us running from batteries and 000A when powered from USB.

If we can find out what's the drift between the level reported when running from USB and when running from batteries, and assuming the drift is stable, then we can use the 0008/000A value to apply a correction in order to always get the correct battery level and calculate a percentage from it, also based on Alkaline/NiMH setting.
When did you see 5.6V change? My fxCG10 has been on for about a week now and it only changed by 0.01V. The USB specifications says that devices that are being powered on USB must accept 4.75V to 5.25V with a 0.4V drop at times.

Quote:
It is always higher than the value with battery, though.
huh. Interesting. Take out the batteries and the voltage just drops out.It's also interesting that it uses each battery separately (I can read different voltages with different amounts of batteries in).

About it always being higher:
USB:5.6V
Battery:6.12V
Alkaline
On my Prizm, using Alkaline batteries, default CPU clocks, and measuring these values with Insight:
New (taken out of the package) batteries: 625 (6,25 V)
Empty batteries, close to make the calc shutdown compulsively: 365 (3,65 V)
The Prizm still worked at 334 (3,34 V), but when the OS is "looking" at the value (it doesn't inside CGDoom, or Raptor, for example), it shuts down compulsively (no logo) at 356 (3,56 V). I guess you can consider that a battery 0% full Wink

I can't read different voltages with different amounts of batteries in. If I have four batteries, and take out one, the value gradually drops to 0 (it takes some time, but it does). Once I put the battery back in, the value instantly increases to the sum of the four batteries. Conclusion: power decrements take some delay, power increments are instant.

Now about USB. With the same new Alkaline batteries and USB connected, it is reporting 576 (5,76 V). With the same empty batteries and the same USB power source, it reports 415 (4,15 V). It isn't always higher, but the value is influenced by the USB being connected (it is like an average). But you can no longer argue it is always 5.6 V.

I hope other people measure the values for their calculators and batteries, also, it'd be good if someone could test with NiMH batteries as the only AAA ones I have are pretty old and no longer function properly.
That's some fascinating information. I'm very surprised that the Prizm continues to run reliably at 3.34V; I would have assumed it would have a low-voltage-dropout regular which nevertheless would need at least 4V or more to power the (presumably) 3.3V CPU and memory. Perhaps not? 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.

Edit: By the way, I added a link to this topic in the Power section of the Technical Info page on WikiPrizm.
I have NiMH batteries, but they aren't new ones. Everything you said I was able to check and confirm it. I will not add in a % until I have the max Alkalines (Needs more testing), max NiMH, minimum NiMH (NiMH act differently when discharging), and a method to see what the OS has recorded for battery type.

<edit>

New screenies:

  
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 1 of 2
» All times are GMT - 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