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.

DAC stuck AIC3106

Hi I'm using board OMAP L137 EVM 
can someone tell me why my DAC always stuck when I try to do filter calculation in floating point ?
it didn't  stuck when I calculate it in fixed point 

I put the ADC data into bandpass filter and send the calculation result  to DAC .
If I use floating point like float or double for my variable, the DAC stuck, but when I use  fixed point (in this case int), the DAC didn't stuck and my bandpass filter worked good in frequency above 200 Hz

please I need the answer

  • Hi Vincent,

    I guess I am a little confused because the biquad filter coefficients only accept one format:

    See Attached.

    biquads.pdf
  • I have read that 
    here is my code 

    what I mean is if I make the filter coding like this:

    int a0 = 0, a1 = 0, a2 = 0;
    int b3 = 0, b4 = 0;

    while (1)
    {

    while ( ! ( MCASP1_SRCTL0 & 0x20 ) );
    a0 = MCASP1_RBUF0_32BIT;
    a0 = a0 >> 16;
    b0 = (((30 * a0) + (0 * a1) - (30 * a2) + (1924 * b3) - (941 * b4)) / 1000);
    a2 = a1;
    a1 = a0;
    b4 = b3;
    b3 = b0;

    b0 = b0<< 16;

    while ( ! ( MCASP1_SRCTL5 & 0x10 ) );
    MCASP1_XBUF5_32BIT = b0;

    }

    The filter will work and the DAC didn't stuck. it show the  correct result 

    but if I use float or double data type for a0 and b0 like this:

    float a0 = 0, a1 = 0, a2 = 0;
    float b3 = 0, b4 = 0;
    int in = 0, out = 0;

    while (1)
    {
    while ( ! ( MCASP1_SRCTL0 & 0x20 ) );
    in = MCASP1_RBUF0_32BIT;
    in = in >> 16;
    a0 = (float) in;
    b0 = (0.0295 * a0) + (0 * a1) - (0.0295 * a2) + (1.924 * b3) - (0.941 * b4);
    a2 = a1;
    a1 = a0;
    b4 = b3;
    b3 = b0;
    b0 = b0<< 16;

    out = (int) b0;

    while ( ! ( MCASP1_SRCTL5 & 0x10 ) );
    MCASP1_XBUF5_32BIT = out;

    }

     the DAC will stuck and it didn't give any signal.

    The filter I use is bandpass filter with center freq in 1000 Hz 

  • Hi Vincent,

    Not sure what is going on in your code (you would probably have to check with the DSP folks). As far as the AIC3106 is concerned, you can always look at the actual I2C writes with an I2C sniffer and see what is being sent to the registers when it works and when it doesn't.