Sign in

username:

password:



Not a member?

Search adsp



Search tips

Subscribe to adsp



adsp by Keywords

AD1819 | AD7332 | ADSP-2106 | ADSP-21060 | ADSP-21065L | ADSP-2116 | ADSP-21160M | ADSP-2181 | ADSP-218x | ADSP-219 | ADSP-2199 | ADSP219 | BF531 | BF532 | BF533 | BF535 | Blackfin | FFT | JTAG | LDF | SDRAM | SHARC | SPORT | UART | VDSP++ | VisualDSP


Discussion Groups

Discussion Groups | Analog Devices DSPs | on ADSP BF537 EZ kit lite Audio Codec

Technical discussions related to Analog Devices DSPs (including Blackfin, TigerSHARC, SHARC and ADSP-21xx DSPs).

  

Post a new Thread

on ADSP BF537 EZ kit lite Audio Codec - isni...@gmail.com - Aug 12 8:29:58 2008



Hello,
I am working with Analog Devices Blackfin BF537 EZ Kit Lite board. I am
storing the 16 bit audio samples of a PCM .wav file  in the memory.
My implementation is as follows
.
1) I store the Audio samples in the SDRAM memory by performing memory allocation.

2) Perform Adio reset in the beginning
     void Audio_Reset(void)
   {
       int i;
      // give some time for reset to take affect
       for(i = 0; i< delay;i++){};
         // set port f set register
      *pPORTFIO_SET = PF12;
   }

3)Initialize SPORT interface.
void Init_Sport0(void)
{
*pSPORT0_TCLKDIV=0xA9;
*pSPORT0_TFSDIV = 0x000F;
 *pSPORT0_TCR1 = TFSR | TCKFE | ITFS |ITCLK ;
*pSPORT0_TCR2 = SLEN_24 | TSFSE;
}
4)Initialize DMA

void Init_DMA(void)
{
    // Configure DMA4
    // 32-bit transfers, Autobuffer mode
    *pDMA4_CONFIG = WDSIZE_16| FLOW_1|DI_EN;
   
    *pDMA4_START_ADDR = iTxBuffer1;
    // DMA loop address increment
    *pDMA4_X_MODIFY = 2;
   
    *pDMA4_X_COUNT = 2;

}
5) Enable DMA and SPORT
Void Ena_DMA_SPORT( ){

      *pDMA4_CONFIG    = (*pDMA4_CONFIG | DMAEN);
     *pSPORT0_TCR1     = (*pSPORT0_TCR1 | TSPEN);
}

6) On receiving the interrupt  I  update DMA with next samples as shown
EX_INTERRUPT_HANDLER(Sport0_TX_ISR)
{
    // confirm interrupt handling
    *pDMA4_IRQ_STATUS = 0x0001;
    while(count<dataLen){
            
    iTxBuffer1[0] = *(sample + count);
    iTxBuffer1[1] = 0;
    count++;
      }
    if(count==(dataLen){
        dma_done=1;
    }
}

The problem I am facing Is as follows
* The Audio data which was supposed to play for 13 seconds is finishing in 1 second.
* I had adjusted TFSDIV and TSCLKDIV based on the sampling frequency of the wavefile
* Other doubt I have is can I generate TSCLK0 and TFS internally.
* I an example you have given "Audio Talkthrough  C" I dont see any sampling
frequency adjustments.??
* How can I play audio with above mentioned method??

Regards,
Nithin K S

------------------------------------



(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )

Re: on ADSP BF537 EZ kit lite Audio Codec - sreeram nagaraj - Aug 13 8:20:06 2008

Hai Nithin ,
=20
 what is the core clock and system clock ?
=20
=20
with regards,=20
=20
S.Nagaraju
09962553485=C2=20
--- On Mon, 11/8/08, i...@gmail.com <i...@gmail.com> wrote:

From: i...@gmail.com <i...@gmail.com>
Subject: [adsp] on ADSP BF537 EZ kit lite Audio Codec
To: a...@yahoogroups.com
Date: Monday, 11 August, 2008, 9:50 AM

Hello,
I am working with Analog Devices Blackfin BF537 EZ Kit Lite board. I am
storing the 16 bit audio samples of a PCM .wav file in the memory.
My implementation is as follows
.
1) I store the Audio samples in the SDRAM memory by performing memory alloc=
ation.

2) Perform Adio reset in the beginning
void Audio_Reset( void)
{
int i;
// give some time for reset to take affect
for(i =3D 0; i< delay;i++){} ;
// set port f set register
*pPORTFIO_SET =3D PF12;
}

3)Initialize SPORT interface.
void Init_Sport0( void)
{
*pSPORT0_TCLKDIV=3D 0xA9;
*pSPORT0_TFSDIV =3D 0x000F;
*pSPORT0_TCR1 =3D TFSR | TCKFE | ITFS |ITCLK ;
*pSPORT0_TCR2 =3D SLEN_24 | TSFSE;
}
4)Initialize DMA

void Init_DMA(void)
{
// Configure DMA4
// 32-bit transfers, Autobuffer mode
*pDMA4_CONFIG =3D WDSIZE_16| FLOW_1|DI_EN;

*pDMA4_START_ ADDR =3D iTxBuffer1;
// DMA loop address increment
*pDMA4_X_MODIFY =3D 2;

*pDMA4_X_COUNT =3D 2;

}
5) Enable DMA and SPORT
Void Ena_DMA_SPORT( ){

*pDMA4_CONFIG =3D (*pDMA4_CONFIG | DMAEN);
*pSPORT0_TCR1 =3D (*pSPORT0_TCR1 | TSPEN);
}

6) On receiving the interrupt I update DMA with next samples as shown
EX_INTERRUPT_ HANDLER(Sport0_ TX_ISR)
{
// confirm interrupt handling
*pDMA4_IRQ_STATUS =3D 0x0001;
while(count< dataLen){

iTxBuffer1[0] =3D *(sample + count);
iTxBuffer1[1] =3D 0;
count++;
}
if(count=3D=3D(dataLen) {
dma_done=3D1;
}
}

The problem I am facing Is as follows
* The Audio data which was supposed to play for 13 seconds is finishing in =
1 second.
* I had adjusted TFSDIV and TSCLKDIV based on the sampling frequency of the=
 wavefile
* Other doubt I have is can I generate TSCLK0 and TFS internally.
* I an example you have given "Audio Talkthrough C" I dont see any sampling=
 frequency adjustments. ??
* How can I play audio with above mentioned method??

Regards,
Nithin K S
=20

------------------------------------



(You need to be a member of adsp -- send a blank email to adsp-subscribe@yahoogroups.com )