-
Notifications
You must be signed in to change notification settings - Fork 94
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
Modify Virtual_Com_Port_ConfigDescriptor to allow for more power? #4
Comments
The USB descriptor does not affect how much power the PC supplies to the device. At best it will change the over current limit on that port. This is just caused by ohmic losses in your cable, try using the USB cable that came with your phone, it should drop less voltage when the relay is powered on. |
The base board I made has its own USB connector, so I used a standard inkjet printer USB cable. Maybe it has too much resistance on the 5V conductor. |
I have a 5.07V without addition load, |
Spindle enable bit and dir bit works ok, I tested them with a brushless spindle motor driver, now there's something that is bugging me. I'm powering a small relay board with 5V coming from the USB Port itself, when either relay is turned on I get a significant voltage drop on the 5V line. Like, with no relay on I get 4.8v, each relay drops the voltage by about 0.2v. Reading into the code, I found this part.
The STM32 identifies itself as a Virtual Com Port, so there's a Configuration Descriptor for it. The byte that specifies how much power the circuit can draw is set at 0x32, or 50 in decimal. This is in usb_desc.c , line 67
According to this page:
https://www.beyondlogic.org/usbnutshell/usb5.shtml#ConfigurationDescriptors
The amount of current the circuit is allowed to draw is that number times 2 mA, 50 times 2 is just 100 mA.
Now, could this be the reason why just a few puny relays are causing that voltage drop? I'll change that value to 7D in order to pull up to 250mA and see what happens
The text was updated successfully, but these errors were encountered: