Weird behavior on ZX81 keyboard interface
Posted: Sun Jul 23, 2023 10:05 pm
Very off-topic question here. I recently tried to add a gamepad to my TS1000 (this idea came from an article in an old Sinclair magazine from the 80's that had you create just a physical connection to attach a joystick). I had previously modified my TS1000 successfully by adding a real ribbon cable to fix a broken membrane (maybe that's adding to the problem?) I did a 20-minute video on the gamepad mod here, though it's not really necessary to watch to understand the problem (hopefully I explain it well enough below):
https://www.youtube.com/watch?v=rwQeQ-kvaas
What I discovered after the fact is that parts of the keyboard refused to work. I realized that partially in my video, assumed it was due to the fine gauge of the 10-wire cable I was using (about 1.5mm thick), and added 1.6K resistors to the connectors for the columns (k0 to k4) to fix it -- note that from its membrane diagram, the ZX81 keyboard is divided into 4 rows of 10 keys with each row split into 2 halves (groupings of 5), and each of the 5 connectors for k0 to k4 connect one of the columns of the groupings of 5. However, digging more into it, I realized some key combinations were completely dead with the gamepad mod.
To figure out how to fix it, I simplified things and used a better cable (one from an old PS-2 mouse). I Just connected 2 wires from a 3 foot length cable (and no gamepad) to k0 and k1 and again, some key combinations didn't work. I added some variable resistors and discovered that there was no sweet spot (i.e. either I'd get the keys for the gamepad cable to work or the key on the keyboard to work but not both).
Finally, after cutting the cable to a little over 2 feet, I got both to work (with 1.6K resistors). I would have thought that the variable resistors would have achieved the same thing, but they didn't. I don't have sensitive enough equipment (I have a cheap digital multi-meter and an old analog one) that can measure any resistance between the two wires in my gamepad cable, though when I use two twisted pair wires of about 3 feet, the issue disappears.
So what's going on here? Anyone here have a good understanding of the ZX81? Which chip reads the keyboard presses on the ZX81 (presumably its ULA) and why does adding two wires to k0 and k1 (just two wires, no gamepad) cause some keys to stop working (usually shift-S to get LPRINT is the last combo that refused to work). Those two wires are acting like an antenna, I'm guessing, though the PS-2 cable is shielded. When I use the twisted pair wires, they are not in a sheath, just by themselves.
I'll eventually post this on a couple of ZX81 forums but thought I'd ask here first as I may get help in clarifying my question -- AND the lot of you are more technical than I find sometimes on other forums.
https://www.youtube.com/watch?v=rwQeQ-kvaas
What I discovered after the fact is that parts of the keyboard refused to work. I realized that partially in my video, assumed it was due to the fine gauge of the 10-wire cable I was using (about 1.5mm thick), and added 1.6K resistors to the connectors for the columns (k0 to k4) to fix it -- note that from its membrane diagram, the ZX81 keyboard is divided into 4 rows of 10 keys with each row split into 2 halves (groupings of 5), and each of the 5 connectors for k0 to k4 connect one of the columns of the groupings of 5. However, digging more into it, I realized some key combinations were completely dead with the gamepad mod.
To figure out how to fix it, I simplified things and used a better cable (one from an old PS-2 mouse). I Just connected 2 wires from a 3 foot length cable (and no gamepad) to k0 and k1 and again, some key combinations didn't work. I added some variable resistors and discovered that there was no sweet spot (i.e. either I'd get the keys for the gamepad cable to work or the key on the keyboard to work but not both).
Finally, after cutting the cable to a little over 2 feet, I got both to work (with 1.6K resistors). I would have thought that the variable resistors would have achieved the same thing, but they didn't. I don't have sensitive enough equipment (I have a cheap digital multi-meter and an old analog one) that can measure any resistance between the two wires in my gamepad cable, though when I use two twisted pair wires of about 3 feet, the issue disappears.
So what's going on here? Anyone here have a good understanding of the ZX81? Which chip reads the keyboard presses on the ZX81 (presumably its ULA) and why does adding two wires to k0 and k1 (just two wires, no gamepad) cause some keys to stop working (usually shift-S to get LPRINT is the last combo that refused to work). Those two wires are acting like an antenna, I'm guessing, though the PS-2 cable is shielded. When I use the twisted pair wires, they are not in a sheath, just by themselves.
I'll eventually post this on a couple of ZX81 forums but thought I'd ask here first as I may get help in clarifying my question -- AND the lot of you are more technical than I find sometimes on other forums.