AnsweredAssumed Answered

SPORT0, transmit problem

Question asked by ak.1234 on Oct 11, 2010
Latest reply on Oct 20, 2010 by gvasanth

Hi,

 

I'm new to the Blackfin.  I'm trying to get the SPORT0 to work on portG and I'm not having any luck getting it to communicate.

 

I want PG6 to be DT0PRIA, PG10 to be TSCLK0 and PG15 to be TFS0A

 

Here's my initialization code:

 

 

void Init_Sport0(void)
{
    // set up PORTG as SPORTs
    // PG6(DT0PRIA) = first function
    // PG10(TSCLK0) = first alternate function
    // PG15(TFS0A) = first function    *pPORTG_MUX &= 0x0CF3;
    ssync();
    *pPORTG_MUX |= 0x100;
    ssync();
    *pPORTGIO_DIR |= 0x8440;
    ssync();

 

    // configure as peripheral NOT GPIO
    *pPORTG_FER |= 0x8440;
    ssync();

 

    // Make sure port disabled
    *pSPORT0_TCR1 = 0;
    ssync();
    // Sport0 transmit configuration
    // Alternate Framing Mode, Internal clock, active low framing
    // internal frame sync, frame sync for each write
    *pSPORT0_TCR1 = LATFS | ITCLK | LTFS | ITFS | TFSR;
    ssync();

 

    // 16-bit data, Secondary side enable, Stereo frame sync enable
    *pSPORT0_TCR2 = SLEN_16;
    ssync();

 

    *pSPORT0_TFSDIV = 31;          // from sample code - will adjust when I figure this out better what I want
    ssync();
    *pSPORT0_TCLKDIV = 1;
    ssync();

 

    // Enable Tx
    *pSPORT0_TCR1 |= TSPEN;
    ssync();
}

 

The status register shows 0x0040 (transmit hold register empty) and so when I try to write out to the transmit data register, I don't see anything on my scope.

 

*pSPORT0_TX = 0x6F3;

 

I do have an awful looking triangle wave of about 25MHz with a magnitude of about 1.28V on the TSCLK0A line.  I would expect that line to toggle only when I'm trying to send data.

 

I'm probably missing something very obvious.  I'm using the EZ-Kit for the BF52x and used the sample code that came wth.  I didn't find anything in the search that answered this, but my apologies if there was and I missed it.

 

According to the DDS that I'm using (AD5932) it wants to have the following conditions on the SPORT channel:

Internal clock operation, active low framing, 16 bit word length, internal frame snc signal generate frame sync for each write and alternate framing mode.

 

Thanks

 

Anne

Outcomes