I've had a few requests for them, so I thought it was about time I did one. I've also had something sitting around for a while which will resolves my objections.
This is a Viglen case for a BBC. It's in too poor condition to use, the plastic supports for the internal metalwork are all snapped off, some parts are missing, and the front is cracked. The idea with these is that the case replaced the top case of the BBC. The keyboard was then moved into a separate unit.
This is also in bad shape, but other than needing a good clean, it's mainly the paper label which is the problem. That would make a nice keyboard. Inside, it is just the standard BBC keyboard, with a nice curly cord extending the normal 17 pin connector.
Most of the USB keyboards I've built in the past have been simple matrix, so that can be connected to the controller to set the rows and scan the columns. The BBC is quite different. It has circuitry on board to drive the columns and read the rows. 4 of the outputs from the BBC are latched into a 74LS161, then to a 7445 binary to decimal converter, which drives the columns. The rows are fed into a 74LS251 8 channel mux to select the row to read. There is also a 74LS30 nand gate which gives a signal if any of the keys on the current column are pressed.
There are also three LEDs (originally Motor, Caps Lock and Shift Lock), and a special key, Break, which is wired to the 6502 reset line. To drive this keyboard, I could remove the logic and drive the matrix directly, but there's no reason to do that, I can just use them in the way they were intended.
Later BBC keyboards have a speaker mounted to them, seems a shame not to use it. The BBC makes two beeps on startup, so I've emulated those on power up. It wasn't right without them. It is an 8 ohm speaker, so I can't drive it directly from the microcontroller, as the output pins are limited to 40mA. I was going to use a simple transistor amplifier, but I though I'd try a series resistor. 220 ohms in series takes it to 228 ohms, which on 5V should draw 22mA. That was loud enough, so I just left it with that.
The keyboard in the Viglen case was an older one without a speaker, so I fitted a small piezo speaker. to that one.
With that installed in the case, the keyboard bolts over the top.
I need to cut some black paper, or spray it black, but other than that it's finished.
Most of the key mapping was reasonably straightforward, although I did notice the circuit diagram in the user manual had the 9 and I keys the wrong way around. The only unusual keys are Break, which I've set as Ctrl+Alt+Delete, Copy which I've mapped to Ctrl+C and Shift Lock which is now the Windows key. The LEDs are mapped to the three normal keyboard LEDs, Num Lock, Caps Lock and Shift Lock, and change accordingly.
Update: a few broken keys have been replaced and the inner section of the case has now been sprayed black.
Update 2: More info on a later blog post: BBC Micro USB keyboard kit.
2023 Update
USB Keyboard Controller Kits are available from my Sell My Retro store:
Note: these are not suitable for use with MiSTer FPGA.