You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

README 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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...).
  5. Features
  6. --------
  7. Mouse keys
  8. You can emulates mouse move and button click using keyboard.
  9. System/Media control
  10. You can sends Power event, Volume down/up and Mute.
  11. USB NKRO(actually 120KRO+8Modifiers)
  12. You can tolggles NKRO feature.
  13. Keymap customization
  14. You can customize keymaps easily by editing source code. See keymap.c.
  15. PS/2 signal handling implementations
  16. ------------------------------------
  17. Following three methods are used to implement PS/2 signal handling.
  18. a. Simple and stupid busy-wait(ps2.c)
  19. This is expected to implemented with portable C code for reference.
  20. b. Interrupt driven(ps2.c)
  21. Uses external interrupt to detect falling edge of clock line.
  22. c. USART hardware module(ps2_usart.c)
  23. Uses AVR USART engine to recevie PS/2 signal. Recomended and default.
  24. This is required to work with V-USB, preceding two methods tend to
  25. miss signal edges while V-USB handles USB.
  26. To select method edit Makefile.
  27. Connect Wires
  28. -------------
  29. In case of Teensy2.0(ATMega32U4):
  30. 0. Connect Vcc and GND.
  31. 1. Connect Clock and Data line.
  32. For a. Clock is on PF0 and Data on PF1.
  33. For b. Clock is on PD1 and Data on PD2.
  34. For c. Clock is on PD5 and Data on PD2.
  35. 2. Optionally you need pull-up register. 1K-10K Ohm is OK.
  36. To change pin configuration edit config.h.
  37. Build Frimware
  38. --------------
  39. 1. Edit Makefile for build options and MCU setting.
  40. Use 'atmega32u4' for Teensy 2.0 or 'at90usb1286' for Teensy++ 2.0.
  41. 2. make
  42. Just type `make` in a terminal.
  43. Use `-f Makefile.vusb` option to build V-USB converter.
  44. Use `-f Makefile.jis` option to use JIS keyboard.
  45. 3. program MCU.
  46. In case of Teensy use `Teensy Loader`.(http://www.pjrc.com/teensy/loader.html)
  47. Otherwise you want to use `avrdude` or `dfu-programmer`.
  48. Demonstration of Features
  49. -------------------------
  50. In default configuration, you can try several keymaps, mousekeys and USB NKRO.
  51. Use following magic key combinations to enable some features.
  52. keymaps and NKRO:
  53. Magic+0: Qwerty with mousekeys(default)
  54. Magic+1: Qwerty without mousekeys
  55. Magic+2: Colemak
  56. Magic+3: Dvorak
  57. Magic+4: Workman
  58. Magic+N: toggles NKRO/6KRO(6KRO by default)
  59. Magic+Esc: sends Power Event(Power button)
  60. where Magic=(LShift+RShift) or (LControl+RShift)
  61. Fn layer function:
  62. Fn0+(hjkl): Mousekey move(vi cursor like)
  63. Fn0+(yuio): Mouse wheel(left,down,up,right)
  64. Fn0+space: Mouse left button
  65. Fn0+(mnb): Mouse buttons(m=left, n=right, b=middle)
  66. Fn0+(zxc): Media control(Volup, Voldown, Mute)
  67. Fn1+(hjkl): Cursor move(vi cursor like)
  68. Fn1+(nm,.): Cursor move(Home,PageDown,PageUp,End)
  69. where Fn0=;, Fn1=/
  70. Keymap
  71. ------
  72. You can change a keymap by editing code of keymap. See common/keycode.h for key symbols.
  73. V-USB Support
  74. -------------
  75. You can also use this converter on ATmega(168/328) with V-USB instead of Teensy.
  76. The converter on V-USB lacks some features for now: USB NKRO and System/Media control.
  77. Circuit
  78. -------
  79. +---+ +---------------+
  80. USB GND | | ATmega168 |
  81. === C3 | |
  82. 5V <-------+--------+---|Vcc,AVCC | PS/2
  83. R1 | | ====
  84. D- <----+--+-----R2-----|INT1 RXD|------->DATA
  85. D+ <----|---+----R3-----|INT0 XCK|------->CLOCK
  86. Z1 Z2 | | ->5V
  87. GND<----+---+--+--+-----|GND | ->GND
  88. | | | |
  89. | C2-+--|XTAL1 |
  90. | X1 | |
  91. +--C3-+--|XTAL2 |
  92. +---------------+
  93. R1: 1.5K Ohm
  94. R2,R3: 68 Ohm
  95. Z1,Z2: Zenner 3.6V
  96. C1,C2: 22pF
  97. C3: 0.1uF
  98. X1: Crystal 20MHz(16MHz/12MHz)
  99. EOF