Post Reply 
DIY prototype RPN/TENKEY programmable calc with printer <:3)--
11-08-2019, 06:46 PM
Post: #1
DIY prototype RPN/TENKEY programmable calc with printer <:3)--
Hi everybody. Some time ago (many years in fact) i found some HP calculator emulators on the web. I found that RPN system can be kinda good for some things, especially for programmable calc. I started to get interested in HP calculators and soon i started to look for some 48GX or 41CX, (un)fortunatelly it was not easy to get one in Poland, and prices of the ones on Ebay were a little too high. I ended using emulators on Android and PC.

Some time after that i just started to think if i could make a calc by myself. I had done some experiments with my own software calc using tenkey system. Then i got some cash registers for parts and i made functioning thermal printer out of that parts. When i got printer i though to myself that i am only missing a good calc to connect it to it ;-) I got some mechanical keybaord modules, LCD displays and stuff like that and i found that those parts are great material for a calc.

I started looking for MCU to handle that stuff and found that AVRs may not be the best choice, i found cheap STM32 board and i found it great for the job. From the lack of pins i used old AVR just to work as keyboard controller. It took many software upgrades to get to the state where i am today, i have learned some things along the road. Software i written is in Bascom (for AVR) and Arduino IDE for STM.


Here are some of the features of the junk i have made:
-RPN/Tenkey system with 6 level RPN stack and 2 Tenkey adders. * key is used not only to clear tenkey adders but also can move data from adders to RPN stack.
-Can swap any 2 levels of stack (not only lower ones).
-Indirect memory access with STORE, RECALL, ADD (shift + left add button) and SUBTRACT (shift + left subtract button) functions.
-Build in unit converter and constant library.
-Various scientific math functions hidden in >MATH< menu.
-Alphanumeric prompting (on LCD) and printing.
-Printing on thermal printer, trough universal UART (for Psion Workabout MX) or USB (emulating HID keyboard or USB UART).
-Shadow and normal programming (shadow mode works like manual operation, but it stores everything you do in background, so the keypresses are both executed and stored in memory).
-5 programmable keys.
-Statistical functions.
-Timer (much like HP-41CX one) that can be triggered manually or by external interrupts.
-Possibility to read values from ADC inputs.
-Multiple display modes (showing things like whole stack, part of stack and tenkey adders, part of stack and alpha registers and so on).
-Dropping values from stack to PC (trough HID USB keyboard emulation).
-Values can be displayed in SCI format or in fixed point (rounded) format, but they are always handled as 64bit floating point.


Attached File(s) Thumbnail(s)
   
Find all posts by this user
Quote this message in a reply
11-08-2019, 10:20 PM
Post: #2
RE: DIY prototype RPN/TENKEY programmable calc with printer <:3)--
Very cute, but also really impressive!

A blue wire is not connected, you’re gonna lose digits Smile
Find all posts by this user
Quote this message in a reply
11-08-2019, 10:57 PM
Post: #3
RE: DIY prototype RPN/TENKEY programmable calc with printer <:3)--
Blue wire is for STM32 default UART bootloader. It is used to program the chip. You connect it to the USB>UART interface and you can load the program into the chip. You also have to flip that switch below it (and obviously change the jumpers on board to put STM32 into bootloader mode), because normally pin RX1 is used to receive data from ATMEGA-16 that is the keyboard controller. So the blue wire is normally not connected to anything, because when switch is flipped left, RX1 goes to ATMEGA and not to blue wire.
Find all posts by this user
Quote this message in a reply
11-08-2019, 11:28 PM
Post: #4
RE: DIY prototype RPN/TENKEY programmable calc with printer <:3)--
Hello!

Very cool project! I especially like how you finally found the ultimate solution as to whether the basic + - * / keys belong on the left side or on the right side of the keyboard: You simply put one of each on both sides :-) I hope you applied for a patent for that, otherwise we will see it on all future calculators of HP. TI and Casio...

Regards
Max
Find all posts by this user
Quote this message in a reply
11-09-2019, 02:49 PM
Post: #5
RE: DIY prototype RPN/TENKEY programmable calc with printer <:3)--
The keys on the right are for tenkey operations. Without shift they affect tenkey adder no1, with shift they affect adder no2. * key is quite funky. First press basically pops the adder's value on the RPN stack, second press clears the adder (just like it used to do on those office calcs).
Above tenkey keys there is a key for adding into statistical registers and one for entering into alpha mode (for programming the ASCII text).

On the left there is a RPN section, those keys affect RPN stack. + and - keys can also affect memory when used with shift (memory add and memory subtract).

There is also multifunction encoder. It can be used to select display mode, ammount of decimal places to display, scroll the program listing, select memory cell holding time of reference for stopwatch mode or scroll the ASCII list in alpha programming mode.
Find all posts by this user
Quote this message in a reply
11-09-2019, 04:52 PM
Post: #6
RE: DIY prototype RPN/TENKEY programmable calc with printer <:3)--
Hope you could send a few videos to demonstrate those functionalities.
Find all posts by this user
Quote this message in a reply
11-09-2019, 05:50 PM
Post: #7
RE: DIY prototype RPN/TENKEY programmable calc with printer <:3)--
I have that in my plans.
Find all posts by this user
Quote this message in a reply
11-10-2019, 04:53 AM
Post: #8
RE: DIY prototype RPN/TENKEY programmable calc with printer <:3)--
Great work!
And RPN machines made in Poland--> just makes good sense!
Find all posts by this user
Quote this message in a reply
11-11-2019, 05:02 PM
Post: #9
RE: DIY prototype RPN/TENKEY programmable calc with printer <:3)--
Here is some demonstration.



