This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Spectrum analyse with sound generation TMS320C5505 eZdsp USB STick

Hello out there,


I try to do a real time audiospectrum analyse with the TMS320 C5505 USB-STick.

i want to use the TMS320 for sound generation and for the CFFT and send the result of the Cfft to another imx6 board.

I try do generate different sounds like a  Frequenzysweep from 20Hz to 20kHz.

So far the fft code is working, But i have some timing issues if i generate some sinus or other sounds.

Please, is someone out there to help me. 

first time for me to work on a DSP.

Thank you

Korbi

  • I try to use the Beep generator.
    but its not working.
    anybody out there ?

    here is my aic init and beep generator init:


    /* Configure AIC3204 */

    AIC3204_rset( 0, 0 ); // Select page 0
    AIC3204_rset( 1, 1 ); // Reset codec
    AIC3204_rset( 0, 1 ); // Point to page 1
    AIC3204_rset( 1, 8 ); // Disable crude AVDD generation from DVDD
    AIC3204_rset( 2, 1 ); // Enable Analog Blocks, use LDO power
    AIC3204_rset( 0, 0 );

    /* PLL and Clocks config and Power Up */
    AIC3204_rset( 27, 0x1d ); // BCLK and WCLK is set as o/p to AIC3204(Master)
    AIC3204_rset( 28, 0x00 ); // Data ofset = 0
    AIC3204_rset( 4, 3 ); // PLL setting: PLLCLK <- MCLK, CODEC_CLKIN <-PLL CLK
    AIC3204_rset( 6, 7 ); // PLL setting: J=7
    AIC3204_rset( 7, 0x06 ); // PLL setting: HI_BYTE(D)
    AIC3204_rset( 8, 0x90 ); // PLL setting: LO_BYTE(D)
    AIC3204_rset( 30, 0x88 ); // For 32 bit clocks per frame in Master mode ONLY
    // BCLK=DAC_CLK/N =(12288000/8) = 1.536MHz = 32*fs
    AIC3204_rset( 5, PLLPR ); //PLL setting: Power up PLL, P=1 and R=1
    AIC3204_rset( 13, 0 ); // Hi_Byte(DOSR) for DOSR = 128 decimal or 0x0080 DAC oversamppling
    AIC3204_rset( 14, 0x80 ); // Lo_Byte(DOSR) for DOSR = 128 decimal or 0x0080
    AIC3204_rset( 20, 0x80 ); // AOSR for AOSR = 128 decimal or 0x0080 for decimation filters 1 to 6
    AIC3204_rset( 11, 0x87 ); // Power up NDAC and set NDAC value to 7
    AIC3204_rset( 12, 0x82 ); // Power up MDAC and set MDAC value to 2
    AIC3204_rset( 18, 0x87 ); // Power up NADC and set NADC value to 7
    AIC3204_rset( 19, 0x82 ); // Power up MADC and set MADC value to 2

    /* DAC ROUTING and Power Up */
    AIC3204_rset( 0, 1 ); // Select page 1
    AIC3204_rset( 0x0c, 8 ); // LDAC AFIR routed to HPL
    AIC3204_rset( 0x0d, 8 ); // RDAC AFIR routed to HPR
    AIC3204_rset( 14, 0x08 ); // RDAC AFIR routed to LOL
    AIC3204_rset( 15, 0x08 ); // RDAC AFIR routed to LOR
    AIC3204_rset( 0, 0 ); // Select page 0
    AIC3204_rset( 64, 2 ); // Left vol=right vol
    AIC3204_rset( 65, 0 ); // Left DAC gain to 0dB VOL; Right tracks Left
    AIC3204_rset( 63, 0xd4 ); // Power up left,right data paths and set channel
    AIC3204_rset( 0, 1 ); // Select page 1
    AIC3204_rset( 0x10, 15 ); // Unmute HPL , -6dB gain = 0x3A
    AIC3204_rset( 0x11, 15 ); // Unmute HPR , -6dB gain = 0x3A
    AIC3204_rset( 18, 10 ); // Unmute LOL set gain
    AIC3204_rset( 19, 10 ); // Unmute LOR set gain
    //AIC3204_rset( 9, 0x30 ); // Power up HPL,HPR
    AIC3204_rset( 10, 0x33 ); // HP powered from LDOIN, CM voltage = 1.65V
    AIC3204_rset( 9, 0x3C ); // Power up HPL,HPR, LOL, LOR
    AIC3204_rset( 60, 0x19 ); // Power up PRB_P25 for beep generator

    AIC3204_rset( 0, 0 ); // Select page 0
    USBSTK5505_wait( 100 ); // wait

    /* ADC ROUTING and Power Up */
    AIC3204_rset( 0, 1 ); // Select page 1
    AIC3204_rset( 0x34, 0x10 );// STEREO 1 Jack
    // IN2_L to LADC_P through 0 kohm
    AIC3204_rset( 0x37, 0x10 );// IN2_R to RADC_P through 0 kohmm
    AIC3204_rset( 0x36, 1 ); // CM_1 (common mode) to LADC_M through 0 kohm
    AIC3204_rset( 0x39, 0x40 );// CM_1 (common mode) to RADC_M through 0 kohm
    AIC3204_rset( 0x3b, gain ); // MIC_PGA_L unmute
    AIC3204_rset( 0x3c, gain ); // MIC_PGA_R unmute
    AIC3204_rset( 0, 0 ); // Select page 0
    AIC3204_rset( 0x51, 0xc0 );// Powerup Left and Right ADC
    AIC3204_rset( 0x52, 0 ); // Unmute Left and Right ADC





    AIC3204_rset( 0, 0 );
    USBSTK5505_wait( 100 ); // Wait




    // ------------------------------------------------------- BEEEEEEP ---------------------------------------------//


    // INIT BEEP
    AIC3204_rset( 0, 0 ); // Select page 0
    AIC3204_rset( 73, 0x01); // Register 73,74,75 = Beep Length -> 0x017700
    AIC3204_rset( 74, 0x77); //
    AIC3204_rset( 75, 0x00); //
    AIC3204_rset( 76, 0x23); // Sinus
    AIC3204_rset( 77, 0xFB); // Sinus
    AIC3204_rset( 78, 0x7A); // Cosinus
    AIC3204_rset( 79, 0xD7); // Cosinux
    AIC3204_rset( 72, 0x80); // Left an right same Level
    AIC3204_rset( 71, 0x80); // Beep Generator Enabled Bit sieben 1000 0000 = 0x80
    AIC3204_rset( 71, 0x10); // 0 db Left
  • Korbi,

    Did you get the 1kHz tone AIC3204 example working first (usbstk5505_BSL_RevD\usbstk5505_v2\tests\aic3204)?

    Also for reference, hope you have seen the FFT app note for C5505 http://www.ti.com/lit/an/sprabb6b/sprabb6b.pdf 

    Lali

  • Hello Lali,

    the AIC3204 is working.

    I try to generate a sine with the beep generator. Because the generator is included in the aic3204! I don't won't to use the DSP to generate the sine sound. 

    The point is when i calculate the sine with the dsp an do a FFT, the sine sounds strange. 

    So i try to use the beep generator. 

    Or do you have another idea !? 

    kind regards

    Korbi 

  • And even in the demo " FFT app note for C5505 www.ti.com/.../sprabb6b.pdf " the output sounds strange when the filter is on ! There is no clear sine hearable ?!? please help ?!
    Where is my mistake ?

    Thank you