[SOLVED] ADSP-2139 SPORT problem

Status
Not open for further replies.

immortal13

Newbie level 6
Joined
Mar 31, 2013
Messages
11
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Visit site
Activity points
1,348
ADSP-21369 SPORT problem

Hello!

I have got a problem with serial port of ADSP-21369. I'm trying to send data with DMA via SPORT interface and except of my data there some extra bit, which I don't need.

This is my configuration of SPORT:

Code:
static void InitSPORT (void)
{
    unsigned  CLKDIV = CCLK / 8 * SPCLK - 1;
    *pDIV3    = CLKDIV << 1;

    SRU(SPORT3_DB_O,DAI_PB04_I);    // Connect SPORT to DAI pins
    SRU(SPORT3_CLK_O, DAI_PB06_I);  //
}

void WriteData (unsigned char *source, unsigned bufSize)
{
  *pSPCTL3  = 0;
  
  *pIISP3B   = (unsigned char) source;
  *pIMSP3B   = 1;
  *pCSP3B    = bufSize;

  *pSPCTL3  = SDEN_B | SPTRAN | SPEN_B | SLEN8 | ICLK;
}

At the beginning of transmitting data I have 3 extra redundant bits and to send for example 3 bytes I need bufSize of 5.

So, what is wrong with it? Has anyone been dealt with this problem?

Any help would be appreciated!
Viacheslav.

- - - Updated - - -

The problem with first extra bits is solved! Frame sync helped me to deal with it.

Code:
*pSPCTL3  = SDEN_B | SPTRAN | SPEN_B | SLEN8 | FSR | IFS | LFS | LAFS | ICLK;
instead of
Code:
*pSPCTL3  = SDEN_B | SPTRAN | SPEN_B | SLEN8 | ICLK;

But I still can't understand, why do I need to make DMA bufSize larger by 2 bytes.
 
Last edited by a moderator:

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…