Close

Faking that VFD look

A project log for Calculators

Exploration of calculators, their emulation, mechanical aspects such as pretty buttons and quirky displays

svofskisvofski 03/17/2024 at 20:520 Comments

The most iconic calculator for me is Elektronika MK-54, or MK-61. MK-52 to a lesser degree, because it came out so late and I never had a chance to actually use it. In the mid-80s, alone in the summer at a country house I spent countless hours on MK-54 playing lunar lander and displaying various things it shouldn't display. Actually it ate through the batteries really fast and the hours were pretty short after all.

The display that those calculators used may seem nothing special today, but the peculiar shape of its segmented characters is very dear to my heart as it turns out. The display is called ИЛЦ2-12/8Л and it's easy to buy it today on ebay. Of course I have a few of them and there's a driver circuit in the works.

However before I found them and the courage to make a VFD driver board, I found an OLED screen which seemed to be perfect for modern fakery. It's a 2.08" 256x64 OLED screen. It has a SH1122 driver with SPI interface. The driver can achieve 16 levels of grayscale, so in theory it could show some antialiased fonts. The lot on aliexpress looked like this:

u8g2, which would be my go-to library for driving a small OLED, supports it out of the box. Unfortunately, u8g2 doesn't have any support for grayscale graphics at all. The older u8glib can handle grayscale, but has no support for SH1122. Fortunately I found this nice video:

Mr. Tsaryov generously shared his code on github here: https://github.com/mikhail-tsaryov/SH1122-STM32-HAL-Driver/

It was easy to adapt it to Arduino HAL, which is what I blasphemously use with Pi Pico. The mini library provides functions for initialisation, graphics primitives and and text rendering with several fonts included. The fonts that it supports can't be antialiased though, so I ended up pixeling up my own stuff.

I traced the indicator in The GIMP from a high-resolution photo. After several iterations I had a tilemap of every character my calculator can display.

I ruled against rendering individual segments because at this low resolution the segments bleed a little bit into eachother, and it is important for the overall warm and fuzzy look. Note how there's a dedicated minus glyph -- this is because mantissa and exponent sign have a wider, more blocky shape rather than the common middle segment in the main digit pattern.
For that nice look, non-lit segments should also be visible. Unfortunately, even though this OLED is grayscale, its darkest non-black value is way too bright.

Trying to achieve slightly better perceptual linearity in the lower intensity range, I played with precharge/discharge parameter of SH1122. Empirically, the value of 0xF1 seemed to give the darkest dark so I kept it.

But it was still way too bright. To further reduce the brightness, I added a checkerboard stencil for the darkest shade. This reduced the brightness by 50%, but it kinda looked ugly. The solution is to invert the stencil every frame. Provided that the frames refresh fast enough, this gives reduced darkness while staying smooth. It's next to impossible to photograph though because you tend to end up with only A or B frame but not a mixture of both.

On the photos it tends to look rather crude, but keep in mind that this is a fairly small indicator. I can't see all the sharp detail with a naked eye.

I already had a port of MK-61 emulator by fixelsan and sergev ready for my pipico, so I just had to plug in my freshly cooked library. After some fiddling around I was greeted by a wonderful MK-61 display in all its weird glory:

It's impossible to catch this on camera really, but the surprising thing about this display is how close to VFD it actually feels in person. Sold as white, it's rather blueish, so not that far off from a typical VFD and would be indistinguishable under a green filter.

In the likeness of the VFD it imitates, this display is also very power-hungry. I couldn't power it from 3.3V rail on a pipico without rendering rp2040 completely unstable. You need a dedicated LDO to power a display like this.

Discussions