AnsweredAssumed Answered

BF 548 sport0 + sport3

Question asked by donviczenzo on Sep 3, 2011
Latest reply on Oct 4, 2011 by PrasanthR

Hi!

This is my first post.

At first sorry for my English.

 

Second - ive got a problem.

 

I've got only one week to do a simple (i hope so) project, but i need your help. I've got ADSP BF-548 EZ-KIT board, and i need to transfer data from Audio Codec outside the board through SPORT 3.

AD1980 ->(sport0) -> SPORT 3 TX -> (OUTSIDE(other device)) -> SPORT 3 RX -> AD1980(sport0).

 

I've tried to modify AudioLoopback Project, but its not working.

 

At first I've added some buffers (almost same as in audioloopback project) for the SPORT 3 transmission and receive.

 

section ("InboundAudio22") u16 TransmissionData0 [BUFFER_SIZE_PER_CHANNEL * NUM_ADC_CHANNELS]; //dane do sportu3
section ("InboundAudio22") u16 TransmissionData1 [BUFFER_SIZE_PER_CHANNEL * NUM_ADC_CHANNELS]; //dane do sportu3
section ("OutboundAudio22") u16 ReceiveData0 [BUFFER_SIZE_PER_CHANNEL * NUM_ADC_CHANNELS]; //dane do sportu3
section ("OutboundAudio22") u16 ReceiveData1 [BUFFER_SIZE_PER_CHANNEL * NUM_ADC_CHANNELS]; //dane do sportu3

 

 

        TransmissionBuffer0.Data              = TransmissionData0;
        TransmissionBuffer0.ElementCount      = sizeof(TransmissionData0);
        TransmissionBuffer0.ElementWidth      = 1;
        TransmissionBuffer0.CallbackParameter = NULL; 
        TransmissionBuffer0.ProcessedFlag     = FALSE;
        TransmissionBuffer0.pNext             = &TransmissionBuffer1;

 

        TransmissionBuffer1.Data              = TransmissionData1;
        TransmissionBuffer1.ElementCount      = sizeof(TransmissionData1);
        TransmissionBuffer1.ElementWidth      = 1;
        TransmissionBuffer1.CallbackParameter = NULL; 
        TransmissionBuffer1.ProcessedFlag     = FALSE;
        TransmissionBuffer1.pNext             = NULL;

 

 

 

        /* Outbound 1D buffers */
        ReceiveBuffer0.Data             = ReceiveData0;
        ReceiveBuffer0.ElementCount     = sizeof(ReceiveData0);
        ReceiveBuffer0.ElementWidth     = 1;
        ReceiveBuffer0.CallbackParameter= NULL;            
        ReceiveBuffer0.ProcessedFlag    = FALSE;
        ReceiveBuffer0.pNext            = &ReceiveBuffer1;

 

        ReceiveBuffer1.Data             = ReceiveData1;
        ReceiveBuffer1.ElementCount     = sizeof(ReceiveData1);
        ReceiveBuffer1.ElementWidth     = 1;
        ReceiveBuffer1.CallbackParameter= NULL;           
        ReceiveBuffer1.ProcessedFlag    = FALSE;
        ReceiveBuffer1.pNext            = NULL;

 

 

the a Sport3 Driver Handler

static ADI_DEV_DEVICE_HANDLE     SPORTDriverHandle; // handler do sportu 3

 

I've configured SPORT3 driver same as SPORT0

