Reverse engineering

First part of the project was to reverse-engineer the keyboard hardware and firmware, to be able to make modifications. Keyboard contains two main sound chips, FM synthesizer and drum sample player. Both of these are Yamaha custom chips, and no documentation has been published for them. This added extra challenge, but as one result of this project, a programmer’s guide for both chips is now written and available.

The FM chip (YM3806) inside this simple keyboard proved to be a full-blown 4-operator 8-voice synthesizer, not a cut-down simple chip as in most cheap Yamaha keyboards. It is very close to chips used in Yamaha DX100 and DX27 “serious” synthesizers from the same era. The capability crippling is done purely in firmware, and partially in hardware, for example by leaving out velocity sensitivity from the keys.

The drum chip is YM2154, a semi-pro chip, used at least in Yamaha RX11 and RX15 drum machines. It is a sample player and uses Yamaha’s special drum sample ROMs. PSR-70 contains smaller and lower samplerate ROMs, though.

The reverse-engineering part of the project was done a couple of years ago and it is documented separately in Hackaday: https://hackaday.io/project/177168-yamaha-psr-70-reverse-engineering

Modifications to original hardware and firmware

Second part of the project was to modify the keyboard to more usable format. I did not want a keyboard with keys in the first place, and PSR-70 keys were not so high quality. So a midi sound module was the target.

PSR-70 contains several PCBs, two of them are of main interest here:

- main board contains processor and memories; also the custom sound chips with their auxiliary circuits reside here

- analog board contains sound mixer, chorus effect, supply regulation and power amplifier for speakers

Processor on the main board is Z80 and firmware is in EPROM, so this is quite ideal retro programming environment. Original firmware is not suitable for use: it wants to scan the keys and read the front panel buttons, both of which will be removed. And it does not understand anything about FM sound parameter editing. Although it contains a midi interface, it does not even react to velocity information, and certainly not to any sysexes.

So I wrote a totally new firmware for Z80, only mimicking some sound chip controlling principles from the original firmware. It was not that hard to do, because functionality of the sound chips was already known, thanks to the first part of the project. Firmware is written in C, using SDCC compiler.

User interface 

Old Z80 with 6 MHz crystal gets quite busy handling the midi data, 8 channels of FM sound, 12 channels of drum samples and all housekeeping related to these. It will be too much to try to get it handling also the LCD display, buttons and encoders needed for local user interface and patch management. Another processor is needed for these.

Here I’m using a modern, or “modern”, microcontroller: C8051F340 is a good old 8051 on steroids. It has modern peripherals, including hardware-USB, which opens up a USB-midi possibility. A Chinese breakout for the F340 is an easy way to go. It needed a small “shield” to connect all the cables and others.

8051 firmware is written in C, compiler is SDCC, development environment is SiLabs old IDE, configurations generated with ConfigWizard.

The 8051 handles the user interface: updates the 4x40 character alphanumeric LCD, reads two encoders and one button. It also implements USB-midi interface and manages the patches, which are kept in I2C EEPROM.

The communication between the processors is a bit tricky: there are no serial interfaces on the Z80 board, except one UART, which is needed for midi. But throwing the keys out freed almost two 8-bit parallel ports which were used for scanning the keys. These are now used for a parallel interface between CPUs with an ad-hoc handshaking protocol. ...

Read more »