USB to Serial Mouse using the Pi Pico!

  • A Raspi Zero is out of question for me.

    Also its not buyable in numbers, so it can`t be used for a easily distributable product.


    Maybe the existing base for tiny2313 could be used and a atmega32u5 or something.

    Hey

    atmega32u4 doesn't have support for usb host. Only device.

    I think a combination of Arduino nano and max3421 might work? (maybe even pico running the Arduino core)
    Maybe it's time to find a usb host shield on amazon or something.

    -Lime.

    Be Happy, it's only going to get worse.

  • Hallo.


    So, I followed one of my personal rules of open source software, "when the official one doesn't work, hope to christ there is a working fork!"
    I found one fork of tinyUSB talking about multiple hub layers which I think was unimplemented on the official version. I tried it out and it picked up the KVM, it connected to it and didn't throw a fit.

    Only problem, I seem to have something broken where it doesn't seem to be posting input data to the correct destination, an issue not exclusive to this fork. I'm very confused by this. I guess I have something set up wrong somewhere along the line but I don't know what.

    HOWEVER, I'm curious if I can backport the fix to make a custom version of tinyUSB 10 which seems to play the nicest with the humble mouse and keyboard.

    So, promising.

    Be Happy, it's only going to get worse.

  • So. turns out that I'm an idiot, no big surprise for those paying attention.

    Real quick,

    Between version 10 of TinyUSB ( the one I was using for this) and version 12 of TinyUSB (the version included in the current version of the Pico SDK) there was a small change that I kept missing.
    You have to repeatedly call a USB host task, in version 10 if there was data from a connected USB device it automatically sent that data to the appropriate callback, in version 11+ that was no longer automatic.
    So there is still one task but you have to tell TinyUSB "Yes I would like data from my USB devices" in both the "USB device mounted" callback and the "here's your data" callback.
    The function for this is called: tuh_hid_receive_report() and in every example it is part of an if statement that printed an error in a debug build. I never thought anything more of it than some error report but it's actually a required function.


    You tell me if I was blind or if it was presented awkwardly.

    Anyway, combine the use of the imperative function AND the fork I had found already, the usb-2-232 actually worked just fine with no problems on my KVM.

    Danke!

    -Lime

    Be Happy, it's only going to get worse.

  • Just to elaborate.

    I haven't uploaded the updated code to the GitHub, still in testing and has to be cleaned up after being prodded and poked.
    I'd like to to test it more with my KVM but I need to do something about it's PSU first. The original 9volt one shorted out so now I'm using it 7809 and a 12 volt supply in short bursts.

    Initial testing with my laptop and 486, the switch over was seamless. The 486 could still talk to the pico, get the mouse driver set up and access the setup terminal all while the actual mouse was controlling the laptop.
    Honestly, it was really damn cool.


    -Lime

    Be Happy, it's only going to get worse.

  • You are fare away Form being an idot! :thumbup: Nice work!

    386SX- 20 Mhz "Erster eigener Rechner!2" NoName Komponenten

    486DX -30 "Industrie PC" auf Steckkarte

    Super Sockel 7 Gigabyte GA-5AA 3Dfx Voodoo 3500 TV

    AMD "Geode" ebenfalls Steckkarte für Backplane

    3x IBM Netvista 8364 "ThinRetroSystem" 1-2 von denen würde ich tauschen...


    "und noch so einiges mehr... "

  • Hallo!

    This is more of a silly update.
    I found that with the newer versions of TinyUSB, my wireless USB mouse caused as assertion error despite working fine before. I checked the code and the only impacting change I can see is that TinyUSB wants devices to give a some description now then checks it with an assertion check. I removed that check and the wireless USB mouse works again. I don't really see the point in a mouse giving the pico its life story but whatever.

    I tried my little Rii wireless pad and it doesn't work very well with this. It picks up that it's a mouse and keyboard but the mouse data is garbage.I don't think that's a big issue.

    I had been experimenting with adding some mouse smoothing. I find the actual cursor is just fine but in Doom for example the camera is jitters if you move the mouse fast. Let me know what you think and if you have any suggestions for how to implement it. Maybe it's just that my 486 is too slow for quick movements in doom, I honestly don't know.

    Danke
    -Lime

    Be Happy, it's only going to get worse.

  • Hallo!

    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 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

    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.

    Danke!
    -Lime

    Be Happy, it's only going to get worse.

  • 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.

  • Hallo!

    I've added support for Baud Rate 19200 which makes this adapter recognizable by the modified mouse drivers included with Matze's PS2toSerial adapter github. It seems to work fine.
    Also I've changed the Dip Switch for 2400 baud for 19200 baud.


    I'm still testing with timings but I'm almost done with that.Well it's pretty much done but I have want to test it more since it is a significant change.

    Danke
    -Lime

    Be Happy, it's only going to get worse.

  • Hallo!

    It has been a few days.

    As some of you may know, the pi pico has two CPU cores caked into it. I have been experimenting with multi core processing, something which I've never done before.
    Currently I have Core 0 handling tinyUSB and core 1 handling the serial interface side of things.

    On the plus side it means that the mouse is reporting very solidly at 25000 microseconds intervals vs the far more loose intervals of up to 30000 microseconds.

    On the negative side, It's proving to be tricky to work with. It's still buggy since I've never worked with multicore processing before.

    I know it's weird to use 2 cores for this but both TinyUSB and the Picos uart tools seem to enjoy blocking. So tight timing on one core didn't feel right.

    That's it for the moment I think. I think 2 core processing will stay, it all depends on the feel of it really.

    Be Happy, it's only going to get worse.

  • Hallo!

    A question for the audience.

    I feel like this project is generally pretty good but there doesn't seem to be much interest in it.


    Is there something I'm missing that should be implemented?
    Should I send out a sample to someone for comment?
    Or has all need for adapters been satiated with the various PS/2 to Serial adapters already?

    I didn't expect to make my first million with this or something silly like that but it feels surprisingly dead in the water as well.
    Regardless of popularity, I would still like to get this to a point where it could be described as scrumptious by a mad man or useful by a more rational person.

    I have been tempted to send out a unit or two to people as a thanks for open sourcing their code.
    This genuinely wouldn't have gotten this far if Scorp had not released his PS/2 to serial adapter on GitHub, I would have given up when trying to build a mouse data packet.


    I'm not sure how best to proceed. I've put a lot of effort into this and I want better for it than to just disappear as soon as I look away.

    Danke
    -Lime

    Be Happy, it's only going to get worse.

  • CalamityLime

    I am following your thread from the very beginning and I am very fascinated by your work.

    Unfortunately I am more a computer assembling man than a electronics guy, so quite a few of the finer details of your work were beyond my scope of expertise, to put it nicely ... :D :D


    Anyhow, I have the adapters from you and also from scorp as potential candidates on my purchasing list, when I finally get my computer corner down in the cellar up and running.


    Best regards,

    Axel

    Daily Driver: MSI X470 Gaming Plus - Ryzen 7 1700 - 32 GB - Geforce GTX 1060 6GB - 1 TB NVMe SSD - 2 x 1 TB Raid-0 SATA

    Projekt #1: ASI 486-33 - Projekt #2: PC Chips M912 486 VLB - Projekt #3: Biostar MB8500TVX-A Pentium MMX 166 - Projekt #4: ASUS TXP4 K6-III 400 - Projekt #5: Gigabyte GA-6BXDS Dual Slot 1 PIII-650 -

    Projekt #6: ASUS P2B-DS Dual Slot 1 PIII-1000 - Projekt #7: Gigabyte GA-6VXD7 Dual Sockel 370 PIII-1000 - Projekt #8: TYAN S2505T Dual Tualatin 1400

  • Hallo Axel

    Thank you for your kind words and interest in this project.

    I've have often described myself as more of an assembler than electronics guy as well. If you had shown this project to me a few years ago, I wouldn't have been able to make any sense out of it.
    Who knows, maybe one day you'll find yourself making your own mouse adapter; joystick to serial mouse maybe? "No more clicking, now just shoot your applications!" :D

    Danke
    -Lime

    Be Happy, it's only going to get worse.

  • Hallo!

    I've been reworking the serial terminal to allow for translation into other languages.


    Does anyone feel like translating it to German? If not, the translation may be a tad spotty.

    Danke
    -Lime

    Be Happy, it's only going to get worse.

  • Hallo,

    I think the easiest way (at least on my end) would be if I made a google doc with the strings which need translating.
    I'm not a fan of GitHub push&pulls.

    Unless someone has a better idea, I'll make a publicly editable google doc and people who add to it can list a name which they would like to be credited by.

    Danke
    -Lime

    Be Happy, it's only going to get worse.

  • sounds like a way even I can support your Projekt :thumbup:

    386SX- 20 Mhz "Erster eigener Rechner!2" NoName Komponenten

    486DX -30 "Industrie PC" auf Steckkarte

    Super Sockel 7 Gigabyte GA-5AA 3Dfx Voodoo 3500 TV

    AMD "Geode" ebenfalls Steckkarte für Backplane

    3x IBM Netvista 8364 "ThinRetroSystem" 1-2 von denen würde ich tauschen...


    "und noch so einiges mehr... "

  • I'll start building a google doc when I have a final list of strings.

    I wrote the serial terminal with the mindset of never editing it again, so I's taking a bit of re-writing.

    Be Happy, it's only going to get worse.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!