I'm trying to add an USB keyboard to an old 8-bit Amstrad CPC 464 home computer, like is done here.
To make a brief summary:
The keyboard is designed as a matrix with 10 lines and 8 bits per line, where each bit indicates the state of a key.
The scan of the keys must be done in sw by polling. The process, described here in detail, consists on the the CPU configuring the PPI (Programmable Peripheral Interface), first to output the keyboard line to scan on lanes C0-C7 and, second, to read the results from the A0-A7 lanes, which are connected to the PSG (Programmable Sound Generator) which also acts as a keyboard interface.
The problem I'm facing is with the 74LS145 decoder. The original keyboard works well, so there's nothing broken. I'd expect to see the polling on the decoder input lines and the outputs changing accordingly, one output activating at a time indicating the selected keyboard line. All of that regardless of any key been pressed on the actual keyboard. But, although I see that the polling is done and the ABCD input lines change, the output ones are always L as long as I do not press any key. It's like the decoder would only be enabled if a key is pressed, but I don't see any enable pin on the decoder.
How can it be? The behavior of the decoder is simple, it just reacts to its inputs selecting one of the outputs. I don't see how output can depend on anything more than that...