Using DMA to gather data from I2S problem

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm using the ATSAMD51J20A and I'm trying to gather the data received through I2S from a codec. The codec sends stereo data at 8KHz and I configured the DMA through Atmel Start to be triggered with the I2S RX 0 Trigger (I assume that could be the RXRDY interruption flag). The thing is that i'm filling a buffer with the data but it gets filled with the same data for like 80-85 samples and then changes to the next channel data and fills with another 80-85 data samples of that data and so on. I think the trigger is not cleared by the DMA so it just keep copying the data. From the datasheet, the RXRDY flag is set when a new data is available and cleared when the data is read. I think im missing something about how DMA works...   

 

I could post a lot more details about the code and configurations but i think that what i just explained is the core problem, something about the DMA trigger doesnt work as i expected. All codes are the ones configured and generated from Atmel Start.