Remapping the HP150 keyboard

Tony Duell ard at p850ug1.demon.co.uk
Mon Apr 13 13:50:02 CDT 2009


For Rik and anyone else who's still folling the saga of the HP120 
keyboard, I've now hacked an HP150 keyboard to make it HP120-compatible. 
Here are some details...

As we all know by now, the HP150 keyboard has the right interface to 
plug into an HP120, it's just that the keys are sent in the wrong order. 
The scanning is done by a 4024 7 bit counter inside the keyboard, my idea 
was to replace with with a circuit that was essentially a counter with a 
non-standard count sequence to select the keys in the order needed by the 
HP120. And the obvious way of doing that is simply a 7 bit counter 
followed by a ROM acting as a lookup table to do the code conversion.

Of course it's not quite as simple as that (things never are!). The main 
problem is that HP120 keyboard runs at 12V internally (it's all 
4000-series CMOS logic chips). And most common EPROMs run at 5V.

I ended up with a board containing 5 chips and a 7805 voltage regulator. 
This links by a short length of ribbon cable and a 14 pin DIL header to a 
socket which I fitted in place of the scan counter chip (a 4024 at 
location M2) on the HP150 keyboard PCB. All the new chips run off the 5V 
output of that 7805. Here's a brief circuit description :  

2 sections of a 4050 hex buffer takes the clock and reset signals from the
HP150 keyboard PCB (these are the signals that would have controlled that
4024). It doesn't seem to be generally known (but it's in all the data
sheets I've looked at) that the 4050 (and its inverting brother the 4049)
can take inputs up to 15V even when run off a lower supply voltage. They
are intended for level-shifting from CMOS voltages to TTL. And unlike the
older 4009 and 4010 (which they replace) they only need the 5V power line,
not a second power line corresponding to the input voltage. 

The outputs of that buffer go to a 4024 7 bit counter in the obvious way. 
The outputs of that go to the bottom 7 address lines (A0...A6) of a 27C64 
EPROM. A7 goes to a switch and pull-up resistor so I can select between 2 
key mappings (HP120 and HP150 mode). The remaining address lines, CE/ and 
OE/ are all grounded. Why use such a large EPROM? It was the first CMOS 
one I found in the junk box :-).

The outputs of the EPROM are, of course at TTL levels, and need to be 
level-shifted back to 12V to drive the CMOS logic in the keyboard. I used 
7 sections of 74LS07 (so 2 packages total) with 3k3 pull-up resistors to 
+12V 

The EPROM cotnains 2 128-byte tables. The first one (locations 00-7f) 
gives the remapping for the HP120 mode. The second one (locations 80-ff) 
cotnains the values 00-7f in order, thus keeping the keys in the original 
sequence for the HP150 mode.

Anyway, I soldered it up. I worked out the correct data for the first 
half of the EPROM, I programmed the EPROM. And I tried it out.

Most of the keys worked correctly, but some, including f8 did nothing. 
While fiddling around, I found f8 _sometimes_ worked. Oh great, I've got 
an intermittant fault.

So I grabbed the LogicDart. While looking at the scan drive signals (the 
outputs of the 74ls07s), I noticed some glitches on some of them, 
doubtless due to the fact that the 4024 is a fairly slow ripple counter. 
Thinking that was the problem, I decied that maybe a 74HCT4024 would 
help. Alas my junk box doesn't contain much in the way of HCT chips, but 
I did find a 74HCT4040 which is a 12 bit ripple counter of a totally 
different pinout. 

One header plug, One DIL socket, and lots of wire later and I'd kludged 
up an adapter. Plugged it in. No change. Glitches still there, f8 works 
intermittantly. I did discover (by comparison with the HP262x keybaord 
I'd already got working) that the effects of some keys are not noticeable 
in 'Local' mode unless you turn 'Display Functions' on (this displays 
control codes on the screen rather than executing them). I did this and 
found that essentially only 2 keys on the HP150 keybaord were dodgy. Hmmm

Finally I put the LogicDart on the signal I should have looked at in the 
first place -- namely the data line back to the HP120. And I found that 
when the key didn't work, there was nothing on that line. No glitches, 
just nothing. 

The output of the scan decoder (4028) in the HP150 keyboard was hehaving 
correctly, as far as I could tell, all the time. The input to the row 
multiplexer (4051) wasn't. Between them, of coruse, are the key switches 
and their diodes.]

And yes, you guessed it. The dodgy keys had dodgy keyswitches. All my 
hackery was working find. Dismantling the keyboard assembly (lots of 
little screws), a squirt of contact cleaner, and it seems OK now.

All I have to do is box it up. The new board will have to go in a plastic 
box screwed to the top of the keyboard. But I want to get things just 
right before I start drilling holes.

-tony





More information about the cctalk mailing list