Jump to content
IGNORED

Question about TI-99/4A keyboard matrix


8bitAndy

Recommended Posts

Hi, I have a TI keyboard but not a working computer. I'm writing a keyboard scanning routine using an Arduino so I can use the keyboard in another project.

When I press and hold (for example) T, H and E, I will also get a K due to the way my scanning routine handles the keyboard matrix.

Does this happen with a real TI-99 computer?

Edited by 8bitAndy
Link to comment
Share on other sites

If you haven't seen this, it is a good resource. https://www.unige.ch/medecine/nouspikel/ti99/keyboard.htm

 

The matrix is prone to that, EK share a column wire and HK share a row... Keyboard building usually include diodes on every key to block this sort of issue (I think) 

 

We don't see that in most software, since I believe most scan routines scan one column at a time. Column 0 gives you modifiers, cache those, and then going through the next columns until a row shows a key. Stopping at the first none modifier key. 

 

But sometimes to save cycles a game will constrain itself to one or two columns worth of keys... 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

31 minutes ago, jedimatt42 said:

If you haven't seen this, it is a good resource. https://www.unige.ch/medecine/nouspikel/ti99/keyboard.htm

Thank you for this. The Phantom Keys section illustrates the problem perfectly. The problem I'm seeing in my code is that typing "the" too quickly often inserts a "k", such as "thke". The keys must be momentarily pressed down at the same time. Maybe I need to adjust the scanning rate.

  • Like 1
Link to comment
Share on other sites

6 hours ago, mizapf said:

If you like to compare, here is my project:

 

Thank you for this. I haven't run your code yet, but one difference I see is that you are pulling a row low and scanning for low columns, while I am pushing a row high and scanning for high columns.

I have seen code samples that pull a row low, and code the pushes a row high. Is there an advantage of one over the other?

Also, are those current-limiting resistors between the Arduino pins and the TI keyboard harness? Are you using any pullup resistors or relying on the internal pullup on the Arduino?

Link to comment
Share on other sites

On 8/14/2021 at 9:29 PM, 8bitAndy said:

Thank you for this. I haven't run your code yet, but one difference I see is that you are pulling a row low and scanning for low columns, while I am pushing a row high and scanning for high columns.

I have seen code samples that pull a row low, and code the pushes a row high. Is there an advantage of one over the other?

 

About the "low active" convention: decoder chips like 74HCT138 take 3 bits, and drive 1 of 8 outputs. The selected output is low and the rest high. This low/high convention saves power (not a concern these days if you choose 74HCT138 instead of 74LS138.)

 

'138 = 74HCT138 chip or similar

etc.

 

At first, you might suppose you need 8 outputs to drive rows, and 6 input pins to sense columns. Here are ways to get the pin count down. (Every GPIO pin on the Arduino is precious, you know?)

 

Pardon me if you already know how to use these logic chips. It might help someone else...

 

First replace the 8 row outputs. Use just 3 output pins connected to the ABC selector pins of a '138. Let the '138 drive the 8 keyboard rows. (Note: TI used 3 pins for the selector, but in a more robust way.)

 

On the input side, you need pull-up resistors. That's because, if no keys are pressed, there must still be some kind of signal provided. (Often, chips with GPIO let you activate an internal pull-up resistor, saving a component.)

 

Then you can save on the 6 column inputs by using a '151. The '151 takes 8 inputs, and outputs 1 of them chosen by its ABC select. So the keyboard-reading side needs to output 3 bits of selector, and use 1 common input.

 

Summary

 

3 outputs ->  '138 ABC row output select

3 outputs ->  '151 ABC col input select

1 input <- read bit from '151

 

That does the interface in 7 pins + 2 chips.

 

Alpha Lock: I'm confused about all the ways to do this.  You can treat this as a separate column--connect to a spare '151 input.

Alpha Lock has a sad history.

 

TI did a lot more things, that are a bit difficult to follow, but more robust. For that, study Thierry's webpage (linked in the first reply.) Briefly, the TI-99/4A drives the 6 columns+2 joysticks, and reads 8 rows. TI  didn't depend on the current drive capability of the logic chips, especially for joysticks. So they used a '156 chip instead of '138.)

 

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...