HERE'S THE SCHEMATIC
HOW IT WORKS
You'll notice in the schematic that the keyboard clock line isn't connected to a GPIO, so how can this work? After a bit of testing I've found you can read a keyboard with a serial port running at a custom speed. This works because the data output of the keyboard is actually standard 8 bit data, one start, one stop, odd parity serial, as long as the keyboard clock pulses are regular and consistent (it was on the keyboards I've tested). The only downside is the baudrate varies for different makes/models of keyboard.
The only components you need are two resistors as required by the PS/2 spec, and an LED to drop the 5V keyboard data output to something the Zero can handle (kind of an unusual use for an LED, but it works beautifully).
And of course you need a kernel module. It's workings are pretty simple: set up the serial port and an interrupt handler. Then on each interrupt get a byte from the UART, translate using a table, and stuff the resulting keycode into the Linux input subsystem.
Hi,
i'm trying to do it but i have a problem.
i've maked all the hardware and compiled the module and when i try to run the ps2test to take the frequency, asks me for semicolon key, i press it and after 2 seconds program ends without response.
Can you help me please?