home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
No Fragments Archive 10: Diskmags
/
nf_archive_10.iso
/
MAGS
/
STEN
/
STEN08.MSA
/
NEWS.TXT
/
DIGIJUN1.ASC
< prev
next >
Wrap
Text File
|
2010-04-21
|
16KB
|
333 lines
DIGITAL JUNCTION
----------------
The right connections are made here.
In this column I intend to show you how to interface the ST to various
devices and projects via the cartridge or MIDI ports. This will introduce
you to an area of computing that you may find as interesting if not more
so than playing games or word processing etc and will perhaps encourage
you to carry out your own interfacing experiments.
Starting with details of the cartridge and MIDI ports I shall move
onto some simple interfacing experiments using LEDs (Light Emitting
Diodes), switches and relays etc. I will then cover more advanced topics
such as ADC (Analogue to Digital Conversion) and DAC (Digital to Analogue
Conversion) along with some useful projects. After that? Well, we'll have
to see - Maybe a computer controlled weather monitor or some simple
robotics such as a computer controlled buggy - I make no promises
however.
The Cartridge Port
------------------
Unlike earlier micros such as the C64 or Spectrum the ST does not have
a general purpose interface or bus extension to allow easy expansion or
interfacing of users own projects. The nearest the ST has to offer is the
cartridge port which was intended for alternatives or extensions to TOS
but has been used for many other purposes, the most common probably being
sound samplers or real time clocks for example.
Although not as flexible as a purpose built interface or bus extension
the cartridge port is quite capable of being used as an interfacing port
thus enabling various devices and projects to be connected to the ST. It
is even possible to adapt and connect projects that were intended for
other micros.
There are 16 data lines (D0-15), 15 address lines (A1-15), 2 ROM
enable lines (ROM3 & ROM4), 1 Upper data strobe (UDS), 1 Lower data strobe
(LDS), 2 +5V lines and 3 ground lines available at the cartridge port. You
may have noticed the A0 line is missing, this is due to the fact that the
68000 CPU (Central Processing Unit) can only address even memory
locations. However, the lower data strobe can be used to provide the A0
line if needed (This will be covered later).
Cartridge port pin-out
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39
----------------------------------------------------------------
| . . . . . . . . . . . . . . . . . . . . |
| . . . . . . . . . . . . . . . . . . . . |
| |
----------------------------------------------------------------
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40
1 = +5V DC 21 = A8
2 = +5V DC 22 = A14
3 = D14 23 = A7
4 = D15 24 = A9
5 = D12 25 = A6
6 = D13 26 = A10
7 = D10 27 = A5
8 = D11 28 = A12
9 = D8 29 = A11
10 = D9 30 = A4
11 = D6 31 = ROM 3 SELECT
12 = D7 32 = A3
13 = D4 33 = ROM 4 SELECT
14 = D5 34 = A2
15 = D2 35 = UPPER DATA STROBE
16 = D3 36 = A1
17 = D0 37 = LOWER DATA STROBE
18 = D1 38 = GROUND
19 = A13 39 = GROUND
20 = A15 40 = GROUND
As the port was designed for use with ROMs (Read Only Memory) there is
no read/write line provided so any attempt to write to the port will
result in a bus error. Even if a read/write line was brought out to the
port an error would still occur as the GLUE chip knows that this is a read
only port and objects to any attempt at writing to it. However, all is not
lost, a programming trick known as address offsetting is used to write to
the port. This places the data to be written on the address lines rather
than the data lines and is then latched into the interfacing circuits when
needed.
Due to Atari using a non-standard pitch for the cartridge port
connector it is rather difficult to find a suitable plug to fit it. I have
not been able to find a supplier and if anybody knows of one please tell
me.
I have overcome the problem by installing my own connector in parallel
with the cartridge port. Simply, this involved soldering two lengths of
20-way ribbon cable at the points where the cartridge port connector pins
enter the ST's main PCB (printed circuit board). I was unable to find a
space to install my connector into the case so I brought the ribbon cables
out from under the cartridge port and soldered a 37-way D type connector
to the ribbons making sure to leave enough length to allow a cartridge to
be installed without fouling on them.
This does mean that I now have a cable and D connector hanging out the
left hand side of my ST but its no problem to me. After all it does mean
that I am able to connect any projects or experiments using cheap and
readily available connectors.
A couple of points should be noted.
(1) Carrying out this type of modification would invalidate any
warranty that may cover your ST.
(2) You would not be able to use any cartridges while having
interfaces connected to the additional connector and vice versa of
course.
If anyone would like further details of my modification then please
send a SAE and I shall return full details and diagrams. If enough people
are interested then I may include the details in this column.
For those that would rather not hack their ST about, after all it's
only nutters like me that would even think of such a thing, but would
still like to interface projects or circuits via the cartridge port, do
not fear, there is a far less drastic alternative. It is in the form of an
interface which slots into the cartridge port providing a fully buffered
16-bit wide input, a latched 16 bit wide output and some control lines for
advanced applications. The interface also overcomes the non standard edge
connector problem by providing a board interface which allows 0.1 inch
pitch double sided edge connectors to be plugged in. There are a variety
of cheap readily available edge connectors that can be used, Locost PC
edge connector 2x25 with closed ends or 50-way IDC socket for ribbon cable
for example.
The interface, costing about 25 pounds well over a year ago, was
designed, built and supplied by Mr. W.M.Kennerley (see 'Suppliers' for
address). I have recently been in contact with Mr. Kennerley and he has
informed me that he is still able to supply the interfaces. Those who
would like one should contact him for details of price and delivery. If
writing to him please don't forget to enclose a SAE.
I do feel that anyone really interested in interfacing should consider
purchasing one of these units, after all, for less than the cost of a full
priced game or serious software you are getting a really useful bit of
kit. As mentioned earlier it saves any hacking of the ST plus the system
busses are protected by the on-board buffers thus saving you having to
include them in your own designs and Mr. Kennerley has provided the full
sixteen bit wide input and output which makes the unit very useful
indeed.
I shall be supporting this interface with software and projects
throughout this series and will do like wise for those that would rather
connect directly to the cartridge port.
The MIDI ports
--------------
If, like myself, you are not into music or don't own any MIDI (Musical
Instrument Digital Interface) equipment then ST's MIDI sockets would
appear to be of little use to you. This, however, is not so. The MIDI
ports work in the same way as any other serial port. The serial data
format used on the MIDI ports has the same specification as the RS-232C
protocol used on the serial or modem port except that the MIDI transfer
rate is fixed at 31.25KBaud. When data is sent or received it starts with
a 'start bit' which is always a 0 then follows the eight data bits (one
byte) starting with the LSB (least significant bit) and finishes with a
'stop bit' which is always a 1. From this it can be seen that the MIDI
ports could be used for general serial communications. There is a
multi-player game, MIDI MAZE, that allows up to 16 STs to be linked
together as a network and play against each other through the MIDI ports.
Programming the ports to send or receive data is catered for in the
BIOS routines bconout, bconin and bconstat. GFA BASIC v3 accesses these
routines with the following commands:-
bconout = ~BIOS(3,3,b%) where b% = data byte to send
bconin = r% = BIOS(2,3) where r% = data byte read from port
bconstat = r% = BIOS(1,3) Interrogates input buffer
r% = 0 if no byte available
r% = -1 if a byte is ready
In order for this port to be of use to us for interfacing, some
circuits capable of serial to parallel and parallel to serial conversion
will be needed. This is fairly easy to do using a UART (Universal
Asynchronous Receiver/Transmitter) but there is a less expensive way of
accomplishing this by using some standard CMOS ICs. I have come across a
project first published by M. Breuer in the April 91 issue of Elektor
Electronics magazine that does exactly this by turning the MIDI ports into
an 8-bit in/out interface.
This interface cannot pass data as fast as the cartridge port nor is
it as flexible in use but it is perfectly capable of most interfacing
tasks and is an ideal project for inclusion in this series. Like the
cartridge port, I shall be supporting this interface throughout the
series.
I chose the MIDI interface project as an alternative for the following
reasons:-
(1) It puts to use the MIDI ports that would have otherwise remained
idle (at least in the case of those that don't have MIDI equipment)
(2) An opto isolator has been included on the interface board MIDI
input which complements the isolator already built into the ST's MIDI
input. This has the very desirable effect of protecting the ST from damage
due to any mishaps that may occur with projects attached to the
interface.
(3) You can still carry out interfacing but still have your favourite
cartridge plugged in plus it is fairly simple to program.
The interface has been designed to be built on a double sided PCB
which is available from Elektor Electronics readers services but this will
cost £13.34 including VAT and P&P. It is possible to build the interface
on a piece of stripboard (Veroboard) costing about £1.35. I have designed
a stripboard layout for the project which I hope to have built and tested
in time for the next article.
Perhaps I should point out that as far as possible I intend to make
sure that it will only be necessary to use the cartridge port OR MIDI port
interface to follow this series. The choice as to which one to use is
yours but I do recommend the cartridge port as your first choice as it is
the more flexible of the two. However,as I said earlier, the MIDI
interface project is capable of carrying out most interfacing tasks and is
an ideal alternative particularly if your cartridge port is tied up with
other devices that you may wish to keep on line.
Close Box
---------
A lot of blurb in this first article but we will get down to some
practical work next issue so get your soldering irons ready.
Next Issue
----------
Full details of parts required and building of the MIDI Interface.
More on buffering the cartridge port.
Stay connected......
NOTES
-----
All modifications, experiments, hardware and software discussed in
this column are tested on an Atari STFM with high resolution monitor but
should work on other set ups.
If you spot an error or know of a better way of achieving something in
the hardware or software then please let me know and I will pass the
information on through this column so that we may all learn. This, after
all, is what STEN is all about.
Whilst every effort has been made to make sure that the information
given in this article is correct neither I or STEN can be held responsible
for any damage which may arise due to you carrying out modifications or
connecting any devices directly or indirectly to your ST.
"By Order of der Management"
*************************************************************************
* Suppliers *
* *
*Cartridge port Expander from:- *
*Mr W.M.Kennerley. 90 Lingfield Road, Stevenage,Herts. SG1 5SN *
*Tel. 0438 352847 *
*-----------------------------------------------------------------------*
*MIDI 8-Bit Interface *
*Elektor Electronics (Publishing), Down House, Broomhill Road, London *
* SW18 4JQ*
*PCB £13.34 inc. *
*Software on disk £8.64 inc. *
*************************************************************************
*************************************************************************
* Bibliography *
* *
*Concise Atari St 68000 reference guide by K.D. Peel *
*Atari ST Internals by Bruckmann, English, Gerits *
*ST Applications- Internals series by Paul Rossiter *
*GFA BASIC V3.6 Manual *
*April 91 issue of Elektor Electronics *
*************************************************************************
*************************************************************************
* Dave Price. 42 Foxglove Green, Willesborough, Ashford, Kent TN24 0RJ.*
*************************************************************************
-oOo-