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 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. PS/2 to USB keyboard converter
  2. ==============================
  3. This firmware converts PS/2 keyboard protocol to USB and for now supports only Scan Code Set 2.
  4. This will works on USB AVR(ATMega32U4, AT90USB) or V-USB.
  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 wait & read loop(intensive use of cycles)
  19. This is implemented with (expected) portable C code for reference. See ps2.c.
  20. b. Interrupt driven
  21. See ps2_intr.c
  22. c. Using USART hardware module(no cycle needed)
  23. This uses AVR USART function to recevie PS/2 signal and be used in V-USB converter.
  24. See ps2_usart.c.
  25. Build Converter
  26. ---------------
  27. Connect PS/2 keyboard into Teensy with 4 lines(Vcc, GND, Data, Clock).
  28. For a. Simple and stupid and b. Interrupt implementaion:
  29. By default Clock is on PF0 and Data on PF1.
  30. You can change this pin configuration by editing config_pjrc.h.
  31. In this photo Vcc is yellow, GND is green, Data is red and Clock is black.
  32. http://img17.imageshack.us/img17/7243/201101181933.jpg
  33. For c. USART implementation:
  34. In case of Teensny(ATMega32u4) CLock is on PD5 and Data on PD2.
  35. Build Frimware
  36. --------------
  37. 1. Edit Makefile for build options and MCU setting.
  38. Use 'atmega32u4' for Teensy 2.0 or 'at90usb1286' for Teensy++ 2.0.
  39. 2. make
  40. Just type 'make' in a terminal.
  41. Use '-f Makefile.pjrc_intr' option to use b. Interrupt.
  42. Use '-f Makefile.pjrc_usart' option to use c. USART.
  43. Use '-f Makefile.vusb' option to build V-USB converter.
  44. 3. program with Teensy Loader.
  45. http://www.pjrc.com/teensy/loader.html
  46. Demonstration of Features
  47. -------------------------
  48. In default configuration, you can try several keymaps, mousekeys and USB NKRO.
  49. Use following magic key combinations to enable some features.
  50. keymaps and NKRO:
  51. Magic+0: Qwerty with mousekeys(default)
  52. Magic+1: Qwerty without mousekeys
  53. Magic+2: Colemak
  54. Magic+3: Dvorak
  55. Magic+4: Workman
  56. Magic+N: toggles NKRO/6KRO(6KRO by default)
  57. Magic+Esc: sends Power Event(Power button)
  58. where Magic=(LShift+RShift) or (LControl+RShift)
  59. Fn layer function:
  60. Fn0+(hjkl): Mousekey move(vi cursor like)
  61. Fn0+(yuio): Mouse wheel(left,down,up,right)
  62. Fn0+space: Mouse left button
  63. Fn0+(mnb): Mouse buttons(m=left, n=right, b=middle)
  64. Fn0+(zxc): Media control(Volup, Voldown, Mute)
  65. Fn1+(hjkl): Cursor move(vi cursor like)
  66. Fn1+(nm,.): Cursor move(Home,PageDown,PageUp,End)
  67. where Fn0=;, Fn1=/
  68. Keymap
  69. ------
  70. You can change a keymap by editing code of keymap.c like following.
  71. How to define the keymap is probably obvious. You can find key symbols in usb_keycodes.h.
  72. To define keymap layer switching may needs a bit of your effort at this time.
  73. /* Default Layer: plain keymap
  74. * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,-----------.
  75. * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr|Slp|Wak|
  76. * `---' `---------------' `---------------' `---------------' `-----------' `-----------'
  77. * ,-----------------------------------------------------------. ,-----------. ,---------------.
  78. * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| /| *| -|
  79. * |-----------------------------------------------------------| |-----------| |---------------|
  80. * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| |
  81. * |-----------------------------------------------------------| `-----------' |-----------| +|
  82. * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| |
  83. * |-----------------------------------------------------------| ,---. |---------------|
  84. * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| |
  85. * |-----------------------------------------------------------| ,-----------. |-----------|Ent|
  86. * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| |Lef|Dow|Rig| | 0| .| |
  87. * `-----------------------------------------------------------' `-----------' `---------------'
  88. */
  89. KEYMAP(
  90. ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, PWR, F13, F14,
  91. GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS,
  92. TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9,
  93. CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS,
  94. LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3,
  95. LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT
  96. ),
  97. EOF