Jump to content
IGNORED

USB Keyboard Adapter w/Arduino style components


jedimatt42

Recommended Posts

Just to share, Shift838 and I are seeing an issue with the ALPHA-LOCK scanning on the adapter.

 

He's not getting uppercase in Super Mass Transfer / TIMXT. And I'm getting intermittent lowercase letters in fbForth editor and turboforth editor.

 

So, I'll be working on a firmware fix for that. A temporary work-around is to set the ALPHA-LOCK on your TI keyboard.

 

It could be worse:

 

post-42954-0-83214200-1454915784_thumb.jpg

 

-M@

Link to comment
Share on other sites

Just to share, Shift838 and I are seeing an issue with the ALPHA-LOCK scanning on the adapter.

 

He's not getting uppercase in Super Mass Transfer / TIMXT. And I'm getting intermittent lowercase letters in fbForth editor and turboforth editor.

 

-M@

If you need to look at the direct keyboard scan routine from TIMXT, just let me know and I'll locate the source for you to inspect.

Link to comment
Share on other sites

Thanks, I'll keep that in mind if I get stuck. :) I did something weird in this area, and I'll have to check my source history to see what problem I was trying to solve. Since I have re-written the other half of the system, I will try going back to what I think is the straight forward model for responding to the TI keyboard columns.

 

One thing I don't do, is handle multiple columns (output pins from the 9901) active at once. That seemed outside the bounds of how the TI keyboard was meant to work.

 

-M@

Link to comment
Share on other sites

Sounds good. I can think of a handful of programs that scan CRU bits to detect multiple special keys, such as holding SHIFT and FCTN together (i.e. Fast Term). Maybe some games look for two keys to handle diagonal moves?

 

The outliers are often games, terminal emulators, and programs with unique routines used to improve speed and/or functionality.

Link to comment
Share on other sites

One thing I don't do, is handle multiple columns (output pins from the 9901) active at once. That seemed outside the bounds of how the TI keyboard was meant to work.

It's actually not possible to get multiple columns at once (except for Alpha Lock which is direct). The column select is done via a 1-of-8 decoder so only one line can ever be active at a time. (I looked at using that connection to transfer data once, and was disappointed to see that ;) ).

  • Like 1
Link to comment
Share on other sites

It's actually not possible to get multiple columns at once (except for Alpha Lock which is direct). The column select is done via a 1-of-8 decoder so only one line can ever be active at a time. (I looked at using that connection to transfer data once, and was disappointed to see that ;) ).

 

Thanks! That's why my Teensy code looks like it does... All of the columns are in an if-else chain except the alpha-lock. I have studied the schematic on TI TECH PAGES, and come to that conclusion before, but I need to go add some notes/comments to my code so I don't keep doubting it.

 

-M@

Link to comment
Share on other sites

Thinking out loud... so if you are writing a scan routine, you only have to turn of P5 on the 9901 if you want to look for FCTN, some numbers, and UP on the joysticks. The rest of the time it can be left on, and if row 4 is LOW, the alpha-lock must be on.

 

My Teensy code is responding to change. And so if a routine is leaving the P5 high, while stepping through the decoded columns, and I'm momentarily turning off the alpha-lock row when FCTN, 2, 3, 4, 5 or 1 are not pressed, just before I then look to see if P5 is on, and set it back on. ( LOW == on thanks to the pull-up-resisters ) (There is no way that sentence passes a grammar checker.)

 

Fast reading routines can actually see this, and I get TtHhIiSs BbEeHhavior.

 

That's my working theory at the moment.

Link to comment
Share on other sites

  • 2 weeks later...

I implemented a solution for the theory above, and didn't see any difference in behavior, but at least now I believe that part of the code is more correct. Then I stewed over things for a week. And remembered some really stupid code around FCTN_EQUALS, I deleted that and 'TtHhIiSs' behavior went away. Using TIMXT for a while, that seemed to work just fine as well. ( Althought that wasn't failing for me previously either. ) The firmware changes are on my website, and up in the git repository...

 

Along the way, the 'programming' port on the Teensy is a little surface mount USB micro connector. Chris was able to break this right off the board. There is no through-hole anchor on this connector. So be gentle. Hopefully the need for post-installation use of the programming port will become obsolete before too much longer.

 

-M@

  • Like 2
Link to comment
Share on other sites

  • 2 weeks later...

post-42954-0-13351400-1457299686_thumb.jpg

 

I've succeeded today in getting basic issue laden functionality of my same TI 99 USB Keys adapter board reprogrammed to output XT scan codes for the Geneve. It should be generic enough to work for any XT application, but I'll probably not ever get around to testing that.

 

My goal here, is to get my PC, Mac, 4a, and Geneve 9640 all sharing the same keyboard ( I only have one desk, and need to share it )

 

There are plenty of issues still. But if anyone is interested, the github project page is: https://github.com/jedimatt42/teensyUSBtoXT

 

-M@

  • Like 4
Link to comment
Share on other sites

I've managed to get the USB to XT / Geneve firmware working to a very smoothly. XT keyboard protocol is soo much easier than the TI-99/4a's matrix keyboard model.

I doubt that I have Print Screen, Scroll Lock, and Break correctly mapped, but I believe all the rest are properly mapped.

 

The pre-compiled firmware and project page are here: http://ti994a.cwfk.net/UsbGeneve.html

