-
1Build Notes
Pick the target you are building for. If you are building for the ZX81 membrane keyboard think hard about whether you want the matrix coming out of the top or bottom. If you are building for other types of keyboard then you may want to use header pins instead
Some keyboards that have a further demux on some of the lines will need 4K7 not 10K resistors.
-
2Address matching
Assemble any way you fancy. I normally start with the 40pin connector and the sockets. You can build the minimal selection circuit (U1, RN1) and test that first by continually accessing the keyboard port 0xFF in software and checking pin 19 of U1.
-
3Keyboard Interface
Assemble the rest of the logic and check that the expected outputs are seen. A port out to xxFF should show xx on the J2 lines.
-
4Add Keyboard Connectors And Keyboard
The connectors snap into the 2.54mm holes and the membrane pushes down into them. It's a little bit fiddly. Note that the connectors are only guaranteed good for about 30 insertions so don't keeping pulling it in and out.
-
5Software
The keyboard defaults to 0xFF. You can jumper lines on J4 to change that. Each line that is jumpered requires that address bit is zero. The actual scan is done by reading from port XXFF using 16bit port I/O. The upper 8bits are placed on the keyboard matrix and the resulting 8bits come back as the data.
To scan each line scan ports 7FFF BFFF DFFF EFFF F7FF etc to set one bit low. Pressed keys are low bits in the result.
For keyboards with demultiplexors of their own you'll need to use the right pattern sequence to scan all the lines.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.