VOGONS


USB to Serial Mouse using the Pi Pico!

Topic actions

Reply 80 of 230, by CalamityLime

User metadata
Rank Member
Rank
Member
Deksor wrote on 2022-03-18, 20:37:

It's simple, add the capability of switching between AT and XT, and perhaps other things that could come to my mind.

Ah, for the keyboard?

I had the same thought but I don't have the hardware for testing anything like that. Should the keyboard and mouse adapters combine into one then switching between AT and XT could be done in the same terminal that you can configure the mouse from.

Like I said, I don't know how far it'll get. I ain't a programmer, just an idiot with an if statement.

-Lime

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

Reply 81 of 230, by Deksor

User metadata
Rank l33t
Rank
l33t

I have the hardware so that's why I wanted to experiment with that 😁

My free time isn't extensible though, so it may take me a really long time.

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

Reply 82 of 230, by CalamityLime

User metadata
Rank Member
Rank
Member

Hello there

In regards to the USB-2-232. I hope to get the new firmware out soon, today if possible. Just testing it and I need to update the serial terminal.

Overview of Changes:

  • Added KVM and USB hub support
  • Added different mouse movement types
  • Added "cosine mouse smoothing"
  • Small bug fixes
  • Latest version of the Pico-SDK
  • Latest but modified version of TinyUSB

More Information:

KVM Support

It works fine on my one KVM that I have on hand to test with. Given that TinyUSB is a bit picky, your results may vary.

Movement Types

USB mice communicate with the Pico faster than the Pico communicates with the serial port. Movement type determines what is done wit the extra packets of data.
Note: Applies only to X and Y mouse movement.

ADDITIVE
Adds up the mouse movement and sends it off in the next serial packet.
Results in a very sensitive feeling mouse, sometimes too sensitive and that's where Averaging comes in.

AVERAGE
Finds the average change in mouse movement and sends that off in the next serial packet.
Results in a fairly insensitive feeling mouse, could be useful for a higher DPI mouse or personal preference.

COAST
Unlike Additive and Average; Coast does not throw away extra movement when the mouse is moved quickly, instead it incrementally sends out the movement.
Results in a cursor feeling like it's skidding along on ice at high speeds. I don't know where it would be useful but it's fun to mess with!

Cosine Mouse Smoothing

Makes the cursor proportionally less sensitive at high speeds, leaving the movement mostly one to one at low speeds.
This was added as an attempt to mitigate the problem of the much more sensitive optical mouse overshooting icons on a low res screen.
It could be useful for point and click DOS games but is not recommended for games where mouse movement controls a camera.

SDK

If you've been following along, you've probably guessed that I spend a lot of time swearing at TinyUSB. It's nice to get the project to the latest version of the Pico-SDK (version 1.3.0 at the time of writing) and the latest version of TinyUSB (version 13 at the time of writing). I modified TinyUSB to work with USB hubs/KVM's and hopefully be less picky with what mice and keyboards are used with it.
I'm just going to include the modified version of TinyUSB in the GitHub for USB-2-232. If you want to compile the firmware yourself just replace the Version of TinyUSB in your PicoSDK directory with the one from the GitHub.

Anything Else?
So I hope that this is an interesting update for people. I'm very interested to see how the compatibility is between different KVM's, it has been the most requested feature and it's great to see it work in person.

Let me know what you think
Thanks for your interest
-Lime

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

Reply 83 of 230, by CalamityLime

User metadata
Rank Member
Rank
Member

Firmware version 1.1.1 has been released!

https://github.com/LimeProgramming/USB-serial-mouse-adapter

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

Reply 84 of 230, by CalamityLime

User metadata
Rank Member
Rank
Member

Hallo!

In regards to USB-2-232:

I woke up with the idea that my timing for the serial mouse was sloppy, I explored that topic and found that yes, they were a bit sloppy.
So the next update will address that issue as well as get higher baud rates working right.

Danke
-Lime

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

Reply 85 of 230, by CalamityLime

User metadata
Rank Member
Rank
Member

Hello

I made a rough, unscripted video about the serial terminal on the usb-2-232
With the help of people on Dosreloaded it has been translated to German.

The video is a bit ranty but if you're interested in the topic you might find it interesting,
https://youtu.be/cL6qdjrDeec

enjoy.

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

Reply 86 of 230, by CalamityLime

User metadata
Rank Member
Rank
Member

It would seem that I am now the proud owner of a limited edition Gotek floppy drive emulator.

I got one with an STM32 and the KC30 header, turns out that it's a prototype board and only about 100pcs used the PCB.

I found this out after installing Flash Floppy onto it and adding an OLED with a rotary encoder.
here is the discussion on Flash Floppys github about the topic: https://github.com/keirf/flashfloppy/discussions/636

