2010-11-16 9:32 AM
Does pull-up resistor on USB bus need the 2-stage transistor switch?
2011-05-17 5:15 AM
As you mentioned, in STM3210E:
http://www.st.com/stonline/products/literature/um/14220.pdf there is two stage tranzistors to pull-up (T1 and T2 on page 32/48). I made the same on my own hardware design and it work just fine. I do not know if simple MCU GPIO pin can be used with 1K5. Maybe not enough current can by provided from GPIO. Afi2011-05-17 5:15 AM
I do not know if simple MCU GPIO pin can be used with 1K5. Maybe not enough current can by provided from GPIO.
GPIO current capability cannot be the reason - 3.3V / 1k5 makes only 2 mA. Also the resistor protects GPIO pin against an overcurrent due to eventual external overvoltage. Ivan2011-05-17 5:15 AM
I would say the best could be to test it if it will work ...
2011-05-17 5:15 AM
The only problem I see is when you connect the USB cable to an unpowered controller as you will apply voltage directly to a standard I/O pin. I do not think that this will cause damage to the controller (I already tried), but it is sure out of spec.
A solution might be inserting a schottky diode between the controller and the resistor. Of course this will lead to some voltage drop so the voltage might be out of spec, too.2011-05-17 5:15 AM
2011-05-17 5:15 AM
It does work without it. I have such a set up on my 1 board.
Thank you for your experience. The problem is with the polarity of the I/O pin after reset.
I don't understand... I think that there is no voltage on USB Data pins from the host until a voltage is injected through the pull-up resistor on the device side and a host driver is switched on. I pull the pin down asap and before any USB initialization, then add a 250ms delay (to simulate a USB disconnect) before pulling it up. Why you set the pin down at the beginning and not leave it in 3rd state (floating input)?
2011-05-17 5:15 AM
2011-05-17 5:15 AM
I am not sure how to do a floating input on a output pin. Would that be the GPIO_Mode_Out_OD option?
I think about switching of GPIO_Mode_IN_FLOATING and GPIO_Mode_Out_PP modes in GPIO_InitTypeDef structure and calling of GPIO_Init function.