E248

A kind of a E12/24/48 or custom resistance ratio calculator for any RPL enabled HP calculator (HP48-50).

Imagine one of the trillions of most simple but common and time-wasting "problems":

Your D/A converter should output a 0-40V signal with a 10bit A/D converter.
For good reasons, you decide that 1000digits should represent 40V, which gives an even ratio.

The output voltage of your D/A converter for 1000digits, assuming it is powered by 3.3V, is:

Uda = (3.3V/1024)*1000 = ~3.223V

Obviously your hardware needs to have a amplification factor of:

V = 40V/3.223 = ~12.41

For other reasons, you decide to use an OP in non-inverting operation, which gives an resistor ratio of:

Rg/R = 12.41-1 = 11.41

Here's where E248 comes in...
Instead of trying all possible combinations, just type 11.41 and e.g. "24" (for E24, as string) and call E248 on your calc. It tries to find the best match for the given E-series.

After a while, E248 puts out:

  • R1
  • R2
  • the real ratio
  • time for calculation in seconds (diagnostics only)
For reference, the input ratio will be left on the stack.
I guess there are much smarter algorithms around but unfortunately I did not find anything comparable. Nevertheless, I like it ;)

Operation

input
output (v2, BETA)
The "nm" input specifies the name of a list "E" which contains the base values of the resistance series (e.g.: "{ 1, 1.2, 1.4, ...}" ).

This became my standard testing-application for every single of my (~100) programmable calculators. While having a little fun with a Casio-PB2000 during holidays, I also redesigned the RPN version towards speed...

There exist 2 different versions of E248, these are the names of them in the ".hp" file:
"AAA", the 1995 original (incl. source-string "BBB")
"AA1", the 2008 redesign (incl. source-string "BB1")

"AA1" is much faster than "AAA" but still not completely tested. Sometimes not the best, but pretty close, ratios come out...

The source files "BBB" and "BB1" provide the RPL content as a string "RPL" for easier editing with emacs or whatever editor you prefer. Use:

STR->
(or ->STR for the inverse operation)
(or the OBJ-> notation)

to convert the string-source to an RPL application.

Download

E248

Here is the complete ".hp" package, including source, RPLs and E12-99 tables
DOWNLOAD: e248.zip




ASkr 06/1995 initial version
ASkr 08/2008 redesign, E248
ASkr 10/2009 redesign, page