Monday, 7 September 2015

Apple Macintosh USB keyboard and mouse conversion

I keep expanding the range of USB keyboards I make and sell in my Etsy store, and I still get requests for ones I haven't done yet, and this one was sent to me for conversion. This is an Apple M0110A keyboard, from (I think) the 512K Apple Macintosh. The very first Macs didn't have the numeric keypad bit (or arrow keys!), and the keypad available separately. This is the later version with the combined keypad and the addition of arrow keys.
Quite a nice solid chunky keyboard, connected via a curly cord with a 4 way connector. It looks like the standard RJ11 connector used on phones, but they are 6 way, 4 connector (6P4C), and these are the thinner, 4 way, 4 connector (4P4C) RJ10.
There is in internal keyboard controller which sends the information to the computer via a serial connection. As with previous keyboard conversions like the recent Atari ST USB keyboard, I can reuse that and read in the data from the keyboard. It is a custom protocol, but there is quite a lot of documentation and code around on the internet, The data is in the form of key pressed / key released information, so that is used to populate a matrix of keys currently pressed, and that is then used to complete the USB keyboard report data.
I used the PCB from my 9 way D USB Joystick adapter, as the pin spacing for the RJ10 socket fits nicely. The 4 pins are ground, clock, data and power, these are wired to the fused USB power and the data pins to two I/O pins on the microcontroller. These signals appear to be open collector, as both the keyboard and the Mac can drive the data line, although the keyboard always drives the clock line. I've added pullups for these on the bottom of the board.
That sits inline, using the same case as the USB joystick adapters. The customer is converting a Mac XL case to have an LCD monitor and Raspberry Pi, so there should be space to fit this inside the case and have the keyboard plug into the front as it would originally have done.
As well as the keyboard, the owner send a matching mouse to be converted as well. An Apple M0100. I was planning to do the same thing, build an interface to connect to the original mouse cable and convert the protocol.
When it arrived, I spotted a slight problem, this particular mouse had no tail. Not knowing if it actually works, or having anything to test it with, I had to abandon that idea and go for plan B.
I don't normally like doing anything that isn't reversible, but this mouse is ready for conversion. Even if I got a replacement cable, and it did work, it's still a ball mouse and they aren't ideal. Whenever I use vintage mice, I'm always pleased to go back to a modern optical mouse as they are so much better to use.
So here is plan B, a Microsoft Optical Mouse 200. This is a small, white optical wheel mouse, just what I was after. Inside, there isn't much, just the small PCB with the optical sensor, a clear plastic light guide and the wheel and switches.
Time to strip down the Apple mouse, and see what's inside. The mouse ball was very heavy, probably an indication of quality, later ones were much lighter.
I had to shorten the optical mouse PCB slightly, but it fitted well. I removed the three buttons and installed the single, taller microswitch from the original mouse. I fed the mouse cable through the original grommet on the back. Now you see why I went for a white mouse, not the typical black one.
The light guide for the LED and optical sensor originally fitted between the board and the case. I had to file it down to fit, with clearance for the cover to be refitted. I held it in place with some hot melt glue.
Originally the cover twisted off to allow access to the rollers for cleaning, this can now just be twisted back on. The optical sensor peers out of the hole and almost looks like it was designed for it.
Here is the finished mouse, I couldn't resist leaving the Microsoft label on the mouse tail.
So there is the completed keyboard and mouse set. Hopefully soon to be combined with the converted Mac XL case, in a project called PiXL.