LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FPGA adding delays between siganls

Hi,

 

Could some one give me a good example of adding delays in a FPGA using a state machine SCTL. I want to add some ns delays between a CS and CLK. Tried using a tick counter to trigger the next state but did not work.

 

Thanks

 

Smiley Very Happy

0 Kudos
Message 1 of 5
(3,751 Views)

You can not put any delays in a SCTL. That would defeat the SCTL.

 

You will have to have some kind of a state machine with a state for the CS and another state for the CLK and a state to count the number of clock cycles needed between the two.

 

How where you counting the clocks ticks?

Omar
0 Kudos
Message 2 of 5
(3,744 Views)

Use a flat sequence to in a normal while loop.  I have attached a screen shot of a DSM reader.

 

DSM.JPG

Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
0 Kudos
Message 3 of 5
(3,736 Views)

So I am trying to add delays between the CS and SCLK of a SPI driver. See here http://zone.ni.com/devzone/cda/tut/p/id/9117

 

Problem is the driver is in a 40Mhz timing loop. I have added extra states between when the CS goes active and inactive in relation to the SCLK but having problems finding a way to waste some time in that state. Smiley Very Happy Adding one extra state before should take 1 clock cycle right? But it seems to have little effect.

0 Kudos
Message 4 of 5
(3,720 Views)

Was thinking of something like this....Not sure it would work, have to try on the HW tommorrow. Basically add the state inbetween the signal changes. Count the ticks and select the next state based on that!?

 

delay ticks.png

0 Kudos
Message 5 of 5
(3,710 Views)