Skip to the content
2 layers70 × 89.5 mmKbd ctrl, the printed circuit board in 3D

TRS-80 Model 100 Cyberdeck

Size
70 × 89.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
8
Nets
76
Pads
113
Tracks, vias
195, 6
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
20 Apr 2024
Updated
17 May 2025

Overview

Kbd ctrl is an open-source printed circuit board by kkestell, from the kkestell/trs-80-model-100 repository on GitHub. It is a 2-layer board of 70 × 89.5 mm with 8 parts on 76 nets, routed with 195 tracks and 6 vias.

It is built around the 74HC595 and 74HC165D. Its parts include 4 ICs and 4 connectors. It belongs with the AVR (ATmega, ATtiny) boards of this library.

Main components

2

README

README.md

TRS-80 Model 100

Overview

TODO

TRS-80 Model 100

TODO

Screen

LCD

The display has a 1920×480 IPS panel. I think I read somewhere that these were designed as rear-view mirrors. At 218mm, it's actually a little wider than the original LCD.

Bracket

The LCD is mounted to a custom 3D printed bracket that's attached to the enclosure using the original screw bosses. The LCD fits snugly between bracket and the front plastic, with three pieces of double sided tape between the display and the bracket for good measure.

Configuration

ini
hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=87
hdmi_force_mode=1
hdmi_timings=480 0 30 30 30 1920 0 6 6 6 0 0 0 60 0 66000000 7
max_framebuffer_width=480
max_framebuffer_height=1920
display_hdmi_rotate=1

Keyboard

Matrix

The TRS-80 keyboard matrix is 9 columns by 8 rows. The pins on the keyboard PCB are labeled 1-20. Pins 1-9 correspond to columns 0-8, pins 10 and 11 aren't used, pins 12-19 correspond to rows 0-7, and pin 20 is ground.

TRS-80 Model 100 Keyboard Matrix

Wiring
Keyboard PinFunction
1Column 0
2Column 1
3Column 2
4Column 3
5Column 4
6Column 5
7Column 6
8Column 7
9Column 8
10Unused
11Unused
12Row 0
13Row 1
14Row 2
15Row 3
16Row 4
17Row 5
18Row 6
19Row 7
20GND
Scanning

The basic process for scanning the keyboard matrix is:

text
INITIALIZE all columns as OUTPUT and set HIGH
INITIALIZE all rows as INPUT with internal pull-up resistors

FOR each column FROM 0 TO num_cols - 1 DO
    SET the current column TO LOW
    
    FOR each row FROM 0 TO num_rows - 1 DO
        IF the value at the current row IS LOW THEN
            key at the current position (row, column) is being pressed
        END IF
    ENDFOR

    SET the current column TO HIGH
ENDFOR

Firmware v1

For this first experiment, I connected the rows and columns directly to the digital I/O pins on an Arduino Pro Micro. The firmware scans the rows and columns every 5ms, and uses the Keyboard library to send key presses and releases to the host.

Wiring
Keyboard PinFunctionArduino Pro Micro Pin
1Column 00
2Column 11
3Column 22
4Column 33
5Column 44
6Column 55
7Column 66
8Column 77
9Column 88
10Unused
11Unused
12Row 021
13Row 120
14Row 219
15Row 318
16Row 415
17Row 514
18Row 616
19Row 710
20GNDGND
Code
arduino
#define USE_TIMER_3 true

#include <TimerInterrupt.h>
#include <ISR_Timer.h>

#include <Keyboard.h>

#define TIMER_INTERVAL_MS 5

#define num_cols 9
#define num_rows 8

int cols[num_cols] = { 0,  1,  2,  3,  4,  5,  6,  7, 8};
int rows[num_rows] = {21, 20, 19, 18, 15, 14, 16, 10   };

