cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with a custom USB-C device

ninjax8
Associate II

Hi,

I am trying to develop a custom USB-C based sensor accessory device for phones and tablets. 

Overview : 

  1. 1 x USB-C male plug that will directly connect to a tablet, the accessory device will get power from the tablet, and a STM32F411 will send connected sensor data via USB 2.0 lines.
  2. 1 x USB-C receptacle, that will be used to charge the tablet (with PD negotiations, up to 100W) when a PD charger is connected to it. It will also send the sensor data while it is charging the tablet. 
  3. For USB-C PD negotiations I need a standalone controller that doesn't require any firmware.  

I did some research and learned that I must implement a DRP to do this and I learned about STUSB1602.

Question: 

  1. For the male USB-C plug the CC1, and  CC2 lines are CC and VCON can I connect the CC and VCON to the CC1 and CC2 lines?
  2. Do I need the dead battery feature for my application?
  3. Can up to 100W PD be achieved using only CC1 and CC2? 

My concept drawing is attached and I need help from the community to ensure that it will work or not.

IMG_0100.jpg

Thanks

Subhadeep

6 REPLIES 6
NBALL
ST Employee

Hello
Text says that:

  • TypeC plug (male) will 'get power from tablet': thus this is Sink role: vbus goes in the connector
  • TypeC receptacle (female) will 'charge tablet': thus this is Source role: vbus goes out

Application is kind of 'power path thru' and not a real DRP as roles are fixed for each connector. 

May I know if you application is only interested into USB2 signals ? 

Drawing seems that external charger is connected to tablet thru your board which is contradictory with your text.
Could you please clarify ? 
Best regards
Nathalie

Hi Nathalie,

Thanks for your response.

Yes my application is only interested into USB2 signals.

I did some research and find out that I need a sink to source pass through for my application. 
Let me describe my problem once again.

I’m trying to develop a circuit board consisting of a STM32F411 mcu with a I2C sensor connected to it. 
I have 2 USB-C ports in the circuit. 1 x USB-C receptacle and 1 x USB-C male plug.

Function 1 : 

When a phone/tablet is inserted using the male plug, the device (source) will power the circuit (sink) and it will the circuit will send the sensor values to the tablet via D+ and D- lines(USB2). 

Function 2 : 

Now let’s say the tablet got discharged and I want to charge my tablet but without disconnecting the sensor accessory. So, I want to insert a charger to the USB-C receptacle and charge the tablet through the circuit board with proper PD negotiation.

So in this case the sensor accessory so act as a source and the tablet should work as a sink. And while charging is happening I also wan to get sensor data from the usb.

As I did some more research, the posted block diagram makes no sense. I’m uploading a modified block diagram. 
I want a standalone solution for this. Please review my block diagram and suggest the best practice to do it.

IMG_0101.jpeg

 On the tablet side -

  1. if no charger is connected the sensor accessory needs to be in sink mode (power consumer).
  2. if charger is connected the sensor accessory needs to be e in source mode (power provider).

My initial logic is to read the pd messages from both side and then open the load switch to pass through the sink voltage to the source.

looks ok? 

thanks 

Subhadeep 

 

Hello

Thanks for the clarifications.

It is not as simple as the block diagram... 
When tablet has done contract, as source and a charger is inserted into receptacle, a contract needs to be done with the charger but it is difficult to know tablet algorithm and thus which PDO will be chosen.

On top of this to revert the power (switching from source to sink), power swap needs to be initiated, 5V needs to be provided by new source, before new contract.

How 5V will be generated here ?

If 5V is first negotiated by sink on receptacle side, to increase the power to be provided to the tablet, it first need to negotiate power with the charger...but vbus voltage will change before new contract will be started with tablet...
I'm sorry but I really don't think such schematic can work.

A battery and at least local 5V needs to be available to allow such transition.

Other question: stm32F411 will act as DFP or UFP ? Please do take care that at startup, datarole shall be aligned with power role: Sink-UFP and Source-DFP. For other configuration, data_swap is needed.

Best regards

Nathalie

STM32 will act as UFP.

I’ve solved this earlier with a pull-up resistor networking and an analog switch. With some basic switching logic. Was able to get a charge only (no data) state when charger is connected and phone / tablet provides power when charger is disconnected. But the main issue with that is I am able to charge my phone at 5V, 2A but as soon as I connect the tablet it is charging only at 5V and 500mA. So I require a pd negotiation happening.

Why do I need fixed 5V or a battery? If the male usbc plug is a dual role, when charger is disconnected shouldn’t it will toggle to sink and get power from phone / tablet ?

“When tablet has done contract, as source and a charger is inserted into receptacle, a contract needs to be done with the charger but it is difficult to know tablet algorithm and thus which PDO will be chosen.”

Yes I’ve I2C attached for receiving messages from both source and sink side. Suppose my phone needs 9V, 3A, I’ll ask the sink to set 9V, 3A then I’ll open the load switch for sink to source pass through. 

is it a good practice? Sorry, this is the first time I’m working on PD.

Thanks 

Subhadeep 

System always starts in 'TypeC' at 5V.
Source has a pull up (3 different values) which advises its current capabilities, Sink has a pulldown to advise it is connected and when consuming more than 500ma, it shall be able to detect source pull up level.

Then, if source is PD capable, it will start to send its 'source_capabilities' to advise all its power capability: this is starting point for power negotiation.

Based on Sink own algorithm, Sink will select a 'PDO' (i.e voltage/current proposed by source). Source would need to accept, then to transition its vbus to negotiated voltage and  green light (PSRdy message) for sink to proceed on power line.

When a power swap is performed, as the 2 units exchange their power role, futur ex-source needs to discharge VBUS line down to below 0.8V, CC terminations shall swap and new power up needs to be started as if plug occurs. Which means that it restarts in TypeC like phase, then new source sends its source_cap, etc.

So if receptacle side has negotiated 9V/2A for the tablet then you try to swap power: 5V phase is mandatory.

Please note that may be also tablet would have prefer 12V or would like 9V but only if current is 3A, other wise, it prefers 5V...

Best regards

Nathalie

Thank you for the clarification. I’ll come up with something else for a review. Thanks