]> git.donarmstrong.com Git - tmk_firmware.git/blob - converter/ps2_usb/README.md
Updates to Ergodox-FAQ.md
[tmk_firmware.git] / converter / ps2_usb / README.md
1 PS/2 to USB keyboard converter
2 ==============================
3 This firmware converts PS/2 keyboard protocol to USB.(It supports Scan Code Set 2.)
4
5
6 Connect Wires
7 -------------
8 In case of Teensy2.0(ATMega32U4):
9
10 1. Connect **Vcc** and **GND**.
11 2. Connect **Clock** and **Data** line. 
12     - **Interrupt**:   **Clock** is on `PD1` and **Data** on `PD0`.(Recommended. Soarer's converter compatible)
13     - **Busywait**:    **Clock** is on `PD1` and **Data** on `PD0`.
14     - **USART**:       **Clock** is on `PD5` and **Data** on `PD2`.
15 3. Optionally you need pull-up register. 1K-10K Ohm is OK.
16
17 To change pin configuration edit config.h.
18
19
20 Build Firmware
21 --------------
22 For **PJRC Teensy** just run `make`:
23
24     $ make clean
25     $ make
26
27 To select keymap:
28
29     $ make clean
30     $ make KEYMAP=[plain|jis|spacefn|...]
31
32 After that you will find HEX file `ps2_usb_lufa.hex` in current directory.
33
34
35 - For **TMK converter Rev.1** use `make -f Makefile.tmk_rev1` instead of `make` and HEX file is `ps2_usb_tmk_rev1.hex`.
36
37 - For **TMK converter Rev.2** use `make -f Makefile.tmk_rev2` instead of `make` and HEX file is `ps2_usb_tmk_rev2.hex`.
38
39
40 Keymap
41 ------
42 Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `keymap_<name>.c` and see keymap document(you can find in README.md of top directory) and existent keymap files.
43
44
45 PS/2 signal handling implementations
46 ------------------------------------
47 Following three methods can be used to implement PS/2 signal handling.
48
49 ### Simple and stupid busy-wait(ps2_busywait.c)
50     This is expected to implemented with portable C code for reference.
51 ### Interrupt driven(ps2_interrupt.c)
52     Uses pin interrupt to detect falling edge of clock line.
53 ### USART hardware module(ps2_usart.c)
54     Uses AVR USART engine to receive PS/2 signal.
55
56 To select method edit Makefile.
57
58
59 V-USB Support
60 -------------
61 You can also use this converter on ATmega(168/328) with V-USB instead of Teensy.
62 The converter on V-USB lacks some features for now: USB NKRO and System/Media control.
63
64 Circuit:
65
66                     +---+   +---------------+
67     USB            GND  |   |   ATmega168   |
68     ===                 C3  |               |
69     5V <-------+--------+---|Vcc,AVCC       |        PS/2
70                R1           |               |        ====
71     D- <----+--+-----R2-----|INT1        RXD|------->DATA
72     D+ <----|---+----R3-----|INT0        XCK|------->CLOCK
73             Z1  Z2          |               |      ->5V
74     GND<----+---+--+--+-----|GND            |      ->GND
75                    |  |     |               |
76                    |  C2-+--|XTAL1          |
77                    |     X1 |               |
78                    +--C3-+--|XTAL2          |
79                             +---------------+
80     R1:     1.5K Ohm
81     R2,R3:  68 Ohm
82     Z1,Z2:  Zenner 3.6V
83     C1,C2:  22pF
84     C3:     0.1uF
85     X1:     Crystal 20MHz(16MHz/12MHz)