Skip to content

Instantly share code, notes, and snippets.

@dglaude
Created September 24, 2022 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dglaude/67585e5be7f59e0f080afbe1f8a25ba9 to your computer and use it in GitHub Desktop.
Save dglaude/67585e5be7f59e0f080afbe1f8a25ba9 to your computer and use it in GitHub Desktop.
PS2 on CircuitPython reseach

PS2 is a old PC keyboard (and mouse) connector/protocol used prior to USB. It is still available on some PC mother board. The protocol is serial and run at 5V, so it require electronic if your microprocessor is 3V.

Support for CircuitPython was added by user elvis-epx with the PR: adafruit/circuitpython#1893

The process to add PS2 protocol to CircuitPython was documented by the author: https://epxx.co/artigos/howto.html

Here is the CircuitPython documentation: https://docs.circuitpython.org/en/latest/shared-bindings/ps2io/index.html

You need to use a board that as the ps2io module build in, so check the support matrix: https://docs.circuitpython.org/en/latest/shared-bindings/support_matrix.html?filter=ps2io#module-support-matrix

https://docs.circuitpython.org/en/latest/shared-bindings/ps2io/index.html

Todbot sample code on how to use it: https://gist.github.com/todbot/08fbfc7613de6b3151f441ffa7f86584

Voilà

This board would be interesting to investigate, to connect a PS2 to a QT Py: http://land-boards.com/blwiki/index.php?title=TinyPS2

TODO: Take the KMK module for PS2: https://github.com/elvis-epx/kmk_firmware/blob/ps2_howto/kmk/ps2protocol.py Adapt it to the official accepted CircuitPython API. Propose as a PR to the main KMK repo: https://github.com/KMKfw/kmk_firmware And I think this should be used: https://github.com/elvis-epx/kmk_firmware/blob/ps2_howto/user_keymaps/epx/ps2converter.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment