Jump to content

Photo

Joystick Port interfacing - TI BASIC & CONSOLE ONLY


7 replies to this topic

#1 Meddler OFFLINE  

Meddler

    Space Invader

  • 24 posts

Posted Fri Feb 10, 2017 9:33 AM

Have you ever wanted to control something with your TI99 without getting complicated?

The versatility of the common 555 timer I.C will open up your Joystick Port using only TI BASIC with CONSOLE ONLY!

Inspired by the weather station project, I started looking at the possibility of using the joystick port for sensing and control. Various configurations of the 555 timer I.C will allow voltage (temperature) measurement, Relay or LED drive and motor drive (forward & reverse) upto 200mA and 15 volts.
Come the next rainy Sunday, I will test the possibilities but meanwhile I offer the following in case you would like to try them yourself. By using 5 volt systems you are unlikely to do any damage but if you want to switch Mains Power then you better ask me first!

We have 5 inputs giving us two planes of X and Y or 5(10) linear 'stops'; with the use of a 555 timer we can measure it's pulse width for a rudimentary Analogue to Digital converter.
We have 2 outputs for controlling relays or a small electric motor using the 555 timer I.C as a latch and power output stage.

If necessary, we can 'borrow' the 0 volts from the cassette port and 'steal' +12 volts from the Video connector.

This means that we have the capability of controlling a 5 floor elevator from our TI99 using only the Joystick port and a couple of 555 timer I.Cs. Now, I don't suppose there are many of you out there that have a 4 story house in which you have just been waiting to install a private elevator but it might be a nice School project for the kids. More usefully, it is possible to measure temperature, detect limit switches and switch a relay or drive small motors using a couple of 555 timer I.Cs.

Looking at the Joystick port we can see that there are two outputs and five inputs and the principle of operation is that a key press is indicated when an input line is taken 'low' and the strobed output line (Joystick 1 or 2) determines which specific key.
The Joystick port has an intricate circuit that is mainly to do with protecting the TI99 from the outside world.
The inputs are relatively simple in that they are held at +5 volts and go to the port through a switch de-bounce filter and current limiting resistors. We can interface to the inputs with a switch, transistor, FET or opto-coupler. The use of a transistor is not advised due to the possibility of Emitter-Base reverse breakdown in this configuration and an opto-coupler is a good option if connecting to higher voltages or external sources.

I propose to use the Joystick port strobe outputs to trigger a 555 timer I.C and the Joystick inputs for limit indicators or sampling. I will use the Joystick 'low' strobe to trigger external circuits, in particular, a 555 timer I.C as it has a useful power output stage and latching function.

This is the explanation of the output drive circuit so you can skip this paragraph. The schematic is attached:
The configuration of the Joystick outputs is a transistor whose job is to drive the voltage on the 1K5 resistor to +5 volts or to a logic 'low' to switch the key inputs. Normally the transistor is 'on' and holding the output at +5 volts by driving the 1K5 resistor that is connected to -5 volts. What happens when the transistor is strobed is that the Base is taken to logic 'low' and so the voltage on the 1K5 resistor is reduced to a fraction of a volt below 0 volts which will switch an input when a key is pressed. The 1K5 resistor is biased towards -5 volts whose voltage drop is controlled by the transistor and so it can be deduced that we can 'sink' upto 2.5mA into an input and maintain a logic 'low' input. Similarly we can 'source' several mA without dropping below the logic 'high' level.
 



#2 Vorticon OFFLINE  

Vorticon

    River Patroller

  • 2,489 posts
  • Location:Eagan, MN, USA

Posted Fri Feb 10, 2017 10:43 AM

Very interesting. You left out the schematic though.

How would one use TI Basic though with this set up since the Call Joyst command only reads the fixed axis values and there is no facility to issue an output command to the joystick port?



#3 RXB OFFLINE  

RXB

    River Patroller

  • 2,267 posts
  • Location:Vancouver, Washington, USA

Posted Fri Feb 10, 2017 11:02 PM

Have you ever wanted to control something with your TI99 without getting complicated?

The versatility of the common 555 timer I.C will open up your Joystick Port using only TI BASIC with CONSOLE ONLY!

