Reverse engineering an old keyboard

Recently I got an old keyboard from the 1980s, it has a 20 pin ribbon cable connector, weights almost 3kg’s and has no information on Google. This should be fun.

The keyboard in question is a Computervision branded one, though the PCB says it’s an Amkey MPNK-68. Looking at the insides, the date codes on the circuit board are from 1984 and 1985, meaning this keyboard is probably from the end of the 1980s. Taking a look at the keycaps and all the special functions, it was most likely used for a terminal.

Now to reverse engineer it. A few tools are required to do so:

  1. A multimeter.
  2. A logic analyzer, like a Saleae Logic.
  3. Some screwdrivers to take the keyboard apart.
  4. A power suply, most likely 5V

Very simply put, the steps are as follows:

  1. Open the keyboard
  2. See what the pinout of the connector is.
  3. Power the keyboard.
  4. Hook up a logic analyzer to all signal pins.
  5. Figure out how it works, is it a serial protocol, parallel, something else.
  6. Build a converter using a microcontroller board like an Arduino.
Continue Reading

A look inside a Marconi signal generator

Recently I got a Marconi Instruments 2019 signal generator, capable of generating signals from 80Khz up to 1040Mhz. It can also modulate these signals with AM, FM and more. This instrument is from the mid 80s and is, as far as I can test, still in good operational order.

A signal generator capable of generating over 1Ghz is pretty impressive, especially in the 80s, so let’s have a look inside this unit and see how it’s made. I have very little RF knowledge, for a good explanation on how this thing works I would recommend the service manual. It can be found with some google magic and contains 240 pages filled with explanation of this signal generator.

Warning: This page contains a lot of big images.

Continue Reading

Turning a CPU into a SoC

In my previous blog I wrote about a one page CPU in SpinalHDL. But just a CPU is a bit boring, time to turn it into a full System on Chip by adding memory, peripherals and even a UART bootloader. One of the great things of Spinal is the existing libraries, making adding some peripherals a lot less work compared to traditional hardware design languages.

Continue Reading

A one page CPU in SpinalHDL

FPGA’s are fun and interesting devices, sadly the usual ways of programming them, Verilog and VHDL, are tedious and annoying to work with. Sadly most FPGA tools support only these languages. Luckily a few projects exist to make a nicer and more fun language to work with, which are translated to either Verilog or VHDL so they can be used with all normal FPGA tools. One of these languages is SpinalHDL, a Scala based language that promises more abstraction, less boilerplate code and also has a good amount of already existing libraries. The only downside is the long name, SpinalHDL, so I’ll short it to Spinal for now :

To try out and learn Spinal a bit, I decided to make a CPU, an always popular project for FPGA’s. To make it a bit more interesting, I wanted to make a CPU which code fits on a single page of paper, inspired by the fun CPU’s made by Revaldinho, which can be found here. Those CPU’s also have the added rule of having a emulator and assembler also fit in a single page of paper, which I choose not to stick to.

Continue Reading

Getting an IBM AS/400 Midrange computer on the internet

Recently I’ve gotten a hold of an old IBM mid-range computer, an AS/400 150.
This is an 1997 server very much aimed at businesses, pay-rolling, inventory management and such. It can be used as a multi user system, with users logging in via a terminal.
The operating system it runs is OS/400 and that is also the only OS it can run, no Linux available for this system.
Of course it comes with all the fun programming languages like COBOL and RPG, all the business classics :)
It’s compatible with the IBM system/36, so any programs made for an 80’s S/36 machine run without problems on the AS/400 machines. It also looks very much 90s, though I personally like the cover at the back, hiding all ports.

Continue Reading

Hello World on the Lichee Tang RISC-V/FPGA board

A Chinese company recently launched a small dev board with some interesting features, it’s one of the very few boards with a RISC-V CPU, like the SiFive HiFive1, at least, I though. Unlike the HiFive1 board, the Lichee Tang doesn’t use a custom RISC-V microcontroller, instead it has a FPGA IC with a RISC-V core pre-loaded. This also means it’s possible to use it as an FPGA board, add custom things in the FPGA next to the CPU and so on. And this is just where the interesting tidbits start. Sadly, the documentation currently is mostly in Chinese. So let’s change that and make a hello world project. Meaning, get a toolchain up and running, recompile the FPGA project and load it all on the dev board. Don’t worry, I also created a virtual machine with all the work done already.