Source is up on github: https://github.com/jedimatt42/teensyUSBtoXT

 

----

 

Now, back to the TI 99 USB Keys variety... Chris pointed out that the '?' isn't working in the newest TIMXT when my adapter is used. It turns out none of the keys that require transitioning a 'shift'-'something' to a 'fctn'-'something-else' work (tilde, pipe, question, squirrelly-brackets, and double-quotes). Manually pressing 'alt'-'i' will still product a '?'. I suspect there isn't enough time between my release of the 'shift' and the next scan, such that TIMXT is seeing 'shift'-'fctn'-'i'. Luckily on the TI keyboard, that yields nothing, instead of a '?' or capital 'i'

 

Hopefully I can fix that without much restructuring.

 

-M@

  • Like 3
Link to comment
Share on other sites

I've managed to get the USB to XT / Geneve firmware working to a very smoothly. XT keyboard protocol is soo much easier than the TI-99/4a's matrix keyboard model.

I doubt that I have Print Screen, Scroll Lock, and Break correctly mapped, but I believe all the rest are properly mapped.

 

The pre-compiled firmware and project page are here: http://ti994a.cwfk.net/UsbGeneve.html

Source is up on github: https://github.com/jedimatt42/teensyUSBtoXT

 

----

 

Now, back to the TI 99 USB Keys variety... Chris pointed out that the '?' isn't working in the newest TIMXT when my adapter is used. It turns out none of the keys that require transitioning a 'shift'-'something' to a 'fctn'-'something-else' work (tilde, pipe, question, squirrelly-brackets, and double-quotes). Manually pressing 'alt'-'i' will still product a '?'. I suspect there isn't enough time between my release of the 'shift' and the next scan, such that TIMXT is seeing 'shift'-'fctn'-'i'. Luckily on the TI keyboard, that yields nothing, instead of a '?' or capital 'i'

 

Hopefully I can fix that without much restructuring.

 

-M@

Recently I added a "ctrl-shift" combo to TIMXT. It's purpose is to immediately stop the display interpreter, effectively pausing the screen. It first tests whether the ctrl key is depressed then tests the SHIFT key. If both are depressed, it waits until one or the other is released. Will something like this function with your adapter?

 

I love the idea of using a similar adapter with the Geneve.

Link to comment
Share on other sites

Recently I added a "ctrl-shift" combo to TIMXT. It's purpose is to immediately stop the display interpreter, effectively pausing the screen. It first tests whether the ctrl key is depressed then tests the SHIFT key. If both are depressed, it waits until one or the other is released. Will something like this function with your adapter?

 

I love the idea of using a similar adapter with the Geneve.

 

I have been surprised that I couldn't google up one on amazon or something. People love their XT keyboards though, and use them on newer computers, instead of the other way around. I just need to find the right sized project box to stick the adapter in, so I can mount it to the side of my PEB.

 

Both TI and Geneve adapter firmware should handle key combo like ctrl-shift without any issue. Pressing and releasing them individually should be fine.

 

-M@

Link to comment
Share on other sites

I suspect there isn't enough time between my release of the 'shift' and the next scan, such that TIMXT is seeing 'shift'-'fctn'-'i'. Luckily on the TI keyboard, that yields nothing, instead of a '?' or capital 'i'

I worked around this on my keyboard adapter by making shift do nothing by itself, it did not get relayed to the TI. (For the very few cases where I needed a real shift key, such as RAMdisk boot bypass, I mapped the Windows key instead). That made life a lot easier, I just handled the shift key as a meta key myself and had separate lookup tables for shifted versus not shifted.

  • Like 2
Link to comment
Share on other sites

I worked around this on my keyboard adapter by making shift do nothing by itself, it did not get relayed to the TI. (For the very few cases where I needed a real shift key, such as RAMdisk boot bypass, I mapped the Windows key instead). That made life a lot easier, I just handled the shift key as a meta key myself and had separate lookup tables for shifted versus not shifted.

Ah, so that is what you meant earlier by the 'Windows' key being a 'real shift'. That is a very practical approach. Thanks for the tip.

 

I already special case this handful of keystrokes. I'll see if I can do something more localized (I am required to be stubborn first for at least a little while.) But if I fail, that sounds like a good fallback. Although, part of me would hate to ask someone to use the windows key on a TI. I don't even use them on a windows machine.

  • Like 1
Link to comment
Share on other sites

Ok, in my head the code for '?': was releasing shift, pressing fctn, and then pressing I, but it was never releasing shift. Once I fixed that TIMXT and the '?' work.

 

I think I need to proof-read my code. I'm actually surprised it worked in so many other programs.

 

-M@

Link to comment
Share on other sites

Ok, I tested the ctrl-shift feature in the new TIMXT with the TI 99 USB Keys adapter, and it gets stuck... one more step to perfection... I just know it :)

 

By any chance, when ctrl-shift is detected, are the keyboard columns just left unchanged until the release? If so, that would be cool, as that exploits a weekness of my TI column scanning routine being fully interrupt driven. As I don't get any interrupts, and consequently don't update the output pins on the Teensy.

 

This shouldn't be a problem on the Geneve adapter, since the hardware inside the Geneve does all of that. But I haven't tested that exactly, as I don't have a serial card in the Geneve system.

-M@

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...