Signal speed analysis  - Page 1
Forum section: electronics / general

author: NickWolfe
author_rank: Contributor
timestamp: April 02, 2019, 01:54:28 pm
content: Hi guys!I'm nearing the end of a prototype but are in need of some speed analysis.I need to measure the speed from a switch and a digital signal input on a computer.Having no clue about that area, I'm only thinking, but is it possible to measure the timing via the followinghttps://www.adafruit.com/product/2312I'm thinking the digital on the data channel on the usb port and the analog on the switch, then compare the timing in the software?Thanks in advance!Sendt fra min SM-G930F med Tapatalk

author: TK
author_rank: Super Contributor
timestamp: April 02, 2019, 02:10:57 pm
content: It all depends the precision you need. Is it in the order of milliseconds or nanoseconds? The saleae logic analyzer has an internal clock and it will not show the exact timing, sample rate is only 12 MS/s @ 8 Bits digital and 6MS/s on analog. I think you should get an oscilloscope. What is tricky is triggering the USB bus right when your timing must start, the old Agilent 54622D has USB triggering and it has 2 analog + 16 digital channels. The Zeroplus LAP-C can also trigger on USB 2.0 but you have the same limitation, depending on the model it has 100MHz or 200MHz samples per second, that limits the precision to 10ns - 5ns (theoretical).Please post a diagram of the circuit you need to measure

author: NickWolfe
author_rank: Contributor
timestamp: April 02, 2019, 02:14:35 pm
content: I would be happy with 1/10 ms precision, but my main problem when thinking about oscilloscopes is that my proto connects via Usb3.I don't need full data analysis, just the time from analog to usb basically. I'm cringing by the thought of a $50,000 oscilloscopeSendt fra min SM-G930F med Tapatalk

author: TK
author_rank: Super Contributor
timestamp: April 02, 2019, 02:38:16 pm
content: Does your proto use a microcontroller? Then you can use one of the GPIO pins to measure the time from the switch to the beginning of the USB3 transmission. You don't need a $50,000 scope for 1/10ms timing measurement, any entry level scope ($400-$1000) will work (Rigol DS1054Z, Micsig TO1104, Siglent SDS1202X-E, Keysight DSOX1102A, etc).

author: NickWolfe
author_rank: Contributor
timestamp: April 02, 2019, 05:38:35 pm
content: It does, currently looking at the rigol you recommended, would I need anything else? Being the first time using an oscilloscope, would it be connecting one probe to the USB end and one probe to the GPIO?Sorry for the ultra newbie questionSendt fra min SM-G930F med Tapatalk

author: rstofer
author_rank: Super Contributor
timestamp: April 02, 2019, 06:33:52 pm
content: Given the latency of USB, does anything else matter? You can expect an average latency of 1/2 ms or 500 us. If it matters...

author: NickWolfe
author_rank: Contributor
timestamp: April 02, 2019, 06:41:55 pm
content: In all honesty, I can't use calculations to much, I have improved a protocol for the transfer by 7.5x but I need the actual measurable time from user input to the receiving end Sendt fra min SM-G930F med Tapatalk

author: TK
author_rank: Super Contributor
timestamp: April 02, 2019, 07:00:15 pm
content: Quote from: NickWolfe on April 02, 2019, 06:41:55 pmIs the receiving end inside the PC or laptop and at the user level (application)? If this is the case, I don't think an oscilloscope can help.

author: NickWolfe
author_rank: Contributor
timestamp: April 02, 2019, 07:05:27 pm
content: Quote from: TK on April 02, 2019, 07:00:15 pmIt is, but I just need the time to the interface, more accurately splitting open the usb jack and measuring there, not application level.Sendt fra min SM-G930F med Tapatalk

author: NickWolfe
author_rank: Contributor
timestamp: April 02, 2019, 07:10:14 pm
content: Basically I'm able to circumvent polling, and thus minimize the time between packets by a huge factor. While I'm now testing it by injecting preprogrammed data in from before the buffer, to the microcontroller and then output it through USB, but in order to be absolutely sure of the numbers, I need to know if the buffer and mcu adds how much if any, delay from the input (will reprogram it to test a switch instead of pre programmed data, that was just for benchmarking the throughput)Sendt fra min SM-G930F med Tapatalk

author: TK
author_rank: Super Contributor
timestamp: April 02, 2019, 07:10:22 pm
content: I think USB is very verbose protocol, I don't think it is going to be quiet until you receive the packet to transmit to the PC. Discerning the meaningful packet from the rest will be a challenge. My suggestion is to use a GPIO on the microcontroller to set it HIGH just before sending the packet to the USB port. Then you can use 2 probes on the scope, one on the switch, another one on the GPIO pin, then trigger on the switch and measure the time from there to the GPIO pin going high.

author: TK
author_rank: Super Contributor
timestamp: April 02, 2019, 07:11:40 pm
content: It can be helpful if you post a diagram from the switch to the USB port

author: NickWolfe
author_rank: Contributor
timestamp: April 02, 2019, 07:11:43 pm
content: Sounds solid! Thanks Sendt fra min SM-G930F med Tapatalk