VOGONS


USB to Serial Mouse using the Pi Pico!

Topic actions

Reply 20 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member
touche112 wrote on 2021-12-11, 08:57:

What do the DIP switches do?

I ordered a PCB and assembled one. Pico is running the code and the 5v jumper is bridged but I have no action on the PC.

Hello there
Sorry for the confusion but I wasn't expecting people to make PCBs at this stage.

I need to post an update to the code on the github. If I remember right the code on the github doesn't use the dip switches right, had to make a change to make the board layout easier.
I did want to have more to say on this project by now but I've been set back due to health issues, issues with my PC setup and christmas crap I haven't even had the chance to test the PCB I have.

But to answer the DIP Switch issue,
Switch 1: Three BTN mouse
Switch 2: Wheel Mouse
Switch 3: 75% mouse speed
Switch 4: 50% mouse speed
Switch 3 + 4: 25% mouse speed
Switch 5: 7N2 (for compatibility with some serial controllers)
Switch 6: officially it's reserved but I plan to have it set to a higher baud rate.

I attached a compiled blob of the newest version but keep in mind I haven't had a chance to test it myself. I think it works though.

Hopefully next week will be somewhat normal and I'll get to do a proper update.

Attachments

  • Filename
    pi232mouse.zip
    File size
    26.12 KiB
    Downloads
    50 downloads
    File license
    Fair use/fair dealing exception
Last edited by Stiletto on 2021-12-12, 12:35. Edited 1 time in total.

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 21 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member
touche112 wrote on 2021-12-11, 08:57:

What do the DIP switches do?

I ordered a PCB and assembled one. Pico is running the code and the 5v jumper is bridged but I have no action on the PC.

Oh yes, just to add, that 5v/3v3 jumper is for the max232.
5v plus the resistor dividers for the max232
3v3 and bridge on r3 + r4 for the max3232

I was using the max232 before I realized that the pico wasn't 5v tolerant so I added support for the max3232 but kept the max232 on my boards because that's what I had been using.
I wanted to document these things before slapping the "go ahead and use it" stamp on the project. I'm just working on this when I have the time to, something I haven't had much of for the past month.

Sorry again.
-Lime

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 22 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member
douglar wrote on 2021-12-10, 15:10:

That looks really cool.

I do promise that that's more than bit beyond what I can do at the moment, both knowledge and time wise.
Maybe give Aviancy poke about this idea since he seems to be using the Pi SBC.

Unless there's something I'm missing here.

Thanks
-Lime!

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 23 of 231, by Deksor

User metadata
Rank l33t
Rank
l33t

Interesting project to say the least !

I have some ideas that could help maybe :
Jumpers are nice and simple, but they're not the most convenient thing. You need to remember what they do and the device will most likely sit at the back of the computer which is not the easiest place to reach. Since the device is connected to the serial port, couldn't they be replaced by a DOS program talking to the serial port ? The pi would then save the configuration for the next time. If that's impossible, I guess having a program in autoexec.bat would be enough

As for the PCB, since the pi pico chip can be bought as a standalone chip, I believe the PCB could shrink in size (especially if you also remove the jumpers). Now this is harder to build for a tinkerer, but having an option of building a smaller device is neat !

Trying to identify old hardware ? Visit The retro web - Project's thread The Retro Web project - a stason.org/TH99 alternative

Reply 24 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member

Hello there

So I finally got a chance to mess with my PCB and bad news.
I messed up the footprint of the serial port so that needs fixing. Some bodge wires should fix that issue for the moment. Very annoying, I checked and doubled checked everything and it turns out that I used the dub9 male footprint instead of the female footprint which has the pins reversed.

Thankfully there is a pin header out for the serial! only problem is that the silkscreen for it is also wrong.
So going from the pinheader to a female dsub 9 here is how to wire it properly.

SilkScreen DSub
CTS 2
RTS 8
TxD 3
RxD 7

Thanks!

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 25 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member

Hello there once more.

