Repurposing PWM output for D- of USBGumstix with USB hub TUSB2036FT2232D - Device not responding to set address24V power supply for MCU+USBSampling analog dataUSB on STM32F107RCT and Stm32CubeMXUSB Audio Input Jitter (?)Are USB 2.0 hubs required to disable downstream VBUS when upstream VBUS is removedSTM32L4 USB Device with VBUS Sensing

A bob hanging in an accelerating train moves backward. What is the force moving it backward?

In a world where Magic steam Engines exist what would keep people from making cars

Python - Strange interaction with for loop and variable

Exactly what color was the text on monochrome terminals with green-on-black and amber-on-black screens?

Match blood types in C

What is the largest piece of space debris volumetrically?

Simulate reproduction in a population of oozes

Why does the B-2 Spirit have a pattern of thin white lines?

Contacted by head of school regarding an issue - should I be worried?

Why does the Eurofighter Typhoon pitch up on brake release?

Does Estonia have discount supermarket chains like Aldi and Lidl?

How can medieval knights protects themselves against modern guns?

How to assign a value to a variable in Terminal?

Why should I invest so much in 401(k)?

What is a polite way to clarify my gender in phone calls?

Do Klingons have escape pods?

Is it necessary to wipe out vile man-eating dragons?

Large products with glass doors

How can I swallow pills more easily?

What's a good use case for SELECT * in production code?

How to assemble PCBs when SMT machine doesn't have enough feeders?

How did LM circuit breakers operate? (famous engine arm CB broken by Aldrin)

How to equalize the chance of throwing the highest dice? (Riddle)

Does USB version speed matter for input devices?



Repurposing PWM output for D- of USB


Gumstix with USB hub TUSB2036FT2232D - Device not responding to set address24V power supply for MCU+USBSampling analog dataUSB on STM32F107RCT and Stm32CubeMXUSB Audio Input Jitter (?)Are USB 2.0 hubs required to disable downstream VBUS when upstream VBUS is removedSTM32L4 USB Device with VBUS Sensing






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;









2















$begingroup$


I'm currently designing a self-powered PCB with a STM32L432KCU6 MCU on it. I want to use USB, but D- is already used for a different purpose.



According to the datasheet, D- and D+ have to be connected to PA11 and PA12. For PA12, this is no problem as this pin is still free. However, I'm using PA11 to drive a small 8 mA LED that is controlled via PWM. There is no free pin to which I could assign this function instead.



My question:
Is it possible to repurpose PA11 from a PWM output to D- once VBUS is detected?



Here the datasheet of the MCU:



https://eu.mouser.com/datasheet/2/389/stm32l432kb-956275.pdf





schematic





simulate this circuit – Schematic created using CircuitLab










share|improve this question











$endgroup$










  • 1




    $begingroup$
    I hope you also have a debug serial interface on your board; if not and you have not proven your USB software on an EVB first you may have a very frustrating process of getting things going. If you do have a debug serial interface, that would be a much more sensible thing to multiplex with the LED.
    $endgroup$
    – Chris Stratton
    Sep 14 at 15:27










  • $begingroup$
    Thanks for your help. Yes, I have a debug serial interface.
    $endgroup$
    – Hermetica
    Sep 15 at 0:04






  • 1




    $begingroup$
    In addition to what's said in the posted answer, you obviously can't have 10 ohm in series with the LED. I take it that's a typo? When you re-design the board, ensure that the LED is driven from a pin which can source sufficient current. Some STM32 can source lots of current on GPIO, pick the right one for your project.
    $endgroup$
    – Lundin
    Sep 16 at 8:52










  • $begingroup$
    Yes, it's a typo. Thanks!
    $endgroup$
    – Hermetica
    Sep 16 at 9:45

















2















$begingroup$


I'm currently designing a self-powered PCB with a STM32L432KCU6 MCU on it. I want to use USB, but D- is already used for a different purpose.



According to the datasheet, D- and D+ have to be connected to PA11 and PA12. For PA12, this is no problem as this pin is still free. However, I'm using PA11 to drive a small 8 mA LED that is controlled via PWM. There is no free pin to which I could assign this function instead.



My question:
Is it possible to repurpose PA11 from a PWM output to D- once VBUS is detected?



Here the datasheet of the MCU:



https://eu.mouser.com/datasheet/2/389/stm32l432kb-956275.pdf





