Apologies if this isn't exacty MiSTer related, but it's a project that was born in these forums and with the idea of being used with the MiSTer. It's also an open "libre" project and I don't think I'll provide pre-built units so it's clearly not for profit.
Those who have been following the Recreated ZX Spectrum support thread may remember that I've been working on this project. Given the general lack of availability for Recreated keyboards, I liked the idea initially raised here by Chris23235 to use an actual ZX Spectrum case with a USB controller that could serve as a USB keyboard, instead of having to find and buy an expensive Recreated keyboard. The drawback is that you lose the Recreated's NKRO (even though the Speccy never had actual NKRO in the first place) and the possibility of connecting via Bluetooth.
It turns out that there are several projects about the same thing:
- https://www.instructables.com/ZX-Spectr ... rd-Part-1/ (same article is available in other webs)
- http://web.archive.org/web/202210060749 ... -part-two/ (archived version, as original link is now defunct)
- https://hackaday.io/project/2076-zx-keyboard
- https://www.instructables.com/ZX-Spectr ... RetroPie-/
Each had its drawbacks:
- The first one requires a Minimus USB, which is sadly no longer sold. The firmware's source code is not public.
- The second one doesn't provide any firmware, and requires lots of glue.
- The third one requires a MCU well above what's necessary for this project, and requires you to make modifications to the MCU board: "The Arduino's LED on pin 13 needs to be removed or a pullup resistor to VCC added".
- The fourth one doesn't provide the PCB modifiable files, therefore the PCB is not "open source". It uses a Teensy 3.2 which is also no longer sold. The firmware kind of sucks, and doesn't specify a license.
So, I started this project with the goal of including:
- Full Kicad files for both a Spectrum/Spectrum+ PCB and a ZX81 PCB. Of course the associated Gerber files too (currently pending because there's no official release yet).
- Open source firmware which can be built with standard tools, that doesn't need an Arduino IDE.
- Support for both normal USB protocol (which is limited to 6KRO) and Recreated protocol (which supports full NKRO). Note that the normal USB protocol just provides the raw keys used by the Spectrum; it's not intended for use as a generic keyboard, but just for emulation. To control the emulator, you additionally need a normal keyboard; in the case of the MiSTer, you could also use a controller with the Menu button mapped.
- Support for using a Spectrum case with a ZX81 core, and vice versa. Talk about a "ZX 81 Spectrum"
I also got rid of the need for diodes and pull-up resistors used in the other projects, using the MCU's built-in high-impedance and internal pull-up features. So, if two rows are connected because two keys are pressed for the same column, e.g. Caps Shift+P (see PJ Evans' diagram on the problem), the high-impedance state of the rows not being scanned suffices to prevent a short, and the reading is meaningful with no diode necessary.
Current status (Sep 21, 2024)
Thanks to Alejandro (wilco2009) who did a field test of the second, corrected PCB (the first one had some screws misplaced), some problems were detected and corrected. The current PCB has not been tested yet, but when it is, a release will be made. Problems identified by Alejandro were:
- With a socket, the MCU is too high and clashes with the keyboard.
- The USB cable clashes with the case too.
- The MCU's µUSB connector is too flimsy; he broke his and had to make some repair work.
- There were two rows flipped. This was a software problem which I quickly fixed and he has confirmed to be working fine again.
- Some keys were not working properly. Again, a software problem solved by raising the settle time delay before reading the inputs.
The first two problems were a rookie mistake on my side, which was fixed by moving the MCU to the top of the board in the new version.
The third problem was solved with this approach: the board will have a microUSB cable that will be cut and soldered to a USB-C connector added to the PCB via a breakout board. This way, the internal cable will not need to be moved or disconnected, and a USB-C cable can be used to connect the unit. The case window used is that for the TV connector, which is the highest and provides the most leeway space for the placement of the USB-C connector.
Additionally, I've placed ribbon connectors at several heights just in case your ribbon cable is too short or something like that. The bottom ones are placed at the height that an Issue 3B Spectrum has them, the idea being to prevent bending those flimsy ribbons more than they were when they were connected to their original board.
Project link: https://codeberg.org/pgimeno/ZXUSBKB
Pics of the old board, with the MCU in what will be its new placement:
Rubber ZX Spectrum case:
ZX Spectrum+ case:
Preview of the new board:
Top side:
Bottom side:
The ZX81 board is currently on hold, until I can get a decent ZX81 case for measurements; the one I bought had the screwing points for critical screw positions broken.