On 7/30/07, Alexandre Souza <alexandre-listas at e-secure.com.br> wrote:
Has anybody
come up with a easy to implement solution for connecting an
ASCII keyboard... to a modern
computer system? I'm just beginning to try to wrap my head around this
problem, and it seems... non-trivial...
The goal would be a USB-compliant HID device that would allow a //e
keyboard to be used on a modern computer.
If you are looking for a PS/2 unit, it is fairly easy to do something
using an Atmel microcontroller and BASCOM basic compiler. USB will be a lot
harder...
USB isn't a lot harder, unless you are stuck with compiled BASIC. I
agree with an earlier poster (Zane?) - take a $4 AVR, like an
ATMEGA-8, then slap a software USB stack on it, along with enough
local smarts to scan a matrix or handshake in an ASCII byte, then top
it off by fiddling the USB stack to emit HID-compatible packets -
voila, a keyboard.
I've done something _similar_ to this with the usb2lcd interface by
Till Harbaum to connect an HD44780-type LCD panel to "modern" machines
(MacBook Pro running MacOS 10.4, various Intel boxes/laptops running
RedHat Linux, _and_ an XP box). At the core of it is a $4 controller
running at 12MHz, doing the USB protocol in software. The only hitch
I've found so far is that with the MacBook, it seems that I need these
"optional" 3.6V zeners to "cool off" the USB interface which is
spec'ed at 3.3V (I am running it through a USB hub at the moment,
which regenerates inputs to a proper voltage level for the laptop).
Since it's a keyboard the OP is after, one can also do what another
earlier poster did - scavenge a USB keyboard PCB, map the grid, then
wire a keyboard to the grid. I did that with a keyboard last year -
the original fault was a bad cable (broken insulation in the green
wire). I clipped off a few inches of the cable, resoldered it, then
wired the PCB to a 2"x3" protoboard so I could choose which parts of
the matrix to tap off. The final step was to mount the PCB and
protoboard inside an old short-haul modem clamshell case, then stick 5
pushbuttons on the top of the case and wire them to Z, X, C, V, and B
- I now have a fits-in-your-pocket xmms remote keyboard. The only
problem I've had so far was when I plugged it into this MacBook - 10.4
didn't like the controller I re-used, and popped up a requester to hit
the key to the right of the shift. Fortunately, I had already
_mapped_ the "Z" key to my row of pushbuttons and just last night was
running xmms and using the small box to start and stop and forward
through my playlist. (I built this for roadtrips to avoid having to
reach for the keyboard while driving).
So... if it looks too hard to re-jigger an Apple IIe keyboard matrix,
an ATMEGA-8 at 12MHz w/freeware software USB stack is an easy way to
go.
-ethan