[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Apple 2e - building a simple expansion card and calling it from BASIC (or assembly)?



mad.scientist.jr@gmail.com wrote:
Thanks for your reply...


To switch a relay on and off, I'd use an annunciator line from the joystick
port.  A card in an expansion slot will need at least a buffer and a latch;
at the joystick port, all you'll need is an NPN transistor, a diode, and a
resistor or two.  You could use an expansion slot for what you want to do,
but to me it sounds a bit like swatting a fly with a sledgehammer.


If all you wanted to do was turn on one relay maybe, but what about 4
or 8 or more? Some things I'm looking to do
* set the value of 1 or more potentiometer (control resistance from
the computer)
* read the value of 1 or more potentiometer (into an 8-bit number =
ok)
* read whether a switch (actually 8 or more switches) is closed or
open, and be able to tell if several are pressed at the same time
* open/close 8 or more relays (or an electronic switch such as a
transistor which is faster)
* control SPDP switch(es)

If you are controlling relays, speed is not an issue.  So it
would be possible to use two annunciator outputs on the game
port to provide a data line and a clock pulse for shifting
bits into a (possibly quite long) shift register, whose parallel
outputs control the relay drivers.

Serial in-parallel out shift registers are available with
latches on the parallel side so that shifting does not
disturb the outputs.

Similarly, there are parallel in-serial out shift registers
that can be used (with a pushbutton input for data) to read
arbitrary numbers of slowly changing inputs.

All of this is easily constructed on a proto board--even a
soderless proto board.

It's best not to build a peripheral card until you know exactly
what functionality you will require and how you will program it.

Using the game port and software-controlled serial input-output
keeps the hardware simple and requires only short assembly language
programs to control.

-michael

NadaPong: Network game demo for Apple II computers!
Home page:  http://members.aol.com/MJMahon/

"The wastebasket is our most important design
tool--and it's seriously underused."