problem with buffer for DAC DUAL
Posted: Fri Nov 13, 2015 12:13 pm
Hi,
I'm trying DUAL DAC from TESTHAL but cannot get sine wave output.
I'm using STM32-F4 Discovery. Looks like this,
then after i see this note:
i change my code buffer 100 sample sine wave to this:
then start DAC:
But, i got no luck, my DUAL DAC still fail to load correct buffer,
Please help me.
Thanks,
Arif,
I'm trying DUAL DAC from TESTHAL but cannot get sine wave output.
I'm using STM32-F4 Discovery. Looks like this,
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,
Please help me.
Thanks,
Arif,