apple ii notes - osiweb/unified_retro_keyboard GitHub Wiki

Building up an Apple II replacement keyboard

This document walks through the keyboard assembly process for the classic keyboard in Apple II configuration, using Cherry MX keys.

Gather the parts

If you got the kit from ReActiveMicro, then your kit will include:

  • A Keyboard PCB

  • an aligner PCB

  • an encoder PCB

  • a bag of components and connectors

  • a bag of #4 hardware to mount the aligner and encoder to the PCB

  • a bag of #6 hardware to mount the keyboard to an Apple II case.

  • a bag of Gateron Black key switches

  • a bag of custom keycaps

Building the Keyboard

Prepare the keyboard PCB

A few parts must be added to the PCB before attaching the aligner, because these parts will be difficult or impossible to add once the keyboard is assembled. Note: the keyboard is designed to accommodate SMT diodes and resistors. If you got your kit from me or from ReActiveMicro, the SMT components are already installed:

  1. Solder the 40-pin header to the back side of the PCB. The connector should be opposite the silk-screen side, as illustrated. The connector will be on the same size as the surface mount resistor as shown in the photos, and the pins will be soldered on the oppsosite side (the front side). Ignore the screws adjacent to the connector in the second photo. They are installed later.

  2. Install the spacebar stabilizer hardware on the PCB. Make sure the metal stabilizer rod is properly installed. Both of the stabilizers should move freely, and should move together. (If you have the ReActiveMicro kit, the stabilizer hardware is included with the spacebar in the keycap set.)

  3. Install the two encoder standoffs as shown: The nuts will be on the front of the keyboard (the silk screen side). No locknuts are necessary here. The following photos show the installed standoffs and 40-pin header. (Ignore the extra screws sticking up through the PCB. This photo is actually a slightly later stage of assembly.)

Assemble the keyboard+aligner frame

The keyboard aligner not only ensures that the keys are properly aligned--it also forms a torsion box with the PCB to add stiffness to the completed assembly. Be sure not to leave out the lockwashers, as they help to stabilize the torsion-box structure, along with the soldered-in keyswitches.

  1. Install the 7/16 machine screws, with a lockwasher for each screw, in the aligner. There will be five screws along the top and four along the bottom of the aligner, as shown. Once installed, secure the screws using masking tape or painters tape.

  2. Secure the screws to the aligner with painters tape or masking tape. Then, turn over the aligner, and slip a 1/8" plastic spacer over each screw.

  3. Fit the upside-down PCB over the screws to complete the aligner-spacer-PCB sandwich.

  4. Secure the screws by installing lockwashers and hex nuts on the back of the PCB. Lightly finger-tighten the nuts just enough to stabilize the assembly, while allowing adjustment of the alignment if needed when installing switches in the next step.

Install the switches
  1. The Apple II layout has 53 keys. The classic keyboard can accommodate a larger layout and therefore has more keys than used by the Apple II configuration. If you need the Apple II layout in order to mount the keyboard in an Apple II case, then you will want to avoid placing keys outside the Apple II layout (and then having to desolder them). Therefore, I suggest first installing "boundary" keys for each row. Populate the following:
  • The second key in the top row.

  • The first key in each of the second, third, and fourth rows

  • The third-to-last key in each row (the last two keys in each row will be unpopulated)

  1. It may be necessary to slightly adjust the alignment of the main PCB and aligner to ensure the keys snap in place smoothly. Once these keys have been installed, tighten the hext nuts with sufficient torque to flatten and fully engage the lockwashers.

  2. Install the rest of the keys, filling in the rows between the "boundary" keys.

Notes:

  • I like to solder the switches in one row at a time. That way, it's harder to miss a lead than if all the switches are installed before soldering.
  • The switch leads are thin and fragile. Make sure the leads are straight before installing each switch.
  • Before soldering a row of switches inspect the PCB visually and by feel to make sure both leads made it through the PCB for each switch. If one key is bent (like the pic below) then you will have an opportunity to straighten it out.

