Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

USB EZ-PD™ Type-C Forum Discussions

anujFromBiii
Level 1
5 replies posted 10 sign-ins 5 sign-ins
Level 1

Hi All,

We are developing a custom USB-PD solution using CYPD3175 & ACT4751. But we are not getting a USB to connect/disconnect events or make a call to psource_set_voltage. Thus VBUS is charged at default 5V.

We are not using VCONN, and CC/D+/D- lines are connected to CYPD3175, Attached are config files.

We would also like to know
1. How to generate a PDO table when we used the EZPD Config utility saving results in a format error.
2. How to read external ADC PIN e.g. P2.1. (there is no ADC block in components)

If required, we can share our schematic and source code through the mail

0 Likes
8 Replies
Wang_Fred
Moderator
Moderator 25 replies posted 10 solutions authored 50 sign-ins
Moderator

Hello,

Is the firmware you are using based on CCGx Power SDK (CYPD3175 PA Project)? and if you mean your power adapter can not supply higher than 5V even though the connected power sink  is requesting?

1. How to generate a PDO table when we used the EZPD Config utility saving results in a format error.

> can you please clarify more about the format error, or upload a capture?


2. How to read external ADC PIN e.g. P2.1. (there is no ADC block in components)

> There is an API existing in power_bank.c of CCGx Power SDK CYPD3171-24LQXQ_pb project - pb_get_battery_voltage(). It's a good reference for you.

static uint16_t pb_get_battery_voltage(void)
{
/* Measure voltage on VBATT_MON GPIO. */
uint8_t level;
uint16_t vbatt;

hsiom_set_config (VBATT_MON_GPIO, HSIOM_MODE_AMUXA);

/* Take ADC sample. */
level = pd_adc_sample (0, PD_ADC_ID_1, PD_ADC_INPUT_AMUX_A);

/* Convert level to VBUS using 1/11 divider. */
vbatt = pd_adc_level_to_volt (0, PD_ADC_ID_1, level);
hsiom_set_config (VBATT_MON_GPIO, HSIOM_MODE_GPIO);
/* TODO: Value on kits board is not 1/11 but around 1/12. */
return (vbatt * VBATT_VOLT_DIVIDER);
}

 

Thanks,

Fred

0 Likes
anujFromBiii
Level 1
5 replies posted 10 sign-ins 5 sign-ins
Level 1

Hi Wang_Fred,

Thanks for your reply and I'll look into the ADC sample you have provided. Attaching GPIO to MUX is the piece of code I was missing.

1. I am using "CYPD3175-24LQXQ_pa_direct_fb" as a base, and changed the set voltage API using configs. My power adapter is also able to supply up to 12v and I guess the sink is also requesting more voltage/power (I have tried a 33W capability phone and 18W capability power bank, and both support USB-PD). 
The issue here is that In the app_event_handler function (app.c) I am not getting APP_EVT_TYPEC_ATTACH / APP_EVT_CONNECT /  APP_EVT_DISCONNECT events when connecting/disconnecting my sink and that's why I think negotiation is not starting.

2. After creating the configuration using EZ-PD, I click on save to firmware file. a popup opens with filetypes CYACD, CYACD2 & HexFiles. then I selected "CYPD3175-24LQXQ_pa_direct_fb_config.cyacd" from project and it says no configuration found. if I create a new file then I'm getting index out of bound.
how to save the configuration so that I can get a table to use in firmware.

Regards

0 Likes
Wang_Fred
Moderator
Moderator 25 replies posted 10 solutions authored 50 sign-ins
Moderator

Hello,

> Let me know if you have a CY4500 protocol analyzer? the CC log captured by analyzer between power source/sink would be much helpful to diagnose the issue. 

> Is there stable 5V supply from your PA design when power sink attached, though no related PD event received? If yes, that means the CCG3PA firmware/type-c state machine is running to some extent and VBUS_CTRL is driven to low after attach.

> Is the original ''CYPD3175-24LQXQ_pa_direct_fb'' applicable to your project directly?

Thanks,

Fred

0 Likes
anujFromBiii
Level 1
5 replies posted 10 sign-ins 5 sign-ins
Level 1

Hi,

1. I do not have CY4500, but I do have a logic analyzer if it is of any use.

