All the chips have 84 datestamps, so I assume it was made around 1985. There is no OEM branding that I can spot. It shows no sign of ever having been used and came in its original(?) foam-lined box.
It appears that CHM has a very similar one. Theirs came with a spec sheet, but it went into their archives and hasn't been scanned yet, so that doesn't help.
There's clearly a 5V regulator on the left there, so it takes 12V (or did originally; since it just regulates it down to 5V, anything around 8-15V should work). So care was required to get the signals right before applying that higher voltage power.
The controller is an 8049 and it connects to the terminal with an RJ12. After a bit of tracing,
- switch 20 (Reset)
- -INT, so an input to keyboard
- P27, so an output from keyboard
- ground
- DC in
- chassis
It came with those red wires already and they turn out to be connected to the signals that really matter: power and data out. This made it easy to connect to a scope and bang on the keys.
Signal looks like TTL serial at around 10kHz. And the scope's decoder works when set to 9600 baud. Two bytes are transmitted for each normal key press. The first is a shift mask and the second is ASCII, with any shifts already applied. Nothing when just pressing the shift keys and nothing for key up.
At this point, the possibilities for what a USB controller can do are a bit limited. So I put the board aside for a while.
Recently there was discussion about what can be done for a USB keyboard without both make and break signals and with character conversion done by the keyboard. So I gave it a shot and the result is here.
A Teensy is usually preferable over Pro Micro for the same processor, because:
- the bootloader is smaller
- it has a reset button to put it into the bootloader when developing
- there are more GPIO pins and they are somewhat more rationally laid out
And in favor of the Pro Micro:
- cheaper
- two ground pins next to the UART pins
Mapping out the keys reveals a couple of additional pecularities.
- The firmware is evidently confused about bracket keys, thinking that there are [ ] and { } keys: unshifted opens and shifted closes. Even though the key caps are normal. This isn't a big deal, except that it means that it was apparently impossible to type GS on this keyboard. Both keys send ESC with Ctrl.
- Most, but not all, of the function keys have different shifted codes. I could not figure what determines whether or not this is the case. None of these key codes are standard and the shift mask is also sent, so I am not sure why one would bother. Or, conversely, why one would not make all such keys distinguishable.
The disassembled result is here.
Looking at the matrix scanning and key mapping routines and data shows the above mentioned strangeness about brackets.
Elsewhere it seems to show support for five commands.
Code: Select all
050E NEXTBITIN:
050E : 97 " " clr c
050F : 86 14 " " jni L0514
0511 : A7 " " cpl c
0512 : A4 17 " " jmp L0517
;
0514 L0514:
0514 : 00 " " nop
0515 : 00 " " nop
0516 : 00 " " nop
0517 L0517:
0517 : 67 "g" rrc a
0518 : 00 " " nop
0519 : BD 0D " " mov r5,#00DH
051B L051B:
051B : ED 1B " " djnz r5,L051B
051D : 00 " " nop
051E : EB 0E " " djnz r3,NEXTBITIN
0520 : 76 61 "va" jf1 CMDARG
0522 : AF " " mov r7,a
0523 : D3 05 " " xrl a,#005H
0525 : C6 5B " [" jz CMDIN5
0527 : FF " " mov a,r7
0528 : D3 01 " " xrl a,#001H
052A : C6 3F " ?" jz CMDIN1
052C : FF " " mov a,r7
052D : D3 02 " " xrl a,#002H
052F : C6 43 " C" jz CMDIN2
0531 : FF " " mov a,r7
0532 : D3 03 " " xrl a,#003H
0534 : C6 49 " I" jz CMDIN3
0536 : FF " " mov a,r7
0537 : 53 8F "S " anl a,#08FH
0539 : D3 04 " " xrl a,#004H
053B : C6 4F " O" jz CMDINX4
053D : A4 63 " c" jmp RETCMD
;
053F CMDIN1:
053F : B4 69 " i" call RESETAUDIOCOUNTER
0541 : A4 63 " c" jmp RETCMD
;
0543 CMDIN2:
0543 : B9 5E " ^" mov r1,#05EH
0545 : B1 00 " " mov @r1,#000H
0547 : A4 63 " c" jmp RETCMD
;
0549 CMDIN3:
0549 : B9 5E " ^" mov r1,#05EH
054B : B1 01 " " mov @r1,#001H
054D : A4 63 " c" jmp RETCMD
;
054F CMDINX4:
054F : 0A " " in a,p2
0550 : 53 F8 "S " anl a,#0F8H
0552 : A8 " " mov r0,a
0553 : FF " " mov a,r7
0554 : 53 70 "Sp" anl a,#070H
0556 : 47 "G" swap a
0557 : 48 "H" orl a,r0
0558 : 3A ":" outl p2,a
0559 : A4 63 " c" jmp RETCMD
;
055B CMDIN5:
055B : A5 " " clr f1
055C : B5 " " cpl f1
055D : B8 60 " `" mov r0,#060H
055F : A4 63 " c" jmp RETCMD
;
0561 CMDARG:
0561 : A0 " " mov @r0,a
0562 : 18 " " inc r0
0563 RETCMD:
0563 : B9 2A " *" mov r1,#02AH
0565 : B1 01 " " mov @r1,#001H
0567 : FA " " mov a,r2
0568 : 93 " " retr
;
0569 RESETAUDIOCOUNTER:
0569 : B9 27 " '" mov r1,#027H
056B : B1 19 " " mov @r1,#019H
056D : B9 28 " (" mov r1,#028H
056F : B1 00 " " mov @r1,#000H
0571 : 9A BF " " anl p2,#0BFH
0573 : 8A 40 " @" orl p2,#040H
0575 : 83 " " ret
- beep
- turn off key click
- turn on key click
- set low three bits of P2
- upload key bitmap
Commands of the form 0b0xxx0100 take those three bits and output them on port 2. This seems pretty clearly intended to drive three LEDs. But this keyboard does not have any LEDs. In fact, the PCB does not even have room for them. Even the traces around those pins (top-left of the large chip in the center of the photo above) don't look to have enough room. Perhaps this same firmware was also used with some entirely different PCB?
I was not able to get these commands to work in a few attempts, even adjusting for potential confusion between bit on because interupt set and bit on because signal high. But it is clear that none of them really help make it more than minimally usable as a USB keyboard for a modern system.