A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/bjoernQ/ps2keyboard-esp32c3 below:

bjoernQ/ps2keyboard-esp32c3: ESP32-C3 interfacing to a PS/2 Keyboard (bare-metal Rust)

ESP32-C3 interfacing to a PS/2 Keyboard (bare-metal Rust)

The example of connecting a PS/2 keyboard and USB keyboard with PS/2 COMBO mode support to ESP32-C3.

You need to build it with the release profile (i.e. cargo run --release) since otherwise the interrupt latency is too slow.


    Keyboard                                    ESP32-C3

    5V      ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  5V

    GND     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  GND

                                        ┏━━━━━┓
    DATA    ━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┫ 120 ┣━━━  IO1
                                 ┃      ┗━━━━━┛
                                ┏┻┓
                                ┃2┃
                                ┃.┃
                                ┃2┃
                                ┃k┃
                                ┗┳┛
                                 ┃
                                 ┣━━━━━━━━━━━━━━━━  3V3
                                 ┃
                                ┏┻┓
                                ┃2┃
                                ┃.┃
                                ┃2┃
                                ┃k┃
                                ┗┳┛
                                 ┃      ┏━━━━━┓
    CLK     ━━━━━━━━━━━━━━━━━━━━━┻━━━━━━┫ 120 ┣━━━  IO2
                                        ┗━━━━━┛

The pinout of PS/2 connector is available at Wikipedia.

Hint 1: use wire wrapping to connect wires to PS/2 connector

Hint 2: make sure to flip the PS/2 pinout if connecting to the male part the connector or to the back part of the connector.

The same circuit works with USB keyboards with PS/2 COMBO mode support. It's sufficient to replace PS/2 connector with USB connector according the schematics USB to PS2 schematics.

Keyboard to serial converter

The example converts keyboard to serial which can be then consumed by other board. The receiver board can use pc-keyboard crate to decode signals. The following connection is used in RustZX-ESP32 project.

  ESP32-C3 Converter                         ESP32-S3 Receiver

     RX IO4 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ TX IO17

     TX IO5 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ RX IO18

     GND    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ GND

Run: cargo run --release --example keyboard_to_serial

Keyboard to serial converter - Embassy

Async implementation of the converter with Embassy.

Note: CPU must be clocked at 160MHz to decode values properly, the frequency 80 MHz is not sufficient.

Run: cargo run --release --example embassy_keyboard_to_serial --features embassy


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4