Jump to content
IGNORED

TI console as keyboard


mizapf

Recommended Posts

Following the reports on Stuart's web browser, people again suggested to use an old TI console and put a Raspberry PI inside. As I already said, at least MESS won't really run well on a Raspi, at least with its current performance, but faster models seem to come soon.

 

I got another idea that should be perfectly feasible: What about using the TI console as a USB keyboard?

  • Remove everything inside except for the keyboard
  • Attach the keyboard lines to the digital inputs of a microcontroller; I suppose an Arduino should be enough, don't need a full Raspi
  • You would then connect the TI console to the USB port of the PC, where it shows up as a keyboard

Does anyone know more about how to make an Arduino pretend to be a USB device, particularly a keyboard?

  • Like 1
Link to comment
Share on other sites

Following the reports on Stuart's web browser, people again suggested to use an old TI console and put a Raspberry PI inside. As I already said, at least MESS won't really run well on a Raspi, at least with its current performance, but faster models seem to come soon.

The Raspberry Pi 2 was released just yesterday. Now with a quad core CPU and twice the RAM. Wonder if this will improve matters?

Link to comment
Share on other sites

Sure, this was also intended to learn more about the capabilities. I see people talking about the Raspberry Pi as if it could replace their desktop PC, but it is really far, far behind. If I succeed in getting the current MESS to run on the Raspi, I'll do a benchmark to see how fast it goes. At this point I can already see the intro screen (system description), but when you press a key to enter the TI emulation, it bails out. However, this is already a first impression on the speed - you have to type "OK" at the beginning, and you need to hold down O and K for at least one second.

 

I think the problem is with the X server. I should try to build the SDL lib without X so that it runs directly on the framebuffer.

 

----

 

Concerning my above idea, I just found that the Arduino Micro has 20 I/O pins which would be enough to connect the TI keyboard and the Joystick port. Could be possible ...

Link to comment
Share on other sites

Here's a completely different way of doing it, which won't require opening the TI at all.

 

It requires a little piece of hardware to plug into the side of the console, with a bit of code running at >4000 to hijack the console as soon as you turn it on. Once the code residing in the external hardware takes over, it will just run a keyscan routine and output the keystrokes via USB.

 

It's more complicated, but doesn't require opening the console, and it was a method used by the Triton TurboXT bridge box to get the TI to act as a PC keyboard, back in the day.

Edited by briantw
Link to comment
Share on other sites

Well, I already ordered an Arduino Micro, and I still have my old TI console, so I guess I'll just try and see how far I can get :) . The Arduino may be powered by the USB interface, so I would not even need a separate power supply. Also, I don't have to make sure the console is still in working condition (has not seen power for 25 years ...)

Link to comment
Share on other sites

OK, that was easier than expected... :-)

 

http://www.mizapf.de/ti99/tikeyboard.mp4

 

(35 MiB)

 

This is the Arduino sketch:

int column = 0;
int value[] = { 0, 0, 0, 0, 0, 0, 0 };
int inputpin[] = { A0, A1, A2, A3, A4, A5, 11, 12 };
char key[] = {
                'p',  '0',  'a',  ';',  '/',  '1',  'q',  'z',
                0x00, 0x00, 0x00, 0x00, 0x00, 0xC1, 0x00, 0x00,
                'y',  '6',  'g',  'h',  'n',  '5',  't',  'b',
                0xB0, 0x00, 0x81,  ' ',  '=', 0x82, 0x80, 0x00,
                'O',  '9',  's',  'l',  '.',  '2',  'w',  'x',
                'i',  '8',  'd',  'k',  ',',  '3',  'e',  'c',
                'u',  '7',  'f',  'j',  'm',  '4',  'r',  'v'
             };

void setup() {
  /* Problem: We need open collector outputs. This can be achieved
     by switching to input mode. */
  for (int i=0; i < 7; i++) {
     pinMode(i, INPUT_PULLUP);
     digitalWrite(i, HIGH);
  }

  for (int j=0; j < 8; j++) {
     pinMode(inputpin[j], INPUT_PULLUP);
     digitalWrite(inputpin[j], HIGH);   /* Activate pullup. */
  }

  // Kill switch
  pinMode(10, INPUT_PULLUP);
  digitalWrite(10, HIGH);
  column = 0;

  if (digitalRead(10)==LOW) {
    Keyboard.begin();
  }
}
  
