Gaps in ADC voltage response when using DMA

plusorc
Posts: 41
Joined: Sat Nov 09, 2019 6:27 am

Re: Gaps in ADC voltage response when using DMA

Postby plusorc » Tue Sep 15, 2020 3:08 pm

ADC works , actually it works like you expect it to work , but sometimes it just makes strange behaviour
If you look at the link I posted earlier , it works but gives strange results from time to time
and only by inverting the signal from HIGH to LOW or (pulling the PIN LOW) , it worked very accurately

either it has abnormal behaviour or some data is not mentioned in the manuals / datasheets

I had a similar situation like you , a circuit is working very fine with Arduino and once I replace Arduino with ESP32 , I get
erratic behaviour from the chip .

ESP_Alfred
Posts: 2
Joined: Tue Jul 03, 2018 12:42 pm

Re: Gaps in ADC voltage response when using DMA

Postby ESP_Alfred » Thu Sep 17, 2020 7:34 am

@jkingdon Thank you for reporting this issue. After investigation, we found that some configuration parameters in the ADC-DMA driver did not match the sampling frequency.(ADC-RTC does not have this problem.) Now we are solving and testing. You will be notified to test after we uploading the code.

jkingdon
Posts: 20
Joined: Wed Jun 15, 2016 2:51 pm

Re: Gaps in ADC voltage response when using DMA

Postby jkingdon » Fri Sep 18, 2020 1:37 am

That's great news! Thanks for the update.

Scott.Bonomi
Posts: 73
Joined: Mon Mar 09, 2020 7:36 pm

Re: Gaps in ADC voltage response when using DMA

Postby Scott.Bonomi » Wed Sep 23, 2020 11:07 pm

In my opinion, it would be good to know what, if any, input you got at that time.
One might need to know what parameters are being sent to the ADC and the DMA.
Is it a case of failing to finish settling in the allowed time slice? Is the output a value that interferes with the DMA operation or causes a reset of the data pointers? A number of years ago I found that I was losing data because the RS232 to USB adapter I was using was eating two specific 16 bit values anytime they came up in the data stream.

If you are getting a jump in the output, I could see that being a tie between two resisters that are supposed to be separate. So if bit two was tied to bit three the output would go 0 1 2 3 C D E F C D E F C D E F or something like that, and the intermediate values would never be seen. That could then repeat every 32 or 64 possible values. Getting No output over a time slice is a possibility but usually shows up as vertical streaks not horizontal ones. but that depends on how you are time tagging your data points. Interaction between the DMA interrupt and the ADC processing (timer driven?) and associated priorities could cause an issue like this but only if there is something in the processing affected by the reported level.

How does it affect the plot if you change the data collection rate by a factor of two or an order of magnitude? What does a scope show when looking at the input values. You have an interesting puzzle.

jkingdon
Posts: 20
Joined: Wed Jun 15, 2016 2:51 pm

Re: Gaps in ADC voltage response when using DMA

Postby jkingdon » Thu Sep 24, 2020 12:15 pm

Hi Scott,

Thanks for your thoughts. Espressif have acknowledged the problem and are working on a fix. see https://www.esp32.com/viewtopic.php?p=65313#p65313

I'd love to know more about the mechanism of the failure too - it's quite intriguing. Input signal is clean on the scope, and I've tried several different sources. Sample frequency doesn't seem to be a factor and I tested with longer than default sampling times.

mwgrabau
Posts: 1
Joined: Fri Apr 15, 2022 8:47 pm

Re: Gaps in ADC voltage response when using DMA

Postby mwgrabau » Fri Apr 15, 2022 8:58 pm

@jkingdon Did you ever figure out what's causing these skipped ADC values? I have the same problem now.

---Michael
I2s ADC output.png
I2s ADC output.png (28.89 KiB) Viewed 3755 times

Who is online

Users browsing this forum: Google [Bot] and 184 guests