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

Re: PC to Apple 2 Keyboard Conversion




On Fri, 16 Mar 2001, Rubywand wrote:

> Edward Ho writes ...
> > 
> > I have several Apple II Plus system board still functioning, but do not have
> > any working keyboard to go with them. Is it possible to convert a PC
> > keyboard to work with an Apple II? If yes, please describe in detail.
>  ....
> 
>      Have not done it, yet; so, there are no details available.
> 
>      It looks like you could use an 8251 to interface with the PC KB.
> 
>      The big catch is having a way to initialize the 8251 or whatever other
> interface chip you use. You want a KB to be ready to go when you turn ON the
> computer and you do not want to have to modify your ROM code or boot some setup
> program-- i.e. you want the KB to act just like an Apple II KB with, probably,
> some extra functions.
> 
>      One approach could be to use a few 1-shots to clock-in stuff from a small
> ROM. Or you could use a microprocessor to run the interface-- probably this is
> the best method and easier to fine-tune to get the most from the KB.
> 
> 
> Rubywand
> 
> 
This isn't going to be a simple project.  The Apple keyboard just outputs
ASCII characters in parallel format.  An IBM-compatible keyboard is not
only serial, and if I remember isn't exactly the same format usually
seen when sending serial, but it is not ASCII.  Press a key on an IBM
keyboard, and you will get a serial code that denotes that key, and I
think a different code is sent when you let go of the key.  The conversion
to ASCII is done in the IBM.  ON the original and XT, there is a TTL
shift register, I think it was the 74LS595, that converted the serial
input to parallel, and then code in ROM does the actual converstion to
ASCII.  On the AT and later, there is a separate microcomputer to do
the serial to parallel conversion, and some or all of the conversion to
ASCII.

If it was just a serial to parallel conversion problem, one would do
better to use a UART intended for standalone use.  They were common
in the early days of small computers and you can still buy them;
the were programmed not by software like the 8251, but by hardwiring
the pins.  Or you might be able to get by with a simple logic based
serial to parallel shift register like the 74LS595.

But it won't be that simple.  You either have to do the conversion
externally, most likely by using a dedicated microprocessor, or
fix the ROM inside the Apple II to do the conversion.  The former
has been done, there is/was such a unit available for the Radio
Shack CoCo, while the latter is going to require a lot of work and
fitting into place.

There was a time when you would either buy a keyboard that was unencoded,
and add an encoder, or buy a keyboard with a built in ASCII encoder.
Those were once plentiful, new and on the surplus market.  The original
Apple counted on you being able to buy such a thing.  Nowadays,
it seems either everyone uses an IBM compatible keyboard, or some
other similar type that puts out a non-standard code.

I don't think someone will find much success in rewiring an IBM keyboard,
because it seems like a lot of them use capacitance switches that require
proper interface.  If they were actually micro-switch type keys, one
could cut traces on the board and wire the keys into a matrix that would
match an ASCII encoder.  This is still doable, if one could find a source
of unencoded keyboards that actually used old-style switches.  You used
to be able to buy ASCII encoder ICs, but if those are hard to find,
one could make such an encoder with common TTL or CMOS logic ICs;  Don
Lancaster shows some in his "TV Typewriter Cookbook" and his "CMOS
Cookbook".

Ironically, the simplest solution is to use another computer.  Youcan find
all kinds of all in one units, like Commodore 64s and Radio Shack
Color Computers that have a keyboard and BASIC in ROM.  You'd need
a parallel output port, ie a parallel printer port, and then just
write a line of code that takes from the keyboard and outputs the 
character to the printer port.  Connect that to where the keyboard
connects on an Apple II, and you've got your ASCII keyboard, albeit
bulky.

     Michael