schematic





simulate this circuit – Schematic created using CircuitLab










share|improve this question











$endgroup$










  • 1




    $begingroup$
    I hope you also have a debug serial interface on your board; if not and you have not proven your USB software on an EVB first you may have a very frustrating process of getting things going. If you do have a debug serial interface, that would be a much more sensible thing to multiplex with the LED.
    $endgroup$
    – Chris Stratton
    Sep 14 at 15:27










  • $begingroup$
    Thanks for your help. Yes, I have a debug serial interface.
    $endgroup$
    – Hermetica
    Sep 15 at 0:04






  • 1




    $begingroup$
    In addition to what's said in the posted answer, you obviously can't have 10 ohm in series with the LED. I take it that's a typo? When you re-design the board, ensure that the LED is driven from a pin which can source sufficient current. Some STM32 can source lots of current on GPIO, pick the right one for your project.
    $endgroup$
    – Lundin
    Sep 16 at 8:52










  • $begingroup$
    Yes, it's a typo. Thanks!
    $endgroup$
    – Hermetica
    Sep 16 at 9:45













2













2









2





$begingroup$


I'm currently designing a self-powered PCB with a STM32L432KCU6 MCU on it. I want to use USB, but D- is already used for a different purpose.



According to the datasheet, D- and D+ have to be connected to PA11 and PA12. For PA12, this is no problem as this pin is still free. However, I'm using PA11 to drive a small 8 mA LED that is controlled via PWM. There is no free pin to which I could assign this function instead.



My question:
Is it possible to repurpose PA11 from a PWM output to D- once VBUS is detected?



Here the datasheet of the MCU:



https://eu.mouser.com/datasheet/2/389/stm32l432kb-956275.pdf





schematic





simulate this circuit – Schematic created using CircuitLab










share|improve this question











$endgroup$




I'm currently designing a self-powered PCB with a STM32L432KCU6 MCU on it. I want to use USB, but D- is already used for a different purpose.



According to the datasheet, D- and D+ have to be connected to PA11 and PA12. For PA12, this is no problem as this pin is still free. However, I'm using PA11 to drive a small 8 mA LED that is controlled via PWM. There is no free pin to which I could assign this function instead.



My question:
Is it possible to repurpose PA11 from a PWM output to D- once VBUS is detected?



Here the datasheet of the MCU:



https://eu.mouser.com/datasheet/2/389/stm32l432kb-956275.pdf





schematic





simulate this circuit – Schematic created using CircuitLab







microcontroller usb stm32 embedded






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 14 at 14:40







Hermetica

















asked Sep 14 at 14:05









HermeticaHermetica

355 bronze badges




355 bronze badges










  • 1




    $begingroup$
    I hope you also have a debug serial interface on your board; if not and you have not proven your USB software on an EVB first you may have a very frustrating process of getting things going. If you do have a debug serial interface, that would be a much more sensible thing to multiplex with the LED.
    $endgroup$
    – Chris Stratton
    Sep 14 at 15:27










  • $begingroup$
    Thanks for your help. Yes, I have a debug serial interface.
    $endgroup$
    – Hermetica
    Sep 15 at 0:04






  • 1




    $begingroup$
    In addition to what's said in the posted answer, you obviously can't have 10 ohm in series with the LED. I take it that's a typo? When you re-design the board, ensure that the LED is driven from a pin which can source sufficient current. Some STM32 can source lots of current on GPIO, pick the right one for your project.
    $endgroup$
    – Lundin
    Sep 16 at 8:52










  • $begingroup$
    Yes, it's a typo. Thanks!
    $endgroup$
    – Hermetica
    Sep 16 at 9:45












  • 1




    $begingroup$
    I hope you also have a debug serial interface on your board; if not and you have not proven your USB software on an EVB first you may have a very frustrating process of getting things going. If you do have a debug serial interface, that would be a much more sensible thing to multiplex with the LED.
    $endgroup$
    – Chris Stratton
    Sep 14 at 15:27










  • $begingroup$
    Thanks for your help. Yes, I have a debug serial interface.
    $endgroup$
    – Hermetica
    Sep 15 at 0:04






  • 1




    $begingroup$
    In addition to what's said in the posted answer, you obviously can't have 10 ohm in series with the LED. I take it that's a typo? When you re-design the board, ensure that the LED is driven from a pin which can source sufficient current. Some STM32 can source lots of current on GPIO, pick the right one for your project.
    $endgroup$
    – Lundin
    Sep 16 at 8:52










  • $begingroup$
    Yes, it's a typo. Thanks!
    $endgroup$
    – Hermetica
    Sep 16 at 9:45







