09-04-2008 06:07 AM
Helo,
I am working with NI PXI-1042 rack with NI PXI-7813R FPGA I/O card.
I can run successfully RunFPGA BM+3_SCTL_3(FPGA).vi to generate dedicated PWM pulses, if only one FIFO is used in While Loop.
But I need 20 cycles to calculate new pulse generation.
Trying to make the calculation more simple and using the Emulation, Radar_3_EMU(FPGA).vi runs correct in the Emulation mode.
Compiled and loaded to the FPGA as Radar_3(FPGA).vi the output puses are wrong and it looks like that only one PWM cycle comes to the output.
Am I correct with following assumptions?
1) The FIFO Write function does not wait ewen if the Timeout is set to -1?
2) The Emulator does ticks for all loops after each other by making only one step i each loop. In the reality all steps are done in each Sinle-Cycle Time Loop but only few in the While Loops?
Are there any rules to calculate how many cycles are needed in a While Loop inside of the FPGA?
However my biggest problem is while the Radar_3(FPGA).vi does not function properly.
Peter Horn
09-08-2008 03:23 AM
Hi Peter,
You have to consider the following points:
1.) One cycle of a loop takes as many ticks as the sum of all ticks of the longest path in that loop is
2.) You can use derived clocks to achieve a timing greater thatn 40 MHz
3.) Putting a function in a loop which takes more than one tick destroys your timing scheme if it is supposed to be
one tick per cycle.
concerning your questions:
1.) The FIFO Write waits until the data is available and then writes it if timeout is -1
For instance timeout = 0 wouldn´t wait and most likely throw an underflow error because of lacking data
2.) I´m sorry, please explain again because I´m not able to understand that point clearly.
3.) There are too many possibilities to generalize the question, but you can always just benchmark or measure the timings.
I found a excel file listing the tick counts of some groups of functions (attached)
I`ve also attached a demo for PWM generation which you could use as a starting point or to copy some approaches.
09-08-2008 12:57 PM