An MK-85 with a modern CPU replacement

Upgrading A Soviet Calculator With A Modern CPU

Today’s supply chain issues can make it hard to buy microcontrollers, or really any kind of semiconductor. But for those keeping retrocomputers alive, this problem has always existed: ancient components might have been out of production for decades, with a dwindling supply of second-hand parts or “new old stock” as the only option. If a rare CPU breaks, you might have no option but to replace the entire computer.

[Piotr Patek] ran into this issue when he obtained an Elektronika MK-85 programmable calculator with a broken CPU. Unable to find a replacement, he decided instead to build a pin-compatible CPU unit based on an STM32 microcontroller. Of course no modern CPU is pin-compatible with a Soviet design from the 1980s, so [Piotr] had to design a small interposer PCB to match the original pinout. This also gave him enough space to add an efficient DC/DC converter chip that generates the 2.5 V supply for the STM32.

As for the software, [Piotr] managed to port the original BASIC interpreter, which was written in PDP-11 assembly, to a modern equivalent written in C. While he was at it, he fixed a few bugs that had been sitting there for about 35 years. The updated CPU also allows the MK-85 to run circles around its contemporary siblings: [Piotr] timed it to be about thirty times faster than the original chip, while using a comparable amount of power.

If you also happen to have an MK-85 with a dodgy CPU, you’ll be pleased to find that the schematics and source code to [Piotr]’s modification are all available on his blog. This is probably the first calculator CPU update we’ve seen, although we’ve featured other ancient calculators updated with new firmware, and some completely new calculator designs based on classic hardware.

Thanks for the tip, [cmholm]!

Turn On Sarcasm With The Flip Of A Switch

Sarcasm is notoriously difficult to distinguish in online communities. So much, in fact, that a famous internet rule called Poe’s Law is named after the phenomenon. To adapt, users have adopted several methods for indicating implied sarcasm such as the /s tag, but more recently a more obvious sarcasm indicator has appeared that involves random capitalization througout the sarcastic phrase. While this looks much more satisfying than other methods, it is a little cumbersome to type unless you have this sarcasm converter for your keyboard.

The device, built by [Ben S], is based around two Raspberry Pi Pico development boards and sits between a computer and any standard USB keyboard. The first Pi accepts the USB connection from the keyboard and reads all of the inputs before sending what it reads to the second Pi over UART. If the “SaRcAsM” button is pressed, the input text stream is converted to sarcasm by toggling the caps lock key after every keystroke.

For communicating in today’s online world with rapidly changing memes, a device like this is almost necessary for making sure you aren’t misunderstood on whichever popular forum you like to frequent. We don’t know how long this trend will continue, either, but until something else replaces it to more concisely communicate sarcasm we expect it to remain relevant. The build is also a reminder of the various interesting ways that microcontrollers can be programmed to act as keyboards.

Thanks to [ted yapo] for the tip!

Better Farming Through Electricity

Chinese researchers are reporting that applying an electric field to pea plants increased yields. This process — known as electroculture — has been tested multiple times, but in each case there are irregularities in the scientific process, so there is still an opportunity for controlled research to produce meaningful data.

This recent research used two plots of peas planted from the same pods. The plants were tended identically except one plot was stimulated by an electric field. The yield on the stimulated plot was about 20% more than the control plot.

The actual paper is paywalled in the journal Nature Food, but the idea seems simple enough. If you search for the topic, you’ll find there have been other studies with similar findings. There are also anecdotal reports of electrical plant stimulation going back to 1746.

Continue reading “Better Farming Through Electricity”

Pocket-Sized Doom Is Actually Playable

It used to be that you needed a well-equipped expensive new beige-box PC if you wanted to play Doom at all. Now, you can do so in a form factor with a footprint smaller than a credit card, as demonstrated by this nifty little build from Adafruit.

The build relies on the Retro-Go firmware for ESP32 devices, which can emulate a range of machines, from the Nintendo NES and Game Boy to the NEC PC Engine, Atari Lynx, and, yes, Doom itself. It can even run Doom mods, via the WAD architecture used by the game.

It was a simple matter of porting Retro-Go to run on the tiny QT Py ESP32 Pico board, and everything fell into place. With six tactile buttons, it’s capable of not just running Doom, but running it at full playable speeds including that classic soundtrack. The 1.3″ 240×240 screen looks surprisingly crisp and does a great job of displaying the game while keeping everything readable.

