Sunday, 24 April 2016

Acorn A3000 USB keyboard

This is a USB keyboard conversion for an Acorn Archimedes A3000 computer, and it has been a long time in the works. I initially planned to build one of these when I picked up an A3000 with battery damage, Unfortunately with that one I was able to fix the damage, so that one is still running as a real A3000.
I have now picked up another one, the damage here is worse, the battery leak has eaten through too many track this time.
This one will getting converted. The keyboard looks reasonably straightforward, two 20 way membrane connectors.
On the A3000, these are connected to an 8051 microcontroller which generates serial data. This is presumably left over from the older Archimedes machines which had a separate keyboard. I did consider making a new board which used that 8051 to run the keyboard and a small microcontroller that processed the serial output. That arrangements works well on the Amiga 500 and Atari ST where the keyboard controller is actually part of the keyboard module.
Instead, I've got for just reading the keyboard as a matrix as normal. I have a standard USB keyboard controller with enough pins (just) to cope with this. The Acorn documentation shows the keyboard controller and connectors. It should be easy to work out which way around they go as the top membrane is missing the rightmost four contacts. All the rows are along the top, and columns and LEDs on the bottom row.
The five LEDs (power, disk access, num lock, caps lock and scroll lock) are connected directly to the membrane The resistors to drive these were on the board, so I needed to add a resistor pack to limit the current to these, driving them from the unused pins on the top row to avoid cutting tracks.
When I built this up and tried it out, it sort of worked, but not all of the keys were working, and none of the LEDs. My wiring wasn't the neatest, and I was a bit short of time, so I presumed I had messed something up with the wiring. I thought it would be easier on a proper PCB, so I designed one to that spec and added it to the list to be ordered with my next batch of PCBs.
Roll on several months, and the new board came back. I built one up, much neater now, with a surface mount resistor pack. The trouble is, that didn't work either. Same problem. After some further investigation, it turns out I had made the assumption that since both connectors were drawn the same way around, and one above the other, that this was the way they were laid out. Well, I was wrong. The top one is drawn with pin 1 and the gaps on the right, and the lower one is drawn pin 1 on the right and the LEDs on the left. It turns out, on the board the lower one is flipped. It is fitted to the board with pin 1 on the left and the LEDs on the right. [Expletive deleted].
So much for the new board. I went back to the original multi-purpose board and removed the resistor pack and wired the resistors to the other end, in a much neater way it turns out.The code had to be shuffled around now as the row connections were all different. It's much easier to change the code to read the pins they happen to connect to, rather than rewiring the connections. They have used three different value resistors in the schematic, so I followed suit. Odd since they are all green LEDs?
Guess what, that worked perfectly! The keyboard mapping was fairly straightforward, most of the keys match a modern layout (well, when I say modern, I mean 'the same as the IBM model M', which came out five years before A3000).
Now that they keyboard is working, I can get on with the plan to install a Raspberry Pi running RISC OS Pi. So it's not really a casemod as such, I've just upgraded the RISC processor on the A3000 to the one on the Pi, and also added more RAM and disk space etc. Oh and HDMI video output and LAN. It's actually quite an old Pi, just happened to be the one I had RISC OS Pi installed on.
More on that once I've sorted out how it's all going to fit together. The A3000 power supply appears to be working, a few caps will need to be replaced, but that could supply 5V for the Pi. The speakers in the case could be wired up.
Not sure about the floppy drive. I've been considering making a USB to floppy adapter for a while, but haven't got there yet.

I will be updating the custom A3000 board in future, but I can build some more of these A3000 USB keyboard controllers with the generic boards. You can order one below:

Acorn A3000 USB keyboard kit
The revised boards are available now.

If you want to support this blog, you can donate via Patreon or Paypal, or buy something from my store.