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 This will works on USB AVR(ATMega32U4, AT90USB) or V-USB(ATMega168, 328...).
10 You can emulates mouse move and button click using keyboard.
12 You can sends Power event, Volume down/up and Mute.
13 USB NKRO(actually 120KRO+8Modifiers)
14 You can tolggles NKRO feature.
16 You can customize keymaps easily by editing source code. See keymap.c.
19 PS/2 signal handling implementations
20 ------------------------------------
21 Following three methods are used to implement PS/2 signal handling.
22 a. Simple and stupid busy-wait(ps2.c)
23 This is expected to implemented with portable C code for reference.
24 b. Interrupt driven(ps2.c)
25 Uses external interrupt to detect falling edge of clock line.
26 c. USART hardware module(ps2_usart.c)
27 Uses AVR USART engine to recevie PS/2 signal. Recomended and default.
28 This is required to work with V-USB, preceding two methods tend to
29 miss signal edges while V-USB handles USB.
31 To select method edit Makefile.
36 In case of Teensy2.0(ATMega32U4):
37 0. Connect Vcc and GND.
38 1. Connect Clock and Data line.
39 For a. Clock is on PF0 and Data on PF1.
40 For b. Clock is on PD1 and Data on PD2.
41 For c. Clock is on PD5 and Data on PD2.
42 2. Optionally you need pull-up register. 1K-10K Ohm is OK.
44 To change pin configuration edit config.h.
49 1. Edit Makefile for build options and MCU setting.
50 Use 'atmega32u4' for Teensy 2.0 or 'at90usb1286' for Teensy++ 2.0.
52 Just type `make` in a terminal.
53 Use `-f Makefile.vusb` option to build V-USB converter.
54 Use `-f Makefile.jis` option to use JIS keyboard.
56 In case of Teensy use `Teensy Loader`.(http://www.pjrc.com/teensy/loader.html)
57 Otherwise you want to use `avrdude` or `dfu-programmer`.
60 Demonstration of Features
61 -------------------------
62 In default configuration, you can try several keymaps, mousekeys and USB NKRO.
63 Use following magic key combinations to enable some features.
66 Magic+0: Qwerty with mousekeys(default)
67 Magic+1: Qwerty without mousekeys
71 Magic+N: toggles NKRO/6KRO(6KRO by default)
72 Magic+Esc: sends Power Event(Power button)
74 where Magic=(LShift+RShift) or (LControl+RShift)
77 Fn0+(hjkl): Mousekey move(vi cursor like)
78 Fn0+(yuio): Mouse wheel(left,down,up,right)
79 Fn0+space: Mouse left button
80 Fn0+(mnb): Mouse buttons(m=left, n=right, b=middle)
81 Fn0+(zxc): Media control(Volup, Voldown, Mute)
82 Fn1+(hjkl): Cursor move(vi cursor like)
83 Fn1+(nm,.): Cursor move(Home,PageDown,PageUp,End)
90 You can change a keymap by editing code of keymap. See common/keycode.h for key symbols.
95 You can also use this converter on ATmega(168/328) with V-USB instead of Teensy.
96 The converter on V-USB lacks some features for now: USB NKRO and System/Media control.
100 +---+ +---------------+
101 USB GND | | ATmega168 |
103 5V <-------+--------+---|Vcc,AVCC | PS/2
105 D- <----+--+-----R2-----|INT1 RXD|------->DATA
106 D+ <----|---+----R3-----|INT0 XCK|------->CLOCK
108 GND<----+---+--+--+-----|GND | ->GND
119 X1: Crystal 20MHz(16MHz/12MHz)