Thomas Russell Murphy 3ee5f565ae Spellchecking converter README files. 12 năm trước cách đây
..
Makefile c9dee36e42 Make ps2_usart default and fix SpaceFN 12 năm trước cách đây
Makefile.jis 1ac674db66 Fix PS/2 protocol build options 13 năm trước cách đây
Makefile.pjrc 0b9c0f6012 Add new keymap file 12 năm trước cách đây
Makefile.vusb 353a9b56e6 Fix BOOTLOADER_SIZE setting 13 năm trước cách đây
README.md 3ee5f565ae Spellchecking converter README files. 12 năm trước cách đây
config.h 10b2b1ae43 Fix key stack and PS/2 Overrun 12 năm trước cách đây
keymap_common.c 0b9c0f6012 Add new keymap file 12 năm trước cách đây
keymap_common.h 0b9c0f6012 Add new keymap file 12 năm trước cách đây
keymap_jis.c e3bcdd8211 Add SpaceFN keymap and JIS keymap 12 năm trước cách đây
keymap_plain.c e3bcdd8211 Add SpaceFN keymap and JIS keymap 12 năm trước cách đây
keymap_spacefn.c c9dee36e42 Make ps2_usart default and fix SpaceFN 12 năm trước cách đây
led.c afb0846208 Made directories for keyboard and converter projects. 14 năm trước cách đây
matrix.c 10b2b1ae43 Fix key stack and PS/2 Overrun 12 năm trước cách đây
usbconfig.h 1ac674db66 Fix PS/2 protocol build options 13 năm trước cách đây

README.md

PS/2 to USB keyboard converter

This firmware converts PS/2 keyboard protocol to USB and supports only Scan Code Set 2.

PS/2 signal handling implementations

Following three methods are 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.

Connect Wires

In case of Teensy2.0(ATMega32U4):

  1. Connect Vcc and GND.
  2. Connect Clock and Data line.
    • Busywait: Clock is on PD5 and Data on PD2.
    • Interrupt: Clock is on PD1 and Data on PD2.
    • USART: Clock is on PD5 and Data on PD2.
  3. Optionally you need pull-up register. 1K-10K Ohm is OK.

To change pin configuration edit config.h.

Build Firmware

Just run make:

$ make

To select keymap:

$ make KEYMAP=[plain|jis|spacefn|...]

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 top README.md) and existent keymap files.

V-USB Support

You can also use this converter on ATmega(168/328) with V-USB instead of Teensy. The converter on V-USB lacks some features for now: USB NKRO and System/Media control.

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)