Find all posts by this user
Quote this message in a reply
07-07-2020, 07:17 PM
Post: #10
RE: DIY prototype RPN/TENKEY programmable calc with printer <:3)--
Things are progressing slowly.

Now i finally got the FLASH memory (25q64 on SPI) for storing programs. With current software it allows to store 256 programs on a memory chip, however the memory itself can hold so much more, it is 8 megabytes (64 megabits) one, quite big as for a stupid calc ;-)

Each program have 16 character name (in ASCII), so i can browse them by the name, list of programs written to the FLASH memory appears on right display and can be scrolled by the encoder.

Experimental feature was added to access SPI from calculator's keyboard, so i can send and read anything over SPI (like memory serial number and so).

Sometimes left LCD was showing rubbish, it took me a day to figure out what was causing it. I was thinking that it doesn't like 3V3 logic level, but it was not a case. Turns out that it was LiquidCrystal library that was causing troubles, i increased delay times for some low level LCD commands and the problem is gone. Seems like left LCD probably has slower grade controller chip on it. Or maybe the timing problem is due to the fact that i am using 2 LCDs on same bus, which very few people do (probably library was never tested for such configuration).

Near future plan is bigger display. I mean using FPGA as character generator so i can use VGA display as virtual printer or big display showing whole stack (which is now 9 level), tenkey adders and all that stuff at once.
Find all posts by this user
Quote this message in a reply
07-08-2020, 06:18 AM
Post: #11
RE: DIY prototype RPN/TENKEY programmable calc with printer <:3)--
(07-07-2020 07:17 PM)macieksoft Wrote:  i increased delay times for some low level LCD commands and the problem is gone.

A while back I rolled out my own libraries for these LCDs (with the Hitachi HD44780 controller, right?). I had two variants of them: one that could operate in 8-bit or 4-bit parallel mode talking directly to the controller, and one that had a PCF8574 chip in front of the controller allowing you to talk to the thing on an I²C bus. The latter variant posed no end of problems for me until I actually read the datasheet for the PCF8574 (when all else fails, RTFM). It only operates at 400KHz, so like you, I had to slow my I²C bus down so that the chip could keep up with it.

There are only 10 types of people in this world. Those who understand binary and those who don't.
Find all posts by this user
Quote this message in a reply
07-08-2020, 10:31 AM
Post: #12
RE: DIY prototype RPN/TENKEY programmable calc with printer <:3)--
(11-10-2019 04:53 AM)jpcuzzourt Wrote:  Great work!
And RPN machines made in Poland--> just makes good sense!

Jan Łukasiewicz would be proud!

Tom L
Cui bono?
Find all posts by this user
Quote this message in a reply
07-08-2020, 01:29 PM (This post was last modified: 07-09-2020 01:57 PM by macieksoft.)
Post: #13
RE: DIY prototype RPN/TENKEY programmable calc with printer <:3)--
(07-08-2020 06:18 AM)grsbanks Wrote:  It only operates at 400KHz, so like you, I had to slow my I²C bus down so that the chip could keep up with it.

I am using 4 bit parallel communications for LCD (not I2C). Both LCDs goes on same bus, that means data pins and RS pins are tied together, and only the E (enable) pins are separate. The left LCD is taken from cash register, right one is left over from previous projects.

EDIT: Got VGA working. I used EP2C5T144 FPGA and used Grant's Multicomp project. It is essentially a modular retrocomputer on FPGA, but it has all i needed. Just needed to replace ROM for Z-80 soft core to turn in into terminal. Now i got the big screen. VGA terminal may be used as extra screen (with it's own display mode selection independent of LCD alphanumeric displays), or it can be used as virtual printer when it behaves like regular printer. It supports 3 bit colors (can be expanded to 6 bit by adding extra resistors).
I have also fixed some funky bug related with printing that was causing a string variable to grow bigger and bigger each time i used print function, it was eventually causing calculator to hang.
Find all posts by this user
Quote this message in a reply
02-20-2021, 07:46 PM
Post: #14
RE: DIY prototype RPN/TENKEY programmable calc with printer <:3)--
Here is FPGA VGA implementation, along with some other features.

That includes:
-3 modes of operation for VGA screen(NORMAL, MEMORY and printer emulation), those modes are fully independent of alphanumeric LCD display modes.
-External SPI flash (W25Q64) for permanent program storage.
-Programs can have 16 character alphanumeric names (to make them easy to find on external SPI flash).
-Conditional jumps are now a thing, better late than never ;-)
-Same with subroutines.
-PRINT display mode, it shows 2 most recently printed lines on left LCD screen and 4 lower levels of RPN stack on right screen. That mode works even with external printer disabled.
-Backspace function added, you can backspace numerical and alphanumerical input.



Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)