ADDS ASCII in ADDS Mode

MMcM

26 Dec 2021, 22:49

ADDS ASCII keyboards have four sets of jumpers that switch between PC/AT and ADDS mode. I believe most people just check these, replace with PC mode when necessary, and use the board with Soarer's converter, end of story. But what if one doesn't replace them or does so in the opposite direction?

I imagine ADDS mode was used by some earlier keyboard as the only mode. I do not have access to one of those, but it might be worth understanding the protocol for anyone who does.

Rather than just replacing the jumpers, I wanted something somewhat switchable. There isn't room on the board for proper DIP switches. And it's too tight vertically for header-style jumpers, especially underneath the right-angle cable connector. So I went with some Dupont style jumpers.
ADDS-ASCII-jumpers.jpg
ADDS-ASCII-jumpers.jpg (454.86 KiB) Viewed 8440 times
The wiki explains the pinout of J1 and the 6P6C RJ plug on the cable for PC/AT mode:
  1. 5: Vcc
  2. 4: ground
  3. 1: clock
  4. 6: PE
  5. 2: data
  6. 3: reset
The board contains:
  • U1 8749, the microcontroller
  • U2 7417, an open collector buffer
  • U3 74123, a one-shot
  • Q1-Q3 2N3904 transistors
In addition to the power connections, some important ones are:
  • PC data to U2:4A and :5Y, the two open collector directions.
  • PC reset to U2:6A.
The jumpers work as follows:
  • JA1/JP1: connects U1:INT to one of U2:2Y (JP1) or U2:3Y (JA1), that is, selects input to the microcontroller.
  • JA2/JP1: connects U1:P27 to one of U2:1A (JP2) or R17 associated with Q3 (JA2), that is, selects output from the microcontroller, with the transistor circuit copying the original board I'd guess.
  • JA3: grounds U2:5A, thereby constantly holding the PC data line low, and U1:P26, to give the microcontroller a mode sense line.
  • JP3: connects U1:RESET to U2:6Y, completing the reset circuit in PC mode.
  • JA4/JP4: connects the PC clock line to one of:
    • JP4: U2:1Y and U2:2A, that is, the input to INT and the output from P27,
    • JA4: R25 and U2:3A, along with the Q3 transistor, the corresponding ADDS inputs.
Summing up, ADDS mode has a single bidirectional signal on what is the PC/AT clock line. From here on, I'll call that the signal line, to try to avoid confusion while assuming ADDS mode. Power and ground are the same and the extra lines don't hurt anything, so there is no reason not to use the same converter as would work with Soarer's were the jumpers the other way. (Unless the UART proved to be useful, which it does not.)
ADDS-ASCII-converter.jpg
ADDS-ASCII-converter.jpg (695.16 KiB) Viewed 8440 times
There are pull-ups inside the keyboard, so the idle state of the signal line is high, but either end can pull it down at any time.

Doing nothing else, a key press results in the keyboard pulling down for 62.5ms (a long time), repeating every 1.25s while anything is held. It does not matter which key. I suppose that this is some kind of wake-up from low-power mode in the terminal.

To get a meaningful signal, the terminal needs to request it. I found that a 100us low pulse every 5ms does the trick. There seems to be some flexibility in the timing and I don't know what the real terminal does.

300us after the rising edge, if the keyboard has data, it sends eight bits, MSB first, encoded as pulses of different width: long 142us for 1, short 28us for 0. The reason I know the polarity and endianness is that the scan codes for printing characters are their unshifted ASCII. So, 41 for A. And, to be clear, this code does not change when SHIFT or CTRL is pressed.

Only four keys send break codes, above the range of regular scan codes, but otherwise unrelated to their make code. In addition to the obvious SHIFT (left and right are indistinguishable) and CTRL, there are ESC and DEL. I'm not sure why.

This is enough to code up a converter, although it's less flexible than PC/AT mode, so not very useful. Given the location of the INS key and that DEL sends key up, but FUNCT does not, I'd be tempted to swap those keycaps if using this keyboard for any length of time, thereby getting an ALT or CMD shift with a somewhat sensible legend.

The only thing still to be figured out is how to control the LOCK LED. I found that sending a 200us square wave causes it to flash briefly every few seconds. Various other frequencies do not do this. Given how output works, it might be that the secret is a shorter sequence of long and short pulses. But I haven't arrived at it yet.

User avatar
snacksthecat
✶✶✶✶

01 Jan 2022, 23:43

Very interesting and clever project. I'd describe most of my keyboard projects as brute force trying **things**, seeing an led blink, and trying to figure out what I just did. Somehow I've never fried a board yet. Anyway, my point is I'm glad to see a pro like yourself sometimes finds himself in a similar boat. No doubt you'll figure out that darn lock light in no time :)

Post Reply

Return to “Workshop”