=> Are crosspoint swithc ICs still easily available? (It seems that so many
useful ICs are no longer made ;-(). If so,e it
would seem to be posisble
to use one of those to simulate the keyswithc matrix for just avout any
swithc-type keyboard. Add a microcotnroller to decode the PS/2 keyboard
signal then if you detect akey-down code close the appropriate swtich in
the crosspoint array, if you detect a key-up contd open it. OK, there may
be a little more work for keys that were originally mechancially locking,
but that's essentially it, I think.
But Tony, I can do everything with a $2 microcontroller...Why the
crosspoint IC? :oO
Can you? I am very supprised...
Although having seen the price of crosspoint ICs (which have a much
better spec that uou'd need for this) I can see wanting to avoid one.
However...
The question related to the TRS-80 M1/3/4 keyboard. These keyboards are
memory mapped. I don't man that they are controled by memory mapped
ports. I maena that the keyboard appears to the CPU as being 256 bytes of
memory.
The keyboard column lines (say) are the 8 low-oeder CPU address lines,
fed through open collector buffers. The keyboard row lines go to a
3-state buffer and then to the CPU data bus. This 3-state buffer is
enabled by the system address decoder whenver an address in the 256 bytes
assigned othe keyboard is accessed.
The normal keyboard scan refrences addeesses xx01, xx02, xx04, xx08,
xx10, xx20, xx40 and xx80 in order, thus selecting one column at a time.
But you don't _have_ to do that. In particular you could look at one
column only (if say all you wanted to detect was the BREAK key). Or you
can look at other addresses to get the logical OR of the keys in those
columns. In partocular looking at address xxFF will indicate if any key
is pressed. These tricks might not be used by the ROM or standard OS
drivers, but they work on all m,achiens, and I know some applciation
software (games, etc) used them.
The keyboard column lines, being simply the low 8 address lines are
chaning all the time whether the machine is reading the keyboard or not.
You get the low half of every memory, I/O and refresh address there.
So what your device has to do is to detect every change of the address
lines and present the apporpriate logical OR of the key states to the
inputs of the buffers. And you have to do that iwthin the read cycle time
of the Z80 processor (which could be clocking at 4MHz in an Model 4).
Yo do not have the keyboard read-enable signal available on the keyboard
connector (at least not in an M3 or M4) since the buffers are on the CPU
board. You might be able ot get it by solderign a wire ot the appropriate
pin on the CPU board, I am not sure if it's an avaialve signal on the
later 'gate array' machines, though.
So what you have to do is detect every change of the column lines 9which,
rememebr are CPU address lines) and output the appropraite pattern to the
inputs of hte 3 state buffers within, say, 500ns. While also decoding
PS/2 data from the keyboard, of course
But even if you have the enable signal, and if you've stored the effective
contents of all 256 possible keyboard laocations, you still have to get
the address, pick the right one of those 256 values and get it on the
3-state buffer inputs in 500ns. Again while decoding PS/2 data.
The first seems ot be a very tall order, the later just a tall order for
any $2 microcontroller...
Unfortunately, the TRS-80 depends on being able to close multiple
switchhes at the smae time (and not just obvious extras like the shfit
key), so the obvious hardware solution of a multiplxer + demutiplexer
(whichonly allows one effective keypress at a time) doesn't work.
The necessary logic to do it properly is quite simple, but not easy to
build in a few chips (nnless you use an FGPA or similar :-().
-tony