Page 1 of 1

problem with buffer for DAC DUAL

Posted: Fri Nov 13, 2015 12:13 pm
by vambwodonk
Hi,

I'm trying DUAL DAC from TESTHAL but cannot get sine wave output.
I'm using STM32-F4 Discovery. Looks like this,
example.png


then after i see this note:

Code: Select all

The buffer is organized as a matrix of M*N elements where M is the
 *          channels number configured into the conversion group and N is the
 *          buffer depth. The samples are sequentially written into the buffer
 *          with no gaps.


i change my code buffer 100 sample sine wave to this:

Code: Select all

#define DAC_BUFFER_SIZE 200

/*
 * DAC test buffer (sine wave).
 */
static const dacsample_t dac_buffer[2][100] = {
      {
            2048,2176,2304,2431,2557,2680,2801,2919,3034,3145,
            3251,3353,3449,3540,3625,3704,3776,3842,3900,3951,
            3995,4031,4059,4079,4091,4095,4091,4079,4059,4031,
            3995,3951,3900,3842,3776,3704,3625,3540,3449,3353,
            3251,3145,3034,2919,2801,2680,2557,2431,2304,2176,
            2048,1919,1791,1664,1538,1415,1294,1176,1061,950,
            844,742,646,555,470,391,319,253,195,144,
            100,64,36,16,4,0,4,16,36,64,
            100,144,195,253,319,391,470,555,646,742,
            844,950,1061,1176,1294,1415,1538,1664,1791,1919
      },
      {
            2048,2176,2304,2431,2557,2680,2801,2919,3034,3145,
            3251,3353,3449,3540,3625,3704,3776,3842,3900,3951,
            3995,4031,4059,4079,4091,4095,4091,4079,4059,4031,
            3995,3951,3900,3842,3776,3704,3625,3540,3449,3353,
            3251,3145,3034,2919,2801,2680,2557,2431,2304,2176,
            2048,1919,1791,1664,1538,1415,1294,1176,1061,950,
            844,742,646,555,470,391,319,253,195,144,
            100,64,36,16,4,0,4,16,36,64,
            100,144,195,253,319,391,470,555,646,742,
            844,950,1061,1176,1294,1415,1538,1664,1791,1919
      }
};


then start DAC:

Code: Select all

dacStartConversion(&DACD1, &dacgrpcfg1, *dac_buffer, DAC_BUFFER_SIZE);


But, i got no luck, my DUAL DAC still fail to load correct buffer,
after.png

Please help me.

Thanks,
Arif,

Re: problem with buffer for DAC DUAL

Posted: Fri Nov 13, 2015 12:33 pm
by Giovanni
Hi,

That looks like a driver problem, I will verify this, stay tuned but it will take some days, there are other things in queue.

Giovanni

Re: problem with buffer for DAC DUAL

Posted: Mon Nov 23, 2015 3:51 pm
by Giovanni
Hi,

Just a note.

I haven't forgot this, I am waiting for an oscilloscope at home in order to test the driver.

Giovanni

Re: problem with buffer for DAC DUAL

Posted: Wed Nov 25, 2015 8:38 am
by vambwodonk
May i can help you with my oscilloscope?,
if your Oscilloscope not ready yet.

Arif,

Re: problem with buffer for DAC DUAL

Posted: Wed Nov 25, 2015 9:24 am
by Giovanni
I need to do some debugging so I need one :) it is almost here anyway, during the weekend I will be on this.

Giovanni

Re: problem with buffer for DAC DUAL

Posted: Sat Dec 05, 2015 12:03 pm
by Giovanni
OK, oscilloscope received :)

I have been able to see the problem in the DAC_DUAL demo, I am trying to understand the problem.

Giovanni

Re: problem with buffer for DAC DUAL

Posted: Sat Dec 05, 2015 12:19 pm
by Giovanni
It was a wrong DMA setting, the driver sent twice the data specified so garbage was added at the end of the stream.

Fixed in repository as bug #677.

Giovanni

Re: problem with buffer for DAC DUAL

Posted: Fri Dec 11, 2015 8:00 am
by vambwodonk
Nice update !! :D