Newsgroups: comp.robotics
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!news.mathworks.com!udel!gatech!newsxfer.itd.umich.edu!agate!darkstar.UCSC.EDU!nic.scruz.net!earth.armory.com!rstevew
From: rstevew@armory.com (Richard Steven Walz)
Subject: Re: Building biped robot, need I/O
Organization: The Armory
Date: Tue, 7 Feb 1995 13:26:52 GMT
Message-ID: <D3MtCt.30p@armory.com>
References: <3h3a3u$306@news.ysu.edu>
Sender: news@armory.com (Usenet News)
Nntp-Posting-Host: deepthought.armory.com
Lines: 64

In article <3h3a3u$306@news.ysu.edu>, Ben Slagle <aq760@yfn.ysu.edu> wrote:
>
>A friend and I are working on a biped robot and we need a schematic for
>a card which plugs into an 8-bit slot and has at least 128 digital inputs
>and 128 digital outputs. This is just an experimental robot, but if we
>ever get it working, we'll need ann AI program which is reasonably simple,
>are there any available to run on an XT? it may be used to transport
>electronic components from a storage area to the workbench. Thanks.
-----------------------------
The card schematic out to TTL level for the XT is quite simple. The most
expensive and bulky part is the drivers for any actuator that you plan to
operate and power for the actuators! The input and output circuits use the
same address selector. The schematic is implemented as the following
Boolean equation, (if you don't know Boolean yet, you better study it, as
you will need it a lot, and it's a hell of a lot better than trying to draw
you the silly schematic in ASCII!!): /Port_Select = /(A0*A1*A2*A3*A4*A5*A6*
A7*A8*A9)+(AEN), and also /Port_Input_Enable = /Port_Select + /IORead, and
/Port_Output_Enable = /Port_Select + /IOWrite .

You use inverters as needed on the address lines coming into the port
selector to choose the ones you want LO for a given port address, and if
you can't find a 10 input NAND gate, you simply OR the outputs of lesser
input'ted NAND gates to construct one (DeMorgan's Laws!).  Then, when the
/Port_Select goes LO as its address is detected, then if either an /IOR or
an /IOW goes low, then it will be used to enable writing or reading to that
port number. You can have separate chips do the writing or reading for the
input byte and the output byte from that port number. It is suggested, so
that you don't screw up other function of your computer, that you use ONLY
unused addresses for these 16 eight-bit ports, such as perhaps 2B0-2BF,
which are the hexadecimal for ports 688 through 703 decimal, for BASIC
language purposes, or binary ports 1010110000 to 1010111111, the last four
digits counting up the sixteen ports like so, 0000, 0001, 0010, 0011, 0100,
0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111. You might
find it simpler to utilize a 4 to sixteen decoder, 74LS154, or two chained
74LS138 3 to 8 decoders, to do the selecting of these lowest four bits to
the selected ports in that address range, but the idea is the same as
wasting your time with all the NAND gates!!;-> The upper 5 port address
bits stay the same, so just use them to enable the decoder output controls!
Then finishing this is easy, if you want to do it with cheap chips. Just
use 16 74LS244's for input by tying the Port_Input_Enable to both /OE1 and
/OE2 pins (1 and 19), and tie the Port_Output_Enable to CLK input on sixteen
74LS374's to latch outgoing data for controlling external bits on the 16
ports. Make sure the /OE pin 1 is grounded on each. This is the simplistic
but serviceable way, if you like daisy chaining the data bus to 32 separate
chips with 8 bits each! Alternately you can take you pick from among some
parallel I/O adapters and look up how to program them and use them in your
design. Massive I/O DOES simply take a lot of chips, and even more
actuators and driver transistors or solid state switches and such. It is a
theoretically simple feat and yet a real pain in the ass, although a very
straightforward one to troubleshoot! Use a logic probe or a scope! I
recommend a scope or other cobbled simultaneous signal detector circuit for
troubleshooting. They are not too bad though, unless you forget to filter
the power to them like crazy, and to isolate your interfaces that might be
noisy. And shielding your BOT's brain from the nasty noise from actuators
can be important if all else fails! Lots of current switching on and off
makes lots of creepy noise! And remember to use free-wheeling diodes on all
coils against the direction of actuation, (opposite the activation
current). 

For more unused addresses in the IBM, consult my file: ibmport.map on my
mini-ftp site: ftp.armory.com /pub/user/rstevew .
Enjoy,
-Steve Walz   rstevew@armory.com

