PDA

View Full Version : Superbrain KR3600 adapter boards



JonB
May 15th, 2017, 02:40 AM
Hi

During my Superbrain repair odyssey, I discovered that my keyboard encoder chip had died. This is an SMC KR3600 and it contains a small ROM that maps key presses to ASCII. The ROM content was specified by Intertec according to the physical key layout, and this means finding a replacement part is very unlikely.

Luckily there is a standard part called a KR3600 PRO (AY-5-3600 PRO is an acceptable substitute) which can still be acquired, and this has a fixed map that returns a code for each key. To use this in a machine like a Superbrain, one simply connects a ROM chip to its output, using the encoder's output code as an address, with the ROM providing the mapping between the key code sent by the KR3600-PRO and what the host system expects (in the case of the Superbrain, ASCII). This is per the datasheet application note.

To patch the ROM into the Superbrain's circuit we have a schematic that looks like this:

38587

This gives us a small carrier board with the fetching JonB Retro logo (LOL):

38586

I chose a 2816 EEPROM as I have a spare and (with the on-board jumpers) we can select one of four possible keyboard maps (providing the ROM is programmed appropriately), which may - or may not - be useful.. maybe for alternative layouts like French AZERTY, etc.

The carrier board is programmed by JP1 and JP2 - set these to the desired keyboard map (one of 4, in binary with JP1 as the LSB). The encoder has a further selectable feature - N-key rollover or lockout - and you can choose which you prefer with JP3. Leave open for rollover, close for lockout.

The keyboard encoder chip is on the same row as the Superbrain's boot ROM and this means that vertical space is going to be limited with the Superbrain's top case in situ. However, to the right of the encoder socket is a "spare" IC socket, unpopulated and unconnected to the rest of the main board. This will give enough space for the carrier board to be mounted close to the main PCB and overhang to the right of the encoder. There are a couple of capacitors which may need to be relocated to the underside of the board, or folded flat.

Regards
JonB

PS, it may be possible to use a KR-3600 (not a PRO) without a ROM or carrier board. To do this you would need to:-


Check the Superbrain's boot ROM to see if it needs a specific key press to boot as mine does (it's the ACT HDD ROM that prints a message "Press F to boot from floppy, any other key to boot from hard disk", then polls the keyboard encoder for a key, jumping to the floppy boot routine if the key is "F", otherwise jumps to the hard disk boot routine). Alter the "F" comparison in the ROM to the new code returned by the F key, and..
..update the CP/M BIOS conin function to apply a mapping (between whatever the keyboard encoder chip returns and ASCII). This will, of course, increase the BIOS size (by something like 265 bytes, as the encoder chip is returning 8 bits rather than 7 for true ASCII).



[Edited to update the schematic and board render]

JonB
May 16th, 2017, 06:05 AM
The EEPROM does need to be programmed. Here is a binary file and the short program that creates it. The .bin file contains only one map (00) and this should be the standard US layout on the Intertec Type B keyboard shown in the Superbrain manual. The only keys that I am unsure about are the arrows on the numeric pad and "HERE NOW", so for now the arrows are set as H, L, K, J respectively and HERE NOW is set a hash character (#).

38588

JonB
May 31st, 2017, 12:18 AM
With help from stephenm, I have the codes for the special keys. Also, corrected a few errors in the control codes - they are all supported now.

38880

(If you want to run the program yourself, you need Linux with gcc++ installed. To build the program, use the command make kbdmap, and to run it use kbdmap > kbdmap.bin.)

JonB
May 31st, 2017, 08:36 AM
v3.0 of the keyboard map. This one works properly - due to the KR3600-PRO having its output lines back to front and me not spotting it, the carrier card has the ROM address lines reversed. To fix this, I had to reverse the address of the location of every character code in the ROM. This release also corrects some out of sequence control characters and adds new ones that I'd missed out.

The full list is:


Oct Dec Hex Char Ctrl-Char
────────────────────────────────────────────────── ─-───
000 0 00 NUL '\0' (null character) Ctrl-@
001 1 01 SOH (start of heading) Ctrl-A
002 2 02 STX (start of text) Ctrl-B
003 3 03 ETX (end of text) Ctrl-C
004 4 04 EOT (end of transmission) Ctrl-D
005 5 05 ENQ (enquiry) Ctrl-E
006 6 06 ACK (acknowledge) Ctrl-F
007 7 07 BEL '\a' (bell) Ctrl-G
010 8 08 BS '\b' (backspace) Ctrl-H
011 9 09 HT '\t' (horizontal tab) Ctrl-I
012 10 0A LF '\n' (new line) Ctrl-J
013 11 0B VT '\v' (vertical tab) Ctrl-K
014 12 0C FF '\f' (form feed) Ctrl-L
015 13 0D CR '\r' (carriage ret) Ctrl-M
016 14 0E SO (shift out) Ctrl-N
017 15 0F SI (shift in) Ctrl-O
020 16 10 DLE (data link escape) Ctrl-P
021 17 11 DC1 (device control 1) Ctrl-Q
022 18 12 DC2 (device control 2) Ctrl-R
023 19 13 DC3 (device control 3) Ctrl-S
024 20 14 DC4 (device control 4) Ctrl-T
025 21 15 NAK (negative ack.) Ctrl-U
026 22 16 SYN (synchronous idle) Ctrl-V
027 23 17 ETB (end of trans. blk) Ctrl-W
030 24 18 CAN (cancel) Ctrl-X
031 25 19 EM (end of medium) Ctrl-Y
032 26 1A SUB (substitute) Ctrl-Z
033 27 1B ESC (escape) Ctrl-[
034 28 1C FS (file separator) Ctrl-\
035 29 1D GS (group separator) Ctrl-]
036 30 1E RS (record separator) Ctrl-^
037 31 1F US (unit separator) Ctrl-_



The DEL key generates ASCII DEL - 128 - but I'm not sure if that is correct. It presents on screen as ^? and the BACK SPACE key acts as the delete (rubout) key.
Here's the file.

38902

I have tested it with the carrier board on my Superbrain and so far, all good.