Hi,
I’m working with the STUSB4500 USB-PD controller through the SparkFun libraries and I’m having a problem with the chip not resetting correctly. It seems to ignore the extra PDO settings and only negotiate PDO1 until I call softReset().
My schematic is identical to that shown on page 26 of https://www.st.com/resource/en/datasheet/stusb4500.pdf with an ESP32 connected to the I2C pins and a BQ2057WSN downstream on Vsnk. If I run the ReadParameters example the output I get is:
Connected to STUSB4500!
PDO Number: 2
Voltage1 (V): 5.00
Current1 (A): 1.00
Lower Voltage Tolerance1 (%): 0
Upper Voltage Tolerance1 (%): 20
Voltage2 (V): 9.00
Current2 (A): 1.50
Lower Voltage Tolerance2 (%): 10
Upper Voltage Tolerance2 (%): 10
Voltage3 (V): 9.00
Current3 (A): 1.50
Lower Voltage Tolerance3 (%): 10
Upper Voltage Tolerance3 (%): 10
Flex Current: 5.32
External Power: 0
USB Communication Capable: 0
Configuration OK GPIO: 0
GPIO Control: 1
Enable Power Only Above 5V: 1
Request Source Current: 0
which seems correct to me, but the chip negotiates an explicit power contract at 5V (verified with a Twonkie PD sniffer). However, if I upload the following sketch:
#include <Wire.h>
#include <SparkFun_STUSB4500.h>
STUSB4500 usb;
#define PIN_SDA 13
#define PIN_SCL 14
void setup()
{
delay(2000);
Wire.begin(PIN_SDA, PIN_SCL);
usb.begin();
usb.softReset();
}
void loop()
{
}
the STUSB4500 still negotiates a 5V contract initially, but then correctly renegotiates correctly to 9V after the call to softReset().
I’m not sure what I’m doing wrong here, I really want the PD chip to run autonomously and merely report status to the micro if it’s on; needing the micro to be booted to reset the PD chip and explicitly initiate charging is going to be a pain. What am I missing?
Thanks!