Setting up STUSB4500 sink for 12V,5 A
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.