Inspired by the weather station project, I started looking at the possibility of using the joystick port for sensing and control. Various configurations of the 555 timer I.C will allow voltage (temperature) measurement, Relay or LED drive and motor drive (forward & reverse) upto 200mA and 15 volts.
Come the next rainy Sunday, I will test the possibilities but meanwhile I offer the following in case you would like to try them yourself. By using 5 volt systems you are unlikely to do any damage but if you want to switch Mains Power then you better ask me first!

We have 5 inputs giving us two planes of X and Y or 5(10) linear 'stops'; with the use of a 555 timer we can measure it's pulse width for a rudimentary Analogue to Digital converter.
We have 2 outputs for controlling relays or a small electric motor using the 555 timer I.C as a latch and power output stage.

If necessary, we can 'borrow' the 0 volts from the cassette port and 'steal' +12 volts from the Video connector.

This means that we have the capability of controlling a 5 floor elevator from our TI99 using only the Joystick port and a couple of 555 timer I.Cs. Now, I don't suppose there are many of you out there that have a 4 story house in which you have just been waiting to install a private elevator but it might be a nice School project for the kids. More usefully, it is possible to measure temperature, detect limit switches and switch a relay or drive small motors using a couple of 555 timer I.Cs.

Looking at the Joystick port we can see that there are two outputs and five inputs and the principle of operation is that a key press is indicated when an input line is taken 'low' and the strobed output line (Joystick 1 or 2) determines which specific key.
The Joystick port has an intricate circuit that is mainly to do with protecting the TI99 from the outside world.
The inputs are relatively simple in that they are held at +5 volts and go to the port through a switch de-bounce filter and current limiting resistors. We can interface to the inputs with a switch, transistor, FET or opto-coupler. The use of a transistor is not advised due to the possibility of Emitter-Base reverse breakdown in this configuration and an opto-coupler is a good option if connecting to higher voltages or external sources.

I propose to use the Joystick port strobe outputs to trigger a 555 timer I.C and the Joystick inputs for limit indicators or sampling. I will use the Joystick 'low' strobe to trigger external circuits, in particular, a 555 timer I.C as it has a useful power output stage and latching function.

This is the explanation of the output drive circuit so you can skip this paragraph. The schematic is attached:
The configuration of the Joystick outputs is a transistor whose job is to drive the voltage on the 1K5 resistor to +5 volts or to a logic 'low' to switch the key inputs. Normally the transistor is 'on' and holding the output at +5 volts by driving the 1K5 resistor that is connected to -5 volts. What happens when the transistor is strobed is that the Base is taken to logic 'low' and so the voltage on the 1K5 resistor is reduced to a fraction of a volt below 0 volts which will switch an input when a key is pressed. The 1K5 resistor is biased towards -5 volts whose voltage drop is controlled by the transistor and so it can be deduced that we can 'sink' upto 2.5mA into an input and maintain a logic 'low' input. Similarly we can 'source' several mA without dropping below the logic 'high' level.
 

Using RXB may peek your interest on this as with CALL IO you can control the ports on the Joystick and read them or write to them.

 

 

 

No Assembly Language required so faster development times. Just use XB alone.


Edited by RXB, Fri Feb 10, 2017 11:04 PM.


#4 Meddler OFFLINE  

Meddler

    Space Invader

  • Topic Starter
  • 24 posts

Posted Sat Feb 11, 2017 5:46 AM

Thank you, I did have trouble up-loading the schematic. ("You are not allowed to use that image extension on this community!?")

Call Joyst is an output command. When Call Joyst(n,x,y) is issued then the line is strobed 'low' irrespective of whether a key is active; I am assuming that it is strobed for a few milli-seconds against switch bounce and that is what I have to check. Those with some electronics experience will appreciate that is sufficient to trigger most devices.

 

Very interesting. You left out the schematic though.

How would one use TI Basic though with this set up since the Call Joyst command only reads the fixed axis values and there is no facility to issue an output command to the joystick port?

 

