LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Square Wave Generation FPGA

Hello ,

 

I am trying to generate a simple Square Wave signal to control frequency of LED blinking ( 0- 100 Hz)  via the FPGA of cRIO 9022.

When I am trying to control it on the host VI the maximum frequency attained was at between 40-50 Hz after that there is a decrease in rate of blinking even after increasing the frequency( 50Hz-100Hz the blinking rate was 50Hz -0 Hz).

 

I have tried using the normalize signal generation Fpga function .

tried changing the Data representation and the digits of precision and number of digits.

but of no use.

below attached are my host and fpga vis

 

What should i do to get a frequency more than 40 Hz ?I want to use this to automate the working of a Powertrain module.

Download All
0 Kudos
Message 1 of 5
(4,998 Views)

Hi,

 

right click on your cRIO in your project Properties>>Top Level Clock. 

Are you looking for that ?

 

Best regards Matijas

0 Kudos
Message 2 of 5
(4,940 Views)

Make sure the Execution Mode of your Square Wave Generator express VI is set to Inside of a Single Cycle Timed Loop.  Otherwise the code looks fine to me.



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 5
(4,928 Views)

Hello ,

 

Thank you for the response Crossrulz and Matijas :).

 

Matijas, it was configured to run on the top level clock itself

Crossrulz, Yes it was made to run inside a SCTL by right clicking it and configuring.

 

My prolem was the data communication and conversion into FXP
When the Freq was 1Hz the fxp value was 2.49 e^-8 and for 100 Hz ( FXP 2.49xe^-6) the behaviour is same, so I was wondering whether the VI was missing the significant bits ?

0 Kudos
Message 4 of 5
(4,888 Views)

Hello,

 

The problem was very simple, I was expecting a complex solution 😛 .It was the  period of the Deterministic loop in RT which was too long that frequency generator couldnt make it at higher frequencies, everything else was fine ( I was so dumb editing the ,Double, FXP , word length and integer length 😄 LOL )

 

Sorry for the late reply,

Just wanted to thank you guys for the support.

 

Cheers

 

0 Kudos
Message 5 of 5
(4,790 Views)