ADC AD7606-4 sampling rate hardware SPI ESP32 #12960
Replies: 6 comments 8 replies
-
Chip: ESP32-WROVER-E |
Beta Was this translation helpful? Give feedback.
-
Hard to say. You will need a logic analyzer to tell, where the lag happens. But you will never get to 50kHz or 20µs. The average latency of the ESP32 between a trigger and something happening I have taken recently was ~45µs. And the response to the IRQ was just switch a pin on/off. The worst latency that I had seen in measurements was ~400µs. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the input. Is this long latency for the ESP32 software related or a principal issue of the chip's architecture? I found this, where a pin switch is realized in <1us. |
Beta Was this translation helpful? Give feedback.
-
This is an application where busy polling the adc busy pin is likely to be substantially more performant than the interrupt mechanism (especially the soft interrupts on the esp32) and easier to implement. |
Beta Was this translation helpful? Give feedback.
-
That's a whopping 80MHz clock rate. Is that what you want? |
Beta Was this translation helpful? Give feedback.
-
Here is my newest attempt to tackle the task. @glenn20, indeed I switched to polling the busy pin as the interrupt story is not solvable without going very deep. Question: Can I poll the pwm output pin register? The busy spikes are quite small. I could then just test if the ADC is busy or not, but get the 'clock' from the pwm output. Any comments and tips welcome.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I drafted a micropyton firmware to read out an ADC (AD7606-4). Using a PWM-Pin (duty cycle 50%), the ADC conversion is initiated with a fixed rate. The falling-edge of the BUSY Pin of the ADC, the SPI read is started.
The performance of my code is really bad. It seems that the spi reading is slower than expected. The measured times are around 250-250us per cycle. I want to achieve a sampling rate of around 50kHz.
Beta Was this translation helpful? Give feedback.
All reactions