It’s one of the smaller Doom-capable portables we’ve seen; we reckon you could stuff this in the change pocket in your jeans if you tried hard enough. We’ll never quite get over seeing the world’s most loved FPS running on commercial kitchen hardware, though. Video after the break.

Continue reading “Pocket-Sized Doom Is Actually Playable”

Building Switching Points For A Backyard Railway

A home-built railway is one of the greatest things you could possibly use to shift loads around your farm. [Tim] and [Sandra] of YouTube channel [Way Out West] have just such a setup, but they needed some switching points to help direct carriages from one set of rails to another. Fabrication ensued!

The basic layout of the railway points.

The railway relies on very simple rails made with flat bar and angle iron, allowing the railway to be built without a lot of heavy blacksmithing work. For a light-duty home railway, these are more than strong enough to do the job.

As for the points, a simple V-shaped frog-and-blade design was used. The frog is the V-shaped section where the rails diverge into two directions, sitting in the center of the Y, while the blade is the part that moves to either side to guide the carriages in one way or t’other.

The blade consists of a 2.2 meter long piece of angle iron with a pin welded on, allowing it to pivot. Two pieces of flat bar were then welded together with a pin to make the frog. Two metal bushes were then forced into a wooden sleeper, allowing the blade to pivot as needed. The rails themselves are slightly kinked as needed and everything tacked down into sleepers with bolts and pipe pegs.

The design runs smoothly, much to [Tim]’s enjoyment. It’s a clear improvement over the earlier design we looked at least year.

There’s something inherently charming about a railway built with little more than wood, metal, and hammers. Seeing the little stone wagon run down the rails to bed in the sleepers is utterly joyful in a way that’s difficult to fully explain. Video after the break.
Continue reading “Building Switching Points For A Backyard Railway”

Reverse Engineering The NeXT Computer Keyboard Protocol

The NeXT computer was introduced in 1988, with the high-end machine finding favor with universities and financial institutions during its short time in the marketplace. [Spencer Nelson] came across a keyboard from one of these machines, and with little experience, set about figuring out how it worked.

The keyboard features a type of DIN connector and speaks a non-ADB protocol to the machine, but [Spencer] wanted to get it speaking USB for use with modern computers. First attempts at using pre-baked software found online to get the keyboard working proved to be unreliable. [Spencer] suspected that the code, designed to read 50 microsecond pulses from the keyboard, was miscalibrated.

Some analysis with an oscilloscope and logic analyzer allowed [Spencer] to figure out the keyboard was communicating with pulses ever 52.74 microseconds, corresponding to a frequency of 18.960 kHz, sending two 9-bit messages at a time. Disassembling the keyboard confirmed these findings – inside was a 455 kHz clock, with the keyboard sending a signal every 24 ticks producing the 18.960 kHz output.

Reworking the initial code found online to work with the actual pulse widths coming from the keyboard got everything humming along nicely. Now, [Spencer] has a nice vintage keyboard with excellent feel that reliably works with modern hardware. We’d call that a win.

If you need more of a fix, be sure to dive into Keebin’ with Kristina, a regular column all about our favorite tactile input devices!

Linux Fu: Bash Strings

If you are a traditional programmer, using bash for scripting may seem limiting sometimes, but for certain tasks, bash can be very productive. It turns out, some of the limits of bash are really limits of older shells and people code to that to be compatible. Still other perceived issues are because some of the advanced functions in bash are arcane or confusing.

Strings are a good example. You don’t think of bash as a string manipulation language, but it has many powerful ways to handle strings. In fact, it may have too many ways, since the functionality winds up in more than one place. Of course, you can also call out to programs, and sometimes it is just easier to make a call to an awk or Python script to do the heavy lifting.

But let’s stick with bash-isms for handling strings. Obviously, you can put a string in an environment variable and pull it back out. I am going to assume you know how string interpolation and quoting works. In other words, this should make sense:

echo "Your path is $PATH and the current directory is ${PWD}"

The Long and the Short

Suppose you want to know the length of a string. That’s a pretty basic string operation. In bash, you can write ${#var} to find the length of $var:


#/bin/bash
echo -n "Project Name? "
read PNAME
if (( ${#PNAME} > 16 ))
then
   echo Error: Project name longer than 16 characters
else
   echo ${PNAME} it is!
fi

Continue reading “Linux Fu: Bash Strings”