- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Solved! Go to Solution.
- Tags:
- ccg3pa and adc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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