cancel
Showing results for 
Search instead for 
Did you mean: 

USB-C set voltage

ashah.16
Associate II

Hi,

I have a NUCLEO-L552ZE-Q board and I am practicing/learning the USB-C protocol. All I need is to set the voltage of USB-C to a higher voltage that the charger is capable of. The default is set to 5v.

In my situation, the adapter can supply up to 12v. Below is the traces taken from Nucleo UCPD software. I am wondering how could I set the voltage of USB, either with this app or using commands. The firmware I am using is USB-PD_consumer_1port.

Thanks,

Amir

7 REPLIES 7
ashah.16
Associate II

I could set the voltage to the highest level that the adapter is able to provide, following this tutorial:

https://wiki.st.com/stm32mcu/wiki/STM32StepByStep:Getting_started_with_USB-Power_Delivery_Sink

However, this does not set the voltage automatically whenever I plug the USB and needs me to restart the MCU sometimes. I'm wondering if you know the reason and if there is a way to set switch between voltages instead of selecting the highest voltage that this tutorial does.

Thanks

Nicolas P.
ST Employee

Hello @ashah.16​ 

Have you looked at the wiki on PDO selection ?

In the above trace we see that you request PDO1 ie 5V.

Please share your new trace (.cpd file, using our tool) to see why you loose your contract.

Regards,

Nicolas

ashah.16
Associate II

Hi Nicholas,

Thanks for the reply. Yes, I checked these and other links before posting. I added two other acceptable voltages to the list of PDOs in the Cube app for the NUCLEO-L552ZE board I have. The example code I have (USB-PD-1consumer-1port) could agree on higher voltages. However, it is not smooth. I had to restart the board or plug-unplug the cable sometimes.

It is a bit confusing for me. I was going to have a code setup from scratch, using the CUBE, and following every setting of this Example code, and I couldn't make an agreement for higher voltages. I can't understand what is going on there but I will get back to this post once I found more. Meantime, can you suggest me if there are more examples or any advice for making my own code?

Thanks

ashah.16
Associate II

Dear @Nicholas​ 

Back to this post, I wanted to know if having USB-Interface IC (such as TCPP03-M20) is mandatory for USB-PD communication between STM32L552 and USB-C adapter? I am a bit lost knowing which one of your chips is required. Could you please recommend one or more of these interface ICs that is in stock and production?

Thanks,

Amir

Nicholas1
Associate II

Dear @ashah.16​ 

I think you tagged the wrong person. Anyways, I think the TCPP03-M20 just acts as a protection circuit for your USB-C. :)

Thanks,

Nicholas Ng

Dear Amir,

TCPP IC are required to protect system (ESD, OVP, OCP, OTP on CC and Vbus lines). They also embed specific features related to Type-C connector (HV interface, Vconn switch, …).

The table below shows features by product.

You can notice that each TCPP corresponds to a use-case :

  • SINK : when system with STM32L552 requires power from Type-C cable
  • SOURCE: when system with STM32L552 can supply power to Type-C cable
  • DRP : when system with STM32L552 can do both (with a battery as example).

However, TCPP03-M20 can be use for SINK as it embeds Dead batteries resistors and Vbus current specific features that are not present on TCPP01-M12 (OCP and current sense).

Best regards,

Mathieu

Thanks @MROUV.1​ 

Dear @ashah.16​ , have you solved the original issue ? Can you share a .cpd trace ?

If you are ok, we could close this thread and open a new one to make the thread clear ?