Why can't I get 20V from the sink side?

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
NaMe_2085021
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

Hi everyone,

I use CYPD3120.

I get the whole range of voltages from the array, but I can't get 20V.

Could you help me?

Part of the code:

........................................................................................................................................................................................

static ccg_status_t hid_output_data (usb_setup_pkt_t *pkt)

{

    uint8_t  port;

    uint8_t *ptr;

    ptr = usb_hid_get_ep0_buffer();

    pd_do_t SNK_PDO[5]; 

    SNK_PDO[0].val = 0x0001912C; //5V 3A

    SNK_PDO[1].val = 0x0002D12C; //9V 3A

    SNK_PDO[2].val = 0x0003C12C; //12 3A

    SNK_PDO[3].val = 0x0004B12C; //15V 3A

    SNK_PDO[4].val = 0x000640C8; //20V 2A

   

    for(i = 1; i < 64; i++)

    {             

        switch(ptr[1])

        {           

            case PD_5V:

                dpm_update_snk_cap(0, 1, SNK_PDO);

                dpm_update_snk_cap_mask (0, 0x0F);

                dpm_pd_command (0, DPM_CMD_SNK_CAP_CHNG, NULL,NULL);

            break;

            case PD_9V:

                dpm_update_snk_cap(0, 2, SNK_PDO);

                dpm_update_snk_cap_mask (0, 0x0F);

                dpm_pd_command (0, DPM_CMD_SNK_CAP_CHNG, NULL,NULL);

            break;

            case PD_12V:

                dpm_update_snk_cap(0, 3, SNK_PDO);

                dpm_update_snk_cap_mask (0, 0x0F);

                dpm_pd_command (0, DPM_CMD_SNK_CAP_CHNG, NULL,NULL);

            break;

            case PD_15V:

                dpm_update_snk_cap(0, 4, SNK_PDO);

                dpm_update_snk_cap_mask (0, 0x0F);

                dpm_pd_command (0, DPM_CMD_SNK_CAP_CHNG, NULL,NULL);

            break;

            case PD_20V:

                dpm_update_snk_cap(0, 5, SNK_PDO);

                dpm_update_snk_cap_mask (0, 0x0F);

                dpm_pd_command (0, DPM_CMD_SNK_CAP_CHNG, NULL,NULL);

            break;                

        }

........................................................................................................................................................................................

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

Hi,

You can try to update the snk cap mask to 0x1F. It looks like you only enabled 4 sink PDOs.


Regards,
Eddie

0 Likes

Hi Eddie,

Thank you for your fast update, but your answer dosn't work for me.

Could you send part of the code example?

Best regards,

Nazar Melnichek

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

Hi,

Do you have a PD analyzer to capture the CC log? Have you updated sink PDO with

dpm_update_snk_cap (0, 5, SNK_PDO);

dpm_update_snk_cap_mask(0, 0x1F);.

0 Likes

Hi,

I don't have a PD analyzer.

Yes, I updated that. But it doesn't work for me.

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

Hi,

It may also be due to your adapter do not have matched 20V PDO. CYPD3120 already have 20V PDO if you have updated the code.

0 Likes