I did not expect this today.

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

Reply 87 of 230, by CalamityLime

User metadata
Rank Member
Rank
Member

Hello!

Version 1.2 of the USB-2-232 firmware has been released!
https://github.com/LimeProgramming/USB-serial-mouse-adapter

Change Log:

  1. Modified terminal code to be easier to translate.
  2. German language translation added to serial terminal.
  3. Multi-core Processing. The Pi Pico has two cores baked into it so might as well use them. The second core is currently dedicated to transmitting the serial mouse data over UART and the first core is dedicated to handing the USB mouse, plus the serial terminal. This should keep the report rate consistent while keeping lag to a minimum.
  4. Flash wear levelling for saving configuration. Should extend the life of the Pico 200 fold.
  5. Added Support for 19200 baud rate.
  6. Changed the Dip Switch 6 to toggle between 19200 and 1200 baud rates.
  7. PWR LED now flashes while the adapter is in serial terminal mode.
  8. While adapter is in serial terminal mode changes to the dip-switches are ignored. This was an easy way to ruin your day before!
  9. Changed how Coasting movement type worked. Should feel the same but work more consistently.

Known Issues:

  1. Use the Nuke Flash on the Pi Pico before if you're updating. I don't think it is strictly required but I'd recommend it.
  2. Sometimes the Pico seems to crash when leaving the terminal. It's rare and very inconsistent, so I don't know why it's happening.

Enjoy!
-Lime

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

Reply 88 of 230, by Sphere478

User metadata
Rank l33t++
Rank
l33t++

That’s a huge improvement list! Good job!

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 89 of 230, by CalamityLime

User metadata
Rank Member
Rank
Member
Sphere478 wrote on 2022-05-02, 01:29:

That’s a huge improvement list! Good job!

Thanks, I hoped to get it out 2 weeks ago but I had been unwell.

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

Reply 90 of 230, by CalamityLime

User metadata
Rank Member
Rank
Member

Just to clarify.

Matze79's ps2toserial adapter has a high speed mode that runs at 19200 baud, the drivers he included on his github are modified cute mouse drivers that run at 19200 Baud. I've had great luck with them in ms-dos 6.2, not so much with 6.22.

Maybe down the line support for logitech c7 mouse extensions could be included to make use of the other baud rates with the mouseware driver. But that's not a priority, MouseSystems and Sun mouse support would be of higher priority.
However I'm tired of this project for the moment so I think I'll dabble in the usb to ps2 adapter for the moment!

-Lime

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

Reply 91 of 230, by CalamityLime

User metadata
Rank Member
Rank
Member

Hello There!

I had been thinking of ordering a PCB with an at keyboard port for making a USB keyboard to AT keyboard.
I know I've mentioned this before and shown a schematic that I tried on a breadboard. While that did work, I never had much confidence in it and I look at it worried that something has shorted.
So why not try to get a pcb made.

I may have mentioned before that I don't really know much about circuits and my limit of understanding of transistors is that they are magic switches.
So I'm asking for input for handling the AT keyboard side of things. I get the feeling that I'm missing something.

I drew up a circuit based off of the breadboard but with a better 5v to 3v voltage translation using a 74LVC2G34.
The 74LVC2G34 is available in SOT-23-6L and the even smaller SOT-363. 6 legs, power, gnd, 2 inputs and 2 outputs. I can just power it off of the pico itself.
According to TI's datasheet, the chip has back-drive protection so I don't think I need to add diodes to the inputs. The docs ask for a cap on the power but not much else.

The ferrites, 2.2k resistors and 470pf clamp caps are based off of my ALPs keyboard which uses those values. Ferrites for noise and the clamp for any signal bounce (I think)

Now about the NPN's. I'm curious if they should have a speed up cap on the base. For some reason it just bothers me that there's one on the collector side and none on the base. It feels wrong but it's likely that I'm wrong.
I could probably go without R3 R4 R5 and R6 since the Pico has built in pull-ups of 50K but the NPN looks a bit naked without them.

So, let me know what you think. Have I made any mistakes so far?

Attachments

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

Reply 92 of 230, by CalamityLime

User metadata
Rank Member
Rank
Member

Hello!

So I layed out the schematic is Kicad and now I'm deciding what shape the board should take.

Attached is my first idea. It's very rough and lots of space between bits but try to ignore that.
What I was going for with it was to taper down to the serial connector to hopefully keep the rest of the PCB out of the way of what would be around your serial port.
While it can be slimmed down you can see the idea of having the USB, DIN and pico micro USB pointing out one side and the serial port on the other.

Do ye think I'm barking up the right tree with this idea or should I do something else?

-Lime

Attachments

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

Reply 93 of 230, by CalamityLime

User metadata
Rank Member
Rank
Member

