USB Concept Keyboard

classic non-acorn hardware, software & languages
Post Reply
User avatar
Phipli
Posts: 128
Joined: Sun Sep 16, 2012 8:12 pm
Location: Derby
Contact:

USB Concept Keyboard

Post by Phipli »

Good afternoon folks,

I was thinking about those weird tablet things we had connected to BBC micros in primary school and decided to investigate. Having found that they were called "Concept Keyboards" and connected to the user port, I got intrigued. Looking on ebay, there was someone selling new old stock for more money than I should be spending and so I bought one with a plan. It arrived this week, wonderfully with all the original documentation and some Arch software. The manual helpfully included the pinout and I happened to have the correct 20 pin IDC connector in a drawer upstairs to make interfacing with the existing cable for the userport nice and easy...

At work I get frustrated sometimes at having to type obscure symbols and units with super and sub scripts a lot. My current solution is a USB numeric keypad and software that intercepts the key presses from that device and runs macros. There are only a limited number of buttons and the stickers I put on the keys are already wearing off. My thought was... the Concept Keyboard costs less than a modern fancy "Macro Keyboard", and has way more buttons - as well as helpfully letting you place an overlay on top to help find selections. The nice simple parallel 5v interface should make connecting it to a modern USB enable microcontroller fairly easy. A few hours later (not since it arrived, but since I started the project) and I now have a USB Concept Keyboard. At the moment it is set up so that it outputs standard keyboard keypresses - this keeps the adapter's firmware nice and simple as it just reads the 7 (8 if you count the shift lock button) bit value sent by the device and translates it into USB Keyboard Speak.

Given how easy it was, I'm considering getting a PCB made to make something that looks a bit nicer.

Anyone interested in the project? Anyone done something similar to connect some classic BBC peripherals to a modern machine?

Image

Image
User avatar
roland
Posts: 4327
Joined: Thu Aug 29, 2013 9:29 pm
Location: Born (NL)
Contact:

Re: USB Concept Keyboard

Post by roland »

Phipli wrote:
Sat May 30, 2020 7:24 pm
Anyone interested in the project? Anyone done something similar to connect some classic BBC peripherals to a modern machine?
I don't connect classic peripherals to a modern machine, but more the opposite: connect modern things to classic machines. I see however a nice project that looks a bit like this and IMHO it will be easy for you to make:

Use your design to send the (ASCII) printer output of a Beeb, Elk or Atom (they have almost the same interface) as keystrokes to an editor. Considering the U(niversal) SB approach this might work on Linux, Mac OS X and (perhaps also on :mrgreen: ) Windows without any additional drivers.

Just a simple 26 pin ribbon cable into the printer port and connect the USB to the host computer. Also suitable for uploading programmes to the host computer if you send a (base64?) coded file from the Beeb, Elk or Atom to the host and then convert it back to a binary.

Other fun usages includes using your Beeb, Elk or Atom as keyboard for a Raspberry Pi by simply sending the ascii values directly from keyboard to printer. Lots of possibilities here :lol:
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:
User avatar
Phipli
Posts: 128
Joined: Sun Sep 16, 2012 8:12 pm
Location: Derby
Contact:

Re: USB Concept Keyboard

Post by Phipli »

Shouldn't be difficult - more of a wiring issue and perhaps filtering out some control signals...

My main issue is a lack of working machines, my elk just needs reassembling though :p
User avatar
roland
Posts: 4327
Joined: Thu Aug 29, 2013 9:29 pm
Location: Born (NL)
Contact:

Re: USB Concept Keyboard

Post by roland »

Phipli wrote:
Sat May 30, 2020 9:14 pm
My main issue is a lack of working machines, my elk just needs reassembling though :p
Well, this is a community. When you post your diagram there sure will be some one who picks it up and converts it to a printer-to-USBkeyboard circuit and make the PCB. In the mean while you can adjust the software for the controller.
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:
User avatar
Phipli
Posts: 128
Joined: Sun Sep 16, 2012 8:12 pm
Location: Derby
Contact:

Re: USB Concept Keyboard

Post by Phipli »

Just did a bit of reading on parallel ports - the only difference between what is needed for inputting from the Custom Keyboard vs. from the printer port (other than reordering the pins) is the addition of an acknowledge pin. The strobe has the same polarity and everything is 5v.

There is no reason why you wouldn't make a dual purpose board, although you wouldn't be able to have both connected at the same time without additional complexity.

You'd use a straight through IDC to IDC cable though - if I remember correctly, the original Raspberry Pi had a 26pin GPIO header, so a cable designed for that would be fine if you didn't fancy making your own.

I have a Plus 1 so can test with the Elk if needed.

There isn't a scheme yet - I just made it up as I went along this morning - it isn't complex. I used an Arduino Pro Micro and so didn't have a full port available anyway for optimised code, so I just picked the most convenient pins. Other than the strobe and power pins it is effectively just a bus between the IDC connector and the Arduino. Used an interrupt enabled pin for the strobe so I could do that properly at least. After that it is just a bit of bit juggling.
User avatar
Phipli
Posts: 128
Joined: Sun Sep 16, 2012 8:12 pm
Location: Derby
Contact:

