Powering DE10-Nano from USB HUB

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, spiny, Greenious, Sorgelig, Moderator Team

Locutus73
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 135
Joined: Wed Feb 07, 2018 6:13 pm

Powering DE10-Nano from USB HUB

Postby Locutus73 » Thu Mar 01, 2018 12:20 pm

Hi,
I'm not an expert in electronics and electricity so I’m asking here before I damage my board.
I own this an Amazon Basics USB 3 powered HUB with a powerful power brick
71tEoiYQvjL._SL1500_.jpg
this HUB is able to provide good wattage (I think 12.5W on each port) and has three “fast charging” ports.
Now, I was thinking about using an USB to barrel connector cable
71b6ANuTAVL._SL1500_.jpg
in order to power the DE10-Nano from the same USB HUB that will be connected to the micro USB OTG port. So the USB HUB will have two physical connections to the DE10-Nano board:
1) A normal USB3 cable for USB data connection between the HUB and the DE10-Nano OTG port
2) A USB to barrel connector cable in order to provide 5V power to the DE10 Nano
This way I could use just the USB HUB power brick (connected to a domotic socket) in order to power the entire system.
Is there any electrical contraindication in this setup? Will I damage anything?

Many thanks in advance.
Best regards.

Locutus73
You do not have the required permissions to view the files attached to this post.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2181
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Powering DE10-Nano from USB HUB

Postby Sorgelig » Thu Mar 01, 2018 5:12 pm

I don't see why such connection may conflict.

Locutus73
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 135
Joined: Wed Feb 07, 2018 6:13 pm

Re: Powering DE10-Nano from USB HUB

Postby Locutus73 » Thu Mar 01, 2018 5:44 pm

Sorgelig wrote:I don't see why such connection may conflict.

Good,
I was worried about, I don't know, common grounds between the two connections? Something like back power from the data cable? Again, I'm no expert, maybe those are just mumbo jumbos of mine...

I remember you talked about some form of electric protection on the OTG USB chip.

[EDIT]
Good news! Today Poste Italiane realized they have my SDRAM package in their hands (according to USPS they have it since February the 10th)!!! Now they’re processing it through customs… incredible and sad at the same time!!!

Thank you Sorgelig

Locutus73

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: Powering DE10-Nano from USB HUB

Postby Foxie » Thu Mar 01, 2018 7:18 pm

I don't think you'll cause any damage, but there are a couple of things about the USB specification that you might want to be aware of.

First, the USB spec only guarantees to deliver 4.4V - not 4.75V like a lot of 5V devices require. You will probably find some hubs have diodes or transistors in series with the power supply, dropping the voltage below 4.75V even if the PSU is delivering 5V. For an FPGA I doubt this will be a problem - the 5V supply is regulated down to 3.3V and lower anyway.

Second, the USB spec requires a maximum capacitance of 10uF and the device must not back-drive the port. Chances are, a USB hub isn't really going to care about you violating these requirements. You can definitely destroy a computer beyond repair by back-driving a USB port. So make sure you only connect that USB-to-barrel cable to a hub, not a computer.

Third, the USB spec requires a device draw no more than 100mA until it's configured. After that, it can draw up to 500mA (a bit more for USB 3). You can generally get away with violating the 100mA requirement, but not always the 500mA requirement. I suspect a hub is going to be pretty simple by design, there isn't much you can damage by drawing too much current. At worst, there will be a polyfuse or current limiter circuit which trips.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2181
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Powering DE10-Nano from USB HUB

Postby Sorgelig » Thu Mar 01, 2018 7:51 pm

Actually, there are many high powered HUBs providing extra current for devices like iPad and other tablets. It can be 2A or even 3A. So it will be enough for DE10-nano.

But I've missed the part about "fast charging ports."
I wouldn't recommend any source supporting fast charging as it can provide 9 to 13 volts over USB. Of course it starts to provide higher voltage after negotiation, so usually non-compatible devices won't get more than 5V. But you cannot be sure someday it won't mistakenly treat DE10-nano as fast charging device and bump the voltage. Not safe.

