LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calculating PWM Duty Cycle and Frequency

Hi,
 
I am using the 7831R to acquire PWM inputs by having them Multiplexed and using the board memory to conserve space. Now, the FPGA loop rate is at 5 microseconds. I am able to capture the signals perfectly, however I am facing issues in calculating the frequency since the FPGA runs on a different clock speed.

What is the ideal way to calculate the freq on the fly and be accurate?
0 Kudos
Message 1 of 3
(4,666 Views)
That's a great question.  The two common ways to calculate the frequency I have seen used with the 7831R can be found in LabVIEW under Help >> Find Examples.  (Look under the folder Toolkits and Modules >> FPGA >> Frequency Measurement). 
 
The first is called "Count and Period (FPGA).vi" and counts the number of rising edges since the last sample event and measures the total period from the first to last edge in the measurement window.  The count can then be divided by the period to determine the frequency.
 
The second is called "Fixed Count.vi"  and measures the total period of a programmable number of rising edges.  The programmed count is divided by the period to determine the frequency. 
 
Jeff M.
 
Applications Engineering
National Instruments
0 Kudos
Message 2 of 3
(4,631 Views)

Thanks, for your reply. I thought nobody had an answer cause this thread was untouched.

Anyway, I had managed to get it done by adopting the first approach.

Regards,

Ashm01

0 Kudos
Message 3 of 3
(4,622 Views)