This is the explanation of the output drive circuit so you can skip this paragraph. The schematic is attached:
The configuration of the Joystick outputs is a transistor whose job is to drive the voltage on the 1K5 resistor to +5 volts or to a logic 'low' to switch the key inputs. Normally the transistor is 'on' and holding the output at +5 volts by driving the 1K5 resistor that is connected to -5 volts. What happens when the transistor is strobed is that the Base is taken to logic 'low' and so the voltage on the 1K5 resistor is reduced to a fraction of a volt below 0 volts which will switch an input when a key is pressed. The 1K5 resistor is biased towards -5 volts whose voltage drop is controlled by the transistor and so it can be deduced that we can 'sink' upto 2.5mA into an input and maintain a logic 'low' input. Similarly we can 'source' several mA without dropping below the logic 'high' level.

Attached Files



#5 Vorticon OFFLINE  

Vorticon

    River Patroller

  • 2,489 posts
  • Location:Eagan, MN, USA

Posted Sat Feb 11, 2017 7:46 PM

Got it. Really lots of control options here with no added peripherals except the interface board. Looking forward to some practical demos!

You should cross-post this project in TI interfacing thread http://atariage.com/...ti interfacing as well in the development forum.



#6 Opry99er OFFLINE  

Opry99er

    Quadrunner

  • 7,614 posts
  • Location:Cookeville, TN

Posted Tue Feb 14, 2017 3:07 AM

This could be really cool!!! Looking forward to your progress!

#7 Meddler OFFLINE  

Meddler

    Space Invader

  • Topic Starter
  • 24 posts

Posted Today, 12:10 PM

The basics i.e TI BASIC - proof of principle.
To look at the Joystick port interfacing options I made a little test rig as attached:

 

( Does anyone know how to embed a photo?)

 

The Video output gives a 12 volts feed and the Cassette port gives the System Ground. The Purple wire is the 12 volts supply from the Video connector.
The Red LEDs are being driven by J1 & J2 and Cassette System Ground; In the centre you can see a standard 5 volt Regulator; the Green LED is connected to the output of the LM555 and, for good measure, I connected the White LED to the Cassette motor drive and 12 volts. The pushbutton on the left is 'FIRE' button for J1 & J2 using a couple of Diodes to isolate channels.
The LM555 is configured as a set/reset latch with the J1 & J2 output connected to Trigger and Reset.
The J1 & J2 outputs referenced to System Ground are 50 micro-second negative going pulses; between 4.5v down to -0.2v.
Alternately switching J1 & J2 turns ON & OFF the Green LED using a simple CALL JOYST 1 or 2. In a software loop with an ON KEY get-out test returns a 100 milli-second cycle.
The purpose of the LM555 is to provide the latching function and greater drive power.
In conclusion then, it is feasible to switch directly from the Joystick port and control that action using the Joystick inputs with only the 99 console. The limitation is that there are only two pulsed outputs.

The next stage is to connect back-to back 555 I.Cs so that I can drive an electric motor in forward and reverse (or two relays). With some modification to the circuit interfacing I will use the 12 volt supply to give 3 Watts maximum power drive.

Applications? The main limitation of the Joystick port is that there are only two outputs meaning that only one axis of motion is possible with out getting complicated. However, that does mean Forward and Reverse for D.C and Stepper motors with minimal interfacing.
Indexed Turntable control or Solar tracking is possible with a more esoteric application using the capabilities of the 99 could be Resistance welding. I have a Temperature sensor connected through my RS232 so I already have Heating control as a possibility.
Any ideas you want me to think about? Slot car Start Line lights and Lap times!!? :)

 

Got it. Really lots of control options here with no added peripherals except the interface board. Looking forward to some practical demos!

You should cross-post this project in TI interfacing thread http://atariage.com/...ti interfacing as well in the development forum.

 

Whilst this is interfacing, it does not justify the title "development".

 

This could be really cool!!! Looking forward to your progress!

Attached Files


Edited by Meddler, Today, 12:15 PM.


#8 arcadeshopper ONLINE  

arcadeshopper

    Stargunner

  • 1,976 posts
  • Location:Portland, Oregon USA

Posted Today, 12:20 PM

( Does anyone know how to embed a photo?)

 

 

you attach it and then hit the little link that says "insert in message" or the like






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users