I am using STM32F4 Discovery board. I have generated a 10Hz sine wave using DAC Channel1.
As per STM's Application note, the sine wave generation should be done as follows:
And it can be used to produce desired frequency using following formula:
This is my simple function which populates 100 Samples. Since I used fTimerTRGO = 1kHz, fSinewave is correctly coming as 1k/100 = 10Hz
Appl_getSineVal();
HAL_DAC_Start_DMA(&hdac, DAC_CHANNEL_1, (uint32_t*)Appl_u16SineValue, 100, DAC_ALIGN_12B_R);
.
.
.
.
void Appl_getSineVal(void)
{
for (uint8_t i=0; i<100; i+=1){
Appl_u16SineValue[i] = ((sin(i*2*PI/100) + 1)*(4096/2));
}
}
Now I want to super impose another sine wave of frequency 5Hz in addition to this on the same channel to get a mixed frequency signal. I need help how to solve this.
I tried by populating Appl_u16SineValue[] array with different sine values, but those attempts doesnot worth mentioning here.