Install the LED

Install the LED on the POWER switch. There is a slot along the bottom of the switch that provides access to the LED pads on the PCB. The long lead is the anode (the + side), and should be on the LEFT side as you face the keyboard.

An amber LED is included in the components kit, but feel free to choose any color you prefer.

If you plan on populating the full classic layout, you may also want to install an LED at the position marked "caps lock" on the PCB

Install the keycaps

As you can see, the classic keycap set includes additional keycaps beyond the Apple 2 keycap set, in case you should choose to populate the full classic layout. There are a few keycaps beyond the standard classic layout, to permit some flexibility in the layout, according to taste. Note that if you alter the layout, you may wish to make some changes to the keymaps in the firmware.

Building the Encoder

Install the SMT crystal (optional)

You may optionally install a 16 MHz crystal. By default the microcontroller uses the internal 8 MHz clock, even if you do install the 16 MHz crystal. If you wish to enable the crystal, you will have to set the appropriate fuses, and you also may wish to adjust the firmware key-repeat rate. The current firmware runs just fine without the crystal.

Install the parallel out connector

The parallel out connector interfaces with the host computer. If you plan to use the keyboard with an Apple 1, Mimeo 1, or similar clone, then install the 16-pin socket in the Apple 1 location. If you plan to use the keyboard with an Apple II/II+ or a Replica 1, then use the Apple 2 connector. Of course, you can install sockets in both connectors if you want to use the keyboard with either type of machine.

Note: For the computer interface, I recomment using a dual-wipe socket, and not a machine-pin socket. Machine-pin sockets grip the pins more tightly and are more likely to bend pins on the ribbon cable as you remove and re-insert the cable connectors.

install the programming, output, and config headers
  1. Install the 6-pin right-angle ICSP (In circuit serial programming) header in the space labeled "ISP" on header J6. If you plan to use JTAG for debugging or programming, then you can use a 14-pin header to cover the entire J6 footprint.

  2. Install the 5-pin control/output header at J4.

  3. Install the 16-pin configuration header at SW1. If you desire, you can install a DIP switch at SW1 instead. The DIP switch is a tidy option. However, I have gravitated toward the header because DIP switches have different numbering from the PCB silk-screen, which can be confusing, and it's sometimes hard to tell which position is open and which is closed. Also, many DIP switches are hard to access without removing the encoder from the keyboard. Headers and jumpers are unambiguous, and easy to manipulate with the encoder mounted to the keyboard.

install the 40-pin keyboard header

Next install the 40-pin male keyboard header as shown. The two resistor arrays shown are discussed further down.

Configure the options header for the Apple II keymap

Place jumpers at positions 0, 1, and 7. This does the following:

  • Positions 0-3 are the keymap ID. Positions 0 and 1 configure for keymap 3, the Apple II ALL-CAPS configuration. See the "tweaks" section if you are interested in an lowercase/uppercase keymap.

  • Position 7 sets positive or negative strobe. The Apple 1 and Apple 2 use a positive strobe. However, the negative strobe works as well. The strobe is triggered on the rising (trailing) edge of the negative strobe, instead of the falling (leading) edge.

Install the diode jumpers (Errata for encoder rev 4.2):

The footprints for D1-D16 are supposed to have a shorting jumper trace built in. However, in the rev 4.2 encoder, these jumpers are missing. Therefore, wire jumpers must be installed in the D1-D16 positions for the keyboard to scan correctly. The diode footprints can be jumpered with wire, or with a small-value resistors. Be aware that any resistor used as a jumper forms a divider with the internal pullups on the column inputs, which are 100K or more, so anything less than 10K should be fine. I suggest using a value less than 1K.

If you have the ReActiveMicro kit, then you have two DIP resistor arrays included. The ends of these DIP resistor arrays have been ground down to allow both arrays to fit end-to-end, as shown. Don't worry if both arrays don't seat perfectly flush. The orientation doesn't matter.

