11-19-2014 12:51 AM
Hello Community,
i have now a myRIO with Labview 2013. I try to read a digital signal of a sensor on port DIO0 (C-Port). It works fine. The problem is that i don't know, how can i find the beginning (the SYNC Nibble) of the SENT- Frame and how does it works with the clock ticks/ clock time of the FPGA System (40Mhz). I don't understand the meaning of the clock time. clock ticks.
The next problem is to measure the time between falling edge to falling edge. Actually i can detect every falling edge of the SENT signal but i can't measure the real time between them. How can i measure the real time depending of the clock time of the FPGA system? The SYNC Nibble have every time 56 ticks. But how much time are the 56 ticks?
Best regards,
Basti
Solved! Go to Solution.
11-19-2014 10:32 PM
What device are you trying to communicate with? What is its communication protocol? That likely tells you how you can determine when it is sending data.
I'm going to assume your loop is running much quicker than your data is changing. If that's the case, you can use that information to determine how long it takes between rising edges.
11-20-2014 06:59 AM - edited 11-20-2014 07:03 AM
Hello blackhack999,
Can you please post your code to see how the detection is implemented at the moment, then i can lock into it.
Here one way, how it can be done to measure the time between rising and falling edge on a FPGA
I have not tested the code at the moment, but it should work.
Every tick takes 25ns with the default 40Mhz clock.
Hope it helps.
11-20-2014 07:44 AM
Hello Alexander,
thank you. It works fine.
Now my problems are solved. The main problem was to build a factor who is able to convert the 56 ticks of the SYNC- SENT- signal to the correct ticks of the sampled signal. The two frequencies from the SENT- Signal (333kHz) and the sampled signal (40Mhz) are different so i have divided the sampled signal frequency by the SENT- Signal frequency (Factor of about 120). Now i can convert the 56 ticks to correct number of ticks from the sampled signal and i can find the SYNC- Puls in the SENT- Frame. The outcome of 56 ticks times the factor of 120 is 6720 ticks. Therefore i have convert the ticks to the correct frequency.
Thank you for your help!
Best regards,
Sebastian