Jump to content
Sign in to follow this  
yorgle

1200xl keyboard question

Recommended Posts

Forgive my noob question here, but when a given key is pressed, what exactly shows up at the 15 pins at the keyboard connector on a 1200xl? From the schematic, I see that some of the lines are ground and +5 vdc, but what about the the lines that connect to POKEY? I believe I am just looking for combinations of volts on/off at those pins? or something more complicated? The reason I ask is that I'm trying to electrically isolate the keyboard from the motherboard and would like to use optocouplers so that no actual current passes between the keyboard and the motherboard. Any help or thoughts?

Share this post


Link to post
Share on other sites

Pokey's K0-K5 lines are a counter that are connected to two 4051 CMOS analog switches. These provide a 1-of-8 MUX function. The 3 low order bits are connected to the input MUX which poll 8 inputs lines from the keyboard matrix. When there is a carry from K2 to K3, the output MUX grounds a different line into the keyboard matrix and all 8 input lines are tested again. There's also a special input line just for SHIFT, CTRL, and BREAK so they are immune to the effects of multiple other keys being held down.

 

http://atariage.com/forums/uploads/monthly_07_2007/post-9683-1183297470.gif

 

So, input lines are either floating or are grounded and output lines either float or are grounded when a key is pressed and their row is being selected. There's also discrete lines for the GTIA keys (Start, Select, Option), and Reset.

 

http://atariage.com/forums/uploads/monthly_08_2013/post-26063-0-81002200-1377636509.gif

  • Like 3

Share this post


Link to post
Share on other sites

Now that I think about it, I believe the 1200XL keyboard has the 4051's onboard meaning you're dealing with K0-K5 directly at the connector, which are always driven high or low. That should make the interface easier to build.

 

The other keyboards require 4051s on the motherboard except the XEGS keyboard.

Share this post


Link to post
Share on other sites

Thanks for the info, guys. So I'm thinking that I should be able to give the keyboard its own, dedicated power source and then replicate the hi or lo state of each line at the connector using an optical signal instead of actual connection. Cutting power to the 4051's should make the keyboard invisible. Does that make sense?

Edited by yorgle

Share this post


Link to post
Share on other sites

Are you leaving the keyboard in the case or trying to move it outside? If you just want to stop key scanning, you can use the inhibit pin on the output 4051.

Share this post


Link to post
Share on other sites

Are you leaving the keyboard in the case or trying to move it outside? If you just want to stop key scanning, you can use the inhibit pin on the output 4051.

I want to use the same keyboard for both the Atari and a separate, programmable keyboard encoder. The two systems each work independently, but because they are electrically incompatible, I need to make them invisible to each other. In other words, I need the programmable encoder to think that the keyboard isn't plugged into the Atari (even when it is). The programmable encoder reads the keyboard matrix using physical connections to the respective row and column connections at the 4051's. It works fine as long as the keyboard isn't physically connected to the Atari. On the other side of the coin, the Atari reads the keyboard just fine-- even with the programmable encoder connected-- so long as it's unpowered, so I can just use a switch to solve that issue.

Edited by yorgle

Share this post


Link to post
Share on other sites

The 4051 is an analog switch, so it can provide the isolation needed to connect two keyboard inputs to the same Pokey. There are other parts that could be used to isolate the rest of the circuit without resorting to optical devices. The only caveat is if the two systems cannot share a common ground.

Share this post


Link to post
Share on other sites

Thanks for all the help Bryan. This is really a learning experience for me. In the present configuration, the encoder and the Atari do not share either vcc or ground. So this "inhibit pin" you mention- what does it actually do?

Share this post


Link to post
Share on other sites

Thanks for all the help Bryan. This is really a learning experience for me. In the present configuration, the encoder and the Atari do not share either vcc or ground. So this "inhibit pin" you mention- what does it actually do?

Normally, the "common" pin is connected to one of the 8 input/outputs. The inhibit pin shuts them all off so that they are in a high-impedance state. This allows something else to drive those lines or the common pin without conflict.

Share this post


Link to post
Share on other sites

Ok, I think I understand what I need to do to make this work. I can use the 5v at the programmable encoder (when it's on) as a signal to a spdt analog switch at the 4051 to pull the inhibit pin from ground to hi; and similarly, a normally closed quad spst between pins 10-13 at the connector to disconnect the Reset, Start, Select and Option lines. I suppose I could even include a relay to kill power to the encoder whenever the Atari is powered on, eliminating the need to unplug it from my PC when using the Atari.

Edited by yorgle

Share this post


Link to post
Share on other sites

Does the external encoder drive the keyboard input lines?

 

The Reset, Start, Select and Option lines can also be run through CMOS switches or open collector gates.

Share this post


Link to post
Share on other sites

Does the external encoder drive the keyboard input lines?

 

The Reset, Start, Select and Option lines can also be run through CMOS switches or open collector gates.

Not sure what you mean by "drive" but yes, it connects to each of the keyboard matrix lines at both 4051's.

Share this post


Link to post
Share on other sites

If you have an external circuit that's going to read the keyboard, it needs to either perform the row scanning itself, or read the results of the scanning done by Pokey.

Share this post


Link to post
Share on other sites

I see what you mean. The encoder does its own scan, reading the rows and columns at the respective pins of the 4051's. When it senses a contact between a row and a column, i.e., a keypress, it converts that to a PC recognizable key code and sends it to my PC via ps/2.

Share this post


Link to post
Share on other sites

Here's how I might do it (requires there to be a common ground connection between the Atari and the encoder):

 

2 4051's for keyboard row select. When one is enabled, the other is disabled. This way, only one can drive the keyboard.

2 4051's for keyboard read-back. When one is enabled, the other is disabled. This way, the powered-off device can't load down the circuit.

similar CMOS muxing for the rest of the buttons.

Power to the 4051's on the keyboard provided through schottky diodes from both circuits.

 

The main thing you need is non-interference from the circuit not in use. The impedance of the CMOS switch in the off-state is very high.

 

EDIT: Actually, you could probably toggle most of the 1200XL's keyboard pins through a set of 74HC4053's and be okay.

Share this post


Link to post
Share on other sites

I harvested a couple of 4053's from an old telephone at my office and came up with a circuit: use the 3 switches from the 1st 4053 and 1 from the second 4053 to toggle the RESET, START, SELECT and OPTION pins at the Atari connector whenever a +5v signal from the encoder is present at the common pins for each of those switches. I can use that same +5v signal to flip the remaining 2 switches of the second 4053, pulling the inhibit pins of each 4051 on the Atari hi whenever the encoder is on and lo when it is off. Everything is soldered up on a protoboard and ready to install, but I have one final question regarding the 4053's: with four of the switches only being used SPST, should I connect the unused second throw pins for these switches to an led or something so the switches don't float?

Share this post


Link to post
Share on other sites

I missed this topic when it was first started. So if I understand this correctly, you are trying to utilize the 1200XL keyboard for input via PS2 protocol to a PC, while still having usability on the Atari? If so this is kinda like the reverse of the TK-II project (PS2-to-Atari Keyboard translation). May I ask what this will be needed for? Just curious ;)

 

