|★ HARDWARE ★ MONTAGES ★ USER PORT Speed measuring ★|
|User Port Speed Measuring|The Amstrad User)||Hardware Montages|
So you would like to put your Amstrad computer to work either counting or measuring time, but you have read an article on interfacing and have been put off by things like, address decoding, buffers, AND gates, NAND gates etc.
If you look carefully on the back of the computer the port you plug the joystick into is labelled USER PORT. Provided what ever you want to measure can operate a mechanical switch, you can connect it to this port. The easiest way to set this up is to use a damaged joystick. The wire that goes to all the switches is the common (pin 8). If you an; going to use more than 5 switches you will have to install diodes as used in the Amstrad joysticks. Where a wire from pins 1 to 7 is split to go to 2 switches 2 diodes have to be installed (see diagram) with the colour band on the diode pointing towards the common wire, the other side of the 2nd switch is connected to common 2 (pin 9).
WARNING Any switches and wires connected to the User Port MUST be insulated from any other electrical current no matter how small! Also, unplug the cord from the computer before soldering etc. on the wires and switches.
Some types of switches that could be used are:
Reed switches are two strips of metal, usually encased in a glass tube, that when a strong magnetic field acts on them either touch (normally open) or separate (normally closed). For example a reed switch could be installed in a slot car track, and a magnet installed in the car (if the motor magnet is not strong enough). The problem with reed switches is that they open and close several times as the magnet passes over them, and for counting it may be necessary to cause a delay of several seconds before reading that switch again.
MICRO or LEVER SWITCHES
Micros switches have a switch in a plastic body with a metal lever on one side that operates the switch, and usually only need a small movement to throw the switch.
Relays use a electric current in a coil to open or close a set of contacts. If what you want to measure is clectrical in basis you can connect that to the coil of a suitable relay and connect the User Port to the relay's contacts. But make sure that the coil is insulated from the contacts because in some automobile relays the coil earths through the contacts.
These are a small glass bulb with two wires entering the bulb, which contains several drops of Mercury. When the bulb is tilted so that the mercury touches both wires the switch is conducting. Following is a small program that has been used with reed switches on a H.O. Model Railway to check the scale speed of the trains. It uses the @ key to enter the timing mode, the Up pin of the Joy stick to start timing and the down pin to stop/display speed.
When the program asks for scale, enter the large number (e.g. If the scale is 1:32, enter 32). If you want to time something in normal Km/Hr. enter 1. When a REM is removed in line 560 it will display Miles/Hour.