Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone USB Device Charger feature #4

Open
rayrrr opened this issue Nov 4, 2019 · 3 comments
Open

Standalone USB Device Charger feature #4

rayrrr opened this issue Nov 4, 2019 · 3 comments

Comments

@rayrrr
Copy link

rayrrr commented Nov 4, 2019

Thanks for the cool project! Can this device also act as a standalone USB Device Charger when powered via 12-20V but not connected to a host computer via USB?

In other words, can I charge my phone with it?

If so, let's document that in the Usage Instructions in the wiki.

Otherwise, consider this a feature request.

@dilshan
Copy link
Owner

dilshan commented Nov 5, 2019

@rayrrr With current firmware this hub need to connect with host computer to activate it's 4 ports. If you are interested to use this as a USB device charger you need to modify "USB sense" section of the firmware.

As you suggested I'll add this feature request to my next firmware update.

@rayrrr rayrrr changed the title Standalone USB Device Charger feature? Standalone USB Device Charger feature Nov 7, 2019
@dgags
Copy link

dgags commented Sep 11, 2021

To turn this into a charging only device, it looks like you can change line 35 in "usb2-power-hub/firmware/main.c"
from: usbFlag = PORTC & 0x20;
to: usbFlag = 0x20;

If I have this right, it should basically just say that the USB host is always connected without bothering to really look if it connected to a computer. I admit that this does not elegantly solve the problem in a way that allows you to selectively turn this feature on and off. I would expect a hardwired switch that the PIC could query is one such way.

I hope this helps anyone wanting to turn this into a high current multi-port usb charging device.

@dilshan
Copy link
Owner

dilshan commented Sep 12, 2021

@dgags good suggestion!
Yes, assigning 0x20 to the usbFlag, disable the USB sense feature from the firmware. I did not include this in firmware because this may change the scope of the project (from USB hub to USB charger).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants