Fetching live Dp Dm lines voltages

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
PrRe_3492461
Level 4
Level 4
First like received 50 sign-ins 50 replies posted

Hello community!

I'm using CCg3pa for my custom design.

In our design CCg3pa can only act as BC1.2 and PD SNK/UFP.

We have a requirement here to read the live D+ and D- voltages ( Similar to vbus_get_value(G_PORT0); /*return present VBUS voltage in mV */ ).

As per below snippet captured from CCG3PA Data sheet I can infer that the Dp/Dm lines voltages can be accessed using available ADC. Correct me if I'm wrong.

PrRe_3492461_0-1624877684088.png

So Can anyone please provide me insights to read Dp/Dm live voltages using an API ?

if reading live voltage is not available,

As per below snippet will reading states of Dp/Dm lines using respective structure and tracking if they're in certain range can be done ? will this structure help me achieving our requirement ?

PrRe_3492461_1-1624877866530.png

Thanks and regards,

Pranay.

 

0 Likes
1 Solution
Abhilash_P
Moderator
Moderator
Moderator
50 likes received 500 replies posted 250 solutions authored

Hi,

  Please refer to the following thread,

https://community.cypress.com/t5/USB-EZ-PD-Type-C/CCG3PA-as-a-BC1-2-Sink-Portable-Device/m-p/199678

"As per below snippet captured from CCG3PA Data sheet I can infer that the Dp/Dm lines voltages can be accessed using available ADC. Correct me if I'm wrong."

      Yes, your understanding is correct. Please go through the below image as a reference,

Abhilash_P_0-1624887040299.png

Please let me know if you were able to understand from the attached thread. 

 

Regards,

Abhilash P

 

 

 

View solution in original post

0 Likes
7 Replies
Abhilash_P
Moderator
Moderator
Moderator
50 likes received 500 replies posted 250 solutions authored

Hi,

  Please refer to the following thread,

https://community.cypress.com/t5/USB-EZ-PD-Type-C/CCG3PA-as-a-BC1-2-Sink-Portable-Device/m-p/199678

"As per below snippet captured from CCG3PA Data sheet I can infer that the Dp/Dm lines voltages can be accessed using available ADC. Correct me if I'm wrong."

      Yes, your understanding is correct. Please go through the below image as a reference,

Abhilash_P_0-1624887040299.png

Please let me know if you were able to understand from the attached thread. 

 

Regards,

Abhilash P

 

 

 

0 Likes

Hi Abhilash,

Thanks for the reply.

Do you mean that as QC Snk functionality is not available in ccg3pa to read Dp Dm line voltages we need to use GPIO mechanism ? I didn't your point completely.

I want to re-iterate my requirement,

Is it possible to read the live D+ and D- voltages in ccg3pa ?

 

Regards,

Pranay.

0 Likes
Abhilash_P
Moderator
Moderator
Moderator
50 likes received 500 replies posted 250 solutions authored

Hi,

  When you are referring to reading live Dp Dm voltages, is it on a software using any specific API or using external Hardware connections. Since Dp Dm lines can be accessed via GPIOs, they can be configured to read live Dp Dm signals. But external connection can be made on the board to read the Dp Dm voltages. 

Regards,

Abhilash P 

0 Likes

Hi Abhilash,

I don't want to make any hardware changes for reading DpDm lines live voltages. I want to make use of existing SW APIs to read voltages. 

However, If GPIOs are configured to read DpDm lines, will the values be either 0 or 1 (general GPIO states) or will values fetched from ADC ? 

Do you have any documents or Can you point me to KBA where related info is available to configure GPIOs to read Dp Dm lines live voltages ?

 

Thanks and regards,

Pranay.

0 Likes
Abhilash_P
Moderator
Moderator
Moderator
50 likes received 500 replies posted 250 solutions authored

Hi, 

 

  Please refer to the following image for API reference on configuring GPIO to read voltages,

1.PNG

 

As far as the voltage specifications of the GPIO is concerned, please refer to the electrical characteristics setion in the datasheet.

 

Regards,

Abhilash P

0 Likes

Hi Abhilash,

I have tried this already. It didn't help me out fetching voltage levels.

Below is the code I have used :

/**DP0*/

hsiom_set_config(GPIO_PORT_3_PIN_0, HSIOM_MODE_AMUXA);

level = pd_adc_sample (0, PD_ADC_ID_1, PD_ADC_INPUT_AMUX_A);

Dp0Val = pd_adc_level_to_volt (0, PD_ADC_ID_1, level);
hsiom_set_config(GPIO_PORT_3_PIN_0, HSIOM_MODE_GPIO);

/**Dm0**/
hsiom_set_config(GPIO_PORT_3_PIN_1, HSIOM_MODE_AMUXA);

level = pd_adc_sample (0, PD_ADC_ID_1, PD_ADC_INPUT_AMUX_A);

Dp1Val = pd_adc_level_to_volt (0, PD_ADC_ID_1, level);

hsiom_set_config(GPIO_PORT_3_PIN_1, HSIOM_MODE_GPIO);

 

Also tried using "HSIOM_MODE_AMUXB & PD_ADC_INPUT_AMUX_B" combination.

Also Note that I added 2 GPIOs in .cysh aswell and configured them as Analog IO and connected to GPIO16, GPIO17 in .cydwr and tried performing above steps, that didnt help aswell.

Have you verified this from your end ? if so please let me know the setup so that I will try to replicate in our end.

Let me know if I have any other things to perform or If I'm missing anything.

 

Regards,

Pranay.

0 Likes
Abhilash_P
Moderator
Moderator
Moderator
50 likes received 500 replies posted 250 solutions authored

Hi Pranay,

 

  

      In this case, adding GPIO’s might not work. For the ADC to be able to measure any internal signal, ideally there should be routing from the signal to the ADC. I am not sure if this is available for DP/DM lines. The only way I can think of is to check whether there is a way to route the DP/DM lines to ADC through ADFT. We are working on this internally and update you at the earliest.

 

Regards,

Abhilash P

0 Likes