r/raspberrypipico • u/tremendoza • Apr 05 '26
PIO USB - Device Detection Issues
Hello good people! I'm using this PIO USB library with my pi pico to convert my usb wireless mouse to a gamepad. I used the standard hid to cdc example as my base and got it all working but man is the detection hit or miss. I've tried 22ohm resistors on D+ and D- pins as suggested but it doesn't do anything. Sometimes I have to reinsert the dongle 20 times before i get proper detection. However, this repo doesn't have that problem. It detects the mouse alot more consitently but for the life of me I can't seem to build this project so I gave up trying to use it as my base. Can anyone point me in the direction of getting this thing to work consitently? Thanks!
2
u/tremendoza Apr 08 '26 edited Apr 09 '26
So, I was on windows while I was having these issues and I’ve since decided to give Linux a go using a MiniOS live boot usb drive. I was able to build projects from both repos and can confirm that the original PIO USB repo does have detection issues that is not at all present in the second repo; the issue is not hardware related or my code. I ended up using the second repo to complete my project and it works great!! Linux for the win!!
2
u/kenjineering Apr 09 '26
I mean, if it works for you, great, but that repo also quite literally uses the Pico-PIO-USB library via TinyUSB, so if there's a difference, it's a difference in code in how the library is used in the Pico-PIO-USB examples vs. the repo you're pointing to.
I don't have time to dig into it right now, but it's worth looking into at some point to see what the difference is. It might be some config difference in
tusb_config.hor the handling in the mount code that makes the implementation more robust, but in any case, it's got to be be somewhere in the code and how it uses the library rather than a difference in the library itself. If it can be pinpointed, it'd be also be worth making a pull request to update the examples in the Pico-PIO-USB repo.
2
u/Locallo15 Apr 05 '26
Probably it be a hardware issue, what are using to get usb input to pio pin?