Re: USB Concept Keyboard

Post by Phipli »

Are there any other interesting input (into the beeb) only userport devices that might be fun to bridge to USB? Something that only uses 5v, Gnd, strobe and pb0 to pb7?

I could probably do output to... don't see why not as long as it is just those pins.

I've ordered some PCBs from China. Sadly my usual source JLCPCB has changed their pricing structure and are now effectively double the price. I've gone with Seeedstudio's Fusion service as it works out a bit cheaper. Sadly the higher prices mean I'm going to be hit by VAT and "Postman tax" (the VAT handling fee that costs more than the VAT).
User avatar
roland
Posts: 4327
Joined: Thu Aug 29, 2013 9:29 pm
Location: Born (NL)
Contact:

Re: USB Concept Keyboard

Post by roland »

Probably too late now but my (favorite) PCB supplier, PCBWay, makes 10 board (up to 10x10cm) for just $5. If you're not in a hurry check delivery from China Post for another $5. That makes $1 per board.... You can't make it cheaper at home, just quicker :lol:
FPGAtom: 512 KB RAM, Real Time Clock and 64 colours
MAN WOMAN :shock:
User avatar
Phipli
Posts: 128
Joined: Sun Sep 16, 2012 8:12 pm
Location: Derby
Contact:

Re: USB Concept Keyboard

Post by Phipli »

I costed my order on PCBWay too - they were more expensive than Seeed to my surprise. They were about the same price as JLCPCB are now if I remember... note it says $10 for cheapest post when I check.

I got 30x various 100x100 boards from Seeed for £22 including postage. Perhaps it is the specifics of my v-scoring and milled corners.
User avatar
Phipli
Posts: 128
Joined: Sun Sep 16, 2012 8:12 pm
Location: Derby
Contact:

Re: USB Concept Keyboard

Post by Phipli »

Excellent,

Adapters have arrived and I made one up this evening. Works fine for my intended purpose (connecting the Concept Keyboard to a modern computer). I need to write some more software to implement additional functionality. jms2 and I were discussing a little earlier today and he was correcting my ideas into sensible things that might work. It made me laugh when I realised we'd both spent our lunchtime reading the Advanced User Guide. The board is about 70x50mm (not exactly because it is a multiple of 1/10th inches).

Image
Image
Image
Image

Ultimately we ended up discussing using event vectors for a couple of different event types and making a printer driver that output to the userport - likely to render the printer connection on the board redundant before we even start. If I make a version 2 I might remove the printer connector because If I can get the board smaller, say 33x50, then I'll be able to fit six on one 100x100 board rather than the current two!

We have some example code that will sort most of the inputting into the BBC direction - jms2 kindly pointed out several typos in it that I'd have been weeks or months working out.
MrGpG
Posts: 34
Joined: Fri Mar 26, 2021 11:26 am
Contact:

Re: USB Concept Keyboard

Post by MrGpG »

Hi

Great work!

I've been looking for a project for an old concept keyboard (sadly without overlays) -- do you have any of the PCBs available (PCB or kit?) and the sketch for the arduino?

Cheers
Glen
User avatar
flaxcottage
Posts: 4579
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire
Contact:

Re: USB Concept Keyboard

Post by flaxcottage »

An oldish post re-discovered. :!:

Only the other day I was looking at my CK and musing "wouldn't it be nice if I could connect it to a Pi?". Would your USB version connect to the Pi? If so I'm defo interested. :D

Then I can, maybe, get some of the old BBC CK titles working on the Pi, he says, needing another project like a hole in the head. :lol:
- John

Check out the Educational Software Archive at www.flaxcottage.com
User avatar
jgharston
Posts: 4373
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: USB Concept Keyboard

Post by jgharston »

Phipli wrote:
Sun Jun 07, 2020 5:41 pm
Are there any other interesting input (into the beeb) only userport devices that might be fun to bridge to USB? Something that only uses 5v, Gnd, strobe and pb0 to pb7?
I plugged my ASCII parallel keyboard into the user port. Somewhere I've got the driver code, which (from memory) was just an IRQ routine triggered by CB1 that did LDA PORTA:JSR insert_into_kbd_buffer

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.36
(C) Copyright J.G.Harston 1989,2005-2020
>_
MrGpG
Posts: 34
Joined: Fri Mar 26, 2021 11:26 am
Contact:

Re: USB Concept Keyboard

Post by MrGpG »

flaxcottage wrote:
Tue May 04, 2021 1:28 pm
Would your USB version connect to the Pi? If so I'm defo interested. :D

Then I can, maybe, get some of the old BBC CK titles working on the Pi, he says, needing another project like a hole in the head. :lol:
It should do -- the ProMicro will be emulating a standard USB keyboard and just sending the key presses. I have exactly the same set up using a C64 keyboard as a USB keyboard for my PC. If I plug my C64 USB keyboard into my PI it works fine as a USB keyboard.