1




1




$begingroup$
I hope you also have a debug serial interface on your board; if not and you have not proven your USB software on an EVB first you may have a very frustrating process of getting things going. If you do have a debug serial interface, that would be a much more sensible thing to multiplex with the LED.
$endgroup$
– Chris Stratton
Sep 14 at 15:27




$begingroup$
I hope you also have a debug serial interface on your board; if not and you have not proven your USB software on an EVB first you may have a very frustrating process of getting things going. If you do have a debug serial interface, that would be a much more sensible thing to multiplex with the LED.
$endgroup$
– Chris Stratton
Sep 14 at 15:27












$begingroup$
Thanks for your help. Yes, I have a debug serial interface.
$endgroup$
– Hermetica
Sep 15 at 0:04




$begingroup$
Thanks for your help. Yes, I have a debug serial interface.
$endgroup$
– Hermetica
Sep 15 at 0:04




1




1




$begingroup$
In addition to what's said in the posted answer, you obviously can't have 10 ohm in series with the LED. I take it that's a typo? When you re-design the board, ensure that the LED is driven from a pin which can source sufficient current. Some STM32 can source lots of current on GPIO, pick the right one for your project.
$endgroup$
– Lundin
Sep 16 at 8:52




$begingroup$
In addition to what's said in the posted answer, you obviously can't have 10 ohm in series with the LED. I take it that's a typo? When you re-design the board, ensure that the LED is driven from a pin which can source sufficient current. Some STM32 can source lots of current on GPIO, pick the right one for your project.
$endgroup$
– Lundin
Sep 16 at 8:52












$begingroup$
Yes, it's a typo. Thanks!
$endgroup$
– Hermetica
Sep 16 at 9:45




$begingroup$
Yes, it's a typo. Thanks!
$endgroup$
– Hermetica
Sep 16 at 9:45










1 Answer
1






active

oldest

votes


















5

















$begingroup$

Simply: No, you can not.



A USB interface is a high speed serial interface with strict impedance rules. The tracks have to be routed side-by side having an impedance close to 90 ohm.



You can not make a tap and route that somewhere else or connect other components to one (or both) of them.



So you have to find a different solution.






share|improve this answer










$endgroup$










  • 2




    $begingroup$
    … and since you say "I'm currently designing a board": well, connecting that LED there was a design mistake that's relatively easy to fix. Re-design that part of the board.
    $endgroup$
    – Marcus Müller
    Sep 14 at 14:44







  • 1




    $begingroup$
    If you just need more GPIO for LEDs, switches, etc., I2C or SPI based I/O expander chips are easy to use.
    $endgroup$
    – Dave Tweed
    Sep 14 at 15:04










  • $begingroup$
    It is definitely a bad idea, that said for a one off personal use hack USB can sometimes tolerate things far out of spec, so I'd hesitate to say that there are no circumstances under which it could work, but definitely not for a product and even for personal use there needs to be a fallback plan like cutting off the LED. Also D- needs to be released faster than it can confuse the speed detection. There's almost certainly a better place to connect the LED.
    $endgroup$
    – Chris Stratton
    Sep 14 at 15:30







  • 1




    $begingroup$
    It is possible od course. Place mosfet very close to the path. It will not change significantly enough the impedance of the track but if the vusb is detected will disconnect the led from it. I have tested it on FS & HS devices. Works without any problems
    $endgroup$
    – P__J__
    Sep 14 at 16:53












Your Answer






StackExchange.ifUsing("editor", function ()
return StackExchange.using("schematics", function ()
StackExchange.schematics.init();
);
, "cicuitlab");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "135"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);














draft saved

draft discarded
















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f458528%2frepurposing-pwm-output-for-d-of-usb%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown


























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









5

















$begingroup$

Simply: No, you can not.



A USB interface is a high speed serial interface with strict impedance rules. The tracks have to be routed side-by side having an impedance close to 90 ohm.



You can not make a tap and route that somewhere else or connect other components to one (or both) of them.



