AnsweredAssumed Answered

DMA code for BF527

Question asked by dheeraj.mor on May 27, 2015
Latest reply on Jun 3, 2015 by jobo23

Hey,

I have been trying to do PPI using DMA with BF527. I done the steps given in the manual. But still I am not able to transfer my data properly on the DMA and thus PPI. Please help me in it.
My code is follows: -

 

 

void delay(int);

 

int main( void )

{

  int i=0, j=0;

  int temp =0;

  int nPushed =0;

  int wave_file[256], check[256];

 

 

    *pPORTF_FER = 0xFFFF;

    *pPORTH_FER = 0x0000;

    *pPORTF_MUX = 0x0000;

 

   

    // DMA Configuration

    *pDMA0_PERIPHERAL_MAP= 0x0000;               // PPI is mapped to channel DMA0

    *pDMA0_START_ADDR = 0xFF800000;                  // DMA Start Address bit Desitination Address

    *pDMA0_X_COUNT = 128;

    *pDMA0_X_MODIFY = 0x0002; // 16 bit transfer, we need to use 0x0002 , so that adress is incresed by 2 after every cycle.

    *pDMA0_CONFIG = 0x0086; // DMA Configuration for 16 bit data.

  

   

   

    // PPI Configuration

    *pPPI_DELAY  = 0x0010;

    *pPPI_CONTROL = 0x1802;                 //  PPI Control register configuration

  //*pPPI_FRAME = 0x0000;                     //  PPI frame value 0 as we are working in 0 frame sync mode.

 

 

 

    // DMA Enable

    *pDMA0_CONFIG = 0x0087; //  Enabling the DMA.

  

  *pEBIU_AMBCTL0  = 0x0000F0F0;

  *pEBIU_AMBCTL1  = 0x00000000;

 

wave_file[0]=49;

wave_file[1]=50;

wave_file[2]=46;

wave_file[3]=49;

wave_file[4]=48;

wave_file[5]=47;

wave_file[6]=48;

wave_file[7]=48;

wave_file[8]=52;

wave_file[9]=51;

wave_file[10]=47;

 

for (i=0; i<10; i++)

{

 

j=wave_file[i];

  * (unsigned long*) (0xFF800000)= j;

 

 

}

 

*pPPI_CONTROL = 0x1803;// PPI Control enable 

 

*pDMA0_CONFIG = 0x0086;//  Disabling the DMA.

}

 

 

void delay(int count)

{

  int time;

    for(time=0;time<count;time++);

}

 

 

Please guide me , where I am doing mistake.

Outcomes