]> git.donarmstrong.com Git - tmk_firmware.git/blob - converter/ps2_usb/README.md
8f06fdd00d0c5e5e3adf74509e6e3d8cb5174e61
[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 and supports only Scan Code Set 2.
4
5
6 PS/2 signal handling implementations
7 ------------------------------------
8 Following three methods are used to implement PS/2 signal handling.
9
10 ### Simple and stupid busy-wait(ps2_busywait.c)
11     This is expected to implemented with portable C code for reference.
12 ### Interrupt driven(ps2_interrupt.c)
13     Uses pin interrupt to detect falling edge of clock line.
14 ### USART hardware module(ps2_usart.c)
15     Uses AVR USART engine to receive PS/2 signal.
16
17 To select method edit Makefile.
18
19
20 Connect Wires
21 -------------
22 In case of Teensy2.0(ATMega32U4):
23
24 1. Connect Vcc and GND.
25 2. Connect Clock and Data line. 
26     - Busywait:    Clock is on PD5 and Data on PD2.
27     - Interrupt:   Clock is on PD1 and Data on PD2.
28     - USART:       Clock is on PD5 and Data on PD2.
29 3. Optionally you need pull-up register. 1K-10K Ohm is OK.
30
31 To change pin configuration edit config.h.
32
33
34 Build Firmware
35 --------------
36 Just run `make`:
37
38     $ make
39
40 To select keymap:
41
42     $ make KEYMAP=[plain|jis|spacefn|...]
43
44
45 Keymap
46 ------
47 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 top README.md) and existent keymap files.
48
49
50 V-USB Support
51 -------------
52 You can also use this converter on ATmega(168/328) with V-USB instead of Teensy.
53 The converter on V-USB lacks some features for now: USB NKRO and System/Media control.
54
55 Circuit:
56
57                     +---+   +---------------+
58     USB            GND  |   |   ATmega168   |
59     ===                 C3  |               |
60     5V <-------+--------+---|Vcc,AVCC       |        PS/2
61                R1           |               |        ====
62     D- <----+--+-----R2-----|INT1        RXD|------->DATA
63     D+ <----|---+----R3-----|INT0        XCK|------->CLOCK
64             Z1  Z2          |               |      ->5V
65     GND<----+---+--+--+-----|GND            |      ->GND
66                    |  |     |               |
67                    |  C2-+--|XTAL1          |
68                    |     X1 |               |
69                    +--C3-+--|XTAL2          |
70                             +---------------+
71     R1:     1.5K Ohm
72     R2,R3:  68 Ohm
73     Z1,Z2:  Zenner 3.6V
74     C1,C2:  22pF
75     C3:     0.1uF
76     X1:     Crystal 20MHz(16MHz/12MHz)