I was messing about with the code, I think there's a bug in the SDK or something. It doesn't seem to want to talk to the USB mouse very well. The wireless one I was using isn't picked up anymore and a wired one I have is picked up but doesn't seem to send any data??
I was banging my head against the SDK trying to figure out why and I have a hunch that it might be the wire going from the pico to the pcb. I might need to make it shorter or use a thicker cable. I'll try desoldering the wire and seeing if that helps.
I might try using a different pico since mine has some battle scars from being inserted and removed from the breadboard to many times. Some components are chipped or scratched.

The pico uses USB1.1 host which I know is more lax with what it'll work with compared to a USB 2.0 host but still.

Not exactly the best of news today, but still, progress is progress.

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 26 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member

Hello there.

Got a chance to spend a bit more time with this project.

I bashed my head against TinyUSB and why the mice were not working right, ultimately I decided to jump back to a windows environment and use the previous version of the pico SDK.
That actually worked.
I found a few complaints on a forum about how the newer version of TinyUSB is a little broken. Maybe I'll revisit this problem if a newer version of TinyUSB actually has working support for USB hubs.

With that head wreak out of the way. Scorp on Dosreloaded pointed out that I can just solder the serial port on upside down and it should work. He is right. Unfortunately I mixed up two pins so I had to run two bodge wires to get the onboard serial connector working right. It's a simple little thing and I'm using the 6 pin header out for this.
I 3d printed a little case to keep the PCB some bit safe.

For the moment it seems like things are back on track!

I'll have to fix the KiCad files at some point but the new code and binary are on the github!

-Lime

Attachments

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 27 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member
Deksor wrote on 2021-12-12, 11:56:
Interesting project to say the least ! […]
Show full quote

Interesting project to say the least !

I have some ideas that could help maybe :
Jumpers are nice and simple, but they're not the most convenient thing. You need to remember what they do and the device will most likely sit at the back of the computer which is not the easiest place to reach. Since the device is connected to the serial port, couldn't they be replaced by a DOS program talking to the serial port ? The pi would then save the configuration for the next time. If that's impossible, I guess having a program in autoexec.bat would be enough

As for the PCB, since the pi pico chip can be bought as a standalone chip, I believe the PCB could shrink in size (especially if you also remove the jumpers). Now this is harder to build for a tinkerer, but having an option of building a smaller device is neat !

Hello there!

Setting the mouse settings from a program within DOS was something done by Matze and his ps/2 to serial project. I thought about doing the same but decided not to since I really have no idea what the interest in this would be. There really isn't any reason why it can't be done with the hardware as is, nothing that I can think of anyway. I know a handful of ways to store data like that between boots with circuitpython/micropython, shouldn't be a reason why the C sdk couldn't do the same. Never actually tried writing programs that talk to each other using rs232, could be a fun experience but I honestly have no idea if that's worth while. My thought is that most people using something like this would set and forget their settings, just going with what works for them.
Let me know if my thinking on that is wrong or not. I'm just guessing.

Yeah the Pico chip is available on it's own, it needs only a few bits around it to work. I did think about and I might do it for fun at some point or just as a personal challenge. You're not going to get a company which offers SMT assembly to do a small batch with the rp2040 for a while so makers would be limited to using hot air rework gear. Plus this is my first PCB so I wanted to limit what I can mess up. Maybe when the current goal of this project is achieved I might design a PCB that takes the pico chip directly at the caveat of not blaming me if I mess something up!

Thanks for your interest!

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 28 of 231, by Deksor

User metadata
Rank l33t
Rank
l33t

Well you're right about the fact that people may try settings that suit them the best and then live with that.

However just doing that with jumpers makes the whole thing harder I think. I mean, you have the choice between moving your set so you can easily reach the rear and then test different jumper settings (reboot between each change ?). To me plugging a mouse in the connector and then mess with the settings through software is better, especially if you don't have to reboot the machine (I don't mean that you actually do that, I mean I just don't know). Furthermore you could perhaps add other settings ? I can't think of one yet (are the jumpers only made to set the sensitivity for the mouse for the X axis ?), but I mean if you think of a new setting later, you can easily add it via software. However you can't really add a physical jumper if needed 😅

For the pico chip solution, indeed this will most likely only be used by hobbyists as well. I'm just saying having the option to have something smaller could be nice, now the way it's made right now is really good as well 😁

Trying to identify old hardware ? Visit The retro web - Project's thread The Retro Web project - a stason.org/TH99 alternative