void loop() {
   /* The "kill switch" is a recommendation for all sketches for Arduino emulating
      a keyboard, because when there is a bug you can at least stop it from messing
      with our input. */

   if (digitalRead(10)==LOW) {
     for (int i=0; i < 7; i++) {
        if (i==column) {
           /* Pull down line */
           pinMode(i, OUTPUT);
           digitalWrite(i, LOW);
        }
        else {
           /* Pull up line, but do not output +5V -> open collector */
           pinMode(i, INPUT_PULLUP);
           digitalWrite(i, HIGH);
        }
     }

    int newvalue = 0;
    int oldvalue = value[column];

    for (int j=0; j < 8; j++) {
       newvalue <<= 1;
       if (digitalRead(inputpin[j]) == HIGH) {
          if ((oldvalue & 0x80) != 0x00) {
             /* Sends the break code */
             Keyboard.release(key[column*8 + j]);
          }
       }
       else {
           newvalue |= 1;
           if ((oldvalue & 0x80) == 0x00) {
             /* Sends the make code */
             Keyboard.press(key[column*8 + j]);
           }
       }
       oldvalue <<= 1;
    }
     value[column] = newvalue;

     column++;
     if (column>=7) column = 0;
     /* Have a little break */
     delay(1);
   }
   else {
      /* Input disabled */
      delay(1000);
   }
}
  • Like 2
Link to comment
Share on other sites

Here's a completely different way of doing it, which won't require opening the TI at all.

 

It requires a little piece of hardware to plug into the side of the console, with a bit of code running at >4000 to hijack the console as soon as you turn it on. Once the code residing in the external hardware takes over, it will just run a keyscan routine and output the keystrokes via USB.

 

It's more complicated, but doesn't require opening the console, and it was a method used by the Triton TurboXT bridge box to get the TI to act as a PC keyboard, back in the day.

 

heck i have a TurboXT box ;)

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
  • 4 years later...

Resurrecting my old thread ... four more years have passed. The existing solution could be improved; the USB cable dangling out of the console bothered me a little.

 

So I thought the proper way would be a USB socket where I could plug in a USB cable. The problem was, however, that USB sockets are typically available for soldering on a PCB; so the challenge was to somehow get it mounted into the chassis so that it would not be pushed out the first time I plugged a cable into it.

 

My initial idea was to use hot glue; I soldered two small pieces of PCB below the socket to increase the surface. While looking for a suitable location - I wanted to have it on the backside - I suddenly found am even better solution. There is a protruding piece of plastic for the screw from the bottom, and I noticed that it was close enough to give support for the socket. I wedged another piece of PCB between the plastic piece and the socket's backside, and then another idea: Stick the containment of the Arduino PCB with double-adhesive tape so close to the backside that it provides the counterpart for the holding PCB. Seems to work. :)

 

Sometimes you just have to start trying ...

 

usb-keyb1.jpg

usb-keyb2.jpg

  • Like 2
Link to comment
Share on other sites

I have also seen USB splitter cables that end in a screw-on socket that would also be perfectly suitable for the case mount--but the other end of the cable like this that I have is for plugging into a PC motherboard. I'll have to look to see if a variant that goes from a standard USB connector to this type of USB socket exists. . .here's one that is a double cable, but it would do the trick. It is a bit long though. Here's a shorter single USB 3 type cable that does the same thing.

Edited by Ksarul
  • Like 1
Link to comment
Share on other sites

That would indeed be a nicer solution, but both cables you showed are in the wrong direction. You would need a A-A cable to connect it to a PC USB port. Such cables are available, but they violate the USB specification that says that the A plug goes towards the USB host.

Link to comment
Share on other sites

  • 3 months later...
On 8/22/2019 at 10:59 AM, mizapf said:

Resurrecting my old thread ... four more years have passed. The existing solution could be improved; the USB cable dangling out of the console bothered me a little.

 

So I thought the proper way would be a USB socket where I could plug in a USB cable. The problem was, however, that USB sockets are typically available for soldering on a PCB; so the challenge was to somehow get it mounted into the chassis so that it would not be pushed out the first time I plugged a cable into it.

 

My initial idea was to use hot glue; I soldered two small pieces of PCB below the socket to increase the surface. While looking for a suitable location - I wanted to have it on the backside - I suddenly found am even better solution. There is a protruding piece of plastic for the screw from the bottom, and I noticed that it was close enough to give support for the socket. I wedged another piece of PCB between the plastic piece and the socket's backside, and then another idea: Stick the containment of the Arduino PCB with double-adhesive tape so close to the backside that it provides the counterpart for the holding PCB. Seems to work. :)

 

Sometimes you just have to start trying ...

 

usb-keyb1.jpg

usb-keyb2.jpg

I was going to do this with meplers solution of the Teensy 2.0++ ... I didn't know Kaal had already done the coding for the Teensy 2.0. hours of processing code to find out someone had already done it successfully *facepalm*.

 

Well I would like to take your thread a small step further. An output Toggle switch. Toggle the output either to the TI Mainboard or to the USB output. Preserve the Awesome Solid State and allow it to interface with the new. Maybe even allow for a Dvorak Keyboard. Just throwing some food for thought.

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