Sunday, 26 April 2015

ZX Spectrum USB keyboard conversion kits

I've been asked many times for kit to convert a ZX Spectrum into a USB keyboard, so here it is.
This is a new replacement membrane I have designed. It does not have the traditional pair of 5 way and 8 way 0.1" pitch tails as the original membrane,
The new membrane has a single short 14 way 1mm pitch tail. The keys are now arranged in a 4x10 matrix, rather than the original 8x5.
With the original membrane, the controller board had to be the full width of the case, and so took up a lot of the space inside.
The new controller board is a lot smaller. This leaves more room in the case, should you wish to add a raspberry pi or other system.
The membrane tail fits directly into a flat flex connector on the board, so no more long flapping tails.
The red button is the mode switch to alternate between mapping modes. The start mode has each key mapped according to what is printed on it. Caps shift and Symbol shift are used to get additional functions and punctuation (see full mappings).
Press the button and it switches to a mode where each key is mapped directly to a key on a normal keyboard (for use with emulators or if you wish to map yourself in your OS). Press again and it goes back to the remapped mode. The buzzer on there beeps where you change mode, and in remapped mode, it makes a 'tick' sound when you press the keys to give you positive feedback.
There are two options for the controller board, it can either have a microUSB port that sticks out of the 'EAR' socket, or a 4 pin header for a captive cable (if you prefer that), or for connection to a pi etc.
The kit is available with either the micro USB version shown above, or the internal connector version.

Currently out of stock

Connection option
Price including postage

The kits are also available form my Etsy store: ZX Spectrum USB keyboard conversion kit.

I will be using these on my ZX Spectrum USB keyboards and ZX Spectrum USB Keyboard with Raspberry Pi, both available from my Etsy store.
I've also listed the ZX Spectrum+ USB keyboard conversion kits, see the blog article on those for more info.
Coming soon: an updated Raspberry Pi 2 build using one of these kits, and another new board for power and USB connections:
Update: Dave Jones' EEVBlog postbag including quick installation and review at 18:25.

Saturday, 18 April 2015

Petdisk clone

A few weeks ago, I wrote about building a prototype version of Bitfixer's Petdisk, an IEEE-488 disk drive for Commodore Pet computers, using an SD card for storage. Credit again to Bitfixer, the creator of the original Petdisk. This was the first stage of a plan to build my own Pet disk drive emulator, recreate what has already been done to prove the principle.
That version was built on an Arduino UNO, using the same pins to connect to the IEEE-488 port as the original version of Petdisk. This allowed me to load the original firmware in to check everything was working.
I did get some way along the road writing a version in the Arduino environment. I started from scratch, but followed the general lines of the Petdisk firmware. I was hoping this might come out to be a some nice short simple Arduino code using the SD libraries etc. However testing showed the I/O operations needs to be fast, so I had to replace all the nicely wrapped Arduino DigialRead and DigitalWrite calls with direct PORT and DDR access. I ended up removing most of the serial debug I had added as well. But it did work. I started with an empty directory and a simple hard coded 48 byte test program.
Whatever filename was requested, it would return the same 48 bytes. With that working, I started using the Arduino  SD library to load files. That is working, but is unfortunately limited to 8.3 filenames. I didn't get around to writing the directory listing bit, but that should be possible. So, the new firmware can be written, but probably best not in the Arduino environment.
The next step was making a PCB version of the SD card version. This would again use the same connections to the IEEE-488 port as Petdisk, so it could use that firmware. As with the Arduino UNO, I used the ATmega328P. Not the actual chip used on the Petdisk (that was the ATmega168), but similar enough to allow the firmware to be used.
Rather than the diode / resistor level conversion used on Petdisk, I went for a 3.3V LDO regulator, and a 4050 hex buffer working as a level shifter. I also went for a microSD card socket rather than full size SD. I added a power LED and using a spare gate of the buffer, an activity LED.
The board slides into the pins of IEEE-488 24 way 0.156" edge connector and it is soldered down on both sides. I missed out the pass-through connector and the USB power connector and went for a simple two pin header for the power. OK, it's sounding less and less like a clone now, not quite an emulator, but the only thing in common between this and the Petdisk now are the edge connector and the microSD card.
The pins at the back are the power in, the 6 pin Atmel programming header and the three jumpers. Two for the address setting, one can be used for serial out.
I built a few for my machines and a few friends who have also tried but been unable to buy a Petdisk. I have a few boards left if anyone else is in the same position.
With the Petdisk v2.0 beta firmware loaded, that is working nicely. I am in the process of writing some new replacement firmware, I've gone back to plain C in Atmel studio, rather than in the Arduino environment.
In my version, I'd like to add some new features, BASIC 4.0 disk commands like 'DIRECTORY' and DLOAD, shift + RUN/STOP support, non- PRG files and file OPEN commands.
One of the things I've been looking at is an old text adventure game. I've found a D64 image, which contains a .PRG file and many .SEQ data files. With those transferred to an 8250 disk, it loads and runs. With the Petdisk firmware it gets so far but cannot load the instructions or start the game as these use OPEN and INPUT# commands. The aim is to get that working.

I've since built a range of PET disk drive replacements based on PET SD instead, see the range of PET microSD boards.

Thursday, 9 April 2015

Atari / Commodore 9 way D USB Joystick adapter

A while ago I designed a board which allows you to plug in one or two Atari / Commodore style joysticks and use them on a PC or Pi with modern games or emulators.
I used this on Spectrum +2's, Commodore 64's, Atari etc., poking out the holes in the case originally used for the joystick connectors. 
I've had a few requests to add this to Spectrums, but there isn't space inside, so I took what was designed to be an internal board and made an external version, the same board in an ABS project box. It looks a bit ugly, and it's a pain to file out three odd shaped holes, but it does the job. 
There has been more interest in this, so I thought I'd design a proper external one. I wanted something that would fit into an existing case, without modification. I initially looked at using a 9 way D connector hood. 
The board had to be very small, only 17mmx17mm. I decided this was just going to be too fiddly as it ended up with components mounted on both sides of the board.
I did look at 3D printing a case, and got some way into designing that. I then found an easy solution staring me in the face on my desk. The case used on the USBtinyISP, was actually designed for a 9 way D to RJ45 adapter. The USBtinyISP uses the RJ45 hole for USB, which fits fine, and the other side was designed to fit a 9 way D connector.
These cases are the Pac Tec CNS-0407. I found they were available (without the LED holes) from Mouser, so I got some and designed a board to fit in there.
One end has the full size USB connector, and the other end a 9 way D connector. Plug in any Atari or Commodore style joystick with a 9 way D connector and it will show up in Windows or Linux as a USB joystick.
The board fits snugly into the case, which tapers at the 9 way D end. There is a bit of space on there, so it's spread out a bit to fill the gap between the two connectors.
The case snaps shut and makes a neat enclosure.
This can just sit inline between the PC and the joystick.
Testing here with a nice microswitched zipstick.
There is now a dual version available.
You can order these from my Tindie store.