Reply 29 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member
Deksor wrote on 2021-12-21, 21:30:

Well you're right about the fact that people may try settings that suit them the best and then live with that.

However just doing that with jumpers makes the whole thing harder I think. I mean, you have the choice between moving your set so you can easily reach the rear and then test different jumper settings (reboot between each change ?). To me plugging a mouse in the connector and then mess with the settings through software is better, especially if you don't have to reboot the machine (I don't mean that you actually do that, I mean I just don't know). Furthermore you could perhaps add other settings ? I can't think of one yet (are the jumpers only made to set the sensitivity for the mouse for the X axis ?), but I mean if you think of a new setting later, you can easily add it via software. However you can't really add a physical jumper if needed 😅

For the pico chip solution, indeed this will most likely only be used by hobbyists as well. I'm just saying having the option to have something smaller could be nice, now the way it's made right now is really good as well 😁

Hiya!

You make some good points.

I suppose to clarify one thing off the bat because I don't think I ever did 😅.
The most of the settings accessible via the jumpers can be changed on the fly. The mouse speed and number of stop bits are changeable on the fly, the mouse type currently is not, for the moment to change the mouse type you have to flip the dip switch and tap the reset button. If the mouse was already talking to the PC it should just continue but the driver might need refreshing.
I haven't found something documenting support for changing the type of mouse on a serial connector yet, so I'm just keeping an eye out. My worry would be throwing junk at drivers which don't expect it and them getting confused in the name of convenience. I'll have to explore this at some point but honestly at small scale I feel just tapping the reset button and refreshing the driver is the safest way.
Also, when I said reboot, I meant the pico rebooting, not the PC itself. I want the PC to think it's talking to a normal mouse with no quirks to it whatsoever.

With that out of the way.

You do make a good point about adding additional settings down the line. I get what you're saying and if that's a road this project decided to walk down then I'd probably need to team up with someone to make the tool on the PC side of things or at least have a good helping hand to point in the right direction. I never made a dos program before and I'd like this to be compatible with as much as possible.
If the project winds up being bigger than I think it will be, then yeah, it would very much be worth while. For what you've pointed out alone.

I did think of a bit of a stop gap solution for the small scale that I'd like peoples option on. (this would be more down the line tinkering on my free time or if someone else wanted to add them)
List some settings at the top of a file in the source code and let the user compile the binary blob then if that's set just ignore the jumpers either completely or partially.
Independent x and y sensitivity settings would be good example for that. CTmouse plays the nicest so far with mice whose sensitivity is a lot higher than in the days of ball serial mice, Logitech drivers do not. Currently the sensitivity jumpers are set as a whole, so 50% would be 50% of both X and Y. To me that still doesn't feel right with logitech drivers.

Thanks for your interest
-Lime

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 30 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member

Hello

So I soldered together the last12 PCB's with all their connectors. I left out the serial connector for an experiment with an expansion slot mount. The original plan was to slide in PCB but with the upside down serial port the board takes up too much room. If I put together a decent little mount I'll just give the option of an expansion slot mount or the serial port for use outside the PC case.

If you're wondering about the wires. I cut the swapped traces with a Dremel, the wires are soldered in under the 6 pin header and I'll solder them in with the serial port and might just cut them off for an expansion slot mount .
My back is feeling a little tight from the soldering so that might be it for today. It was nice though, it felt like the adult version of gluing the Lego pieces together.

-Lime

PS: I ordered the Pi Picos for the boards from Berrybase.de today as well. The little things get costly when you're buying a few of them.

Attachments

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 32 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member

Hello there!

Happy new year!

While fixing the teething issues with the original PCB, I decided to make a slimline version of it without the dipswitchs, USB pin header and Serial pin header for those who value the PCB being small over all else.
I got it as small as I could (bar a millimetre or two) while keeping the pico PCB. To go smaller again I'll have to actually put the actual pico chip onto the board. In theory you could probably just cut a third of the pico PCB off and make the main PCB smaller as a result, that could be fun for those who like making portable Wii's 😂

Anywho, let me know what you think.
I'm pretty sure everything is wired into the correct place this time.

-Lime

Attachments

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 34 of 231, by Sphere478

User metadata
Rank l33t++
Rank
l33t++

