tmk_keyboard/converter/ps2_usb/README.md

91 lines
3 KiB
Markdown
Raw Permalink Normal View History

2013-11-29 23:52:29 +09:00
PS/2 to USB keyboard converter
==============================
2014-04-29 19:42:24 +09:00
This firmware converts PS/2 keyboard protocol to USB.(It supports Scan Code Set 2.)
2013-11-29 23:52:29 +09:00
2019-09-09 12:10:15 +09:00
You can discuss about this converter here.
2013-11-29 23:52:29 +09:00
2019-09-09 12:10:15 +09:00
https://geekhack.org/index.php?topic=14618.0
Preassembled TMK PS/2-USB converter is available here.
2013-11-29 23:52:29 +09:00
2019-09-09 12:10:15 +09:00
https://geekhack.org/index.php?topic=72052.0
2013-11-29 23:52:29 +09:00
2014-01-04 22:45:52 -05:00
Build Firmware
2013-11-29 23:52:29 +09:00
--------------
2016-09-17 10:20:52 +09:00
For **TMK converter Rev.2**:
2013-11-29 23:52:29 +09:00
2016-09-17 10:20:52 +09:00
$ make -f Makefile.rev2 clean
$ make -f Makefile.rev2 KEYMAP=plain
2013-11-29 23:52:29 +09:00
2016-09-17 10:20:52 +09:00
To program firmware push the button on converter and run:
2014-04-29 19:42:24 +09:00
2016-09-17 10:20:52 +09:00
$ make -f Makefile.rev2 KEYMAP=plain dfu
2014-04-29 19:42:24 +09:00
2019-09-09 12:10:15 +09:00
For **TMK converter Rev.1** use `Makefile.rev1` instead.
If your use DIY converter with ATMega32u4 board you can use `Makefile.32u4`, but note that progarmming with 'dfu' may not work for your converter.
Build your own converter
------------------------
Use ATMega32u4 as controller and Makefile.32u4 to build firmware.
1. Wire **Vcc** and **GND** properly.
2. Connect **Clock** to `PD1` and **Data** to `PD0` line. (Compatible to Soarer's converter pin configuration)
3. You need pull-up resistors on both signal lines. 1K-10K Ohm would be fine.
You can configure controller and pin configurations in Makefile and config.h.
2014-04-29 19:42:24 +09:00
2013-11-29 23:52:29 +09:00
Keymap
------
2019-09-09 12:10:15 +09:00
To define your own keymap copy `unimap_plain.c` to `unimap_<name>.c` and edit it. Or just edit `unimap_plain.c` directly.
See wiki pages and documents.
https://github.com/tmk/tmk_keyboard/wiki
2014-04-29 19:42:24 +09:00
PS/2 signal handling implementations
------------------------------------
2019-09-09 12:10:15 +09:00
Following three methods are available to implement PS/2 signal handling.
- **Interrupt** Uses pin interrupt to detect falling edge of clock line. **Recommended.** (ps2_interrupt.c)
- **Busywait** Implementation with portable C code for reference. (ps2_busywait.c)
- **USART** Uses AVR USART hardware engine to receive PS/2 signal. You must use this fothis for V-USB. (ps2_usart.c)
2014-04-29 19:42:24 +09:00
2019-09-09 12:10:15 +09:00
TMK converter rev1 uses **USART** and rev2 uses **Interrupt** for reference.
2014-04-29 19:42:24 +09:00
2019-09-09 12:10:15 +09:00
You can change method by editing `Makefile` but not needed in most case.
2013-11-29 23:52:29 +09:00
V-USB Support
-------------
2019-09-09 12:10:15 +09:00
With V-USB you can use this converter on ATmega(168/328). Use Makefile.vusb to build firmeware. Not supported actively anymore.
2013-11-29 23:52:29 +09:00
Circuit:
+---+ +---------------+
USB GND | | ATmega168 |
=== C3 | |
5V <-------+--------+---|Vcc,AVCC | PS/2
R1 | | ====
D- <----+--+-----R2-----|INT1 RXD|------->DATA
D+ <----|---+----R3-----|INT0 XCK|------->CLOCK
Z1 Z2 | | ->5V
GND<----+---+--+--+-----|GND | ->GND
| | | |
| C2-+--|XTAL1 |
| X1 | |
+--C3-+--|XTAL2 |
+---------------+
R1: 1.5K Ohm
R2,R3: 68 Ohm
Z1,Z2: Zenner 3.6V
C1,C2: 22pF
C3: 0.1uF
X1: Crystal 20MHz(16MHz/12MHz)