So you have to find a different solution.






share|improve this answer










$endgroup$










  • 2




    $begingroup$
    … and since you say "I'm currently designing a board": well, connecting that LED there was a design mistake that's relatively easy to fix. Re-design that part of the board.
    $endgroup$
    – Marcus Müller
    Sep 14 at 14:44







  • 1




    $begingroup$
    If you just need more GPIO for LEDs, switches, etc., I2C or SPI based I/O expander chips are easy to use.
    $endgroup$
    – Dave Tweed
    Sep 14 at 15:04










  • $begingroup$
    It is definitely a bad idea, that said for a one off personal use hack USB can sometimes tolerate things far out of spec, so I'd hesitate to say that there are no circumstances under which it could work, but definitely not for a product and even for personal use there needs to be a fallback plan like cutting off the LED. Also D- needs to be released faster than it can confuse the speed detection. There's almost certainly a better place to connect the LED.
    $endgroup$
    – Chris Stratton
    Sep 14 at 15:30







  • 1




    $begingroup$
    It is possible od course. Place mosfet very close to the path. It will not change significantly enough the impedance of the track but if the vusb is detected will disconnect the led from it. I have tested it on FS & HS devices. Works without any problems
    $endgroup$
    – P__J__
    Sep 14 at 16:53















5

















$begingroup$

Simply: No, you can not.



A USB interface is a high speed serial interface with strict impedance rules. The tracks have to be routed side-by side having an impedance close to 90 ohm.



You can not make a tap and route that somewhere else or connect other components to one (or both) of them.



So you have to find a different solution.






share|improve this answer










$endgroup$










  • 2




    $begingroup$
    … and since you say "I'm currently designing a board": well, connecting that LED there was a design mistake that's relatively easy to fix. Re-design that part of the board.
    $endgroup$
    – Marcus Müller
    Sep 14 at 14:44







  • 1




    $begingroup$
    If you just need more GPIO for LEDs, switches, etc., I2C or SPI based I/O expander chips are easy to use.
    $endgroup$
    – Dave Tweed
    Sep 14 at 15:04










  • $begingroup$
    It is definitely a bad idea, that said for a one off personal use hack USB can sometimes tolerate things far out of spec, so I'd hesitate to say that there are no circumstances under which it could work, but definitely not for a product and even for personal use there needs to be a fallback plan like cutting off the LED. Also D- needs to be released faster than it can confuse the speed detection. There's almost certainly a better place to connect the LED.
    $endgroup$
    – Chris Stratton
    Sep 14 at 15:30







  • 1




    $begingroup$
    It is possible od course. Place mosfet very close to the path. It will not change significantly enough the impedance of the track but if the vusb is detected will disconnect the led from it. I have tested it on FS & HS devices. Works without any problems
    $endgroup$
    – P__J__
    Sep 14 at 16:53













5















5











5







$begingroup$

Simply: No, you can not.



A USB interface is a high speed serial interface with strict impedance rules. The tracks have to be routed side-by side having an impedance close to 90 ohm.



You can not make a tap and route that somewhere else or connect other components to one (or both) of them.



So you have to find a different solution.






share|improve this answer










$endgroup$



Simply: No, you can not.



A USB interface is a high speed serial interface with strict impedance rules. The tracks have to be routed side-by side having an impedance close to 90 ohm.



You can not make a tap and route that somewhere else or connect other components to one (or both) of them.



So you have to find a different solution.







share|improve this answer













share|improve this answer




share|improve this answer










answered Sep 14 at 14:43









OldfartOldfart

11.5k2 gold badges10 silver badges34 bronze badges