Locutus73
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 135
Joined: Wed Feb 07, 2018 6:13 pm

Re: Powering DE10-Nano from USB HUB

Postby Locutus73 » Thu Mar 01, 2018 10:23 pm

How much current can the DE10-Nano draw under load (i.e. running Windows under 486 core)?
I see it has a 5V 2.5A transformer.
I could use both that beefy 10 port USB3 hub with its own laptop style 19V 3A power brick or a small 4 port USB3 hub with a small 5V 2.5A transformer; the first one seems a bit overkill (with a lot of headroom) to me, but the second one maybe is too little powerful to feed both the board and three wireless dongles. I don’t know.
This evening I measured 5.10V on the barrel USB cable connected to a “fast charging” port with no load; I briefly tried the DE10-Nano and it booted to the main core.
This weekend I’ll have some time to do some more tests.

Thank you in advance

Locutus73

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: Powering DE10-Nano from USB HUB

Postby Foxie » Thu Mar 01, 2018 11:45 pm

Sorgelig wrote:Actually, there are many high powered HUBs providing extra current for devices like iPad and other tablets. It can be 2A or even 3A. So it will be enough for DE10-nano.

But I've missed the part about "fast charging ports."
I wouldn't recommend any source supporting fast charging as it can provide 9 to 13 volts over USB. Of course it starts to provide higher voltage after negotiation, so usually non-compatible devices won't get more than 5V. But you cannot be sure someday it won't mistakenly treat DE10-nano as fast charging device and bump the voltage. Not safe.


How does a device know whether it's attached to a high power hub? A device can detect a charger by pulling D- to a specific voltage and checking for a voltage on D+ - and refuse to charge if it's connected to a computer. Does the hub need to support some kind of extended negotiation? Some devices use so-called "charger detector" chips, and I think those only detect voltages on D- / D+.

I know higher voltages are used for USB-C, but do devices with USB-A connectors exist which use > 5V? USB-C seems to allow up to 20V, and has a dedicated communication pin for that.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2181
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Powering DE10-Nano from USB HUB

Postby Sorgelig » Fri Mar 02, 2018 4:18 am

DE10-nano draws nearly constant current. No matter which core you run - Menu or ao486.
It draws around 1A-1.2A as far as i know.
Pi-Top battery reports ~500mA on 16.5V with minimum display brightness.

Fast chargers started to appear on USB2.0 devices (phones with micro-USB). Even my Samsung S8 with fast charge 3.0(or 4.0 - i forgot) comes with USB-A 2.0 charger. So, yes USB-A 2.0 connector is the common connector for fast chargers. Depends on phone, the cable may have micro-USB or USB-C.

With my USB power modification i've posted in separate topic, you can power the whole DE10-nano from micro-USB connector and still use it as USB host. Though you need to be careful as back powering has no over-voltage protection. Main power jack has over-voltage protection which in theory should disconnect the DE10-nano if input is >5.4V.

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: Powering DE10-Nano from USB HUB

Postby Foxie » Fri Mar 02, 2018 5:10 am

Sorgelig wrote:Fast chargers started to appear on USB2.0 devices (phones with micro-USB). Even my Samsung S8 with fast charge 3.0(or 4.0 - i forgot) comes with USB-A 2.0 charger. So, yes USB-A 2.0 connector is the common connector for fast chargers. Depends on phone, the cable may have micro-USB or USB-C.


Is the charger actually delivering more than 5V though? If the device detects a charger rather than a computer, it could potentially draw 2A or more without problems. That's a fair bit of charging current for a small lithium ion battery.

I would hope if there's a method to negotiate higher voltages on a USB A connector, it would be very fail-safe.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2181
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Powering DE10-Nano from USB HUB

Postby Sorgelig » Fri Mar 02, 2018 5:23 am

I believe Qualcomm is the fast charger patent holder. I don' know if FC negotiation details are freely available. It's possible it may use a standard USB data communication to agree the power supply specs. There is special Qualcomm FC chip inside the phones.

