How to dynamically change PD output profiles (CCG3PA)?

Announcements

Live Webinar: USB-C adoption. Simple & Cost-efficient solutions | April 18th @9am or 5pm CEST. Register now !

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

cross mob
JoLu_3455101
Level 4
Level 4
5 likes given 5 solutions authored 25 replies posted

Hi,

I am trying to figure out if there is a way to dynamically change the USB PD output profiles for CCG3PA. So far, I've specified my output profiles in the configuration table (i.e. a bunch of hex values in config.c). If there is a way to specific output charging profiles with "if/else" statements in the firmware code, that would solve my problem.

For example, my system has 2 input voltage supplies and 2 output profiles (5V @ 3A or 9V @ 1.67A). If the higher input power supply is turned OFF, the system cannot source the 9V output. However, because my configurable table is static right now, the end device keeps asking for 9V when it is not available. So I need to change the output charging profiles based on conditions (I have the power supply's status feed into the CCG3PA GPIO).

Thanks,

Jonathan

0 Likes
1 Solution
YiZ_31
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hi Jonathan,

You can look into this thread about changing PDO(Power Data Object) dynamically by issuing GPIO interrupt:

Active Power Identification with Multiple PDOs

Another option is dynamically change PDO by overriding source PDO mask. See function dpm_update_src_cap_mask().

Regards,
Eddie

View solution in original post

0 Likes
6 Replies
YiZ_31
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hi Jonathan,

You can look into this thread about changing PDO(Power Data Object) dynamically by issuing GPIO interrupt:

Active Power Identification with Multiple PDOs

Another option is dynamically change PDO by overriding source PDO mask. See function dpm_update_src_cap_mask().

Regards,
Eddie

0 Likes

Thanks Eddie. That is useful information. I'll try it to dynamically change the PDO.

On a related note, from your original reply, you said 9V @ 1.67A (15.03W) has priority over 5V @ 3A (15W). I think this explains a strange observation that I experienced. If I configure my PDO to have "5V @ 2A" and "9V @ 2A" profiles, even though my end device chooses/requests the 5V profile, the CCG3PA outputs 9V to end device (although at a lower current than 2A to compensate). It seems weird to me and I wasn't sure if I did something wrong in my code. Do you think the priority scheme that you mentioned can be the cause of this?

Thanks,

Jonathan

0 Likes
YiZ_31
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

That's my mistake actually, so I modified my answer. That process is done when you receiving profile not sending profile. When CCG3PA acts as power source, it just sending PDOs and the the sink decide to take it or not.

Regards,
Eddie

0 Likes

Hi Eddie,

Thanks for letting me know. Yes, my configuration is that CCG3A is providing power to the end device (i.e. phone).

Which part of the code should I explore about my weird problem (ask for 5V, but get 9V)? I've been exploring different configurations...

-When EDO profiles are 5V @ 3A and 9V @ 2A, phone asks for 5V profile and gets 5V.

-When EDO profiles are 5V @ 2A and 9V @ 2A (yes, the max power isn't close in matching, but for the purpose of this test, please bear with me), the phone asks for 5V profile and gets 9V with lower current to compensate (as measured by the Cypress PD Analyzer, as well as a multi-meter).

The firmware modifications are minimal from the default car charger project (CYPD3171-24LQXQ_cla) and the PDOs are copied & pasted into config.c.

Best regards,

Jonathan

0 Likes
YiZ_31
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hi Jonathan,

According to PD Spec 3.0:

The Sink receives a Source_Capabilities Message from the Source and responds with a Request Message. If this is a Valid request the Sink receives an Accept Message followed by a PS_RDY Message when the Source’s power supply is ready to source power at the agreed level. At this point the Source and Sink have entered into an Explicit Contract.

So, it's impossible that your phone ask for 5V profile but get 9V, that is not reasonable. Source would only give sink 9V when sink ask for 9V. If it's a device that can not take 9V but the adapter did that, that would cause damage the the sink device. You can check the PD communication log with EZ-PD analyzer.

Regards,

Eddie

0 Likes

Hi Eddie,

Thanks for your response. It was using the EZ-PD analyzer that we discovered the discrepancy (phone asked for 5V, but the software & DMM measured 9V). And yes, we did experience hardware damage. However, we will do more experiments to see what's going on. For now, I will mark the original question as answered. Thanks for your help.

Best regards,

Jonathan

0 Likes