The "tick" is to decode the keyboard matrix and then hook them up to the Arduino with an appropriate sketch.

The PCB looks "swish"

Glen
Coeus
Posts: 2159
Joined: Mon Jul 25, 2016 12:05 pm
Contact:

Re: USB Concept Keyboard

Post by Coeus »

Does this re-use TMK or QMK? These are frameworks for interfacing a variety of old keyboards to USB using an ATMega microcontroller.
User avatar
Elminster
Posts: 4280
Joined: Wed Jun 20, 2012 9:09 am
Location: Essex, UK
Contact:

Re: USB Concept Keyboard

Post by Elminster »

I don't have this project on the hardware list. Just need a bit more detail than was in the original post to add it.
User avatar
Phipli
Posts: 128
Joined: Sun Sep 16, 2012 8:12 pm
Location: Derby
Contact:

Re: USB Concept Keyboard

Post by Phipli »

Evening folks,

Sorry - this one stalled - irritatingly I caught the plague early on and it knocked me for six. Lost all my energy for months.

So, how far did I get - I got to the point that I had the board converting the signals from the Concept Keyboard into key presses based on the numerical value for the press. Simple enough. Exactly what I was working on at the time I forget, but I was discussing possibilities in the /other/ direction (into the beeb) with jms2.

What I had left to do - I wanted to make it so that over the serial console you could do custom key mappings, including complex combinations, so that you could use it either as a control surface for software, or a macro keyboard.

Additionally, as mentioned, I am able to make it bi-directional, so I wanted to add a mode where the adapter could be used as a PC to BBC adapter and read a file out and into the BBC as if it was typed or whatever. I know other solutions exist... but everything I needed was there including some useful example code. I can't remember the exact specifics of why, but I intentionally included a printer and userport on the board (although one is oversized due to a misnamed footprint! Never trust user submitted footprints! No matter - it doesn't impact functionality).

I think it would probably be better for me to finish the project a bit more rather than start sharing too early and so avoid frustration. I need to get the firmware to a point where it is flexible enough to meet peoples needs. I'm not sure anyone wants a keyboard that has a fixed completely un-natural layout that isn't much use unless you sit there counting!
User avatar
Phipli
Posts: 128
Joined: Sun Sep 16, 2012 8:12 pm
Location: Derby
Contact:

Re: USB Concept Keyboard

Post by Phipli »

Found the board anyway - that's a start!

Plus I haven't "borrowed" the Arduino from it! That was pure luck as I'm always short of Pro Micros. Too useful.
User avatar
Phipli
Posts: 128
Joined: Sun Sep 16, 2012 8:12 pm
Location: Derby
Contact:

Re: USB Concept Keyboard

Post by Phipli »

Just remembered why I wanted a printer port and userport - it was so you could use the redirect to printer functionality to "print" to a PC using the board as a printer port to USB adapter!

I have such a terrible memory!
User avatar
Elminster
Posts: 4280
Joined: Wed Jun 20, 2012 9:09 am
Location: Essex, UK
Contact:

Re: USB Concept Keyboard

Post by Elminster »

Take your time. It just looked like an interesting project I could add to the hardware list, but sort of trailed off. Now I know why. Hopefully you are back up to steam again.
User avatar
Phipli
Posts: 128
Joined: Sun Sep 16, 2012 8:12 pm
Location: Derby
Contact:

Re: USB Concept Keyboard

Post by Phipli »

Thank you Elminster - thankfully I recovered from the thing itself quickly and didn't get too bad, it was just the lingering tiredness made it more difficult than usual to do programming projects :)

I spent much more time with my pet chickens last year instead :lol:

I found the microcontroller code - I got further than I thought. I'd started implementing four operational modes, although hadn't finished, or implemented the menu to select them. I'd got as far as the code which takes the Concept Keyboard output and converts it to HID keyboard, and to serial (over USB). These are the modes I was clearly planning based on the defines at the start, although I'm sure I will think of more :

Code: Select all

#define CKOff 0
#define CKUsr2HID 1 // mode 1 = User port/ printer port to HID USB (PC Keyboard Emulation)
#define CKUsr2Ser 2 // mode 2 = User port/ printer port to Serial USB
#define CKSer2Usr 3 // mode 3 = Serial USB to Userport / printer port
User avatar
BeebMaster
Posts: 4227
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: USB Concept Keyboard

Post by BeebMaster »

Phipli wrote:
Tue May 04, 2021 8:54 pm

I spent much more time with my pet chickens last year instead :lol:
What about the elephants?
Image
User avatar
Phipli
Posts: 128
Joined: Sun Sep 16, 2012 8:12 pm
Location: Derby
Contact:

Re: USB Concept Keyboard

Post by Phipli »

They mostly look after themselves...
Image
Post Reply

Return to “other vintage hardware, software and languages”