FC voltage is variable. FC v2.0 uses 9V with 2A. FC v3.0 uses 13V (don't know about current). The current passed through USB has physical limit, that's why FC uses a higher voltage to overcome this limitation.
Since i don't see any usage of higher USB voltage for my devices, i never check precise details of FC and possibility to ask the PSU deliver it. Probably, internet can give you more details.

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: Powering DE10-Nano from USB HUB

Postby Foxie » Sat Mar 03, 2018 10:44 pm

Sorgelig wrote:I believe Qualcomm is the fast charger patent holder. I don' know if FC negotiation details are freely available. It's possible it may use a standard USB data communication to agree the power supply specs. There is special Qualcomm FC chip inside the phones.

FC voltage is variable. FC v2.0 uses 9V with 2A. FC v3.0 uses 13V (don't know about current). The current passed through USB has physical limit, that's why FC uses a higher voltage to overcome this limitation.
Since i don't see any usage of higher USB voltage for my devices, i never check precise details of FC and possibility to ask the PSU deliver it. Probably, internet can give you more details.


I managed to find a datasheet for a Qualcomm fast charge chip - which outlines the protocol used. It uses specific voltages on the D+ / D- lines to select a Vbus voltage. The device first places a request on the lines to select which voltage it wishes to use. Then, the device switches the lines to the "continuous" mode by pulling them to another pair of voltages. At this point, the charger raises its output voltage. If the device is disconnected from the charger, the output capacitor in the charger is discharged and it switches back to 5V.

Because of the need to switch the lines between two pairs of voltages, I don't think there's much chance of accidentally activating high voltage mode. It should be safe to assume that Vbus will always be 4.4V to 5.25V when there's nothing connected to D+ / D-.

Locutus73
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 135
Joined: Wed Feb 07, 2018 6:13 pm

Re: Powering DE10-Nano from USB HUB

Postby Locutus73 » Mon Mar 05, 2018 10:39 am

Yesterday I was able to perform some tests (with the “old” MiSTer distro available on Sunday) and, no matter what, I wasn’t able to reliably power my DE10-Nano through powered USB hub.
I tested both the big Amazon’s hub, the one with fast charge ports,
71tEoiYQvjL._SL1500_.jpg
and a small Amazon’s 4 ports hub.
71q72XXMgiL._SL1500_.jpg
I tested the ports with a multimeter and the big one has 5V only on the “fast charging” ports with the power brick connected, but the USB data cable disconnected; the small one has 5V on all 4 ports under the same conditions.
With both USB hubs I can power up the DE10-Nano with the USB-barrel connector power cable
71b6ANuTAVL._SL1500_.jpg
until I keep the USB data cable disconnected: as soon as I connect the data cable the DE10-Nano goes into a reboot loop. I think that, as soon as the data cable is connected and the hub is “initialized” by the kernel, it “power cycles” all the ports.

Now I’ll try to power both the DE10-Nano and the small hub in parallel, using the hub's 5V 2.5A power brick.

[EDIT]
Today Poste Italiane finally delivered my SDRAM+heatsink+fan package along with DHL, which delivered my Analogue Super NT (shipped Friday vs Poste Italiane 1 month trip)… and they both required no additional custom fees! Christmas time!!!

Best regards.
Locutus73
You do not have the required permissions to view the files attached to this post.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2181
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Powering DE10-Nano from USB HUB

Postby Sorgelig » Mon Mar 05, 2018 12:27 pm

I'm not sure what you mean by power from USB. Since devices and cables involved in discussion are all USB - it's easy to confuse.
DE10-nano cannot be powered from micro-USB. Even in USB device mode it's impossible to power from USB.
You can power from microUSB only with hardware modification: viewtopic.php?f=117&t=32879

You've shown that USB to barrel adapter - so i've thought this is the cable you want to use to power the DE10-nano. If USB hub/AC adapter supplies enough power, then you can use this USB->barrel cable to power the DE10-nano.

Usually USB hub has no power control on USB sockets, so the state of hub usually doesn't affect the power on USB ports. The reason why DE10-nano turning off while USB initialization is unclear. Probably it's not enough power supplied to DE10-nano and small fluctuations on power affect the stability of the board.

Locutus73
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 135
Joined: Wed Feb 07, 2018 6:13 pm

Re: Powering DE10-Nano from USB HUB

Postby Locutus73 » Mon Mar 05, 2018 2:37 pm

Sorgelig wrote:I'm not sure what you mean by power from USB. Since devices and cables involved in discussion are all USB - it's easy to confuse.
DE10-nano cannot be powered from micro-USB. Even in USB device mode it's impossible to power from USB.
You can power from microUSB only with hardware modification: viewtopic.php?f=117&t=32879
You've shown that USB to barrel adapter - so i've thought this is the cable you want to use to power the DE10-nano. If USB hub/AC adapter supplies enough power, then you can use this USB->barrel cable to power the DE10-nano.

I’m not trying to backpower the DE10-Nano through micro USB, and you’re right, it’s easy to confuse, I’ll try to explain the issue to my best. Here’s the tests I performed with both USB hubs obtaining the same exact results.

Test A:

Code: Select all

HUB Power brick ->Powered HUB->USB to Barrel connector->DE10-Nano barrel power socket
In this case the DE10-Nano boots correctly and stays on.

Test B:

Code: Select all

                               ┌-> USB to Barrel connector->DE10-Nano barrel power socket
HUB Power brick ->Powered HUB->|
                               └-> USB data cable->USB to micro USB OTG cable->DE10-Nano OTG Micro USB port
In this case the DE10-Nano goes into a reboot cycle as soon as I plug the USB data cable

Sorgelig wrote:Usually USB hub has no power control on USB sockets, so the state of hub usually doesn't affect the power on USB ports. The reason why DE10-nano turning off while USB initialization is unclear. Probably it's not enough power supplied to DE10-nano and small fluctuations on power affect the stability of the board.

I don't know; I mean, the small HUB could have not enough power, but the big one has a 19V 3.16A laptop style power brick, it should have enough juice to power 10 DE10-Nanos plugged in each of its 10 USB ports.

Locutus73

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: Powering DE10-Nano from USB HUB

Postby Foxie » Mon Mar 05, 2018 7:28 pm

Did you measure the voltage on-load? It's possible that it drops to 4.4V which could upset the DE10-Nano. On the other paw, most FPGAs run from 3.3V and lower. In that case, you should be OK with a lower input voltage.

Is the hub data cable connected to the hub's host port, or one of the device ports? It's possible some hubs may switch the power to the device ports. Have you checked with a multimeter to see if the power is cycling?

Locutus73
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 135
Joined: Wed Feb 07, 2018 6:13 pm

Re: Powering DE10-Nano from USB HUB

Postby Locutus73 » Tue Mar 06, 2018 12:32 pm

Foxie wrote:Did you measure the voltage on-load? It's possible that it drops to 4.4V which could upset the DE10-Nano. On the other paw, most FPGAs run from 3.3V and lower. In that case, you should be OK with a lower input voltage.

I didn’t measure the voltage dip/sag; I should find a contact to tap and, honestly, I really don’t care, since this solution seems to be unreliable after all.

Foxie wrote:Is the hub data cable connected to the hub's host port, or one of the device ports? It's possible some hubs may switch the power to the device ports. Have you checked with a multimeter to see if the power is cycling?

The USB data cable is connected to the hub's host port and to the DE10-Nano OTG port. I meant to use the HUB as DE10-Nano’s power source and HUB for keyboard and joypad dongles.

Now I’ll try to use the hub’s 5V 2.5A transformer in order to feed both the hub and the DE10-Nano in parallel.

Best regards

Locutus73

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2181
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Powering DE10-Nano from USB HUB

Postby Sorgelig » Tue Mar 06, 2018 1:02 pm

With new USB host driver i use simple OTG HUB which obviously draw the power from DE10-nano and i have no problems to connect at the same time: RF receiver for keyboard, RF receiver for gamepag, wifi dongle and USB power to VGA splitter(!). I didn't use USB power mod.
So far so good. If you don't plan to power something powerful, then probably you don't need external power for USB hub. Try it.

There is one thing to mention: Current DE10-nano has revision C0 with revised USB power. It uses other chip for USB power. I have another DE10-nano with B2 revision and old USB circuit but i've modified USB power there and cannot test currently if new USB host driver is the one which really improved USB power or it's because new HW revision.

Locutus73
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 135
Joined: Wed Feb 07, 2018 6:13 pm

Re: Powering DE10-Nano from USB HUB

Postby Locutus73 » Tue Mar 06, 2018 2:22 pm

Sorgelig wrote:With new USB host driver i use simple OTG HUB which obviously draw the power from DE10-nano and i have no problems to connect at the same time: RF receiver for keyboard, RF receiver for gamepag, wifi dongle and USB power to VGA splitter(!). I didn't use USB power mod.
So far so good. If you don't plan to power something powerful, then probably you don't need external power for USB hub. Try it.

Oh, well, I’ll try this approach with the small 4 port hub. Honestly, few days ago, I tried to use the big 10 port hub on the DE10-Nano without its power brick and it didn’t work, but probably it is power hungry. Then I forgot to test the small one without its transformer. I’ll test and I’ll report back the results.

Sorgelig wrote:There is one thing to mention: Current DE10-nano has revision C0 with revised USB power. It uses other chip for USB power. I have another DE10-nano with B2 revision and old USB circuit but i've modified USB power there and cannot test currently if new USB host driver is the one which really improved USB power or it's because new HW revision.

If I remember correctly I have a B2 revision; do I have to test the unpowered hub with the recent kernel you posted elsewhere?

Locutus73

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: Powering DE10-Nano from USB HUB

Postby Foxie » Tue Mar 06, 2018 3:39 pm

Locutus73 wrote:The USB data cable is connected to the hub's host port and to the DE10-Nano OTG port. I meant to use the HUB as DE10-Nano’s power source and HUB for keyboard and joypad dongles.


I wonder if the hub is sensing power on its host port, and switching over to that? If it does so then it would be trying to draw power from the DE10-Nano, which in turn is getting its power from the hub - which gets its power from the DE10-Nano. So, it would shut off. Then the hub might notice the lack of power on its host port and switch back to the external transformer and the cycle repeats.

You could try to stop the hub drawing power from the USB host port by putting an unpowered hub in-between the DE10-Nano and the host port. Another thing to try might be to connect a heavy load to the hub, forcing it to use the external transformer. Something like a mechanical hard drive.

Sorgelig
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2181
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: Powering DE10-Nano from USB HUB

Postby Sorgelig » Tue Mar 06, 2018 5:05 pm

Locutus73 wrote:If I remember correctly I have a B2 revision; do I have to test the unpowered hub with the recent kernel you posted elsewhere?

No.
Use latest installer release to update your SD card. New driver is there already.

Locutus73
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 135
Joined: Wed Feb 07, 2018 6:13 pm

Re: Powering DE10-Nano from USB HUB

Postby Locutus73 » Fri Mar 09, 2018 7:15 pm

Sorgelig wrote:With new USB host driver i use simple OTG HUB which obviously draw the power from DE10-nano and i have no problems to connect at the same time: RF receiver for keyboard, RF receiver for gamepag, wifi dongle and USB power to VGA splitter(!).

I tried my DE10-Nano with the 1to1 USB OTG cable, the unpowered little Amazon 4 port USB HUB, a Logitech Keyboard+Mouse combo receiver and a 8bitdo retro receiver and, using the last MiSTer release (I didn’t ever try the unpowered 4 port hub with previous releases) and all seems to work perfectly!
Thank you @Sorgelig

P.S.: my Poste Italiane adeventure seems to be ended: finally, I received the SDRAM+heatsink+fan from CBMSTUFF. It seems I won the silicon lottery: I tested my SDRAM for 2.5 hours at 150MHz with no errors!

Thank you @JimDrew


Return to “MiSTer”

Who is online

Users browsing this forum: No registered users and 2 guests