With individual jumpers installed:

With DIP arrays installed:

Note: If you are using the encoder with a keyboard without any built-in diodes (such as the original Apple II keyboard, or a prefabricated key matrix), then populate the diodes D1-D16 with 1n4148, 1n914, or any similar small-signal diodes to protect the row-scanning TTL outputs from conflicting logic levels in the event of simultaneous keypresses.

Mount the encoder to the keyboard

Mate the 40-pin connectors and install the two 1/4" #4-40 screws:

Install in the Apple II

The original Apple II keyboard has a metal frame that holds the keyboard a bit below the level of the case. Since we don't have a frame to provide spacing, we must install standoffs to properly set the keyboard height.

Mounting Hardware

You will need 4 standoffs. Choose the right standoffs for the keys in your keyboard:

Installation
  1. Install the standoffs:

  1. Install the cable. This is easier to do before the keyboard is mounted in the case.

  2. Mount the keyboard on the spacers and secure with 1/4" 6-32 machine screws. You may optionally use plastic spacers to protect the PCB. Don't fully tighten the screws.

  3. Adjust the keyboard as necessary so that the spacing around the edges of the keyboard is even, then tighten the screws.

Tweaks

Make the LED brighter

You can make the LED brighter, if you desire, by decreasing the value of the current-limiting resistor on the keyboard PCB.

The brightness of the POWER lamp LED is controlled by the current-limiting resistors R1 and R4. Both R1 and R4 are wired in parallel, and typically only one need be installed. R1 has a through-hole footprint, and R4 has and surfact mount (SMT) footprint, and may be pre-installed. (It will be pre-installed if you got the keyboard as a kit, and won't be installed if you had the PCB fabricated yourself without any assembly.)

If your keyboard has a 330-ohm SMT resistor already installed at R4, you don't need to remove it. You can simply install a through-hole resistor at R1, which will form a parallel circuit with the installed resistor.

For example, if the LED diode drop is about 2V, then with a 5V supply, there is about 3V across the resistor. For a 330 ohm resistor, the current is about 10 mA. If you want 20 mA, you need approximately 150 ohsms, so you can install a 270 ohm resistor (giving 148 ohms in parallel with the 330 ohm resistor) or 330 ohm (giving 165 ohms).

If you want 15 mA, you want an effective resistance of about 200 ohms, so a 470 ohm resistor would give 193.88 ohms in parallel with the 330 ohm resistor.

Use a Lowercase/Uppercase Apple keymap

If you want Upper and Lower case, then you can remove the jumper at position 0 leaving the jumper at position 1 in place to select keymap 2. However, be aware that some keys will behave differently. For example, the POWER key becomes a CAPS LOCK, and the N-^ and P-@ keys will behave as regular upper/lower keys. I have not yet added the "@" and "^" keys back in to the map. The Upper lower keymap is a work in progress, and I accept any suggestions.

Keymaps for Apple Layout:

0 1 2 3 Map Number Keymap
- + - - 2 Apple II, Uppler / Lower
+ + - - 3 Apple II, ALL CAPS

Key:

+ Jumper installed
- No Jumper
Use a different keyboard layout

If the keyboard doesn't need to fit in an apple II case, then you might want a more complete ASCII keyboard layout. The "classic" layout is modeled after the ADM-3A and can produce the full ASCII character set. Simply add in the extra keys to fully populate the keyboard, and install the extra keycaps (included in the keycap set.)

Keymaps for Classic Layout:

0 1 2 3 Map Number Keymap
- - - - 0 Classic, Uppler / Lower
+ - - - 1 Classic, ALL CAPS

Key:

+ Jumper installed
- No Jumper

Here is a full classic keyboard:

Note, this is an older prototype. The reason a chunk is missing chunk from the bottom is because I had not installed spacebar stabilizer hardware, and I had to break off the chunk to gain access to install the stabilizers after the keyboard was already soldered.

⚠️ **GitHub.com Fallback** ⚠️