The Commodore 16's keyboard contains 64 distinct keys. Logically, they are organized as an 8x8 matrix. This is perfect to use with the keypad.KeyMatrix object in CircuitPython.

The more common Commodore 64 keyboard is visually very similar, but has a different pinout.

The keyboard's connector is a .100", 20-pin female header with a key at position 2 and several unused positions.

On the KB2040 side, the connection will be split into 8 pins on one side and 8 pins on the other side.

The following diagram shows the connections to make. Pin 1 of the keyboard connector is at the left, and the 2nd position is the "key", a position that is blocked with plastic and cannot accept a matching pin.

You can either make connections with 16 separate jumper wires or build a cable as discussed below. Since the connectors are pre-crimped this is a really quick way to build a custom wiring adapter!

 

Choose the correct jumper wires: At the keyboard end of the cable, you must have Male pins. What you have at the other end depends how you're connecting to the KB2040.

  • If you want to push the connector onto a male pin header that you've soldered to the KB2040, then the other end needs to be female (Male/Female jumper wires).
  • If you want to use a solderless breadboard, then both ends need to be male (Male/Male jumper wires).
  • If you want to solder the wires directly to the KB2040, use either Male/Female or Male/Male, just snip the connector off and strip a bit of the insulation from the wire.

Here, I'll describe using pin headers on the KB2040. From the package of housings, select two with eight positions and two with ten positions.

Separate out two sets of 8 wires from bare Male/Female jumper wires.

Take one of the 8-position housings and insert the Female ends into the housing, one after the the other.

Repeat this with a second 8-position housing.

Now, take a 10-pin housing and one of the finished 8-pin housings. Note the position of the "1" arrow on the 8-pin and 10-pin housings (▲). Starting at Pin 1 on each side, make sequential connections inserting the male ends, skipping positions 2, 4, and 5 on the 10-pin housing. Finish the first housing with wire #7.

Insert the last wire (#8) in position #1 of the 2nd housing. Then, again noting the pisition 1 marking (▲) of the 2nd 8-pin housing, insert all 8 pins without any gaps.

The final position on the 2nd housing will be left empty.

Your finished cable should look like this: (In these photos, the two 10-pin connectors have been carefully dabbed with super glue to make a single, solid 20-pin connector.)

Now, plug the first connector into the KB2040 with its "pin 1" to the KB2040 "2" and continuing to the end of that side; plug the other connector with its "pin 1" to the opposite corner (labeled "10" on the bottom) continuing to the pin labeled "A3".

Last, plug the two 10-pin connectors into the Commodore 16 keyboard's connector.

This guide was first published on Sep 14, 2022. It was last updated on Mar 28, 2024.

This page (Wiring the Commodore 16 Keyboard) was last updated on Mar 08, 2024.

Text editor powered by tinymce.