I'm looking to build something akin to HP's non-graphing RPN calculators (15C, 42S, 32S, etc.) and am trying to come up with a bill of materials:
A 16x2 character alphanumeric LCD display ($11)
Two or three 4x4 button pads ($4 each)
or one pad with at least 30 buttons, if there is such a thing.
Is this feasible? How many button pads can be connected to a single Arduino? If programmed correctly, could this setup run a few dozen hours between battery changes?
Typically, a keypad is a matrix. For example, a 30 button 5x6 matrix would require 11 "connections".
With a little more electronics, you can use multiplexing to read an almost unlimited number of buttons. For example, the Arduino's ATmega chip only has one analog-to-digital converter inside, but there are several analog pins, which are read one at a time (rapidly).
A good programmer, yes, author of a widely-used open-source application, but my hardware skills are weak. Tried to solder new capacitors into a dead monitor a couple years ago, and totally hosed it.
Bearing in mind that the floats for the Arduino are only 6 - 7 digits of precision (total), and that the math library seems to lack arcsin, arccos, arctan, and probably quite few other less common scientific functions, maybe it would be better to use some 16-bit platform for this task.
Chained calculations, starting out with that poor a precision level, only get worse.
I wasn't planning to use the built-in floats, but 64-bit mantissas with exponents handled separately. That's 19 decimal digits, rounded to 16 when it's time to display the answer. It won't be fast, especially with an 8-bit ALU, but fast enough for a calculator. The Teensy LC might be a good choice -- low power, low price, a 32-bit ALU, and 62K of non-volatile memory. Whatever I don't use for the firmware can hold user programs and variables.
For the keyboard, should I just buy a big bag of push-button switches, shove them into holes drilled in a sheet of plastic, and wire them together into a grid? I'm sure there's no FIFO, so I'll remember to poll the keyboard inside every loop.
Yes -- the HP 32s has roughly the feature set I'm aiming for, but with a two-line display. I've only used the 32SII and later models, but the extra features (e.g. fractions, non-RPN mode, equations, vectors) are not very useful.
jrdoner:
Bearing in mind that the floats for the Arduino are only 6 - 7 digits of precision (total), and that the math library seems to lack arcsin, arccos, arctan, and probably quite few other less common scientific functions, maybe it would be better to use some 16-bit platform for this task.
Chained calculations, starting out with that poor a precision level, only get worse.
List of default supported math functions is quite complete and include acos, asin, atan, atan2 ..
Using 66 keypad matrix you can make 36 key, Now have have 12 pins to deal with. Use 161 mux, 12 i/p of your keypad matrix and rest four to ground; Now you have 4 select lines pin to deal with.
By using arduino you can easily deal with 4 pins .
dave_rpn:
I wasn't planning to use the built-in floats, but 64-bit mantissas with exponents handled separately. That's 19 decimal digits, rounded to 16 when it's time to display the answer.
Do you have a library for that?
I don't know any library which can handle that precision (64-bit mantissa), neither on 8-bit Atmega controllers nor on 32-bit controller platforms.
This sounds like "x86 Extended Precision Format", which is an 80-bit format in total. The only platform I'd be able to do such 80-bit "Extended" precision calculations would be my Windows PC.
That's 13 correct digits after rounding away the last digit.
Thank's for confirming, that it might become a hard piece of work or requires a special high precision math library to display a result with 16 correctly rounded decimals like demanded by 'dave_rpn' in reply #9!