11.5k2 gold badges10 silver badges34 bronze badges










  • 2




    $begingroup$
    … and since you say "I'm currently designing a board": well, connecting that LED there was a design mistake that's relatively easy to fix. Re-design that part of the board.
    $endgroup$
    – Marcus Müller
    Sep 14 at 14:44







  • 1




    $begingroup$
    If you just need more GPIO for LEDs, switches, etc., I2C or SPI based I/O expander chips are easy to use.
    $endgroup$
    – Dave Tweed
    Sep 14 at 15:04










  • $begingroup$
    It is definitely a bad idea, that said for a one off personal use hack USB can sometimes tolerate things far out of spec, so I'd hesitate to say that there are no circumstances under which it could work, but definitely not for a product and even for personal use there needs to be a fallback plan like cutting off the LED. Also D- needs to be released faster than it can confuse the speed detection. There's almost certainly a better place to connect the LED.
    $endgroup$
    – Chris Stratton
    Sep 14 at 15:30







  • 1




    $begingroup$
    It is possible od course. Place mosfet very close to the path. It will not change significantly enough the impedance of the track but if the vusb is detected will disconnect the led from it. I have tested it on FS & HS devices. Works without any problems
    $endgroup$
    – P__J__
    Sep 14 at 16:53












  • 2




    $begingroup$
    … and since you say "I'm currently designing a board": well, connecting that LED there was a design mistake that's relatively easy to fix. Re-design that part of the board.
    $endgroup$
    – Marcus Müller
    Sep 14 at 14:44







  • 1




    $begingroup$
    If you just need more GPIO for LEDs, switches, etc., I2C or SPI based I/O expander chips are easy to use.
    $endgroup$
    – Dave Tweed
    Sep 14 at 15:04










  • $begingroup$
    It is definitely a bad idea, that said for a one off personal use hack USB can sometimes tolerate things far out of spec, so I'd hesitate to say that there are no circumstances under which it could work, but definitely not for a product and even for personal use there needs to be a fallback plan like cutting off the LED. Also D- needs to be released faster than it can confuse the speed detection. There's almost certainly a better place to connect the LED.
    $endgroup$
    – Chris Stratton
    Sep 14 at 15:30







  • 1




    $begingroup$
    It is possible od course. Place mosfet very close to the path. It will not change significantly enough the impedance of the track but if the vusb is detected will disconnect the led from it. I have tested it on FS & HS devices. Works without any problems
    $endgroup$
    – P__J__
    Sep 14 at 16:53







2




2




$begingroup$
… and since you say "I'm currently designing a board": well, connecting that LED there was a design mistake that's relatively easy to fix. Re-design that part of the board.
$endgroup$
– Marcus Müller
Sep 14 at 14:44





$begingroup$
… and since you say "I'm currently designing a board": well, connecting that LED there was a design mistake that's relatively easy to fix. Re-design that part of the board.
$endgroup$
– Marcus Müller
Sep 14 at 14:44





1




1




$begingroup$
If you just need more GPIO for LEDs, switches, etc., I2C or SPI based I/O expander chips are easy to use.
$endgroup$
– Dave Tweed
Sep 14 at 15:04




$begingroup$
If you just need more GPIO for LEDs, switches, etc., I2C or SPI based I/O expander chips are easy to use.
$endgroup$
– Dave Tweed
Sep 14 at 15:04












$begingroup$
It is definitely a bad idea, that said for a one off personal use hack USB can sometimes tolerate things far out of spec, so I'd hesitate to say that there are no circumstances under which it could work, but definitely not for a product and even for personal use there needs to be a fallback plan like cutting off the LED. Also D- needs to be released faster than it can confuse the speed detection. There's almost certainly a better place to connect the LED.
$endgroup$
– Chris Stratton
Sep 14 at 15:30





$begingroup$
It is definitely a bad idea, that said for a one off personal use hack USB can sometimes tolerate things far out of spec, so I'd hesitate to say that there are no circumstances under which it could work, but definitely not for a product and even for personal use there needs to be a fallback plan like cutting off the LED. Also D- needs to be released faster than it can confuse the speed detection. There's almost certainly a better place to connect the LED.
$endgroup$
– Chris Stratton
Sep 14 at 15:30





1




1




$begingroup$
It is possible od course. Place mosfet very close to the path. It will not change significantly enough the impedance of the track but if the vusb is detected will disconnect the led from it. I have tested it on FS & HS devices. Works without any problems
$endgroup$
– P__J__
Sep 14 at 16:53




$begingroup$
It is possible od course. Place mosfet very close to the path. It will not change significantly enough the impedance of the track but if the vusb is detected will disconnect the led from it. I have tested it on FS & HS devices. Works without any problems
$endgroup$
– P__J__
Sep 14 at 16:53


















draft saved

draft discarded















































Thanks for contributing an answer to Electrical Engineering Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f458528%2frepurposing-pwm-output-for-d-of-usb%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown









Popular posts from this blog

Tamil (spriik) Luke uk diar | Nawigatjuun

Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?