Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 15:53 23 Apr 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Difficulties with external USB Hub

Author Message
stef123
Regular Member

Joined: 25/09/2024
Location: United Kingdom
Posts: 82
Posted: 03:56am 12 Apr 2025
Copy link to clipboard 
Print this post

Hi,

PicoMiteVGAUSB (no matter, which Version) doesnt seem to like my 7 Port USB Hub, which uses a HS8836A Chip (USB2.0). If a USB Device is connected to it, PM responds with "Invalid Address- reset" = General fault. This is independent on which Connector the Device is being plugged in.

Is it likely that the Chip tries to allocate more USB Channels (7) than the USB Stack could handle / is configured for (4), when a Device has been plugged in?

Edit: Tried to make some adjustments in tusb_config.h, but that doesn't resolve this issue.

Best regards
Stef
Edited 2025-04-12 15:21 by stef123
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4809
Posted: 05:58am 12 Apr 2025
Copy link to clipboard 
Print this post

Hi stef,

I cannot give you an answer, but I assume the on board 4 port hub is 1 level. connecting one port of it to a second hub is level 2. Maybe the stack cannot support 2 levels. You could test this by disconnecting the on board hub (as if you would do a firmware update) and connecting the 7 port hub directly to the pico,

Also I am pretty sure there will be memory limitations on the total number of ports the pico stack can support.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7433
Posted: 06:57am 12 Apr 2025
Copy link to clipboard 
Print this post

I doubt if it's a USB1/2 issue. The module I use is actually a 4-port USB2 hub and the PicoMite is USB1.

Remember that the PicoMite shouldn't be used with powered USB hubs - and I bet a 7-way is powered.

There's no reason to have more than four ports anyway. By the time you have keyboard, mouse and two game controllers on it there's nothing else you can add as other types of devices don't work. The PicoMite's USB system is very simple (for USB).

.
Edited 2025-04-12 17:03 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
stef123
Regular Member

Joined: 25/09/2024
Location: United Kingdom
Posts: 82
Posted: 03:25pm 12 Apr 2025
Copy link to clipboard 
Print this post

Hi,

"technically" the Hub can be powered externally, but it isnt a must, it can happily drive a mouse and Keyboard when connected to the PC without PSU. The Pico itself is powered though 5V 2A, so there is in theory plenty of it.


The thing is: If if wouldn't communicate with the Pico at all, PM should already reject the Hub at the moment he is plugged in with the same fault, without any Keyboard or Mouse attached to it, but that isnt the case. I suppose i have to dive in deeper, since the "invalid address" can be caused by anything including hardware faults of the RP2040.


Mick, may i ask you which Hub you use?

Best regards
Stef
Edited 2025-04-13 01:27 by stef123
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7433
Posted: 04:36pm 12 Apr 2025
Copy link to clipboard 
Print this post

I have a cheap Chinese 4-port external unpowered hub that works fine. This sort of thing.

For my boards I use this module. It works fine, but the footprint is a bit of a nightmare. :)

By the way, you may not be able to stack hubs on a PicoMite. i.e. it might not work if you are plugging a hub into a PicoMite board that already has USB ports. I must admit that I haven't attempted this because, as I said previously, having more than four USB sockets is pointless.

.
Edited 2025-04-13 02:41 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
stef123
Regular Member

Joined: 25/09/2024
Location: United Kingdom
Posts: 82
Posted: 06:08pm 12 Apr 2025
Copy link to clipboard 
Print this post

Well, sort of useless - as you know from my current Project, i am fiddling around with Midi Devices via the PM and the WS-19907 Display. If possible, i really like to use as much as i can via USB-Midi, altrough it isn't entirely a must since i also can use normal Serial RX/TX for that, but i have some Synthesizers which only can be connected via USB.

My current Idea is to move away from the 480x320 LCD and use a rather large VGA-Touchscreen, where its Touch controller thankfully emulates a Mouse.

Of course that will need some adjustments to TinyUSB and PM on Code level and the RP2350 needs to be used for that, in order to be able to provide enough RAM for more than four devices to the USB Stack.
Edited 2025-04-13 04:10 by stef123
 
aFox
Regular Member

Joined: 28/02/2023
Location: Germany
Posts: 100
Posted: 01:03am 13 Apr 2025
Copy link to clipboard 
Print this post

Maybe try two cheap 4-port hubs in series.

It sounds like that you can use also an (old) Android Phone and OliBasic 3.00+.
Cheap, BASIC, Touchscreen and USB Support

Gregor
Edited 2025-04-13 11:11 by aFox
 
stef123
Regular Member

Joined: 25/09/2024
Location: United Kingdom
Posts: 82
Posted: 04:44am 13 Apr 2025
Copy link to clipboard 
Print this post

Nice Idea using the Smartphone :-)

As it seems, some of the cheap Chinese Hubs generally tend to cause Problems on the RP2040 in Combination with TinyUSB.

https://github.com/hathach/tinyusb/issues/2517

So i think that i have to go for the small USB Board which provides 100% Compatibility, instead of buying another USB Hub.
 
stef123
Regular Member

Joined: 25/09/2024
Location: United Kingdom
Posts: 82
Posted: 04:54am 13 Apr 2025
Copy link to clipboard 
Print this post

Another Idea was to use the PI Zero, but in this case i would need to use an external HDMI (or Composite) to VGA Converter, since my VGA-Touchscreen unfortunaly doesn't allow anything else than VGA.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7433
Posted: 07:35am 13 Apr 2025
Copy link to clipboard 
Print this post