​I was thinking about the keyboard connector.

​I went into this thinking that I'll just use a female din port then the user just uses a midi cable to connect the adapter to the PC. The midi cable has a downside where the ground wire for midi goes to either the clock or the data line of the at keyboard din.
For a cheaper cable that wouldn't bother grounding the connector properly, it should work fine out of the box but my advice would still be to "get a midi cable and re-wire it yourself to be safe"

​Now I'm thinking that since this project is still expecting the end user to go soldering, should I change out the connector on the PCB with something smaller? Like a female ps/2 for example.

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

Reply 94 of 230, by Sphere478

User metadata
Rank l33t++
Rank
l33t++

Ooo neat! New version! It’s amazing how the project is never done isn’t it? Lol

Should be easy to make s cover for that, I like it.

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 95 of 230, by CalamityLime

User metadata
Rank Member
Rank
Member
Sphere478 wrote on 2022-05-11, 16:42:

Ooo neat! New version! It’s amazing how the project is never done isn’t it? Lol

Should be easy to make s cover for that, I like it.

KVM support and USB keyboard support were the two most requested things.

KVM support was pretty much just luck. TinyUSB itself has no interest in nested hubs but someone else out there added support for nested hubs with about about 10 lines of code.
I could not figure out TinyUSB to save my life so I was very relieved when someone else had a working solution.

Most of the other stuff I added were just convenience things. The higher baud rate is very nice but really only works under DOS as far as I've found.
Which is fine really since a lot of motherboards made for 98 and up have ps/2 mouse support.
You can still buy new ps/2 mice but really only cheap plastic-y ones.

At least with the usb-2-232 you can use a Logitech g502 and I was surprised when it even worked at 1000hz polling rate. I had to add some handling for mice that want a polling rate that high so they didn't feel weird.
Basically I added a artificial cap on the polling rate that changes with the Baud Rate. So for the highest baud rate the adapter tries to poll the mouse at around 600hz I think.
It does that entirely for feel, it makes playing something like Doom on old hardware; feel surprisingly modern.

-Lime

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

Reply 96 of 230, by CalamityLime

User metadata
Rank Member
Rank
Member

​I spent a few hours tinkering with the PCB. I added a JLC part number for each component that can be soldering on with their SMT service.

​I also experimented with having the midi port point out the side of the PCB to see how much slimmer I can make the board. Not all traces are routed just some to see how viable it is to put all the surface mount parts under the pi pico. Really only the parts between the 2 20 pin sockets have any thought put into their placement.

​I added a poly fuse to the power in line from the midi port.

​J6 is UART0 out that you can use to configure the settings in software with a usb to ttl adapter. That already works with the usb-2-232 but I never added a header for it.

​One 100uf cap is connected to the power in for the pico, 232 and usb port, the second 100uf cap is connect to vsys of the pico which I added for a bit of extra safety when saving config to the flash memory.

​What do you think? I'm not sure I like the midi port pointing off the side I feel like it might be more in the way than a wider PCB but it's just a thought.

Attachments

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

Reply 97 of 230, by Sphere478

User metadata
Rank l33t++
Rank
l33t++

seems like the smallest would be all ports on the same side but for cabling it's nice to have a in side and a 180 degree out side

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 98 of 230, by CalamityLime

User metadata
Rank Member
Rank
Member
Sphere478 wrote on 2022-05-13, 05:54:

seems like the smallest would be all ports on the same side but for cabling it's nice to have a in side and a 180 degree out side

hmmm I get what you mean and the in side and out side is always more intuitive than having to read something tbh.

I suppose maybe that brings up the better question of should this be a dongle that you plug into the serial port directly or should this come in a box and expect the use to run wires to the PC.
The old usb-2-232 was a dongle but it was almost too big. This one has no choice to be larger thanks to the midi port and the extra bits.

Hmmm. I'm not sure.

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

Reply 99 of 230, by Sphere478

User metadata
Rank l33t++
Rank
l33t++
CalamityLime wrote on 2022-05-13, 10:45:
hmmm I get what you mean and the in side and out side is always more intuitive than having to read something tbh. […]
Show full quote
Sphere478 wrote on 2022-05-13, 05:54:

seems like the smallest would be all ports on the same side but for cabling it's nice to have a in side and a 180 degree out side

hmmm I get what you mean and the in side and out side is always more intuitive than having to read something tbh.

I suppose maybe that brings up the better question of should this be a dongle that you plug into the serial port directly or should this come in a box and expect the use to run wires to the PC.
The old usb-2-232 was a dongle but it was almost too big. This one has no choice to be larger thanks to the midi port and the extra bits.

Hmmm. I'm not sure.

Double sided serial cables aren’t hard to come by. So serial port on one side, others on the other is my vote

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)