10-26-2015 06:42 PM
Hi all,
I have a question about FPGA sine waveform generation: the waveform generated has unknown non-periodic discontinuity. I want to know where it was generated and how to solve it.
As you can see from my FPGA code shown below, I generated reference signal- a sin wave and a cos wave using the "sine wave generation" function. Then I write the data to their corresponding FIFO and the sampling rate is controlled by "Period In(usec)" and it's set at 20us. So the sampling rate is 50KS/s.
Fig. 1. FPGA sin wave generation code
At RT level I observe the data through code shown in Fig. 2, and what I observe is Fig. 3. Three charts from top to bottem are: sine wave result, cosine wave result, sin/cos wave shown using the same chart.
Fig.2 RT Level Code
Fig.3 Sin/Cos Wave Result
Anybody has the same problem ever or any input on what caused this?
Thanks!
Regards,
Doris
Solved! Go to Solution.
10-27-2015 05:25 PM
Hi Doris,
Is this the extent of your code that's running on the target? If possible would you mind attaching your FPGA and RT VI? It might help if I can try and reproduce the issue.
Also what type of target are you running this on?
10-29-2015 10:36 AM
Hi,
Thanks for responding! I believe I have solved this problem. What happened is the execution duration for the rest of my RT level code is longer than the duration for FIFO to be filled, so the FPGA code that writes data to the FIFO waits for the RT code to be finished. FIFO data is not time-continuous because of this reason.
Regards,
Doris