ADI_DEV_CMD_VALUE_PAIR SPORTConfigurationTable [] = {   
      /* clear any previous Tx errors */
        { ADI_SPORT_CMD_CLEAR_TX_ERRORS,    (void *)NULL                    },
        /* clear any previous Rx errors */
        { ADI_SPORT_CMD_CLEAR_RX_ERRORS,    (void *)NULL                    },
        /* SPORT in Circular mode       */
        { ADI_DEV_CMD_SET_DATAFLOW_METHOD,  (void *)ADI_DEV_MODE_CHAINED   },
        /* Enable Streaming mode        */
        { ADI_DEV_CMD_SET_STREAMING,        (void *)false                    },
        /* External Frame sync, MSB first, No TFS required  */
        { ADI_SPORT_CMD_SET_TCR1,           (void *)0                       },
        /* Secondary disabled   */
        { ADI_SPORT_CMD_SET_TCR2,           (void *)0                       },
        /* Tx Wordlength = 16 bits  */
        { ADI_SPORT_CMD_SET_TX_WORD_LENGTH, (void *)15                      },
        /* Internal RFS, Require RFS for every data */
        { ADI_SPORT_CMD_SET_RCR1,           (void *)0x0600                  },
        /* Secondary disabled   */
        { ADI_SPORT_CMD_SET_RCR2,           (void *)0                       },
        /* Rx Wordlength = 16 bits  */
        { ADI_SPORT_CMD_SET_RX_WORD_LENGTH, (void *)15                      },
        /* sets RFS to 48kHz (BIT_CLK for AC'97 = 12.288MHz) */
        { ADI_SPORT_CMD_SET_RFSDIV,         (void *)0xFF                    },
        /* MFD = 1, Enable Multi Channel, Enable Tx/Rx DMA packing */
        { ADI_SPORT_CMD_SET_MCMC2,          (void *)0x101C                  },
        /* 16 Channels */
        { ADI_SPORT_CMD_SET_MTCS0,          (void *)0xFFFF                  },
        /* 16 Channels */
        { ADI_SPORT_CMD_SET_MRCS0,          (void *)0xFFFF                  },
        /* Window Size = ((16 Channels/8) - 1) = 1 */
        { ADI_SPORT_CMD_SET_MCMC1,          (void *)0x1000                  },
        /* Enable error reporting */
        { ADI_DEV_CMD_SET_ERROR_REPORTING,  (void *)true                    },
        /* End of Configuration table */
        { ADI_DEV_CMD_END,                  (void *)NULL                              },
    };

 

 

In audio static void AD1980Callback() ive added something like this:

 

*(TransmissionData0+1+(NUM_DAC_CHANNELS*i))    = *(InboundData0+1+(NUM_ADC_CHANNELS*i));

*(TransmissionData1+1+(NUM_DAC_CHANNELS*i))    = *(InboundData1+1+(NUM_ADC_CHANNELS*i));
               
*(OutboundData0+1+(NUM_DAC_CHANNELS*i))    = *(ReceiveData0+1+(NUM_ADC_CHANNELS*i));
*(OutboundData1+1+(NUM_DAC_CHANNELS*i))    = *(ReceiveData1+1+(NUM_ADC_CHANNELS*i));

 

And of course I've opened the driver

 


adi_dev_Open(adi_dev_ManagerHandle,
                 &ADISPORTEntryPoint,
                 3,
                 NULL,
                 &SPORTDriverHandle,
                 ADI_DEV_DIRECTION_BIDIRECTIONAL,
                 adi_dma_ManagerHandle,
                 Callback_Handle,
                 CallbackRoutine);      

configure the SPORT driver with the values from the configuration table

adi_dev_Control(SPORTDriverHandle, ADI_DEV_CMD_TABLE, SPORTConfigurationTable); 

 

At the end ive enabled the data flow for SPORT3.

adi_dev_Read(SPORTDriverHandle, ADI_DEV_1D, (ADI_DEV_BUFFER *)&TransmissionBuffer0);
adi_dev_Write(SPORTDriverHandle, ADI_DEV_1D, (ADI_DEV_BUFFER *)&ReceiveBuffer0);
   
// enable dataflow

adi_dev_Control(SPORTDriverHandle, ADI_DEV_CMD_SET_DATAFLOW, (void *)TRUE);

 

 

Ive added full project at bottom.

 

SPORT 3 is beeing configured but there is no dataflow.

 

Can someone help me out, and tell how to make it work?

Attachments

Outcomes