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 .
Gaps in ADC voltage response when using DMA
-
- Posts: 2
- Joined: Tue Jul 03, 2018 12:42 pm
Re: Gaps in ADC voltage response when using DMA
@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.
Re: Gaps in ADC voltage response when using DMA
That's great news! Thanks for the update.
-
- Posts: 73
- Joined: Mon Mar 09, 2020 7:36 pm
Re: Gaps in ADC voltage response when using DMA
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.
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.
Re: Gaps in ADC voltage response when using DMA
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.
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.
Re: Gaps in ADC voltage response when using DMA
@jkingdon Did you ever figure out what's causing these skipped ADC values? I have the same problem now.
---Michael
---Michael
Who is online
Users browsing this forum: No registered users and 31 guests