Keyboard firmwares for Atmel AVR and Cortex-M
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.

README.md 2.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. Connect Wires
  5. -------------
  6. 1. Connect **Vcc** and **GND**.
  7. 2. Connect **Clock** and **Data** line.
  8. - **Interrupt**: **Clock** is on `PD1` and **Data** on `PD0`.(Recommended. Soarer's converter compatible)
  9. - **Busywait**: **Clock** is on `PD1` and **Data** on `PD0`.
  10. - **USART**: **Clock** is on `PD5` and **Data** on `PD2`.
  11. 3. You need pull-up resistors. 1K-10K Ohm would be fine.
  12. To change pin configuration edit **config.h** and **Makefile**.
  13. Build Firmware
  14. --------------
  15. For **TMK converter Rev.2**:
  16. $ make -f Makefile.rev2 clean
  17. $ make -f Makefile.rev2 KEYMAP=plain
  18. To program firmware push the button on converter and run:
  19. $ make -f Makefile.rev2 KEYMAP=plain dfu
  20. - For **TMK converter Rev.1** use `make -f Makefile.rev1` instead.
  21. - To select keymap use `jis`, `spacefn` or your own in place of `plain`.
  22. Keymap
  23. ------
  24. 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.
  25. PS/2 signal handling implementations
  26. ------------------------------------
  27. Following three methods can be used to implement PS/2 signal handling.
  28. ### Simple and stupid busy-wait(ps2_busywait.c)
  29. This is expected to implemented with portable C code for reference.
  30. ### Interrupt driven(ps2_interrupt.c)
  31. Uses pin interrupt to detect falling edge of clock line.
  32. ### USART hardware module(ps2_usart.c)
  33. Uses AVR USART engine to receive PS/2 signal.
  34. To select method edit Makefile.
  35. V-USB Support
  36. -------------
  37. With V-USB you can use this converter on ATmega(168/328) but it doesn't support NKRO at this time.
  38. Circuit:
  39. +---+ +---------------+
  40. USB GND | | ATmega168 |
  41. === C3 | |
  42. 5V <-------+--------+---|Vcc,AVCC | PS/2
  43. R1 | | ====
  44. D- <----+--+-----R2-----|INT1 RXD|------->DATA
  45. D+ <----|---+----R3-----|INT0 XCK|------->CLOCK
  46. Z1 Z2 | | ->5V
  47. GND<----+---+--+--+-----|GND | ->GND
  48. | | | |
  49. | C2-+--|XTAL1 |
  50. | X1 | |
  51. +--C3-+--|XTAL2 |
  52. +---------------+
  53. R1: 1.5K Ohm
  54. R2,R3: 68 Ohm
  55. Z1,Z2: Zenner 3.6V
  56. C1,C2: 22pF
  57. C3: 0.1uF
  58. X1: Crystal 20MHz(16MHz/12MHz)