Close
0%
0%

MK-52 Resurrect

A Programmable Calculator from the USSR!

Public Chat
Similar projects worth following
The purpose of this project is to replant ESP-32 brains into a long-dead (and not easily fixable) Soviet-era programmable calculator MK-52.

The body in my graveyard was born in April 1991 and had rested in peace (RIP) since about 2010, after its wonderful lime-on-green vacuum fluorescent display was busted. Apparently these parts are still available... but looking for them is a pain, soldering one in is not much of a challenge, and the calculator itself is a bit dated.

The decision was to frankenstein the MK-52 body with ESP-32 for a brain and an ILI-9341 240x320 TFT screen for a display - both fit almost natively into the original plastic shell. The keyboard parts are being reused. The machine will not be an exact replica of the original MK-52, but rather a programmer fantasy of what the MK-52 could have been if there were no hardware limitations.

The brief explanation can be found at:  https://en.wikipedia.org/wiki/Elektronika_MK-52

Yes, the machine was not functional and repair questionable! I have preserved the original board rested in pieces (RIP) - if someone interested.

The machine can execute the standard MK-52 / MK-61 code, except for the "undocumented features" [ЕГГОГологии](https://ru.wikipedia.org/wiki/%D0%95%D0%B3%D0%B3%D0%BE%D0%B3%D0%BE%D0%BB%D0%BE%D0%B3%D0%B8%D1%8F)

The technical solutions will be used in more ambitious [Retro Calculator project] (https://github.com/ptravnik/Retro_CALC) with Terminal BASIC.

The software development path is as following:

1. Build quick, but fully functional prototype on C# without any hardware considerations, but with extensive automated testing capability. Document in Wiki as you go.
2. With Visual Studio, convert base classes into C++ for porting into ESP32. Update documentation in Wiki as you go.
3. Develop the hardware drivers on ESP-32 and test the actual hardware.
4. Port C++ classes and release ESP-32 solution.
5. Release the simulator if someone interested.
6. ???
7. PROFIT (have fun)

MK52_Resurrect.zip

Simulator Installer. 1,246,469 bytes, MD5=8e932e311123dbe3887a6eb13bcf090b Instructions: https://github.com/myak555/MK-52_Resurrect/wiki/Appendix-5.-SIMULATOR-INSTALL

x-zip-compressed - 1.19 MB - 04/06/2021 at 07:28

Download

MK52_Electronics.sch

KiCAD Schematics

sch - 14.14 kB - 01/22/2021 at 12:53

See BOM
Download

lib - 7.28 kB - 01/22/2021 at 12:53

Download

pro - 688.00 bytes - 01/22/2021 at 12:53

Download

  • 34 × 6-mm tactile switches To replace the original domes (1 switch for extra power button is optional)
  • 2 × 2N7000 Discrete Semiconductors / Diode-Transistor Modules
  • 1 × BS250 Discrete Semiconductors / Diode-Transistor Modules
  • 3 × Resistor 430R
  • 1 × Resistor 4.7M

View all 19 components

  • BRPs (Memory Expansion Modules)

    ptrav07/07/2021 at 11:12 0 comments

    The original MK-52 came with memory expansion modules, called "BRP". I have never seen one in-metal, but by the effort of Sergey Frolov the contents are available for download at http://www.leningrad.su/museum/show_calc.php?n=157

    The "disassembler" program was provided by Mike Yakimov at https://github.com/myak555/MK-52_Resurrect/tree/main/MK-52_Sample_Programs/BRP%20Expansion%20Modules

    The extraction of the first 5 programs (out of 60) from the BRP-3 image went without a glitch! The translated manual is here:

    https://github.com/myak555/MK-52_Resurrect/wiki/12.-BRP-ROM-Instructions

    Instead of the bulky BRP, the programs now are kept at the SD card. For what I understand, the module insertion into the calculator was a tricky business.


    The plan so far is to convert both BRP-3 (math programs) and BRP-2 "Astro" (navigation programs) into usable form.

  • Started on Solvers

    ptrav06/20/2021 at 08:19 0 comments

    After reconciling requirements, started work on quick solvers.

    The plan is to implement at least:

    • Quadratic equation solver,
    • Cubic equation solver,
    • Gain-offset solver,
    • Generic root search (for any equation defined in program memory),
    • Numeric integration (for any equation defined in program memory),
    • Forward probability solver for normal distribution,
    • Reverse probability solver for normal distribution.

    Below is the approximate sequence for cubic equation Ax^3+Bx^2+Cx+D=0:

    1. Enter A into T:, B into Z:, C into Y: and D into X: by any convenient method:


    2. Press [F],[A],[]

    3. Read the result

    Of course, the same can be achieved by a program, such as
    https://github.com/myak555/MK-52_Resurrect/blob/main/MK-52_Sample_Programs/0017_Cubic_Equaton.MK52
    but loading a program via File Manager is too time-consuming.

  • One Month of Use

    ptrav05/14/2021 at 07:40 0 comments

    In early May the BS250's have finally arrived from China, and the calculator became completely autonomous.

    In sleep mode, it consumes less than 2uA (micro-Amps). The natural NiMH battery discharge is probably more than that. The booting is by 0.5-sec press on Cx button; to put back to sleep - A-Cx.

    I have been using the machine every day, in on-off mode for 80-90 minutes per day on average. The battery life of 4 new AA NiMH batteries (2300 mAh as claimed by the manufacturer) is over 30 hours, which means recharging is due every 3 weeks. The HP-35S under this use pattern eats 2 coin cells in about 1 month.

    With the batteries installed and cover on, the calculator is exactly 390 g:

    Retro look-and-feel of the original is preserved:

    Admittedly, the letters are a bit of a screw-up. I used a white-out marker and hand-writing. To fix it, I have ordered letter stickers.

    The SD card fits natively between two "fake slot" covers. Note that the original calculator used two right-most covers for the expansion slots and the other two served decorative purpose. I just expanded the "fake slots" with Dremel.

    With the card in, all looks pretty native:

    How, the sacred question "So, how much memory does this thing have?" the answer is "Just under 8 gigabytes!"

    The quick usability remarks after 1 month of extensive usage:

    * Keyboard quality - excellent, better than the original and about par with HP-35S.

    * Screen readability - good, better than the original and far superior to the HP-35S non-backlit LCD.

    * Battery life - comparable to the original (if modern NiMH are used), but because of the Instant-ON, the Resurrect does not need to be on for long periods of time, which saves a lot of battery time.

    * Program entering and editing functionality: comparable to HP-35S. Additional screen lines help.

    * Original functions of MK-52 badly missed: none so far. Tried many historical programs from A.Schelest and other books, always was able to reproduce results.

    * Functions badly missed from HP-35S: One-Key Solvers, Hyperbolcs, One-Key Stats, Numerical Integration, Unit converters, Physics Constants.

    * Portability: 390 g against 184 g of HP-35S. MK-52 is exactly 1 3/4 inch longer and 1/8 inch thicker. Some little price to pay for being "Retro".

    The next picture is without photo light to show the relative screen brightness/contrast under normal usage conditions.

  • Simulator: recording macros

    ptrav04/06/2021 at 07:38 0 comments

    Just added macro recording capability to the the Simulator:

    The green buttons at the bottom allow to record, temporary pause or execute macros in memory.

    The macro can be saved to disk or loaded from disk via Buttons menu.

    The "Copy X" is to copy the content of X-register into Windows buffer.

    The installer is available on Hackaday (see files) and also on GitHub

    The instructions are in Git Wiki

    The ESP32 code is also fully operational.

  • User Manual and Wiki

    ptrav03/20/2021 at 03:21 0 comments

    The original Russian manual has been translated.

    It came as two thick books, about 3x6 inches, 180 pages each - the book size allowed to bundle them under the calculator. The manual featured excellent content combined with terrible printing quality. For what I understand, the books were printed directly at the calculator factory in Kiev (Ukraine) using the East Germany's "Rotaprint" equipment. The book original was produced on a typewriter, with some manual drawings!

    Hopefully my translation features slightly better graphics:

    All programming examples are tested on both the Simulator and the actual ESP32 machine.

    The (almost) full text is featured at Github

  • MK-52 Goes to Chemistry Class

    ptrav03/07/2021 at 12:45 0 comments

    A simple program that was tricky on the original MK-52, but easy on the Resurrect:

    #
    # MK-52 program
    #
    PC=0000
    P0000: LBX> ENTER N.X:
    P0001: LBY> MOLAR WEIGHT:
    P0002: Cx
    P0003: Enter
    P0004: STOP
    P0005: X->M L0
    P0006: M->X L0
    P0007: -
    P0008: 100
    P0009: *
    P0010: K M->X L0
    P0011: *
    P0012: +
    P0013: Enter
    P0014: GOTO 0004
    #
    # MK-52 data
    #
    MC=0001
    M0001: 1.008
    M0002: 4.0026
    M0003: 6.94
    M0004: 9.0122
    M0005: 10.81
    M0006: 12.011
    M0007: 14.007
    M0008: 15.999
    M0009: 18.998
    M0010: 20.18
    M0011: 22.99
    M0012: 24.305
    M0013: 26.982
    M0014: 28.085
    M0015: 30.974
    M0016: 32.06
    M0017: 35.45
    M0018: 39.948
    #... and so on through the Periodic table 

    Start by pressing B/0, S/P, then enter the <element number>.<number of atoms in molecule>, S/P.

    For example, glucose (C6 H12 O6):

    B/0, S/P,

    6.06,S/P,

    1.12,S/P,

    8.06,S/P

    The same calculation manually (in the most efficient RPN way) looks like this:

    12.011 Enter

    15.999 +

    1.008 Enter

    2 * + 6 *,

    and each element weight (12.011, 15.999 and 1.008) has to be punched-in. With the program, obviously, still need to keep the Periodic table in hand, but no need to type the numbers with decimal places.

  • MK-52 goes to zee Moon

    ptrav03/05/2021 at 23:43 0 comments

    The simulator is fully tested, (still needs the keyboard macro function). Now it can save and load files!

    The installer is here: https://github.com/myak555/MK-52_Resurrect/tree/main/Install

    To test the compatibility, the old LUNOLET-1 (MOONFLY-1) game has been used:

    Those who can read the language, can see the original at http://epizodsspace.airbase.ru/bibl/tehnika_-_molodyoji/1985/6/put.html

    I probably do a shortened translation to English later. At this point, the story is about a ground technician at the Moon base in 2087, who by accident flew a tiny spacecraft (number 22, as above). The program can be loaded from https://github.com/myak555/MK-52_Resurrect/tree/main/MK-52_Sample_Programs/LUNOLET

    Note there are two programs: LUNOLET-1.MK52 - is the original from the magazine, LUNOLET-1B.MK52 is slightly modified to utilize the new screen with 4 lines of stack.

    Back in the day, the owners of B3-34, MK-54 and MK-61 had to enter the program every time the power was cycled. The program looked like this:

    The proud owners of MK-52 entered the program just once and then saved it in the memory module! So we pretend it has been entered (press A-ABT to enter FILE mode):

    Select the program name with ШГ-> and <-ШГ buttons and press П->X

    Here, just press F-ABT to return to the AUTO mode.

    After loading, press [B/0], [C/П]; and check/enter the parameters: Moon gravity, dry mass of the MOONFLY (including 2 people in space suits), specific impulse in m/s and the maximum g-force the pilot tolerates. According to the story, the technician did not qualify for a pilot because he blackouts at 3 g.

    Press [C/П] again and enter/verify the parameters: fuel mass, life support time, initial speed and altitude.

    Press [C/П] again, and now you are ready to fly. Each command consists of 2 or 3 inputs: first, enter the amount of fuel to burn, press [ПП], then enter the number of seconds for the burn. If reversed thrust is not needed, just press [C/П]. For the reversed, press [ПП], followed by [/-/][C/П].

    The first command was issued by the technician's son, "soon will be 12"! Entering 65, [ПП], 3 [C/П] gives us

    Hit [C/П] to "wake up".

    You've been in blackout for about 3.5 seconds.

    According to the story, the technician tried to land the thing. The full sequence of commands in the story:

    * 65 kg for 3 sec (blackout), v=+84 m/s, H=169 m (this command is already done)

    * 0 kg for 2 sec (the technician climbs into the chair), v=+80 m/s, H=334 m

    * 65 kg for 3 sec (blackout), v=+166 m/s, H=916 m

    * 0 kg for 120 sec, v=-28 m/s, H=9175 m

    * 25 kg for 2 sec, v=+5 m/s, H=9151 m

    * 10 kg for 10 sec (reversed thrust, use /-/), v=-26 m/s, H=9044 m

    * 25 kg for 5 sec, v=+3 m/s, H=8984 m

    * 0 kg for 90 sec, v=-143 m/s, H=2652 m

    * 100 kg for 3 sec (blackout), v=-31 m/s, H=2123 m

    * 10 kg for 20 sec, v=-49 m/s, H=1314 m

    * 10 kg for 15 sec, v=-57 m/s, H=515 m

    * 35 kg for 1.5 sec (blackout), v=-17 m/s, H=390 m

    * 22 kg for 22 sec, v=-17.5 m/s, H=13.5 m

    * 22 kg for 0.7 sec (blackout), v=-17 m/s, H=7 m (this was a panic press)

    * 22 kg for 0.7 sec (blackout), and:

    The MOONFLY ran out of fuel (press C/П), but still landed with some reasonable speed of 3.6 m/s:

  • Speed test

    ptrav02/22/2021 at 04:03 0 comments

    This is the "classic" MK-52 speed test adapted from Dr.Shelest book.

    On the actual ESP32 hardware, it executes about 175 times faster. Actually, the processor speed is even faster, but the Resurrect updates the screen and checks for the STOP button 3 times per second, so 60% of the time it is busy sending pixels via SPI.

    P0000: # TRIPLE SUMMATION LOOP
    P0001: # A.E.Shelest, "Programmable Calculators in Physics", p. 27.
    P0002: # On the original MK-52, this program took 35 minutes
    P0003: # ESP32 computes the same in under 12 seconds (x175 the speed)
    P0004: Cx
    P0005: X->M 9
    P0100: 7
    P0101: X->M L0
    P0102: 8
    P0103: X->M L1
    P0104: 9
    P0105: X->M L2
    P0106: M->X L0
    P0107: M->X L1
    P0108: X^2
    P0109: *
    P0110: M->X L2
    P0111: SIN
    P0112: *
    P0113: M->X 9
    P0114: +
    P0115: X->M 9
    P0116: WHILE L2>0 GOTO 106
    P0117: WHILE L1>0 GOTO 104
    P0118: WHILE L0>0 GOTO 102
    P0119: STOP
    P0120: GOTO 2
    

  • Simulator Install

    ptrav02/21/2021 at 06:02 0 comments

    The simulator is fully operational, apart of the file Load and Save. The Alpha is available here:

    https://github.com/myak555/MK-52_Resurrect/tree/main/Install

    To install on Windows 7 or above:

    • Download MK52_Simulator.zip and unpack to any convenient location.
    • Navigate to the folder.
    • Right-click on the MK52_Setup.msi file and select "Install".
    • Follow the Wizard as below.

    To install on Windows XP:

    • Download MK52_Simulator.zip and unpack to any convenient location.
    • Navigate to the folder.
    • Right-click on the setup.exe file and select "Run as an administrator".
    • Enter admin credentials.
    • Follow the Wizard as below.

    To install on Linux under Wine:

    • Make sure Wine is installed. The instructions are here.
    • Download MK52_Simulator.tar and unpack to any convenient location.
    • Navigate to the folder.
    • Right-click on the setup.exe and select "Open with Wine Windows Program Loader".
    • Follow the Wizard as below.
    • Right-click on ~/.local/share/applications/wine/MK-52.desktop and allow "Execute:" under Permissions tab
    • If desired, copy the MK-52.desktop file from the Wine location into the /usr/share/applications:
    sudo cp ~/.local/share/applications/wine/MK-52.desktop /usr/share/applications

    Installation wizard steps:


    At this point, Windows will dim the screen and ask to confirm the install.

  • MK-52 is fully functional

    ptrav02/14/2021 at 12:24 0 comments

    Now the calculator can  enter programs, store them to SD card and read them back. Basically, everything works as planned. The English wiki docs is are about 33% cooked here:  https://github.com/myak555/MK-52_Resurrect/wiki/6.-AUTO-Mode.-Manual-Calculations./_edit

    I have started using the monster as my primary calculator. Based on the experience, some refinements may be needed. In particular, an automatic switch-off after a period of inactivity is a must. Also, it would be nice to allow a WiFi connectivity. I will build a laundry list and then do yet another coding session.

    The next big item is to make a full copy of the ESP32 into the C# emulator and release a Windows installer. Now the display is a pixel-to-pixel match:

    Programming editor:

    This is a test screen with all 255 symbols shown:

View all 14 project logs

Enjoy this project?

Share

Discussions

Ken Yap wrote 07/26/2021 at 23:03 point

This is a cool project, kudos! 👍 So many cool retro opportunities out there that I have to be selective and only filter in those that I have personally encountered.

  Are you sure? yes | no

paulhoets wrote 07/18/2021 at 14:37 point

This is a fantastic project. I literally made an article about this two days or so ago, but if I knew about your project, I would have written a lot differently. 

https://electronicsdeli.net/2021/06/23/mk52/

Thank you for sharing your hard work with the maker community - I know a lot of people have deep nostalgia for this calculator.

  Are you sure? yes | no

ptrav wrote 07/26/2021 at 21:11 point

It is an excellent article, Paul!

Now I am developing a legacy-free version of this - so the MK-52 functionality and look-and-feel can be reproduced as a electronics hobby project without looking for the old calculator body. The estimated cost will be around $30, including a laser-cut case and PCBs. This will address the original calculator keyboard issues too...

  Are you sure? yes | no

ptrav wrote 06/30/2021 at 08:55 point

Thank you for your interest. I am planning to develop a full board and laser cut-offs for this project (the original calculator will not be needed). Some components have been ordered from China, now waiting on delivery to experiment with low cost keys and keycaps.

Something will be probably ready in 3-4 months.

  Are you sure? yes | no

Joseph D. Coyote wrote 07/01/2021 at 02:25 point

I am a long time MK-52 user.  I recently wore my best buddy out- Some traces peeled off the keyboard matrix.  So, I bought a NOS one, and made some modifications.  First, I replaced all the keys with those from my old MK-52, because I like the older, wider key font better.  Then I made a new foam backing for the keys, from a thin firm foam, so all the keys sit nice and level.  I added a black paper mask behind and around the VFD, and another in the display window...  This combination really improves the contrast.  My new best friend has been pressed into service! :)

I really like your modernization of the calculator.  You've added modern features, while still keeping the general feel and spirit of the original.

I will be watching what you do.  Perhaps...  PERHAPS you might make my new NEW best friend!

  Are you sure? yes | no

Joseph D. Coyote wrote 06/25/2021 at 11:57 point

I need to build one of these.  Desperately.

  Are you sure? yes | no

Does this project spark your interest?

Become a member to follow this project and never miss any updates