cancel
Showing results for 
Search instead for 
Did you mean: 

Setting up STUSB4500 sink for 12V,5 A

ARadh.1
Associate III

We are using the STUSB4500 PD chip in one of our applications. The requirement is to set the Power delivery to 12 V and 5A for the sink. I have been referring the driver code provided by ST to program our microcontroller. To set PDO to 12 V and 5 A, i program the DPM_SNK_PDO3 registers using I2C. The voltage and current are set as shown below

sinkPDOobj.fix.Voltage = (12000 /50);

sinkPDOobj.fix.Operationnal_Current = (5000 / 10);

temp[0]=(sinkPDOobj.d32 & 0x000000ff);

temp[1]=((sinkPDOobj.d32 & 0x0000ff00) >> 8);

temp[2]=((sinkPDOobj.d32 & 0x00ff0000) >> 16);

temp[3]=((sinkPDOobj.d32 & 0xff000000) >> 24);

adresse = DPM_SNK_PDO1 + 4*(3 - 1) ;

for(i=0;i<4;i++)

{

adresse+=i;

i2c_write_ctrl_reg(twi, adresse,temp[i]);

delay(100);

}

However when i read the DPM_SNK_PDO3 register , the voltage and current values are different from what i had programmed. Kindly guide me on how i should be programming to set the PD sink register for 12V and 5A configuration. I am connecting the type C cable from the laptop to the sink.

18 REPLIES 18

Hi Winfred,

Are the Source PDOS capabilities in the example application provided by ST read from the RX_DATA_OBJ register? I2C_Read_USB_PD(STUSB45DeviceConf[Usb_Port].I2cBus,STUSB45DeviceConf[Usb_Port].I2cDeviceID_7bit ,RX_DATA_OBJ ,&DataRW[0], Header.b.NumberOfDataObjects * 4 ); . When i read this register i get all zeroes? Any reason why this could be happening?

Please refer to STSW-STUSB004 package, which includes documents and sample source codes for STUSB4500 NVM customization.

https://www.st.com/content/st_com/en/products/embedded-software/evaluation-tool-software/stsw-stusb004.html

As well as STSW-STUSB002 package, the GUI to easily customize STUSB4500 NVM with a NUCLEO-F072RB acting as an USB to I2C bridge.

https://www.st.com/content/st_com/en/products/embedded-software/evaluation-tool-software/stsw-stusb002.html

Thanks Winfred. I am also trying to read the Source Capabilities. In the application code provided by ST i see the source capabilities read this way

Status = I2C_Read_USB_PD(STUSB45DeviceConf[Usb_Port].I2cBus,STUSB45DeviceConf[Usb_Port].I2cDeviceID_7bit ,RX_DATA_OBJ ,&DataRW[0], Header.b.NumberOfDataObjects * 4 );

However when i port the same i2c reads in our controller i observe that the data is all zeroes. Can you guide me the right way to fetch the source capabilities? Is there some prerequisite to reading this register? We have a STUSB4500QTR but the device ID read is 0x25, does this mean that the chip does not support USBPD?

HI Winfred. Can you provide an update on the above query on fetching the Source PDOs? We would also like to confirm if we are using the right chip(STUSB4500QTR) as the device id read is 0x25? We have an upcoming release for which we have to set the USB PD for 12V,5 A configuration and need to fix it as soon as possible.

Please refer to STSW-STUSB004, NVM customization library for STUSB4500:

https://www.st.com/content/st_com/en/products/embedded-software/evaluation-tool-software/stsw-stusb004.html

ARadh.1
Associate III

Hi Winfred,

We have a STUSB4500QTR part but the device ID read is 0x25, does this mean that the chip does not support USBPD?

Device ID can also be 0x25 for STUSB4500.

The device supports USBPD, with the evidence that you have seen a negotiated PDO 15.2V.

But it is just strange that how they got there. If it is possible to provide BMC traces (for CC pin) the cause will be clear.

>However when i port the same i2c reads in our controller i observe that the data is all zeroes. 

It is because the registers are FIFOs temporarily storing the received messages.

In the sample project (STUSB003 package), when a message comes, Alert pin triggers the ALARM_MANAGEMENT() to check the received message, and saved the information (to PDO_FROM_SRC) if that message is about Source PDO.

> We have an upcoming release for which we have to set the USB PD for 12V,5 A configuration and need to fix it as soon as possible.

Please contact your local FAEs directly since it is urgent.