USB EZ-PD™ Type-C Forum Discussions
Hi,
In my project I need to request the Samsung phone to change its power role from source to sink a few seconds after it is plugged in the USB-C connector and starts sending data stream to the usb port and a Dp-to-HDMI converter.
what code should be added in the reference SDK project CYPD3120-40LQXI_dp_dongle to send the USB Power Delivery messaging?
Thanks,
Derong Yuan
Show LessHi,
My project is based on reference project firmware CYPD3120-40LQXI_dp_dongle it partly works except the power charging.
Below is the diagram. Before Samsung is plugged in the USB-C the MOSFET switch is off so when Samsung is plugged in the USB-C the Dp-to-HDMI converter and USB hub start working. But Samsung is a power source.
I can use one of the GPIO P1.0 or P1.1 to turn on/off the MOSFET switch. I would like to turn on the MOSFET switch to charge the Samsung from the dc/dc power supply. Could you please tell me how I can send a command to Samsung to change to power sink?
Thanks,
Derong Yuan
Show Less
Hi,
I add the two commands (bold in below) in function "dock_port_type_role_monitor()" called by while(1) in main(). the 1st command is to turn on a MOSFET switch and the 2nd to send a PR_SWAP command to a Samsung phone in the USB-C connector.
After Samsung plugged I found the 1st command works but the 2nd command does not. The Samsung is not changed to being charged. Could you tell me why and how to make it work?
The dock_port_type_role_monitor() is posted by LisaZ_26 in the previous post in the forum. The main.c is at attached.
void dock_port_type_role_monitor()
{
const dpm_status_t* dpm_stat = dpm_get_info(0);
if(!(dpm_stat->attach))
{
dock_port_monitor_state = 0;
}
switch(dock_port_monitor_state)
{
case 0:
if((dpm_stat->attach) && (dpm_stat->contract_exist)){
dock_port_monitor_state = 1;
ds_flag = 0;
ps_flag = 0;
}
break;
case 1:
if(!timer_is_running(0,PORT_CHG_RETRY_TMR)){
if((dpm_stat->cur_port_role == PRT_ROLE_SINK) && (ps_flag < 3))
{
if(dpm_pd_command(0,DPM_CMD_SEND_PR_SWAP,NULL,ps_cbk) != CCG_STAT_SUCCESS)
{
timer_start(0,PORT_CHG_RETRY_TMR,PORT_CHG_RETRY_TMR_PERIOD,NULL);
}
}
if((dpm_stat->cur_port_type == PRT_TYPE_DFP) && (ds_flag < 3))
{
if(dpm_pd_command(0,DPM_CMD_SEND_DR_SWAP,NULL,ds_cbk) != CCG_STAT_SUCCESS)
{
timer_start(0,PORT_CHG_RETRY_TMR,PORT_CHG_RETRY_TMR_PERIOD,NULL);
}
}
}
USB_SWITCH_CTRL_Write(0);
CyDelayUs(100);
// pd_prot_send_ctrl_msg(0,SOP,CTRL_MSG_PR_SWAP);
dpm_pd_command (TYPEC_PORT_0_IDX, DPM_CMD_SEND_PR_SWAP, NULL, NULL);
CyDelayUs(100);
break;
}
}
Thanks,
Derong Yuan
Show LessI am trying to add a command in the source code of the reference project "CYPD3120-40LQXI_dp_dongle" to turn on/off a GPIO port of CYPD3123 when a device is detected plugged in the USB-C. Can anyone tell me the command and the source code name in the project?
Thanks,
Derogn Yuan
Show LessI tested my chip cypd3125 by cy4531, and I could use PSoC programer to program/read firmware in my chip by SWD using MiniProg3. And then I put the cypd3125 in my demo power adapter, and SWD pins connect the typec pins to ensure I can connect it by typec line. However I can't connect the cypd3125 by SWD(I use vbus pin to power),what's the difference between cy4531 and my demo power adapter? thanks.
Show LessHi,
I have designed a circuit with CYPD3125, a Dp-to-HDMI converter, a USB hub controller and a DC power regulator. The PCB is ready but later found the SDK project "CYPD3120-40LQXI_dp_dongle" firmware can not be changed for CYPD3125 controller but can be changed for CYPD3123 controller. I do not see the functional difference between two controller but can anyone tell me if I can use CYPD3123 to replace the CYPD3125 for my application circuit below:
1. The upstream signals DRX0P,DRX0N, DRX1P,DRX1N, DRX2P,DRX2N, DRX3P,DRX3N of the Dp-to-HDMI converter are directly connected to a USB-C connector but the signals AUXP, AUXN of the Dp-to-HDMI converter are connected through CYPD3125 to the USB-C connector.
pin 11 of CYPD3125 ----------------->AUXP
pin14 of CYPD3125 ----------------->AUXN
pin12 of CYPD3125 <----------------SBU1 (pin A8) of USB-C
pin13 of CYPD3125 <----------------SBU2 (pin B8) of USB-C
2. D+ (pin 21) ,D- (pin 22) of CYPD3125 are connected to a USB hub downstream port. The upstream port of the USB hub is connected to DP (A6), DN (A7) of the USB-C
3. the USB hub controller, Dp-to-HDMI converter and CYPD3125 are powered by an external power supply and must be turned on before connecting to USB-C connector.
4. CYPD3125 needs to talk with a smart phone plugged in the USB-C and let the phone to transmit video through the Dp-to-HDMI converter.
5. CYPD3125 turns on an NMOSFET to charge the smart phone.
Thanks,
Derong Yuan
Show Less
What's the slave address of CCG3' I2C2 port(GPIO3.4、GPIO3.5),when used as slave I2c?
Hello
Once the sample FW is written to the CY4532 kit, the connetione will not be 2 as attached.(USB Type-A to Micro-B) cable connected to J12 on the CY4532 EVK power Bard). Q)How can I return CY4532 to its initial state?I want to return to the same state as attached
Best Regards
Arai
Show Less