ATSAMD21 DMAC ADC to Memory to I2S

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

SAMD21

I've read through the datasheet multiple times and concluded that the case is impossible, but decided to ask smarter people here.

 

I'm reading ADC data to memory1 with DMAC. It works.

I'm writing from memory2 to I2S with DMAC. It works.

Doing these two simultaneously doesn't.

 

I'm reading two ADC channels to alternating buffers. Do some audio processing (in an Arduino loop) and write to another alternating buffer. The later is sent to I2S to an Audio Driver. I tried doing it with DMAC but it would only do one of these at a time. Read a whole buffer or write a whole buffer. I switched to reading ADC wit DMAC, and writing I2S with interrupts. (obviously there is a delay of a few tens of ms between the input signal and output signal in my case, which is perfectly fine, and not part of the problem)

 

Any way to make it all work (like magic) with DMAC?

 

best,

Radu 

Last Edited: Mon. Jul 5, 2021 - 07:33 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes. It should all work.

 

In what way isn't it working using DMA on both at once? Could you not make the DMA store ADC samples into memory while the DMA was also reading different samples for the I2S?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I need to retract my question due to user stupidity (myself). Now I'm pretty sure I failed to realise I had to enable each channel, and was enabling whichever was the first one. Can't test though, because I burned all my original uCs and the new batch just wouldn't work the same, but this will be a new thread.

 

Thanks for making me recheck my original conclusion.