Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use ADC-DMA-Mode? Documentation missing (IDFGH-4785) #6588

Open
Wokinloksar opened this issue Feb 21, 2021 · 6 comments
Open

How to use ADC-DMA-Mode? Documentation missing (IDFGH-4785) #6588

Wokinloksar opened this issue Feb 21, 2021 · 6 comments
Labels
Type: Feature Request Feature request for IDF

Comments

@Wokinloksar
Copy link

The documentation about the ADC states:

Each ADC unit supports two work modes, ADC-RTC or ADC-DMA mode.

After that documentation for ADC-RTC follows, but documentation for ADC-DMA is missing. I searched for example code, code fragments, but was not able to find proper documentation.
Can someone point me to the right direction or is able to finish documentation.

@Wokinloksar Wokinloksar added the Type: Feature Request Feature request for IDF label Feb 21, 2021
@github-actions github-actions bot changed the title How to use ADC-DMA-Mode? Documentation missing How to use ADC-DMA-Mode? Documentation missing (IDFGH-4785) Feb 21, 2021
@krzychb
Copy link
Collaborator

krzychb commented Feb 21, 2021

Hi @Wokinloksar, thank you for noting this issue. Indeed we are missing description of ADC-DMA or at least pointer in the ADC section that is it implemented using I2S. Before documentation is prepared, if you have not find it already, please check the i2s_adc_dac example.

@drws
Copy link

drws commented Sep 17, 2021

Missing documentation should be marked as bug rather than a feature request. The state od ESP32 ADC-DMA API and its documentation is ridiculous for a 4-point-something version.

@higaski
Copy link
Contributor

higaski commented Jun 4, 2022

In the meantime... has anybody figured out what the configuration values conv_num_each_intr and conv_limit_num actually do?

How does one setup a DMA which performs a single conversion for a single channel at the set sample frequency? (Assuming all bugs revolving around the frequency settings are solved... because currently it doesn't seem to change anything.)

@Harry-Smith1
Copy link

In the meantime... has anybody figured out what the configuration values conv_num_each_intr and conv_limit_num actually do?

How does one setup a DMA which performs a single conversion for a single channel at the set sample frequency? (Assuming all bugs revolving around the frequency settings are solved... because currently it doesn't seem to change anything.)

Did anyone ever figure this out

@higaski
Copy link
Contributor

higaski commented May 17, 2023

I haven't...
If you can, update to 5.x. Although it's still buggy it at least has a sane API...
Currently setting the sampling rate only works on ESP32S3 as far as I know (#10612), but I hope this can get fixed soon.

@ManuelRojasDev
Copy link

I agree. Was looking for a way to use the DMA to do ADC sampling, on the ESP32 ESP32-WROOM-32, using ESP-IDF 5.1.xx. By using a timer timer, to trigger the DMA. But unfortunately I also couldn't find documentation about this. Tried both oneshot and continuous modes, but could not get a reading faster than 125Ksps and 50Ksps respectively. I've been trying to use a timer (eg timer 1 from MCPWM0)to trigger the DMA for ADC readings on various channels.

What I really wish for is a seamless synchronization between the MCPWM driver and DMA-ADC readings. This would be a game-changer, especially in the realm of power electronics applications. It's a bit frustrating and time consuming hitting these walls without ample documentation.Thought that changing the sampling rate would be as easy as changing the sample_freq_hz variable in the adc_continouse_config_t struct. Would be nice to be able to synchronize the MCPWM driver with the DMA-ADC reading, as this would be most useful to power electronics applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature Request Feature request for IDF
Projects
None yet
Development

No branches or pull requests

6 participants