Continue Reading


Using GAls in the 21st century

A long time ago, 7400 logic was all that was available, but having only 7400 logic means designs can get big and difficult, but making a custom logic IC was expensive and hardly a possibility. A few companies started making programmable logic devices like the Programmable Logic Array (PLA) and Programmable Array Logic (PAL). These devices started being available in the 1970’s and where generally one time programmable devices, with the capability to contain a handful of simple logic. Much later, in 1985, the Generic Array Logic (GAL) came into existence, a reprogrammable version of the PAL. Later on the CPLD’s and FPGA’s came and are still used today.When reading about this I discovered there are still GAL’s made and sold, and getting old ones from Ebay is easy enough. They looked like weird odd devices, so I decided to have a closer look, eventually making a dual BCD to 7 segment decoder with them that even handled multiplexing.

Continue Reading


Programming and debugging the STM8S microcontrollers using open source tools

ST makes the very popular STM32 line of ARM Cortex M microcontrollers, which have a good amount of hobby and professional users, but ST also makes a lesser known family of microcontrollers, at least, lesser known except in China. The STM8S series are 8 bit microcontrollers with their own CPU core and peripherals that are fairly similar to the ones on STM32 devices. And they are used on a lot of cheap Chinese gadgets and DIY boards. Slowly some hobbyist interest also is starting to form and there is an Arduino like library available and good support in the interesting Forth language. Sadly, an C IDE with debugging support, like the STM32 system workbench is not available, at least, not for Linux. There is ST Visual Develop but it’s a bit crusty and Windows only.

The STM8 devices are cheap, really really cheap. But apart from being very cheap and in a lot of Chinese gadgets, for hobby use just grabbing an Arduino, STM32 or other mode popular board is a lot easier to get running and to get support. But if you want to try a new architecture, hack some Chinese gadget or need a microcontroller that is less then 0.25usd in bulk. please read on.

I already made a few makefile projects for the STM8S, but that still lacks debugging, so time to do it a bit better. And why not make everything work in Eclipse while we’re at it. This is all tested on Debian Stretch, I imagine it will work on any Debian based distro like Ubuntu or Mint and without too much changes on any other distro, but your mileage may vary.

As the SDCC compiler is unable to optimize unused functions, the makefile splits every C file from the peripheral drivers into a separate file and then compiles a library. This way the code size remains small. The downside is that stepping into a function like GPIO_WriteReverse does not work when debugging. As these drivers are provided by ST and probably tested, I don’t find this a problem, but good to keep this in mind.

Look at that fancy debugging support :D

Continue Reading


StupidCPU, the RAM

a.k.a. the most energy inefficient memory possible.
A computer needs RAM to function, the StupidCPU is no different.
I decided to design the RAM first as it’s a relative straitforward element and the first board also means designing an interface to hookup multiple boars together.
And multiple boards it will be. The design idea is to make everything on 10*10cm PCB’s as those are the cheapest to order from China and one single boards means more things to go wrong.
A backplane like structure will be used with multiple boards plugging in to the backplane to form a computer.
This blog post will discribe the backplane interface and the first board, the RAM board.

Continue Reading


Using FPGA’s for audio processing

FPGA’s are cool, Digital Signal Processing is cool and audio is a nice way to show it.

To get a bit better at working with FPGA’s and see if I remembered anything from DSP classes I started working on a project to combine those two. I had a board laying around with an I2S ADC/DAC that doesn’t need any configuration so the plan was to read in the audio data, process it and spit it back out. For the processing I choose to use the digital biquad filter, a fairly simple filter that can be used for a multitude of purposes. It can be used as a lowpass, highpass, bandpass, notch filter and even more. In the end I the result is that the FPGA reads in the audio data, can apply a maximum of 11 biquad filters (more are possible) and spits it back out. A computer program is made to calculate the filters:

A RIAA filter, using 3 of the 11 possible biquad filters.

Continue Reading