- Michael

Share this post


Link to post
Share on other sites

I use my 1200xl as my pc keyboard at my office. It looks great on my desk and can't be best for typing. However, my present interface doesn't work unless the keyboard is physically disconnected from the 1200 motherboard.

Share this post


Link to post
Share on other sites

I use my 1200xl as my pc keyboard at my office. It looks great on my desk and can't be best for typing. However, my present interface doesn't work unless the keyboard is physically disconnected from the 1200 motherboard.

 

Very nice. I bet that gets some interesting looks from the other people at your office :) Back in the 90's I did just the opposite and had an Atari in a PC case with an AT keyboard. Nobody was the wiser that I was actually using an A8 and not a PC. So did you create the encoder to go from the 1200XL's matrix-ed keyboard to the PS2 port on your PC?

 

- Michael

Edited by mytekcontrols

Share this post


Link to post
Share on other sites

Yes. Each row and column is hard wired to the encoder. And because it's programmable, any PC function can be assigned to any Atari key. It's complicated, but it works. If I had the skills, I'd prefer to build/code a translator that could read the Atari key codes at, say, a joystick port and convert that to PC keyboard codes. The downside to that, however, would be that the Atari would have to be powered on all the time.

Share this post


Link to post
Share on other sites

I think someone suggested earlier the idea of looking at the signals going directly into Pokey and then decoding those. That would basically be 8 lines, 6 for the count, and two for the scan results. Decoding that into PS2 would be the reverse of what I do in the TK-II and/or similar to what was done in the AKI. The cool thing about this aproach is that due to open collector nature of the keyscan response lines on Pokey, there would be no problem to have both the PC encoder and the A8's Pokey looking at the same keyboard (parallel connected). If I had more time, this sounds like an interesting project. But it would require at least energizing the scan circuit on the 1200XL keyboard, although power for that could be picked up from the PS2 interface (would only require a common ground from PC to the Atari, and with the use of two diodes, the 5 vdc could come from either the PC or the Atari). Just thinking out loud.

 

- Michael

Edited by mytekcontrols
  • Like 1

Share this post


Link to post
Share on other sites

If you dont mind elaborating on that idea, I'm curious what would this physically look like? From your description, I'm picturing an 8 wire ribbon cable running from the keyboard connector to a board with a processor chip and a ps2 connector. If so, that would definitely be a cleaner and less solder intensive install than my setup.

Share this post


Link to post
Share on other sites

Yes. Each row and column is hard wired to the encoder. And because it's programmable, any PC function can be assigned to any Atari key. It's complicated, but it works. If I had the skills, I'd prefer to build/code a translator that could read the Atari key codes at, say, a joystick port and convert that to PC keyboard codes. The downside to that, however, would be that the Atari would have to be powered on all the time.

 

This was an idea that I started to research. Use an Arduino Pro which can act as a USB keyboard, and connect it to the joystick port. Haven't gotten around to trying it, but I like it because it doesn't involve any modifications to the machine.

Share this post


Link to post
Share on other sites

If you dont mind elaborating on that idea, I'm curious what would this physically look like? From your description, I'm picturing an 8 wire ribbon cable running from the keyboard connector to a board with a processor chip and a ps2 connector. If so, that would definitely be a cleaner and less solder intensive install than my setup.

Since we talking about using a 1200XL as the keyboard, it could simply be a TK-II-PiggyBack board installed inside, with a PS2 connector interface board, and a PS2 to PS2 cable going from it to the PC. Of course it would require 'new' firmware to be developed that would change the way the TK-II adapter presently works, but it should be doable. And best part of all, it would be a solder-less plug-in modification (piggybacks the Pokey chip which is socketed in a 1200XL).

 

3892017_orig.jpg7357110_orig.jpg

 

And since the interface to Pokey will be sensing key closures and count, it can be left connected all the time with no interference to the Atari. And then if you wanted a PC disable switch, a special multi key press done on the 1200 XL's keyboard could be looked for to toggle it on or off.

 

The key point here is that the hardware is already available from the TK-II project (would need a small mod, adding some power steering diodes). All it really needs is new firmware to be written. Since this project has caught my interest, I would be willing to play around with this, but it might take some time before it's ready.

 

- Michael

Edited by mytekcontrols

Share this post


Link to post
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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...