I've been going through the post here viewtopic.php?hilit=dma%20adc&p=2101823 ... bc131bd3c2 but finding it very hard to follow. I want to adapt it so that I continuously read 2 ADC inputs at a fixed sample rate but fill a buffer with a fixed number of samples from each ADC channel so I can perform an FFT. That example just reads the ADCs once before printing the output and then relies on a delay to set the sample rate.
I've set the specific ADCs I want to use and set the sample rate via the clock divider and then changed the count_of() field in the dma_channel_configure() so it becomes...but I don't know how to access the ADC data. The destination is nullptr in the above code because it is set by the control DMA channel, which is...In the simple, single channel examples I've seen, this is an array that can be indexed for the data but I can't figure out how to extract data from this. Trying to print it out causes a freeze.
I'm using the Arduino IDE so my code structure is different from the original but can still post if needed.
I've set the specific ADCs I want to use and set the sample rate via the clock divider and then changed the count_of() field in the dma_channel_configure() so it becomes...
Code:
dma_channel_configure( samp_chan, &samp_conf, nullptr, &adc_hw->fifo, num_channels * num_samples, false );
Code:
&dma_hw->ch[samp_chan].al2_write_addr_trig
I'm using the Arduino IDE so my code structure is different from the original but can still post if needed.
Statistics: Posted by StarryPied — Mon Jan 29, 2024 10:40 am — Replies 0 — Views 14