[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)?
In article <1193432119.249035.83790@o38g2000hse.googlegroups.com>,
<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?
That's where you might be better off building a card (though you could also
put a 1-Wire controller on the joystick port and use that to do all sorts of
I/O...search previous messages in this newsgroup for "1-Wire" for examples).
>> In either case, some PEEKs and POKEs are all you'd need to control it from
>> BASIC.
>
>Well that part is promising... Any good examples?
That's dependent on your eventual hardware design. If you use the
annunciator outputs at the joystick port, each is turned on/off by PEEKs to
one of a pair of addresses (one turns the annunciator on, the other turns it
off). An expansion card will have all of its I/O in one of the 16-byte
ranges between $C090 and $C0FF, and its behavior will be determined by your
hardware design.
If you decide to use something fancier like 1-Wire or I2C, you'll need to
implement that protocol. I've implemented 1-Wire on the Apple II and have
tools for native development in BASIC and assembly language and
cross-development in C on my website.
_/_
/ v \ Scott Alfter (remove the obvious to send mail)
(IIGS( http://alfter.us/ Top-posting!
\_^_/ rm -rf /bin/laden >What's the most annoying thing on Usenet?