Timestamping positive or negative edges #41
Replies: 4 comments 2 replies
-
|
They are the same as the Jetson clock in epoch format |
Beta Was this translation helpful? Give feedback.
-
|
Okay, thanks for the confirmation. Also, I am trying to figure out a way to verify how precise the timestamps are. Do you already have an example to check this or would be great if you suggest a method in which I can verify. I calculated a rough estimate by subtracting t + 1 by t and get a value which is roughly the time period of my train pulse. Is there a better way to do it? |
Beta Was this translation helpful? Give feedback.
-
|
The error that you are going to get is around +/-1 ms, but is not deterministic, it could be less or even more. Check the tables here: So, is a +/-1 ms error acceptable measuring a signal period? depends, especially on the maximum frequency of that signal. If the signal is pure periodic, you could also just count a number of pulses e.g. 1000 and measure the time at the end and divide to get the period, this will improve the period measurement. The advantage of using this method is that you rely on the kernel interrupts, but you can improve accuracy running an infinite loop e.g. on a thread by using the simple: int gpioRead() checking for level, you will waste one of the cores but if you want accuracy, this would be a way to do it. Check also: https://github.com/Rubberazer/JETGPIO/blob/main/EXAMPLES_C/jetgpio_round_trip.c for inspiration |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for your reply. The acceptable error range for my purpose is <=100 microseconds. I also found that it is not deterministic as you said, but overall I would say it is performing good. However, I will put it to some rigorous tests as well and check it. But, I would like to know more about the gpioSetISRFunc(). I wanted to understand the importance of the "debounce" parameter. I assume it's the time delay between which the interfering signals will be discarded. For now, I have set this to be "0". Will this impact the performance in any way? Also, would like to know more about how the edges are captured. You explained that it uses linux gpio driver, may I know more about this or can you point me out to some links which can explain this and how kernel interrupts work in detail? Thanks. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @Rubberazer
Many thanks for the library. I went through it and it is helping me a lot to generate output signals on Jetson GPIOs. I am using an AGX Orin device and trying to generate a pulse train. I would like to timestamp the occurence of positive edges. I used your jetgpio_edge.c to do this. It works and I get the timestamps, but I am not sure if they are the same time representing the Jetson clock. Could you please confirm that whatever timestamps that are seen are exactly the same as the clock running on Jetson or is it the GPIO clock or something else? Your insights are much appreciated.
Best regards
Madhu
Beta Was this translation helpful? Give feedback.
All reactions