1
0
tmk_keyboard/converter/ps2_usb
2016-10-05 14:00:48 +09:00
..
binary ps2_usb: Use standby mode in suspend 2016-10-04 16:08:06 +09:00
config_mbed.h Port ps2_usb to mbed 2014-07-30 14:07:43 +09:00
config_rev1.h ps2_usb: Change Makefiles 2016-09-17 11:44:54 +09:00
config_rev2.h ps2_usb: Add setting for suart debug 2016-10-04 10:21:46 +09:00
config.h ps2_usb: Fix for VUSB configuration 2016-03-19 08:08:49 +09:00
keymap_common.h Remove keymap read code from project directories 2016-08-29 13:54:44 +09:00
keymap_jis.c Fix: Use action_t in keymap files 2016-08-29 13:54:44 +09:00
keymap_plain.c Fix: Use action_t in keymap files 2016-08-29 13:54:44 +09:00
keymap_spacefn.c Fix: Use action_t in keymap files 2016-08-29 13:54:44 +09:00
led.c Made directories for keyboard and converter projects. 2012-06-08 13:32:38 +09:00
main.cpp Port ps2_usb to mbed 2014-07-30 14:07:43 +09:00
Makefile ps2_usb: Use standby mode in suspend 2016-10-04 16:08:06 +09:00
Makefile.mbed Remove keymap read code from project directories 2016-08-29 13:54:44 +09:00
Makefile.rev1 ps2_usb: Change Makefiles 2016-09-17 11:44:54 +09:00
Makefile.rev2 ps2_usb: Change Makefiles 2016-09-17 11:44:54 +09:00
Makefile.unimap.rev1 ps2_usb: Change Makefiles 2016-09-17 11:44:54 +09:00
Makefile.unimap.rev2 ps2_usb: Add setting for suart debug 2016-10-04 10:21:46 +09:00
Makefile.vusb Remove keymap read code from project directories 2016-08-29 13:54:44 +09:00
matrix.c Fix matrix_clear() for new matrix API 2016-10-05 14:00:48 +09:00
README.md ps2_usb: Change Makefiles 2016-09-17 11:44:54 +09:00
unimap_plain.c ps2_usb: Change unimap 2016-09-19 13:21:50 +09:00
unimap_trans.h ps2_usb: Add unimap 2016-09-17 11:53:20 +09:00
usbconfig.h Fix PS/2 protocol build options 2012-10-14 20:06:50 +09:00

PS/2 to USB keyboard converter

This firmware converts PS/2 keyboard protocol to USB.(It supports Scan Code Set 2.)

Connect Wires

  1. Connect Vcc and GND.
  2. Connect Clock and Data line.
    • Interrupt: Clock is on PD1 and Data on PD0.(Recommended. Soarer's converter compatible)
    • Busywait: Clock is on PD1 and Data on PD0.
    • USART: Clock is on PD5 and Data on PD2.
  3. You need pull-up resistors. 1K-10K Ohm would be fine.

To change pin configuration edit config.h and Makefile.

Build Firmware

For TMK converter Rev.2:

$ make -f Makefile.rev2 clean
$ make -f Makefile.rev2 KEYMAP=plain

To program firmware push the button on converter and run:

$ make -f Makefile.rev2 KEYMAP=plain dfu
  • For TMK converter Rev.1 use make -f Makefile.rev1 instead.
  • To select keymap use jis, spacefn or your own in place of plain.

Keymap

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.

PS/2 signal handling implementations

Following three methods can be used to implement PS/2 signal handling.

Simple and stupid busy-wait(ps2_busywait.c)

This is expected to implemented with portable C code for reference.

Interrupt driven(ps2_interrupt.c)

Uses pin interrupt to detect falling edge of clock line.

USART hardware module(ps2_usart.c)

Uses AVR USART engine to receive PS/2 signal.

To select method edit Makefile.

V-USB Support

With V-USB you can use this converter on ATmega(168/328) but it doesn't support NKRO at this time.

Circuit:

                +---+   +---------------+
USB            GND  |   |   ATmega168   |
===                 C3  |               |
5V <-------+--------+---|Vcc,AVCC       |        PS/2
           R1           |               |        ====
D- <----+--+-----R2-----|INT1        RXD|------->DATA
D+ <----|---+----R3-----|INT0        XCK|------->CLOCK
        Z1  Z2          |               |      ->5V
GND<----+---+--+--+-----|GND            |      ->GND
               |  |     |               |
               |  C2-+--|XTAL1          |
               |     X1 |               |
               +--C3-+--|XTAL2          |
                        +---------------+
R1:     1.5K Ohm
R2,R3:  68 Ohm
Z1,Z2:  Zenner 3.6V
C1,C2:  22pF
C3:     0.1uF
X1:     Crystal 20MHz(16MHz/12MHz)