Skip to main content
Visitor II
November 26, 2020
Question

Using USB 2.0 in Type C connector

  • November 26, 2020
  • 9 replies
  • 6930 views

Hi,

We are designing a USB 2.0 interface between STM32H750IB and PC.

PC will be acting as Host and STM32H750IB will be acting as Device.

But for some reasons like future upgradability, we are using USB Type-C Connector.

Note that we are going to use USB 2.0 pins for Data transfer alone.

Our concern here is, what all pins/signals we need to use in Type-C connector, may be for configuration process for determining port’s role or for any other reasons also.

Also we are not using power delivery option (neither source nor sink). Can I leave VBUS pin of MCU floating? If not, can we feed from 5V Regulator, instead of Bus power ? Because if we have to feed Bus power in Type-C, then, you might be knowing, that one has to use different chipsets like PD (power delivery) Manager etc.

Appreciate your quick response. 

Best Regards,

Preetham

    This topic has been closed for replies.

    9 replies

    Super User
    November 26, 2020
    PY.1Author
    Visitor II
    November 27, 2020

    Hi,

    Thanks a lot for the link.

    I understood about what all signals will be needed.

    On VBUS, can we directly connect VBUS coming from the Type C bus/connector to VBUS pin of the MCU ?

    Thanks.

    Visitor II
    November 27, 2020

    I wouldn't think you can directly connect VBUS to STM32,

    VBUS could be 3V3, 5V, or something else depending on what is on other side (old USB2 port with USB-ISBC cable).

    There are ICs for this, depending on whether your MCU is USB Host, USB Slave, or Both, and also whether you input or output VBUS.

    Also careful of ESD protection, Noise, Power Spikes, and the like if the USB will be used by Customers (or only Staff Diagnostics). If a USB cable is left plugged in with nothing on the other side the cable can be an antenna.

    We use the USB purely for UART style diagnostics, our product is select powered, so we ignore all the power signals on USB-C and connect only DP,DN,GND - Works great and can allow faster serial diagnostics that typical UART (depending on system clocks).

    Paul

    Visitor II
    April 15, 2021

    Hello there,

    I have something similar question, can i use the typeC connector with STM32H745Z? which phy is recommended? do you have any reference design?

    thanks,

    dave

    Visitor II
    April 16, 2021

    We use USBC connectors for VCP for diagnostics (not for connection by customer).

    No Power (No VBus), just USB2 D+/D-. The USBC is nice as cables common and can be plugged in mirrored.

    Note: See other posts about handling baudrate settings and the like in ST code, otherwise some PC com programs won't connect properly.

    TeraTerm, and Recently CoolTerm do work.

    Note the VCP isn't available immediately at bootup, so may need to delay any critical messages till VCP is up and running.

    0693W000008zmEoQAI.pngYou can get right angle USBC connectors that only have USB2 pins, easier layout with less pins.

    If you want USB power look for appropriate ICs, some ST Demos have such circuits.

    If planning to include as a production connection best to include ESD protection as direct MCU pins on connector exposes MCU to ESD.

    Paul

    Visitor II
    April 16, 2021

    Hello Paul,

    thanks for quick reply.

    Like you mention that for VCP +FS can work as TypeC, but how to solve the high bandwidth data > 100Mbit?

    is there any example of HS+ typeC ? can i directly connect the HS to TypeC?

    for this high end chip, i would expect similar request from other customers.

    in my application STM32 will work as a device with Vbus as optional, while data rate should be high.

    i found this ppt which is helpful to understand the basic -"en.STM32-USB-C-PD-solutions-presentation"

    i would appericiate your recommedation, or schematic for above problem.

    thanks,

    dave

    Visitor II
    April 16, 2021

    You can use the HS port for this.

    I suggest you get a Nucleo or other demo, and attach a USBC socket with wire leads and try it.

    This USBC connector has only USB2 pins so easier to hand solder: USB4105-GF-A (digikey)

    I suspect the datarate achieved will depend on the other device, and how optimized your code is. May need DMA.

    Paul

    Visitor II
    April 20, 2021

    hello Paul,

    thanks for sharing the part number.

    1. suppose if we use the CC controller+Ulip then I can sink the I upto 3A from Vbus? what thing i have to look for?

    is there any example available? how generate a dedicated clock for ulip (52Mhz)/ which pin should be used for ulip domain?

    1. is there any example on how to generate a waveform using the DAC+ timer+ internal pll. how to calculate the min-max freq of generated waveform ? how to set the tr & tf of the waveform ? how to avoid the jitter ? i am looking for detail info for pwm, saw tooth, sine wave and square wave.
    2. is there any example available on how to use adc ? with internal reference voltage? with 8bit 5msps? with continuous scanning mode? how to do calibration for offset?
    3. how to calculate that available ram (2meg) is sufficient for dma operation ? do i need external ram? with dma, can i avoid the ram? DMA to USB is possible to avoid the ram?
    4. due to budget problem, i cannot use the ready solution for debug ( ST-LINK v2), FS USB is good enough? which tool and licence i need to buy to debug the code?

    thanks in advance,

    dave

    Visitor II
    April 20, 2021

    hello Paul,

    thanks for sharing the part number.

    1. suppose if we use the CC controller+Ulip then I can sink the I upto 3A from Vbus? what thing i have to look for?

    is there any example available? how generate a dedicated clock for ulip (52Mhz)/ which pin should be used for ulip domain?

    1. is there any example on how to generate a waveform using the DAC+ timer+ internal pll. how to calculate the min-max freq of generated waveform ? how to set the tr & tf of the waveform ? how to avoid the jitter ? i am looking for detail info for pwm, saw tooth, sine wave and square wave.
    2. is there any example available on how to use adc ? with internal reference voltage? with 8bit 5msps? with continuous scanning mode? how to do calibration for offset?
    3. how to calculate that available ram (2meg) is sufficient for dma operation ? do i need external ram? with dma, can i avoid the ram? DMA to USB is possible to avoid the ram?
    4. due to budget problem, i cannot use the ready solution for debug ( ST-LINK v2), FS USB is good enough? which tool and licence i need to buy to debug the code?

    thanks in advance,

    dave

    Visitor II
    April 20, 2021

    Your questions are getting off topic, best post separately to get max responses.

    FYI: Just found out you can also program STM32 ICs through their USB port using STM32CubeProgrammer.

    Just need D+, D-, and Gnd pins.

    Chip must be blank, or make a call from your code into the on chip USB Bootloader.

    This is great for us as we can program blank production boards through our robust USB-C diagnostics connector.

    Reference AN2606.

    Extract from our internal Wiki:

    • STM32 Tutorials/Examples

    * ST

    ** "ST Getting Started":https://wiki.st.com/stm32mcu/wiki/STM32StepByStep:STM32_step_by_step_overview

    ** "ST Development Zone":https://wiki.st.com/stm32mcu/wiki/Development_zone

    ** "STM32 Education":https://www.st.com/content/st_com/en/support/learning/stm32-education.html Many Sections & Styles

    *** i.e. "STM32L4 with UART by DMA in section 5.2":https://www.youtube.com/playlist?list=PLnMKNibPkDnEEvQWrDqVuu1w_iQ214GXi

    * Misc Tutorials:

    ** "WaveShare":https://www.waveshare.com/

    *** "STM32CubeMX_Tutorial_Series:_USART":https://www.waveshare.com/wiki/STM32CubeMX_Tutorial_Series:_USART

    • Useful Links

    * "Official STM32 MCU Wiki":https://wiki.st.com/stm32mcu (Includes Tutorials and examples)

    * "STM32 Main Page":https://www.st.com/en/microcontrollers-microprocessors/stm32-32-bit-arm-cortex-mcus.html

    * "STM32F4xx HAL User Manual":http://www.disca.upv.es/aperles/arm_cortex_m3/llibre/st/STM32F439xx_User_Manual/index.html

    * "STM32CubeMX User Manual = UM1718":https://www.st.com/resource/en/user_manual/dm00104712-stm32cubemx-for-stm32-configuration-and-initialization-c-code-generation-stmicroelectronics.pdf

    * "STM32CubeIDE User Manual = UM2609":https://www.st.com/resource/en/user_manual/dm00629856-description-of-the-integrated-development-environment-for-stm32-products-stmicroelectronics.pdf

    * "@ld@ linker reference guide":https://sourceware.org/binutils/docs/ld/index.html#SEC_Contents

    * "OpenSTM32":https://www.openstm32.org/HomePage Examples, Forums... 

    * Not very useful: The Examples under this tree are pre-STM32Cube as of 2020Nov: C:\Users\Paul\STM32Cube\Repository

    Paul