AnsweredAssumed Answered

ADSP-21469 SPI receive master DMA mode, how many dummy words?

Question asked by RRC on Mar 25, 2011
Latest reply on May 8, 2012 by Sinalux

Hi,

 

I am using ADSP-21469 SPIB channel for reading data from chained ADC's. Here is the code snippet related to SPIB:

 

SRU(DPI_PB06_O, SPIB_MISO_I);       /* Connect DPI 06 pin buffer output to SPIB MISO input */
SRU(SPIB_CLK_O,  DPI_PB07_I);       /* Connect SPIB clock output to DPI 07 pin buffer input */
SRU(SPIB_FLG0_O, DPI_PB08_I);       /* Connect SPIB flag 0 output to DPI 08 pin buffer input */

 

SRU(LOW, DPI_PBEN06_I);              /* SPIB MISO pin buffer enable   */
SRU(HIGH,  DPI_PBEN07_I);             /* SPIB clock pin buffer enable  */
SRU(HIGH, DPI_PBEN08_I);             /* SPIB flag 0 pin buffer enable  */

 

*pSPIDMACB = 0x0;                       /* disable SPIB DMA */
 
*pSPICTLB = (TXFLSH | RXFLSH);   /* clear SPIB control register, and flush TX and RX buffers */

*pSPIBAUDB = 8;                           /* setup the baud rate to 12.5MHz at CCLK = 400MHz */

*pSPIFLGB = (DS0EN | SPIFLG0 );   /* set SPIB flag 0 */

*pSPICTLB = (AUTOSDS | SPIEN | SPIMS | WL16 | MSBF | TIMOD2 | CPHASE); /* set AUTOSDS */

*pIISPIB = (int) &g_Data_ADC;           /* SPIB DMA destination */
*pIMSPIB = 1;                                 /* SPIB DMA increment */
*pCSPIB = 4;                                      /* SPIB DMA counter */
  //*pSPIDMACB = (SPIDEN | SPIRCV | INTEN | INTETC);

  //*pSPIDMACB = (SPIDEN | SPIRCV | INTEN);

*pSPIDMACB = (SPIDEN | SPIRCV);

 

According to the ADSP-214xx hardware manual, I should get 5 additional words transfered (junk data read in), because the SPI DMA FIFO is 4-word deep. But I can only see 3 extra transfers on scope by monitoring the SPIB_CLK and SPIB_FLAG0 signal. If I set DMA counter to 8, I see 11 words transfered; if I set the counter to 4, I see 7 words transfered. Did I miss something here?

 

Regards,

RRC

Outcomes