AnsweredAssumed Answered

How to synchronize DAC, ADC together?

Question asked by C S on Oct 31, 2017
Latest reply on Nov 1, 2017 by C S

I am using stm32L476 discovery board. I am trying to generate triangular wave with DAC. I am using two lookup tables for the DAC(1 for each up slope and down slope). I am giving sine wave at ADC input and I am getting some samples in triangular wave up slope time and down slope time. I start ADC and DAC together for up slope as well as down slope. I am calculating FFT of ADC samples. FOr up slope data, I start calculating FFT at down slope DAC conversion start and for down slope ADC samples FFT, I start calculating FFT after down slope DAC conversion completion. I have put all the necessary to ensure proper start and end timings of the processes of DAC, ADC and FFT. The problem is when I am running DAC at high speed(about 500 KSPS), the waveform appears for some seconds and afterwards the output becomes flat. The output waveform becomes flat on the peak side of wave. When I decrease the DAC speed to around 400 KSPS, the problem does not occur. Also, when I use HAL delay after the down slope FFT completion, the issue is resolved and the wave appears properly for all the DAC speeds. But I don't want to waste any time there. Below is the code. Anyone knows what the issue is here?

The code is attached. Please find the attachment.