TinyUSB is tiny for a very good reason. It's very limited. On top of that the Pico doesn't have much RAM so it's restricted even more. Messing about with USB is decidedly non-trivial so doing things with it is very programming-intensive. I doubt very much if any extension to the Pico's USB capabilities will or even can be done.

It might be better to use a CMM2 for this. The PicoMite 2 is still very limited.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
stef123
Regular Member

Joined: 25/09/2024
Location: United Kingdom
Posts: 82
Posted: 03:20pm 13 Apr 2025
Copy link to clipboard 
Print this post

TinyUSB provides at least Audio/ Midi classes, so at least in theory it could be done.

USB Midi host for example is running on one of my self built 4*4 Midi Interfaces called MidiKlik, which provides a USB Host on a STM32F103C8T6 and exposes 8 Midi Endpoints / Devices to the PC - with 20 KB RAM, where a good amount of RAM is sure used for Midi communication buffering. Of course, that is not comparable to such a complex program like Picomite.
 
stef123
Regular Member

Joined: 25/09/2024
Location: United Kingdom
Posts: 82
Posted: 06:06pm 13 Apr 2025
Copy link to clipboard 
Print this post

For the moment i will stick to go over the Serial Console via MAX3232 and CH340, keeping only the Touchscreen connected to USB.
 
stef123
Regular Member

Joined: 25/09/2024
Location: United Kingdom
Posts: 82
Posted: 08:41pm 13 Apr 2025
Copy link to clipboard 
Print this post

Well, external Touchscreen was working "sort of", because it delivers absolute, not relative x/y-Position, as a Mouse does, additionally in a 12 Bit format, not signed 8 Bit.

Its a TSHARC Octopus Touch Controller integrated into my Screen

https://docs.rs-online.com/3b6c/0900766b807afb5e.pdf

Solved this by modifying USBKeyboard.c


nunstruct[n].L=report->buttons & MOUSE_BUTTON_LEFT   ? 1 : 0;
nunstruct[n].R=report->buttons & MOUSE_BUTTON_RIGHT   ? 1 : 0;
nunstruct[n].C=report->buttons & MOUSE_BUTTON_MIDDLE   ? 1 : 0;

uint8_t *raw = (uint8_t *)report;
nunstruct[n].ax = (raw[2] << 4) | (raw[1] >> 4);
nunstruct[n].ay = (raw[4] << 4) | (raw[3] >> 4);


if(nunstruct[n].ax>=HRes)nunstruct[n].ax=HRes-1;
if(nunstruct[n].ax<0)nunstruct[n].ax=0;
if(nunstruct[n].ay>=VRes)nunstruct[n].ay=VRes-1;
if(nunstruct[n].ay<0)nunstruct[n].ay=0;
nunstruct[n].az+=report->wheel;
if(nunstruct[n].x0!=(report->buttons & 0b111)){
nunfoundc[n]=1;


Still in 8 Bit Format and doesnt cover exactly X/Y 0->255, but thats quite enough for my task. IF's should not be neccessary, but i just leave it in there.


But overall, i think i'll move this Project to a Pi Zero, Linux, Python & Co and attach a HDMI-VGA Converter to it. The Task seems to be indeed too complex to handle it with PM alone; i have too much special needs for it.
Edited 2025-04-14 11:25 by stef123
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7433
Posted: 07:27am 14 Apr 2025
Copy link to clipboard 
Print this post

How about a CMM2? Or is it an embedded application?
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
stef123
Regular Member

Joined: 25/09/2024
Location: United Kingdom
Posts: 82
Posted: 05:08pm 14 Apr 2025
Copy link to clipboard 
Print this post

The System should be only used for this one purpose, the CMM2 would be too good for it.

I would also like to have the original Surfaces of my Synthesizers as a visual representation on my Touch Panel and control them through it, and to achive that, i need a quite high resolution with a decent colour Depth.

Scaling the Pictures of their Surfaces from 1920x1080 and above down to say 640x480, would destroy most of the Markings on them and scrolling trough Parts of the Surfaces is no option either.

I need every controllable Parameter of one particular Synthesizer at a time visible in one Page and for the "feeling" its original surface, instead of using controls like "modified" Bargauges and LEDs, as i already did with the PM + the small Waveshare-TFT.

The CMM2 could resolve at least Resolution issue, but as said, it would be a shame for me to use it only for this purpose.

Of course, everything could be also done on my PC using things like PureData or Max/MSP, with which i alrady have built some control surfaces and Synthesizers in the past, and virtually connect everything together.

But i'd like to have an external solution, which eventually plays a "Man in the middle"-Role between my PC, running a Sequencer, and my music Equipment, without the need to set up every time again virtual connections on one machine, loading and runnign scripts and so on. I'm using Linux, so its quite different from Windows in terms of available Software and "how to do it".
Edited 2025-04-15 03:10 by stef123
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7433
Posted: 06:10pm 14 Apr 2025
Copy link to clipboard 
Print this post

Raspberry Pi then. Any chance of changing the VGA display to a HDMI using the same touch overlay? VGA isn't great in any resolution.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
stef123
Regular Member

Joined: 25/09/2024
Location: United Kingdom
Posts: 82
Posted: 08:19pm 14 Apr 2025
Copy link to clipboard 
Print this post

Maybe - it is a 19 Inch 4:3 Screen, previously being used in a Drugstore and sold for a couple of Euro; the Touch Overlay itself is integrated.

Sure it can be somehow separated, but the question is where to put the overlay in, so that it matches the dimensions of the old screen - with HDMI - and for an affordable price...
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2025