12-03-2007 03:04 PM
12-04-2007 11:12 AM
I don't know what rate you're running at, but it seems likely that you're losing a lot of data on the way back to the host. At 40 MHz, you would fill up the host buffer in less than a millisecond (I tried this on a PCI-7833R, and the FPGA buffers overflowed almost immediately). If you have any buffer overflows, there is no guarantee that your data is coherent since the index and results are on separate DMA channels.
I would recommend adding logic to monitor your buffer states and errors, both on the FPGA and host. Increasing the size of the buffers on both ends should help, and optimizing your host FIFO read loop might be necessary. Instead of reading a point at a time, try reading a whole frame as an array. Minimize unnecessary operations in the host loop, such as writing the array to the front panel indicator. Try a very slow clock rate until you have verified the FFT core, then work on the transfer issues.
You will probably also need to delay starting the FPGA VI until the host acquisition loop is ready to go. Uncheck the "Open and Run" option in the pop-up menu for Open FPGA VI Reference, and add a Run method as the last operation before entering the loop. This will reduce the chance of overflowing the FPGA buffer before the host gets going.
One way to ensure coherence between your index and data is to pack a 16-bit index with both the real and imaginary parts, sending real+index on one channel and imag+index on the other. This will ensure that the data belongs to the correct index, but then you will have to figure out what to do if they get out of sync.
12-05-2007 09:39 AM