AnsweredAssumed Answered

ADSP592 SPI DMA (DMA_ERR)

Question asked by scott_wilson46 on Mar 18, 2014
Latest reply on Apr 15, 2014 by VineethaThomas

Hi,

I am having trouble getting SPI DMA accesses to work with the ADSP592. 

What I attempting to do is to put 10 16-bit words into the buffer my_buffer which is defined as:

 

uint16_t my_buffer[50];

 

 

My code is as follows:

  // Set the port up to let the spi stuff through:

  *pPORTF_MUX = 0x0;

  *pPORTF_FER = 0xe000;

 

  // do an initial direct SPI Write:

  *pSPI0_FLG  = *pSPI0_FLG | 0x2;

  *pSPI0_BAUD = 0x10;

  *pSPI0_CTL  = 0x5008;

  *pSPI0_FLG  = *pSPI0_FLG &~ 0x0200;

 

  for (i=0; i<5; i++) {

    if (i==0) {

     spi_tx_data = 0;

    } else {

     spi_tx_data =  address >> ((4-i)*8);

   }

  *pSPI0_TDBR = spi_tx_data;

  a = *pSPI0_RDBR;

  while((*pSPI0_STAT & 0x1) == 0) {}

}

 

toggle_clock();


// Set up the DMA:

*pDMA5_CONFIG = 0x0004;

*pDMA5_START_ADDR = &my_buffer[0];

*pDMA5_X_COUNT = 20;

*pDMA5_Y_COUNT = 1;

*pDMA5_X_MODIFY = 1;

 

// Set up the SPI:

*pSPI0_FLG |= 0x2;

*pSPI0_BAUD = 0x10;

*pSPI0_CTL  = 0x110A;


// Start Transfer:

*pDMA5_CONFIG |= 0x1;

*pSPI0_CTL    |= 0x4000;

 

a = *pDMA5_IRQ_STATUS;

 

while(*pDMA5_CURR_X_COUNT < 10) {}

 

*pDMA5_CONFIG &= ~0x1;

*pSPI0_CTL    &= ~0x4000;

 

 

The problem is that pDMA5_IRQ_STATUS always indlcates a DMA_ERR condition.  I am not sure why this is not working as its very similar to the code in the hw manual.  Any ideas?

Outcomes