2. 5V power is also not supplied I have to invert pfet control logic control config to have it, so I guess the type-c state machine is not running. 

3. no direct feedback is not applicable as we are using an i2c-based BuckConverter. That's why we want to config PDO to use VBUS_CTRL_NONE. But unable to generate uint8_t array from EZ-PD.

Regards

0 Likes
anujFromBiii
Level 1
5 replies posted 10 sign-ins 5 sign-ins
Level 1

Hi Wang,

I have tried bootable project from  CYPD3175-24LQXQ_pa_direct_fb and to my surprise, APP_EVT_CONNECT /  APP_EVT_DISCONNECT are fired. unfortunately, fet_on is not called; thus, PD Stack is still not running.
while same example's noboot project fails to generate connect/disconnect events

0 Likes
Wang_Fred
Moderator
Moderator 25 replies posted 10 solutions authored 50 sign-ins
Moderator

3. no direct feedback is not applicable as we are using an i2c-based BuckConverter. That's why we want to config PDO to use VBUS_CTRL_NONE. But unable to generate uint8_t array from EZ-PD.

> What's the feedback type of DCDC used on your design? As you told a I2C-based BuckConverter instead direct-feedback is used on your design, the demo project for direct-feedback could not be used directly and some more modification need be done  to apply to your design.

> Can you clarify more about the ''VBUS_CTRL_NONE'' and ''unable to generate uint8_t array from EZ-PD''?

0 Likes
anujFromBiii
Level 1
5 replies posted 10 sign-ins 5 sign-ins
Level 1

1. Yes, we are using I2C-based BuckConvert instead of direct feedback. and got to know that we need to use VBUS_CTRL_NONE as VBUS_CTRL_TYPE_Px. I did that, following is the screenshot

anujFromBiii_1-1659247532758.png


2. we also need to use the custom bus ctrl method, here is the screenshot of that config

anujFromBiii_2-1659247581250.png


3. this need after this is stuck at this line (highlighted). that fails because the config in pdo table is not VBUS_CTRL_NONE. config table came from config.c file in same project

anujFromBiii_3-1659247689278.png

That's why need to generate gl_config_table, I have used some prebuilt tabled from google and it gets past that. it will be better if I can generate gl_config_table from EZ-PD utility. e.g.

anujFromBiii_4-1659247796129.png



On feedback type, we do have feedback from BuckConverter to CyPD, but to control VBUS we need to send I2C commands. here is the screenshot of the circuit

anujFromBiii_5-1659247972342.png


Now back to issue
1. if I use "noboot" project then I don't even get connect/disconnect events in the "app_event_handler" function in the "app.c" file. (APP_EVT_CONNECT/APP_EVT_DISCONNECT).
2. if I use bootable project from same workspace then I do get connect/disconnect event. but it is not turned ON on its own, I have to add patches (call to macro APP_VBUS_SRC_FET_ON_P1() & APP_VBUS_SRC_FET_OFF_P1() on connect/disconnect events) to power the bus manually.
3. In both case PowerDelivery negotiation is not executed and I don't get call to even to "psrc_select_voltage" and "psrc_set_voltage" in psource.c file.


I hope this information will be helpful to you in suggesting a way to resolve this issue. we are stuck on this issue for 2 weeks now

0 Likes
Wang_Fred
Moderator
Moderator 25 replies posted 10 solutions authored 50 sign-ins
Moderator

That's why need to generate gl_config_table, I have used some prebuilt tabled from google and it gets past that. it will be better if I can generate gl_config_table from EZ-PD utility.

> Yes, you can generate gl_config_table from EZ-PD Configuration Utility. If the configuration file is created for CCG3PA power adapter application, you can select the feedback type manually. Once you save it, there is a .c file generated where gl_config_table existing, and you can replace the config data with the one in your project.

Wang_Fred_0-1659407483883.png

3. In both case PowerDelivery negotiation is not executed and I don't get call to even to "psrc_select_voltage" and "psrc_set_voltage" in psource.c file.

> This kind issue need to be debugged. maybe you need to add a indicator led to show that if the FW is running or not(there is APP_FW_LED_ENABLE in FW designed for this purpose ). Besides, a PD protocol analyzer (e.g. CY4500) is much helpful to trace if the PD negotiation happens or at which step the PD negotiation fails.

0 Likes