

Самодельная клавиатура с интерфейсом ps/2. Собрана на Attiny2313A и сдвиговых регистрах 74HC595 и 74HC165.
- Size
- 174 × 80 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 115
- Nets
- 65
- Pads
- 469
- Tracks, vias
- 2,456, 38
- Pours
- 3
- Routed
- Yes
- KiCad
- KiCad 7 (file 20221018)
- Created
- 23 Sep 2022
- Updated
- 1 Feb 2024
Overview
Keyb is an open-source printed circuit board by coprolitebbs, from the coprolitebbs/ps2-keyboard repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 174 × 80 mm with 115 parts on 65 nets, routed with 2,456 tracks and 38 vias.
It is built around the ATTINY2313-20PU. Its parts include 69 switches, 20 resistors, 4 ICs, 2 diodes and 2 connectors. It belongs with the AVR (ATmega, ATtiny) boards of this library.
Main components
1README
README.mdps2-keyboard
Самодельная клавиатура с интерфейсом ps/2. Собрана на Attiny2313A и сдвиговых регистрах 74HC595 и 74HC165.
Прошивка Attiny базируется на библиотеке ps2dev
Простое описание данных для протокола PS/2.
Если что-то не работает, попробуйте старую прошивку из моей же статьи на хабре: https://habr.com/ru/articles/693784/ Например, эмулятор PS/2 клавиатуры для Спектрума, почему-то, не заводится с последней версией прошивки, но, завелся с версией из статьи. Собирали на стриме здесь: https://www.youtube.com/watch?v=hVR3ve-gX_8
Прошивка компилируется средой Arduino IDE,
Прошивается с помощью progisp172 программатором через порт "РПрог" для программирования на плате клавиатуры,
Fuse-биты для Attiny2313A: Low: E2, High: DF, Ext: FF, Lock: FF
Имейте ввиду, клавиатура не настраивается под ваш PC или контроллер автоматически, придется играться с таймингами в исходнике.
Для PC используйте значения:
#define BYTEWAIT 1000
#define CLK_FULL 40
#define CLK_HALF 20
#define TIMEOUT 30Для работы с esp32 и библиотекой FabGL используйте
#define BYTEWAIT 500
#define CLK_FULL 10
#define CLK_HALF 5
#define TIMEOUT 50Parts
115| Qty | Value | Footprint | References |
|---|---|---|---|
| 16 | 220 | Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal | R5, R6, R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19, R20 |
| 2 | 10K | Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal | R1, R4 |
| 2 | 1K | Resistor_THT:R_Axial_DIN0204_L3.6mm_D1.6mm_P7.62mm_Horizontal | R2, R3 |
| 2 | АЛЬТ | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW79, SW81 |
| 2 | КТРЛ | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW78, SW82 |
| 2 | ПРОБЕЛ | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW80, SW84 |
| 1 | ' " Э | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW65 |
| 1 | + = | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW34 |
| 1 | - _ | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW33 |
| 1 | / ? . | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW76 |
| 1 | 0 ) | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW24 |
| 1 | 0.5Mф | Capacitor_THT:C_Disc_D5.0mm_W2.5mm_P2.50mm | C1 |
| 1 | 1 ! | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW7 |
| 1 | 10K | Resistor_THT:R_Array_SIP9 | RN1 |
| 1 | 2 @ " | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW8 |
| 1 | 3 # | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW17 |
| 1 | 4 $ ; | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW18 |
| 1 | 5 % | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW19 |
| 1 | 6 ^ : | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW20 |
| 1 | 7 & ? | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW21 |
| 1 | 8 * | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW22 |
| 1 | 9 ( | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW23 |
| 1 | : ; Ж | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW64 |
| 1 | < , Б | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW74 |
| 1 | > . Ю | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW75 |
| 1 | A Ф | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW55 |
| 1 | ATtiny2313-20P | Package_DIP:DIP-20_W7.62mm_Socket | U1 |
| 1 | B И | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW71 |
| 1 | C | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW69 |
| 1 | D В | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW57 |
| 1 | E У | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW40 |
| 1 | F А | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW58 |
| 1 | G П | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW59 |
| 1 | H Р | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW60 |
| 1 | I Ш | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW48 |
| 1 | ICSP | Connector_PinSocket_2.54mm:PinSocket_2x03_P2.54mm_Vertical_ICSP | J2 |
| 1 | J О | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW61 |
| 1 | K Л | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW62 |
| 1 | KP1564ИP52 - 1 | Package_DIP:DIP-16_W7.62mm_Socket | U2 |
| 1 | KP1564ИP52- 2 | Package_DIP:DIP-16_W7.62mm_Socket | U3 |
| 1 | KP1564ИP9 | Package_DIP:DIP-16_W7.62mm_Socket | U4 |
| 1 | L Д | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW63 |
| 1 | LOGO | LOGO | G*** |
| 1 | LSHIFT | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW66 |
| 1 | M Ь | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW73 |
| 1 | N Т | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW72 |
| 1 | O Щ | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW49 |
| 1 | P З | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW50 |
| 1 | PS/2 | Connector_PinSocket_2.54mm:PinSocket_1x04_P2.54mm_Vertical | J1 |
| 1 | Q Й | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW38 |
| 1 | R К | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW44 |
| 1 | RSHIFT | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW77 |
| 1 | S Ы | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW56 |
| 1 | T Е | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW45 |
| 1 | U Г | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW47 |
| 1 | V М | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW70 |
| 1 | W Ц | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW39 |
| 1 | X Ч | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW68 |
| 1 | Y Н | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW46 |
| 1 | Z Я | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW67 |
| 1 | [ X { | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW51 |
| 1 | \ | | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW35 |
| 1 | ] Ъ } | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW52 |
| 1 | ` ~ Ё | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW6 |
| 1 | В КОНЕЦ | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW41 |
| 1 | ВВЕРХ | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW25 |
| 1 | ВВОД | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW53 |
| 1 | ВЕРХРег | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW54 |
| 1 | ВЛЕВО | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW27 |
| 1 | ВНИЗ | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW26 |
| 1 | ВПРАВО | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW28 |
| 1 | ВСТВ | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW29 |
| 1 | НАЗАД | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW30 |
| 1 | ОТМ | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW1 |
| 1 | ПАУЗА | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW83 |
| 1 | ПЕЧАТЬ | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW43 |
| 1 | СТР ВВЕРХ | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW42 |
| 1 | СТР ВНИЗ | Button_Switch_THT:SW_PUSH_KEYB_6mm_H4.3mm | SW31 |
| 1 | Св.1 | LED_THT:LED_D3.0mm | D1 |
| 1 | Св.2 | LED_THT:LED_D3.0mm | D2 |
The 100 most common of 115 parts.
Similar boards
- 2 layers88 × 102 mm

- 2 layers50 × 60.5 mm

- 2 layers62.5 × 47.5 mm

C64UserPortMidi
relic-se/C64UserPortMidi
Simple MIDI input and output interface using Commodore 64 user port. Utilizes an ATtiny2313 microcontroller and 6n138 opto-isolator.
25 parts4GPL-3.0 - 2 layers437.8 × 127.8 mm

- 2 layers63.5 × 48.3 mm

- 2 layers170 × 50.5 mm

- 2 layers

- 2 layers91.4 × 53.3 mm

Questions
How big is the Keyb PCB?
It measures 174 × 80 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Keyb use?
115 parts, built around the ATTINY2313-20PU. 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 Keyb KiCad files?
From the coprolitebbs/ps2-keyboard repository on GitHub, at the commit this page was made from: the board is hardware/kicad_project/keyb.kicad_pcb and its schematic hardware/kicad_project/Butts 2.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Keyb design in my own project?
Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).