char charmap[72] = {
    /*      0    1    2    3     4    5                6              7       8 */
    /* 0 */ 'z', 'a', 'q', 'o',  '1', '9',             ' ',           KEY_F1, KEY_LEFT_SHIFT,
    /* 1 */ 'x', 's', 'w', 'p',  '2', '0',             KEY_BACKSPACE, KEY_F2, KEY_LEFT_CTRL,
    /* 2 */ 'c', 'd', 'e', ']',  '3', '-',             ' ',           KEY_F3, ' ',
    /* 3 */ 'v', 'f', 'r', ';',  '4', '=',             KEY_ESC,       KEY_F4, ' ',
    /* 4 */ 'b', 'g', 't', '\'', '5', KEY_DOWN_ARROW,  ' ',           KEY_F5, ' ',
    /* 5 */ 'n', 'h', 'y', ',',  '6', KEY_UP_ARROW,    ' ',           KEY_F6, ' ',
    /* 6 */ 'm', 'j', 'u', '.',  '7', KEY_LEFT_ARROW,  ' ',           KEY_F7, ' ',

Detour: Shift Register Experiments

The easiest way to reduce the number of digital I/O pins used by the keyboard firmware is to use a shift register. Shift registers are either serial-in, parallel-out (SIPO) or parallel-in, serial-out (PISO). We'll need both types to read and write to the keyboard matrix.

Serial-In, Parallel-Out (74HC595)

74HC595

The 74HC595 is an 8-bit serial-in, parallel-out shift register. This allows us to write to eight outputs using only three digital I/O pins.

cpp
int latchPin = 8;  // Pin connected to RCLK  (pin 12)
int clockPin = 14; // Pin connected to SRCLK (pin 11)
int dataPin  = 16; // Pin connected to SER   (pin 14)

// NOTE: Also connect VCC (pin 16) to 5V and GND (pin 8) to GND as well as OE (pin 13) to GND.
// If you don't connect OE to GND, the 74HC595 will behave strangely.

void setup()
{
    // Set pins to output so you can control the shift register
    pinMode(latchPin, OUTPUT);
    pinMode(clockPin, OUTPUT);
    pinMode(dataPin,  OUTPUT);
}

void loop()
{
    // Count from 0 to 255, displaying each number in binary on eight LEDs
    for (int num = 0; num < 256; num++)
    {
        // Take the latch pin low so the LEDs don't change while you're sending in bits
        digitalWrite(latchPin, LOW);

        // Shift out the bits

This covers writing to the shift register, but we still need to read from the keyboard.

Parallel-In, Serial-Out (74HC165)

74HC165

The 74HC165 is an 8-bit parallel-in, serial-out shift register. This allows us to read eight inputs using only three digital I/O pins.

cpp
int loadPin  = 8;  // pin connected to SH/LD (pin 1)
int clockPin = 14; // pin connected to CLK   (pin 2)
int dataPin  = 16; // pin connected to QH    (pin 9)

void setup()
{
    // Set the load and clock pins to output so you can control the shift register
    // and the data pin to input so you can read the serial in
    pinMode(loadPin, OUTPUT);
    pinMode(clockPin, OUTPUT);
    pinMode(dataPin, INPUT);

    // Initialize serial communication
    Serial.begin(9600);
}

void loop()
{
    // Take the parallel load pin low
    digitalWrite(loadPin, LOW);

    // ???
    delayMicroseconds(5);
  

Firmware v2

Scanning the keyboard matrix involves writing to the columns and reading from the rows. We'll use a 74HC165 to read the rows, and chain two 74HC595s together to write to the columns.

text
Serial Data        ---> DS (74HC595 #1)
Clock Input        ---> SH_CP (74HC595 #1) 
                   ---> SH_CP (74HC595 #2)
Latch Input        ---> ST_CP (74HC595 #1) 
                   ---> ST_CP (74HC595 #2)
Q7' (74HC595 #1)   ---> DS (74HC595 #2)
Q0-Q7 (74HC595 #1) ---> Output Bits 1-8
Q0-Q7 (74HC595 #2) ---> Output Bits 9-16

TODO

Parts

8
QtyValueFootprintReferences
274HC595Package_DIP:DIP-16_W7.62mm_SocketU3, U4
2Conn_01x12_SocketConnector_PinSocket_2.54mm:PinSocket_1x12_P2.54mm_VerticalJ1, J2
174HC165Package_DIP:DIP-16_W7.62mm_SocketU2
1ProMicroArduino:Sparkfun_Pro_MicroU1
1Screw_Terminal_01x08TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-8-5.08_1x08_P5.08mm_HorizontalJ3
1Screw_Terminal_01x09TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-9-5.08_1x09_P5.08mm_HorizontalJ4

Similar boards

  • 2 layers245.1 × 160 mm8-Bit CPU 32k, the printed circuit board in 3D

    8-Bit CPU 32k

    slu4coder/Minimal-64x4-Home-Computer

    My DIY TTL home computer with VGA and PS/2 and 4x the processing power of a Commodore C64 or Apple II.

    139 parts326
  • 2 layers171.5 × 106.7 mmSequencer, the printed circuit board in 3D

    Sequencer

    westlicht/performer-hardware

    PER|FORMER Eurorack Sequencer - Hardware Design Files

    435 parts110
  • 2 layers306.1 × 130.2 mm8-Bit CPU 32k, the printed circuit board in 3D

    8-Bit CPU 32k

    slu4coder/Minimal-64-Home-Computer

    Legacy: Full TTL-only home computer with VGA and PS/2 and twice the processing power of a Commodore 64

    132 parts94
  • 2 layers208.9 × 170.8 mm8-Bit CPU 32k, the printed circuit board in 3D

    8-Bit CPU 32k

    slu4coder/Minimal-UART-Computer-3

    Version 3 of my educational DIY TTL computer built around a UART serial interface - now with blinkenlights!

    207 parts54
  • 2 layers148.8 × 132.2 mmUsbflashprog, the printed circuit board in 3D

    Usbflashprog

    robsonsmartins/usbflashprog

    A memory device programmer (Flash/EPROM/E2PROM) board and software, connected to PC by USB port.

    125 parts36
  • 4 layers120 × 100 mmBsc, the printed circuit board in 3D

    Bsc

    shining-man/bsc_hw

    Hardware battery safety controller (BSC)

    286 parts31MIT
  • 2 layers56 × 110 mmTrs pcb, the printed circuit board in 3D

    Trs pcb

    Windfisch/midikraken

    A open source, open hardware up-to-16x USB-MIDI-interface for around 15 bucks in its smallest configuration.

    125 parts28

Questions

How big is the Kbd ctrl PCB?

It measures 70 × 89.5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Kbd ctrl use?

8 parts, built around the 74HC595 and 74HC165D. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Kbd ctrl KiCad files?

From the kkestell/trs-80-model-100 repository on GitHub, at the commit this page was made from: the board is keyboard-controller/kbd-ctrl/kbd-ctrl.kicad_pcb and its schematic _keyboard/keyboard.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Kbd ctrl design in my own project?

Its repository states no licence, so its author keeps all rights: ask kkestell before reusing the design.