Page 1 of 4

USB Keyboard IF

Posted: Wed Dec 22, 2021 10:45 am
by Maskenlos
Hi all,

based on the project from Alex:

https://codeberg.org/xelalexv/spectratur

I build a keyboard interface for the QL. Basically it consists of an Arduino Nano and a switch matrix array MT8812. The matrix array is directly attached to the original keyboard sockets (J11 and J12) thus I expect only minor incompatibilities. It allows to attach a PS/2 or USB (emulating PS/2) Keyboard to the Arduino. Currently it is in a very early stage but I want to use the opportunity to ask for your opinion and features you may interested in.

So far what I obtained:

- Build the IF on my breadboard, all keys are working as expected. More testing is required
- Only add 2 additional keys so far, "Backspace" and "Delete"
- Only German keymap so far. No idea if modification for UK keymap is required. But it should be doable

What to do next:

- Build a proper PCB which fits inside the QL (obvious)
- Define keypad keys
- Any additional Key combinations required more than Delete and Backspace? What do you would need?
- Joystick support to map Joystick on (variable) keys. Is this a need from your point of view?

Any comment is highly appreciated.

Best regards,

Stephan
20211222_093540.jpg

Re: USB Keyboard IF

Posted: Wed Dec 22, 2021 11:13 am
by Pr0f
Nice project - does it deal with CRTL, ALT and SHIFT keys and combinations of those with other keys - the IPC code has some special cases - particularly with the HERMES IPC replacement - that you may want to handle.

Re: USB Keyboard IF

Posted: Wed Dec 22, 2021 10:54 pm
by Peter
Impressive. I would be far more interested in a QL matrix to PS/2 converter though ;)

Re: USB Keyboard IF

Posted: Thu Dec 23, 2021 7:03 am
by Maskenlos
Pr0f, anything particular you want me to test? So far I only tested the basic combinations with CTRL (e.g. CTRL + arrow left) and with SHIFT. This works well. I do not have a Hermes, so I can not test Hermes specific things.

Peter, fully understand your demand. Probably this is useful to you:

http://www.deblauweschicht.nl/tinkering/qlkeys1.html

Maybe I will give it a try after I have finished this small project. But in your special case the Arduino may be omitted?

Stephan

Re: USB Keyboard IF

Posted: Thu Dec 23, 2021 9:09 am
by Derek_Stewart
Maskenlos wrote:Pr0f, anything particular you want me to test? So far I only tested the basic combinations with CTRL (e.g. CTRL + arrow left) and with SHIFT. This works well. I do not have a Hermes, so I can not test Hermes specific things.

Peter, fully understand your demand. Probably this is useful to you:

http://www.deblauweschicht.nl/tinkering/qlkeys1.html

Maybe I will give it a try after I have finished this small project. But in your special case the Arduino may be omitted?

Stephan
Hi Stephan,

Looks good, I will have a go at making this interface, for one of my QLs.

Re: USB Keyboard IF

Posted: Thu Dec 23, 2021 7:38 pm
by bwinkel67
Maskenlos wrote:Hi all,

based on the project from Alex:

https://github.com/xelalexv/spectratur

I build a keyboard interface for the QL. Basically it consists of an Arduino Nano and a switch matrix array MT8812. The matrix array is directly attached to the original keyboard sockets (J11 and J12) thus I expect only minor incompatibilities. It allows to attach a PS/2 or USB (emulating PS/2) Keyboard to the Arduino. Currently it is in a very early stage but I want to use the opportunity to ask for your opinion and features you may interested in.
So 8x12 gives 96 keys. The QL has a 9x11 matrix for 99 keys. Which 3 keys are not supported. Also, in the picture I see 9 & 8 for ribbon cables going to the keyboard connector...so not all lines are used?

Nice seeing a German board. Very similar to the US ones except they don't have that little daughter board on top of memory near the CPU :)

Re: USB Keyboard IF

Posted: Thu Dec 23, 2021 9:08 pm
by Maskenlos
I just counted the keys on my QL, if not miss-count there are 65 keys. Could anyone kindly double confirm :D
To be honest, there are no keys missing, even better, there are keys on the PC Keyboard which not even exist on the QL keyboard:
- Backspace
- Delete
- / (on the Key-Pad)
- x (on the Key-Pad)

Also its a mystery that the QL has a 9x11 Matrix, the 8049 IPC only supports 8x8 Matrix. Kindly check the diagram below. So a MT8812 and 3 external diodes will do the job. 8 & 9 ribbon cable are correct, as I do not use pins 1,2 & 11 from J12.
Keyboard.png

Re: USB Keyboard IF

Posted: Thu Dec 23, 2021 9:14 pm
by Maskenlos
Sorry, of course 64 keys as there are 2 Shift keys. And in almost all cases 8x8 is 64 :-)

Re: USB Keyboard IF

Posted: Thu Dec 23, 2021 9:58 pm
by XorA
I am working on the firmware for a very similar USB->QL keyboard adapter!

Re: USB Keyboard IF

Posted: Thu Dec 23, 2021 10:01 pm
by XorA