AnsweredAssumed Answered

bug extra word when sending via sport

Question asked by nh.anh on May 17, 2012
Latest reply on May 21, 2012 by Prashant

NewFile0.jpg

Hi everyone,

 

I'm newbie with blackfin bf51x. I'm trying to configurate sport as I2S and sending out  4bytes  {0x61, 0x61,0x61, 0x61}

I dont know why:

- There is always a extra word  sending out  (1)

- To stop transfer  I need to delay  before  disable  transmit  *pSPORT0_TCR1 &= ~(TSPEN);. That generates unexpected clock  (2).

 

What I expect  is ( I2S using  ARM Cortex M3 -  ST) :

aegFile1.jpg

 

Kindly see my configuration below. Am I wrong ? Thanks alots

 

void Init_Sport(void)

{

          /* sport0 transmit configuration */

 

          *pPORTG_MUX &= 0xfc03;          /* need to clear bits 9:8, 7:6, 5:4, 3:2 */

          ssync();

          *pPORTG_FER |= (PG3 | PG4 | PG5 | PG6 | PG7 | PG8);

          ssync();

 

          *pSPORT0_TCR1 = 0x0000;    

     *pSPORT0_TCR2 = 0x0000;    

 

          *pSPORT0_TCLKDIV = 1249; /*  clk = sck / 2(div +1) = 80Mhz/ 2( 1249 +1) = 32khz */

          *pSPORT0_TFSDIV = 15;      

 

     *pSPORT0_TCR2 = SLEN_16;

          *pSPORT0_TCR1 = ITCLK | ITFS | TFSR ;

               ssync();

 

          //*pSPORT0_TCR1 |= TSPEN;

          //ssync();

  }

 

EX_INTERRUPT_HANDLER(Sport0_TX_ISR)

{

    int i = 0;

    while ((*pSPORT0_STAT & TXF)==1);

    ssync();

 

    *pSPORT0_TX16 =I2S_Tx_Buffer[TxIdx++];

    ssync();

    while ((*pSPORT0_STAT & TXHRE)==0);

 

    if(TxIdx == TxCnt)

    {

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

         asm("nop;");

       *pSPORT0_TCR1 &= ~(TSPEN);

    }

}

 

 

Best regards,

Nguyen Hoang Anh

 


Outcomes