LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PWM pulse generation in FPGA with nano seconds

Solved!
Go to solution

Hi guys,

 

 

I am working with myRIO FPGA.

 

I have seen some examples to generate PWM pulses in FPGA target with the help of timed structures. The timed structures can hold the frame in flat sequence structure with the least time control of 1 micro second (1MHz).

But I want to generate PWM  pulses from the digital pins  in hundreds of nano seconds.

I have seen the data sheet of myRIO - 1900. It can generate a frequency till 40MHz.

 

I need pulses in the range of 10MHz.

 

Can anyone help me how to generate PWM pulses in the range of 10MHz?

0 Kudos
Message 1 of 7
(3,943 Views)
Solution
Accepted by topic author triptathakur

Hi trip,

 

the FPGA can use "ticks" aka clock pulses for time delays.

 

As your pulses are in the order of 4 ticks you could use simple wait statements!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 7
(3,938 Views)

I have tried using ticks. Even they are giving 1 micro second nly

0 Kudos
Message 3 of 7
(3,932 Views)
Solution
Accepted by topic author triptathakur

Hi trip,

 

on a FPGA VI you can use wait functions with a tick resolution. Point.

 

Attach what you have tried. Show a VI where you can't use tick resolution for wait functions!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 7
(3,922 Views)
Solution
Accepted by topic author triptathakur

@triptathakur wrote:

I have tried using ticks. Even they are giving 1 micro second nly


No, the ticks are at the 40MHz.  So you must be having at least 4 ticks happening inside of your structure.  Attach your code and we will see what we can figure out for you.


GCentral
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
Message 5 of 7
(3,919 Views)

Another way to do it is using a single cycle timed loop with pulse generating code inside. I needed to generate very short pulses of <100ns with better resolution than given by the standard 25ns ticks of the 40MHz clock.

 

By giving the SCTL a higher rate derived clock you can get smaller clock ticks. It can be tricky to write code that will compile at higher clock rate, but that's part of the fun!

Message 6 of 7
(3,857 Views)

Sir,

 

Its a different way. I may like this wa

 

Let me try to build the code as you recommend me.

Thanks for suggesting

0 Kudos
Message 7 of 7
(3,834 Views)