MEGA65 / mega65-core

MEGA65 FPGA core
Other
240 stars 85 forks source link

MK-II keyboard uses a different protocol: Add auto-detect and support for it #637

Closed gardners closed 1 year ago

gardners commented 1 year ago

Is your feature request related to a problem? Please describe. The MK-II keyboard uses I2C to communicate, which is very different to the original keyboard protocol. So the MK-II keyboard doesn't work with current bitstreams.

Describe the solution you'd like The bitstreams should support both versions of the keyboard, automatically detecting which has been connected. Bonus points if hot-swapping works.

Describe alternatives you've considered Slapping fish while chanting. But too alternative to be useful.

Additional context N/A

gardners commented 1 year ago

Solved in two different ways for different targets:

  1. For mega65r2, mega65r3, that have MAX10 FPGAs, the conversion is done in MAX10, because the MAX10 is the FPGA that is actually connected to the keyboard, and thus the only one that can tri-state lines.
  2. For the Nexys4DDR target, adding experimental support for connecting a MK-I or MK-II keyboard using the same approach, by replicating mk2_to_mk1.vhdl from MAX10 into this repo.
gardners commented 1 year ago

Support for Nexys4DDR / Artix7 A100T boards now implemented and confirmed working.