VOGONS


First post, by Aviancy

User metadata
Rank Newbie
Rank
Newbie

Hey,

I've written a USB to Serial Mouse adaptor and released it as open source under LGPL. As of 23.07.2021 there's two versions of the software, one that runs on Linux and can also be run on a Raspberry Pi and a micro-controller version for making a stand-alone adaptor out of a Raspberry Pico. As far as I know this is the first implementation on a Pico, which is particularly convenient since it can act in USB host mode for the mouse. Planning on releasing a circuit diagram for making the stand-alone adaptor later.

You can find the software at:
https://github.com/Aviancer/amouse

Give it a poke around and let me know what you think.

Since I initially had some problems finding a serial mouse myself and eventually native serial mice are going to get more rare, I thought it would be nice to share this project with everyone who might find it useful.

Currently the software emulates a Microsoft three button mouse with wheel, or the very basic original Microsoft mouse protocol alternatively. All buttons work as well as the wheel as one would expect. I recommend using something like ctmouse.exe for a DOS driver, but I've also used it successfully with Windows 95. For the Linux version basically all you need is a cheap USB to Serial adaptor to connect from your computer

I wrote up some instructions on the Github page on how to use it which hopefully are fairly straightforward.

Quick and simple video of some input testing with amouse on a 486 with DOS 6.2 + ctmouse.exe, https://www.youtube.com/watch?v=sy9O2Y8Pvo0

Reply 4 of 8, by matze79

User metadata
Rank l33t
Rank
l33t

started PCB Design 😀

Thanks for nice work!

https://dosreloaded.de - The German Retro DOS PC Community
https://www.retroianer.de - under constructing since ever

Co2 - for a endless Summer

Reply 5 of 8, by Thermalwrong

User metadata
Rank Oldbie
Rank
Oldbie

Wow, thank you for putting this Anachro Mouse project together and sharing this Aviancy, I'm impressed!
I bought a pair of Pi Pico boards with this exact intent many months ago with a larger order, but just haven't made the time to work on the project - I don't really have much programming experience for that to go well yet. So I've got these boards handy and some TTL to RS232 boards ready to use, this evening I put one together.

Thanks for putting a ready to use build up in the github project page. That was very easy to load up, just connect it to the PC, boot it with the flash button pressed, drop in the firmware and it's done.

The hardware side was a little tougher though. Initially it didn't go well and I found a slight error in the schematic - the schematic shows an RS232 male connector, but the RS232 for a mouse is female, so the CTS needs to be pin 7 rather than 8, the TX should be on 2 and the RX should be on 3.

My ready-made MAX3232 adapter had the TX/RX already positioned correctly, but I put the CTS in the wrong place and was wondering why it didn't work. Ended up having another go on the breadboard and that worked. In Windows it detects as a Standard Serial Mouse:

IMG_1185.JPG
Filename
IMG_1185.JPG
File size
1.07 MiB
Views
291 views
File license
CC-BY-4.0
IMG_1187.JPG
Filename
IMG_1187.JPG
File size
310.16 KiB
Views
291 views
File license
CC-BY-4.0

At last the LED on the Pi Pico went green to indicate detection and it was detected by ctmouse in DOS.

Once I had it working, I starting putting it back into the original config, I want to have the Pi Pico zip tied to the plastic of the RS232. The Micro USB port remains and is just used for power, while the USB port for the mouse connects up to the power and USB data pins.
I hit a snag in that there doesn't seem to be a way to have the Micro-USB used just for power - I'm guessing my little USB charger does something to the USB D+ & D- pins. I think a USB power cable that just has the power wires would've resolved it.
While troubleshooting, the Micro-USB port got damaged and won't work for data to the PC anymore, so I cut the USB data traces to the port and hooked the USB port for the mouse directly to the traces before the cut:

IMG_1190.JPG
Filename
IMG_1190.JPG
File size
1019.78 KiB
Views
291 views
File comment
"cut the red wire..."
File license
CC-BY-4.0

