My 286 system does not have built-in mouse support (yet). I have been experimenting with a few options. Back on my 6502 system, I added mouse support with the help of an Arduino Mega. See USB Mouse for 6502. I then used essentially that same approach for my mouse on my 65816 system. See USB Mouse Add-in Card for My 65816.
For my 286, I first tried using an Arduino Nano with a CH375B. Anurag Chugh has a post on how to do this. See Interface USB Mouse to your Arduino using CH375B (electronicsfaq.com). A couple of things I learned from this. The first was that the specific Nano used makes a difference. I have a couple of different batches of Nanos. One batch does not work with the CH375 for this setup, while the other batch works fine. The second thing I learned was that this setup only will provide data when the mouse is moving, so button clicks while the mouse is not moving cannot be reported. Without still mouse button support, I moved on to the next option.
My second test was using an Arduino Mega, like that in my 65xxx builds. However, instead of using an 8-bit interface from a Programmable Peripheral Interface or Versatile Interface Adapter to the Mega, I used SPI from my 286 to the Mega. The SPI interface was a significant step up from my 65xxx approach. However, this solution was fairly bulky.
I then trimmed down the solution to use SPI from my 286 to an Arduino Nano, with the Nano connecting to the mouse with a physical USB connector but using the PS/2 compatibility support in the mouse. I have included interrupt support so that the Nano raises an interrupt on the 286 system whenever the mouse is moved or a button is pressed.
Below is a simple schematic showing how I have the mouse, Nano, and 286 interconnected.
I have placed a copy the Nano .ino file I used in the third video above, along with the 286 assembly code here: x86/286-related/WorkingCode/spi_nano_mouse_20230215 at main · rehsd/x86 · GitHub.
Comments