Saturday, 24 January 2015

Commodore plus/4 USB Keyboard

This is a new addition to the range of USB keyboards, a Commodore plus/4 converted into a USB keyboard. I first built one of these two or three years ago when I briefly used the Arudino Leonardo as a base for these keyboards, but ended up reusing the bits to repair a plus/4 with a damaged case and missing keys.
I've had a request for one of these, so I've built a new one using the new USB keyboard controller boards. As with any of the USB keyboards I make, I don't like to take a working computer out of circulation (or even a repairable one). I think this one was an ebay 'untested' example.
The plus/4 has a number of Achilles heels. The usual issues of the 264 series (Commodore 16 etc.), the TED chip and the earlier versions of the 7501, both of which eventually burn out. There are also the common problems with computers of that age, the DRAM and mask ROMs. This unit looks like it has had a few parts swapped out, half the screws are missing and screwdriver marks on the sockets. The TED, CPU, and one of the ROMs were all faulty. The RAM however, was working on this, so I was also to use this board to fix another plus/4 which had faulty RAM I hadn't yet replaced. So that leaves a spare board with duff RAM, missing it's BASIC ROM, CPU and TED chip. Sadly, the only source for those replacement parts is another 264 series computer, so it's added to the collection of spare boards.
The other issue with these is the keyboard connector. It is an 18 way solid core ribbon cable. This flexes each time the case is opened, and this one had obviously been opened a good few times. If this flexes where it is soldered to the board,the connections eventually break. Often when there are multiple keys out on a plus/4, it is worth checking the cable, although you can also get the same fault with the TED chip or the 6529 driver chip.
This one had completely snapped. In these cases, I normally replace it with a pin headers at both ends and a flexible ribbon cable. Although not true to the original design, it tends to be a reliable solution.
In this case, I can mount the keyboard controller on the rear of the keyboard. It needs to be offset slightly as the case sides are stepped in. There is sufficient height for the same right angled pin header I used on the replacement ribbon cables, and a suitable header on the USB keyboard controller. This is the latest revision of this board, it is refined each time I get a new batch. This time I have standardized the mode switching through out the range, and shrunk it a bit more.
Since this means taking the keyboard apart, it's a good opportunity to give the keys and contacts a good clean.
The usual collection of keycaps, springs and plungers are cleaned, and it comes up looking very nice.
When making a keyboard with a mode switch, I normally replace the power LEDs with a tri-colour one, so I can use red for emulator direct mode, and green for remapped mode.
That's easy on the breadbin style Commodore cases, but here the power LED is part of the keyboard, and is an odd stepped rectangular shape.
I couldn't find an exact replacement, so I made one by filing down a normal round 5mm LED. This worked rather well, but it's a bit labour intensive,
I may just hot melt glue a normal flat rectangular LED in the case next time. With that connected to the board and the mode switch fitted into a convenient hole in the case, it's ready to assemble.
The firmware is almost identical to the Commodore 16, not surprising, given the C16 was basically this board with some bits removed and it relaid out to fit into the corner of a breadbin style case. The pin order is the same, offset by a few pins, and with some differences at one end (the plus/4 includes the LED).
There are a good number of familiar keys on the plus/4 keyboard, so mapping those is easy. Some odd things like dedicated keys for *, @ and £, but it gives me an opportunity to use shift to give some mising symbols, such as \ and €. There is also a set of arrow keys and function keys.
The buyer had requested the mode switch version, so I had to work out the reverse mappings to allow all the keys to work correctly when used with the Vice emulator. I had to do the same thing when I introduced the mode switch for the Commodore 64 models. It's always a bit strange, but I need to make the keys on the plus/4 keyboard send appropriate key presses to the PC so that Vice will reverse the mapping and show the key I actually pressed. This is based on position, so you press ctrl on the plus/4. It tell the PC you pressed tab. Vice says, ah, the user pressed tab, so I'll interpret that as ctrl. Strange, but it works well and give you the surreal experience of using a plus/4 keyboard to drive a plus/4 emulator.
The plus/4 USB keyboards are now for sale on my Etsy store. I haven't listed a Raspberry Pi version, but there shouldn't be a problem fitting one in.

I now have a Commodore Plus/4 USB keyboard kit if you wish to convert your own.