Awesome project!! Very good job!

For your smaller version, maybe some micro jumpers may let you keep the dip options?

Any chance of making one that makes my fancy rgb keyboard work on my oldschool din kb port? 😀

Sphere's PCB projects.
-
Sphere’s socket 5/7 cpu collection.
-
SUCCESSFUL K6-2+ to K6-3+ Full Cache Enable Mod
-
Tyan S1564S to S1564D single to dual processor conversion (also s1563 and s1562)

Reply 35 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member
Sphere478 wrote on 2022-01-01, 14:50:

Awesome project!! Very good job!

For your smaller version, maybe some micro jumpers may let you keep the dip options?

Any chance of making one that makes my fancy rgb keyboard work on my oldschool din kb port? 😀

Hello there!

For the smaller jumpers, I thought about it but held off to see what I came up with otherwise to see if there is a spot for them. I'm not sure that there is a nice spot for them.
There is a surface mount dip switch package that is a lot smaller than the bigger kind so I might try to squeeze that on there if there is room. I don't want to get rid of the power in pin headers just because from my own tinkering, micro usb sucks for power.

About the keyboard, that is something that crossed my mind a few times but I haven't looked into that at all. I have no idea if there is anything out there that does that already or not. I would worry about compatibility since newer keyboards do all sorts of rubbish for nkro and increased polling rates that could mess with the pico. That's something which would need to be tested.
I'm sure there would be interest in it though, imagine playing a game on a 486 with a new logitech mouse and keyboard, the novelty alone would be fun.

-Lime

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 36 of 231, by Deksor

User metadata
Rank l33t
Rank
l33t

Having a device that would combine both mouse and keyboard support could be interesting. Maybe you could avoid the need for an external power supply anymore since the keyboard connector supplies 5V 😁

Trying to identify old hardware ? Visit The retro web - Project's thread The Retro Web project - a stason.org/TH99 alternative

Reply 37 of 231, by CalamityLime

User metadata
Rank Member
Rank
Member
Deksor wrote on 2022-01-01, 17:35:

Having a device that would combine both mouse and keyboard support could be interesting. Maybe you could avoid the need for an external power supply anymore since the keyboard connector supplies 5V 😁

The ps/2 port gives out about a 200-250milamp @5v, I think a DIN style connector is much of the same. Powering a pico + keyboard could be pushing it if the keyboard is RGB. My cheapo RGB keyboards takes about 300-400 milliamp with LEDS on full, which is fine for the 500 milliamp -> 2amp limits of a USB port.
So I don't think it could break away from having a power in, even if it's an optional one just for RGB keyboards.

Combing the two into one would probably take a teensy since the picos USB host support via TinyUSB is kinda crap. I wish the pi foundation just copied what the teensy did instead. Doing two separate devices (that you could probably daisy chain together to avoid a second power supply) would be more reliable with a pico.
While TinyUSB is handy and people seem to like it for making midi controllers, I don't like it. It's buggy, poorly documented, people who get it to work really have to force it to work and above all it's written differently to the PicoSDK. So it feels harder to keep track of than it should be.

Sorry for the whining but I'm just being honest. If I did this over again, I'd go with a teensy.

-Lime

Be Happy, it's only going to get worse.
- Projects
Limes Strange 3D models
USB-2-232

Reply 38 of 231, by Deksor

User metadata
Rank l33t
Rank
l33t

That's good, I have a similar idea in mind which I may or may not do someday, which would also use USB, so this is good to see other people's experience with such thing !

Trying to identify old hardware ? Visit The retro web - Project's thread The Retro Web project - a stason.org/TH99 alternative

Reply 39 of 231, by Sphere478

User metadata
Rank l33t++
Rank
l33t++

Supplemental Power input should be a mini usb imho (not micro)

Power it from a spare usb port on the machine or a iphone charger and mini usb cable.

Would be nice if it was optional and tried to run from the ps2/din

I’ll grab a ma reading from my keyboards later

Sphere's PCB projects.
-
Sphere’s socket 5/7 cpu collection.
-
SUCCESSFUL K6-2+ to K6-3+ Full Cache Enable Mod
-
Tyan S1564S to S1564D single to dual processor conversion (also s1563 and s1562)