hsStowawayKB

(First request from a visitor!)

The HandSpring Visor series PDAs had a foldable-keyboard (made by Targus, called "Stowaway") that could fit in a (large) shirt-pocket. Cool! This interprets the scan-codes into ASCII characters, and makes use of the "special" keys for my own purposes.

I don't know whether Stowaway keyboards designed for other PDAs used the same scan-codes, and I'm certain different PDAs had entirely different pinouts... but this might be a good starting-point.

The files test1.c and test2.c haven't been revisited in quite some time. It's entirely likely they won't work with your system... As I recall, they were used to determine the scan-codes sent by the keyboard. The keyboard was connected to the computer's serial-port via an RS-232 to 3.3V TTL level-shifter.

Some snippets from the code (see a link to the file, below):

// The Handspring Visor Deluxe's Cradle Pinout:

// (LCD facing us, i.e. the same as the keyboard's pinout)

//

// (hsTx)

// 2.7V,3mA GND kbTx

// | | |

// v v v

// 8 7 6 5 4 3 2 1

// | | | | | | | |

// -..--------------------------..-

// | keys... |

// . .

// | <SpaceBar> |

// -..--------------------------..-

// Just guessing, based on readable data,

// it appears to be running at 9600bps

// The Handspring Visor Deluxe can supply up to 3mA via the Tx pin

// this is designed specifically for keyboards, etc. Cool.

// It's rated at 2.7V, so in my 3.6V (3.3V?) system, I just throw a diode

// (1N914) inbetween 3.3V and Pin 8, to drop .6V or so... seems to work

// (Possibly unnecessary)

// Key Mapping determined by hand...

// It apears that each key-down is < 0x80, and key-up is the same | 0x80

// Also, it appears that each key-up is sent twice

// This takes the raw value received by the keyboard

// and returns the appropriate character (or 0 if not-mapped)

// Also handles Shift and Caps-Lock

// NOTE: CapsLock is always activated when pressed

// To DEactivate, hold Shift then press CapsLock

// (since there's no indicator)

// ALSO: Shift doesn't override caps-lock

// (if it's on, it's all caps, regardless of Shift)

The Capslock situation needs revision... In most cases I never needed to use it, and when I did, I'd forget to Shift-Caps to remove it. The particular project this was used in did *not* have a display, so it became particularly-annoying when CapsLock was *accidentally* pressed. Better would be to Shift-Caps to *enable* caps-lock, then a second-press would disable it. This is NYI.

Also, many keys are *not* handled, as this was implemented via RS-232, how does one send e.g. "CTRL"? Usually the computer handles these keypresses, not the keyboard itself.

This particular bit of code has only been used for one of my projects, so far. Yes, the file-extension is '.h', but it should probably be a '.c'. See _commonCode for an explanation of why I tend to go this route in early-design-stages on the AVR...

FILES:

hsStowawayKB.h

test1.c

test2.c