Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!elroy!mahendo!wlbr!hacgate!tcville!sed170!lee From: lee@sed170.HAC.COM (jhlee@hac2arpa.hac.com) Newsgroups: comp.sys.amiga Subject: A2000/B2000 Transformer Keyboard Fix (Part 1 of 2) Summary: Early keyboards follow specs too closely Keywords: A2000, B2000, Transformer, Keyboard Message-ID: <265@sed170.HAC.COM> Date: 14 Dec 88 03:24:08 GMT Reply-To: lee@sed170.UUCP (John Lee) Organization: Hughes Aircraft Co., El Segundo, CA. Lines: 117 The Problem --- ------- After I purchased my B2000, I tried to run the Amiga Transformer (I know, I know. Why? :-) and promptly found my keyboard locked up, as did many other people on the net. The general conclusion was that Transformer assumed a great deal and that minor differences between the A1000 and A/B2000 caused it to lock up. (From now on I'll call the Amiga 2000 an A2000 regardless of whether it's actually an A2000 or B2000. It gets confusing, you know.) The Discovery --- --------- That never sat well with me since Transformer ran fine on other people's A2000's. I suspected the keyboard, since I have a narrow function key caps (but 2 Amiga keys, no C= key) keyboard and the A2000 in the store on which Transformer ran fine had the newer wide function key keyboard. However, I didn't confirm my suspicion until my roommate purchased a new A2000 with the wide keycaps. I decided to try his keyboard on my A2000 and Surprise! Transformer didn't lock up my keyboard. After a poking around with an oscilloscope, I discovered the problem: Transformer was sending too short a handshake pulse back to the keyboard. For details about the keyboard, see appendix H in the A&W Amiga Hardware Reference Manual. The specs say that the handshake pulse must be at least 75 microseconds long. I found that Transformer sends a 40 microsecond pulse for regular keys and only a 20(!) microsecond pulse for the left & right Amiga keys. For comparison, AmigaDos sends a 200+ microsecond pulse. The newer keyboards are more tolerant than the keyboard model I have, I guess. The Solution --- -------- The proper solution is to patch Transformer to send the proper handshake pulse. However, since I don't have the source nor do I feel like disassembling it, I came up with a hardware fix for the keyboard. A bonus is that other programs that have the same problem should be fixed by this as well. Only owners of A/B2000 keyboards with narrow function keys and can't run Transformer should implement this fix. It won't interfere with normal operation of the keyboard. Only programs that sent too short a handshake pulse will have their pulses stretched for them. ****************************** WARNING *********************************** Do this ONLY if you feel confident enough to open your keyboard (thus voiding any warrantee you might still have), construct the circuit, and solder to your keyboard. As always, you do this at your own risk. ************************************************************************** The Circuit --- ------- The schematic is posted separately as an uuencoded DPaint picture file. Basically, circuit stretches the handshake pulse on the keyboard data line (KDAT) from the computer without touching the data pulses from the keyboard. A 74LS74 flip-flop is used as an negative-going edge- detector to trigger a 555 timer to force KDAT low via a 74LS03 quad open- collector NAND gate for at least 150 microseconds. However, keyboard data must not be stretched so a negative pulse on the keyboard clock line (KCLK) resets the 555. Any negative pulse generated by the keyboard is accompanied by a pulse on KCLK centered in the KDAT pulse while a pulse generated by the computer is not accompanied by a KCLK pulse. Thus, only the handshake pulse form the computer is stretched. This circuit is made simple by both KDAT and KCLK being open-collector driven lines so I cam simply "wire-or" the 555 onto KDAT. NOTES: 1. It's okay to substitute equivalent packages if for some reason you can't get the ones I chose. Be sure to use LS parts only, and *do not* substitute a 74xx00 or any other quad positive NAND package that's not open-collector like the 74xx03. The circuit draws 10 mA or less, so there should be no problem powering it from the keyboard's power. 2. Don't try to use a negative-edge triggered FF like a 74LS76 instead of the 74LS74 with an inverter on the clock input. KDAT has some overshoot on it and the downward edge on the overshoot is enough to trigger the 74LS76 incorrectly (I know--I tried it.) The inverter acts as a buffer for the 74LS74 and cleans up the KDAT signal. 3. Be sure to properly terminate unused inputs to ground or +5 as appropriate, such as those of the unused half of the 74LS74 (not shown on schematics) and those of the unused quarter of the 74LS03 (that does appear). Otherwise they'll act as antennae and cause gates to flip randomly. The /PRE and /CLR inputs go to +5, and the CLK and D inputs of the 74LS74 go to ground. 4. Use power bypass capacitors as close to the power pins of IC's as possible. I used two 0.1uf caps, one each for the 555 and 74LS74. 5. Keep leads from the board as short as possible. Besides being nice to neighbors and not spraying EM radiation all over their TV's, you don't want any extra parasitic capacitance on the lines. I wired the circuit up on a piece of perfboard, opened up my keyboard and soldered it to the connecter on the underside (PC trace side) of the keyboard. My keyboard has a six pin in-line connector with pin 3 cut off. The pins are as follows: Pin Function 1 (left-most) Ground 2 +5 from computer 3 (None, keyed pin) 4 Ground 5 KCLK 6 (right-most) KDAT Make sure your keyboard is the same. If not, you'll have to use an oscilloscope and multimeter to figure it out. I mounted the board with some double sided foam on the underside of the PC board where there was plenty of space. Epilogue -------- The circuits works fine for me and for the first time since I bought my B2000 I can run Transformer (please, no flames for wanting to. :-). As I said before, it draws only about 10mA and won't interfere with any program that works within the keyboard specs while fixing programs that don't. Enjoy! ------------------------------------------------------------------------------- Raining CATS and DOGS? Join the RATS: Remote Amiga Teleconferencing System +--------+ John Lee | HUGHES | +--------+ ARPAnet: jhlee@hac2arpa.hac.com Hughes Aircraft Company The above opinions are those of the user and not of those of this machine.