Page 1 of 1

Pico based serial/USB keyboard membrane emulator.

Posted: Sun Jul 27, 2025 6:57 pm
by stephen_usher
Over the last week I've been working upon a way of talking to a bare BBQL motherboard from another system.

Well, as of today I can do so with a prototype system...

IMG_4524.jpeg

Currently I can plug the Pi400 into the PIco's USB port and use minicom so that I can type on the machine as if I'm using the keyboard, well, other than no ALT key as there's no way that ASCII can translate to that really.

The QL's matrix is effectively just 8 scan lines and 8 sense lines. The Shift, Ctrl and Alt keys map into sense line 7.

One problem I had was that the matrix diagram I had to map the matrix to keys was wrong. It had 1 and 3 transposed, similarly 9 and o.

The other thing to note is that to enable one of the modifier keys you first have to enable them on their own before ORing them with the key code data.

Anyway, I've designed a more generalised PCB (which can handle up to 12 sense lines) which also adds an RS232 port. Once I can move stdio over RS232 then I can develop the USB HID code to allow the use of USB keyboards and do away with an extra machine.

Pico-Keyboard-Matrix-Interface.jpg

Hopefully the PCBs will arrive around the end of the week and I can move away from the RatsNest(tm).

Re: Pico based serial/USB keyboard membrane emulator.

Posted: Fri Aug 01, 2025 3:23 pm
by stephen_usher
The boards arrived just after lunch, so I quickly built one up. Just a minor issue with the DB9 sockets I bought overlapping one of the header positions, but nothing a pair of wire cutters couldn't fix.

The good news is that it works at least as well as the breadboard version so far. I've not tested the RS232.

IMG_4532.jpeg
IMG_4533.jpeg

Re: Pico based serial/USB keyboard membrane emulator.

Posted: Fri Aug 01, 2025 5:08 pm
by stephen_usher
And the RS232 works... though when the board is powered by the PicoATX power supply the 74LS244 didn't get power as it seems that the Pico doesn't power the VBUS line if powered by VSYS, so a bodge wire was necessary.

Re: Pico based serial/USB keyboard membrane emulator.

Posted: Fri Aug 01, 2025 5:57 pm
by Popopo
I like it. Congrats for successful development

For what the serial port?
Would not save resources (in this case) to use the Arduino Nano? for power and signal level compatibility.

Re: Pico based serial/USB keyboard membrane emulator.

Posted: Sat Aug 02, 2025 9:07 am
by stephen_usher
Popopo wrote: Fri Aug 01, 2025 5:57 pm I like it. Congrats for successful development

For what the serial port?
Would not save resources (in this case) to use the Arduino Nano? for power and signal level compatibility.
The serial port is there mainly so that I can debug the USB HID (keyboard and maybe joystick) support via the Pico's USB interface. It's also a neat use case of controlling a QL remotely... :-)

As for why the Pico? I'm more comfortable with the programming in C with dual core and accelerated programmed I/O. One ARM core purely deals with the QL side of things and the other purely the input. As it is the Pico is just about keeping up with the IPC's scans in this configuration.

The board is also not only for the QL potentially, which is why I added an extra four output lines. I can use this board for other systems which have a larger number of sense lines. It can also double as a useful generic Pico interface board with 8 inputs and 12 outputs.