It's hooked up to my Toshiba Portege 610CT, a great little laptop marred by the poor trackpoint and the PS/2 ports being reserved for the impossible to find dock:

IMG_1189.JPG
Filename
IMG_1189.JPG
File size
1.17 MiB
Views
291 views
File license
CC-BY-4.0

Your adapter works extremely well! So far I've tried a couple of games, the detection of CTmouse with it forced to use com1 (because otherwise it uses the bad PS/2 trackpointer otherwise) detected as an MS mouse without issue. Windows 95 eventually detected it and motion is very good on a VGA screen - although a bit quick, I'm keen to try out anything you can add for changing the sensitivity slightly. The Pico has enough GPIO that jumpers / dip switches could work?

In terms of compatibility, it's worked well with the 2x microsoft USB mice I've tried with it. It doesn't work with my Logitech M185 wireless mouse, or my cheap Silvercrest wireless mouse from lidl, but that's probably limits of tinyusb and USB-HID mouse drivers.
Latency was not perceptible with my MS Basic Optical mouse v2, it did feel a little less responsive with the original intellimouse. At this point I've got so many old mice, I can't test with newer ones 😀

It may be worth posting about this in the general hardware forum, it may have gone under the radar in the releases section.
Since PS/2 mice (or USB mice that can fallback to PS/2) are getting harder to find, there should be some interest I think, especially if someone lijke matze79 can make an easy to use adapter board.

Reply 6 of 8, by Aviancy

User metadata
Rank Newbie
Rank
Newbie

Whoa!

Seeing these responses really made my day. What a feeling to see someone build your design and put it to good use, very happy to hear it's working well and being useful. Great to see the pictures too.

A PCB design started no less? Awesome matze79! Do kindly submit a pull request once that's completed, I've not gotten around to learning how to design that part yet.

Thank you Thermalwrong for mentioning about the pins in the schematic - I will check on it. Believe the thought I originally had was reversing the pins cable-wise, rather than the adapter being directly connected to the port. But that's of course not marked in currently and is likely to cause confusion.

There's certainly enough many GPIO pins to set up a dip switch type solution also. My current thinking is along the lines of detecting when both LMB and RMB are pressed and if the scroll wheel is moved up/down to adjust the sensitivity at runtime. This would of course not save the setting if the adapter was powered down between uses, and would then need to be re-applied. There isn't really purpose intended non-volatile memory on the Pico as per default so it's a bit of a challenge to persist settings without added complexity/components. It looks like it might be possible to erase and write a part of the onboard ROM (Where the program also lives) for persisting the settings but that needs more careful investigation.

I noticed the same about my wireless mouse which has a separate receiver that probably doesn't identify as a mouse, I suspect that anything that uses more specialized drivers isn't likely to play happily with TinyUSB by default. I'm rather curious about the latency differences and what they might be caused by. The adapter should accumulate movement until the next transmission is scheduled and optimize it to be pretty much the same latency on the serial side. Could be a data rate difference on the USB side perhaps?

One of the things I've done with the Pico USB port is using a physical host adapter and that interestingly enough worked fine. Another was using a separate power source directly connected to VSYS. I should eventually get around to poking at using the onboard USB port for power delivery a bit more as well, a cable without data pins might well do.

Reply 7 of 8, by matze79

User metadata
Rank l33t
Rank
l33t

Hi, yes,

but i have some small Problem.
The RP2040 is not so easy to buy.

I have to purchase 3400 Units at once or 500 reel...
Thats way to much!

jlcpcb also assembles them put they tell on their page:
Must be Ordered in Multiples of 100 or 500

So i have at least to order 100 Pieces well..

I will change Design a bit to use RP2040 Dev Board then..

https://dosreloaded.de - The German Retro DOS PC Community
https://www.retroianer.de - under constructing since ever

Co2 - for a endless Summer

Reply 8 of 8, by matze79

User metadata
Rank l33t
Rank
l33t

Now got 2x PicoPi for trying out 😀

https://dosreloaded.de - The German Retro DOS PC Community
https://www.retroianer.de - under constructing since ever

Co2 - for a endless Summer