how to use the ADC, if it is not present in PSoC Creator for 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
VaVo_2449711
Level 1
Level 1
First like given

Hi All.

There is the following problem:

CCG3PA has a built-in ADC and the datasheet informs "This ADC can be accessed from all GPIOs and the DP/DM pins through an on-chip analog mux".

But in the PSoC creator there is no ADC component to use to read the analog input.

Please help me, how can I read the analog input in the application code without the ADC component.

0 Likes
1 Solution

Hi Vadim,

You can use the below function for accessing ADC:

uint8_t   pd_adc_sample ( uint8_t port, PD_ADC_ID_T adc_id, PD_ADC_INPUT_T input )

This function will handle the registers and AMUX for the user. PD_ADC_ID_0 will be used for VBUS measuring.

Regards,

Rajath

View solution in original post

3 Replies
RajathB_01
Moderator
Moderator
Moderator
250 replies posted 100 replies posted 50 replies posted

Hi,

There is no option to use an ADC component in the creator.

ADC can be used only by accessing the registers in the firmware code.

Regards,

Rajath

Thank you Rajath.

I will look for examples and options to read directly ADC through registers.

Perhaps you can share an example for this.

It is also a question: is it necessary to place the code for reading the ADC register, as well as switching the analog MUX to the critical section, so as not to interfere with the operation(access) of the ADC used in PD-lib?

Regards, Vadim.

0 Likes

Hi Vadim,

You can use the below function for accessing ADC:

uint8_t   pd_adc_sample ( uint8_t port, PD_ADC_ID_T adc_id, PD_ADC_INPUT_T input )

This function will handle the registers and AMUX for the user. PD_ADC_ID_0 will be used for VBUS measuring.

Regards,

Rajath