Synchronous Serial Controller (SSC or I2S ) using DMA controller on SAM3x8e : Incomplete Data Transfer from memory to SSC peripheral

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

Hi,

 

I am using SAM3x8E on an arduino due to output sound data through SSC. The sound data is stored in an int16 buffer with 12270 elements . I was able to play the entire audio on speaker using the SSC interface to DAC . (This makes it sure that the DAC is configuration is correct )

 

Now I am trying to use the DMAC (Channel 0)  to transfer the sound from memory to the SSC peripheral. But now I am getting only partial sound (Only 4078 elements from the buffer are played through the speaker).

My DMAC configurations are as follows : 

> Single Buffer Transfer

 

DMAC transfer types

 

> Hardware Handshaking with destination SSC Peripheral

> DMAC Channel Descriptor Register is set to zero.

> Buffer Transfer size is set to number of elements in the buffer  = 12270

 

 

 Is there any limit to the number of elements that can be transferred using a single buffer transfer?

 

(I am using asf libraries on Atmel Studio 6)

 

Thanks, 

Ashwin

This topic has a solution.

AS_N

Last Edited: Fri. Dec 4, 2015 - 11:20 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Hi,

 

We did more testing and observed the following:

 

> Whenever we write in to Buffer Transfer size (BTSIZE) buffer of DMAC_CTRLA register of a DMA Channel a 16-bit value (say,4096 = 0x1000) only the first 3 bytes get written in to the buffer (i.e. 0x000) and the MSB is getting masked out.

 

>The no: of elements in the buffer that I need to transfer is 12270 which is 0x2FEE in hex (as mentioned in the previous post) but the value that's getting written into the BTSIZE buffer is 4078 = 0xFEE and this was causing the partial transfers. 

 

 

The following are my queries:

 

>The BTSIZE register is 16 bits wide and should be able to hold values till 0xFFFF. Why is it not able to do so?

 

>Is it because of any transfer size limitation for the DMA?

 

Thanks,

 

Ashwin

AS_N

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

Hi,

 

We had solved the issue few weeks back. 

 

This is how we solved it. 

> The dmac.h file in asf library has a macro named DMA_MAX_LENGTH set to 0xFFF = 4095. We tried changing it to higher values but still Buffer Transfer size (BTSIZE) register was showing only values till 4095. This seemed to us to a hardware limitation of the DMAC in Atmel SAM3x8E (which we did'nt see mentioned in the datasheet). So this closed the option of single buffer transfer for us and we moved to multi-buffer transfer

 

> It was a simple way out(even though I took some time to figure it out :P ) - USE MULTI-BUFFER TRANSFER WITH CONTIGUOUS SRC ADDRESS! (see table 22.4 Row 3)

 

 

Thanks!

 

AN

AS_N

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

 

Many thanks for posting the solution :)

 

 

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

Hi,

I have the same problem with SAM3U4C ,In my project, I use DMAC to transfer data from memroy to SSC ,but DMAC always in busy, but SSC always in ready status. the data cannot be transferred  from DAMC to SSC ,

In the datasheet of SAM3U4C, the DMA Channel HW Interface Number does not supply,does this need supply for DMAC?

 

ltg