AnsweredAssumed Answered

BF518F SPORT DMA problem

Question asked by AlexeyADI on Jun 17, 2011
Latest reply on Jun 17, 2011 by Prashant

SPORT CONTROLLER

 

We are using DMA, transmit/receive word is 16bit

The following code doesn’t work properly (last command ):

 

//programm SPORT0 registers

    p0.l = lo(SPORT0_TCR1);
     p0.h = hi(SPORT0_TCR1); /* Set P0 to SPORT0 Base Address */

//programm receive
      r0.l = SLEN(15);
      w[p0 + (SPORT0_RCR2 - SPORT0_TCR1)] = r0; //programm world length = 16
     
//     r0.l = RFSR | RSPEN; // &&&&&&&&&&&&&&&&&&&&&&&&&lust step in code initialization

//  programm transmit
   
     r0.l = SLEN(15);
     w[p0 + (SPORT0_TCR2 - SPORT0_TCR1)] = r0; //programm world length = 16
    
     p1.l = init_codec;
     p1.h = init_codec;
    
     p2 = (N- 1)(x);//load number of elements in massive init_codec - 1
     r1.l = w[p1];
     p1 +=2;
  
     [p0 +(SPORT0_TX - SPORT0_TCR1)] = r1;//write SPORT0_TX register

 

But if the command will be changes to following:

 

w[p0 +(SPORT0_TX - SPORT0_TCR1)] = r1;//write SPORT0_TX register

 

it will works normally, the question here is register 32bit SPORT0_TX, which must have 32bit acessibility but it doesn't.

Therefore we had to adjust header file and create new pointer

*SPORT0_PTR = (unsigned short*)0xFFC00810;

instead of original pointer in    *.h file  *pSPORT0_TX

 

Should it be like this?

Outcomes