Generating standard pulse from list of periods with off-the-shelf equipment? - Page 1
Forum section: electronics / projects

author: thayer
author_rank: Newbie
timestamp: May 21, 2025, 09:05:01 pm
content: Howdy folks,Part of our tech involves responding to a series of very regularly-shaped pulses (~4us width, 5V single-ended) that happen at a nominal 360Hz. However, sometimes there are pulses that fall outside of this spec- they're always 5V, but perhaps they're a little bit narrow or arrive at a different time than we expect. As a result, our hardware gives us a list of periods between pulses, such as the following:275000, 275000, 275000, 100000, 275000, 275000, 275000, 275000 (units of 10ns, so 100000 = 1.0ms; basically, one pulse arrived too early)Sometimes these lists end up with a few thousand entries and we need to play them back for debugging. I've got super-standard STM32 running at 100MHz feeding a GPIO pin with DMA from these lists- works well enough, but my coworkerinsiststhat there has to be a better (and less bespoke) piece of equipment for doing this.However, when I look at AWGs, they all want a time series- but given that our signal is 4us pulses into 2.78ms periods, that's just a lot of zeroes and quickly fills up memory when we're talking about 90+ seconds of data at this time resolution. Pulse generators, similarly, don't seem to have the adjustability between pulses that I need. I don't need picosecond accuracy, nor do I need perfect rise times- everything's fed into a Schmitt trigger input and I just need to be within a few 10s or 100s of nanoseconds in terms of periods, something my microcontroller is able to do. Is there an off-the-shelf box that will do this, or will I be forced to support my homebrew solution for years to come, preferably one that doesn't cost 50k?

author: langwadt
author_rank: Super Contributor
timestamp: May 21, 2025, 09:17:55 pm
content: what does you coworker think an off the shelf solution that you will probably spend day or weeks tweaking to mostly do what you want, will do better than you simple cheap solution that already does what you need?

author: Someone
author_rank: Super Contributor
timestamp: May 21, 2025, 11:40:06 pm
content: The behaviour could almost certainly be produced with the sequence mode of AWGs but does your coworker realise those are $X,000 or $X0,000 investments?

author: PCB.Wiz
author_rank: Super Contributor
timestamp: May 22, 2025, 01:31:26 am
content: Quote from: thayer on May 21, 2025, 09:05:01 pmbecause he fails to mention price, he is of course, correct.Youcanget AWG with 8 million points, (and even 128 million...) and 8 million is enough for 11,000 pulses at 4us quanta averaging 2.78msQuote from: thayer on May 21, 2025, 09:05:01 pmSince yours works, what is the problem with supporting it?An approach some logic analyzers used, to compress captures and keep resolution, was to store pattern/time pairs, so only the edges were stored.If you wanted amore easily supported by otherslow cost solution, you could look at a PiPICO programmed on the PIO with playback pattern/time pairs.The lists are then compressed to much smaller, and easier to manage, and the solution is broadly flexible.Google finds this paper on pattern/time pairs being captured on the PICO PIO, which could be recoded to instead output pattern time pairs.https://j-hui.com/publications/hui2023timestamp.pdfAddit : more found herehttps://arxiv.org/html/2406.17603and that has a broken link, they meant thishttps://github.com/labscript-suite/prawn_digital_outputBroadly :SpecsAll timings are given relative to the default system clock of 100 MHz.Resolution: 1 clock cycle (10 ns)Minimum Pulse Width: 5 clock cycles (50 ns)Max Pulse Rate: 1/10 system clock frequency (10 MHz)Maximum Pulse Width: 2^32 - 1 clock cycles (42.94967295 s)Max Instructions: 30,000Supports Indefinite Waits and Full StopsMax system clock frequency of 133 MHz

author: thayer
author_rank: Newbie
timestamp: May 22, 2025, 03:31:37 pm
content: @PCB.Wiz this might be EXACTLY the kind of thing I was looking for, and probably never would have found on my own- it's got a lot more features that my current system does and functionally identical performance, at least at first glance. Gonna dig into it a bit. Really appreciate it.

author: langwadt
author_rank: Super Contributor
timestamp: May 22, 2025, 03:40:32 pm
content: Quote from: PCB.Wiz on May 22, 2025, 01:31:26 amor logic simulators,https://en.wikipedia.org/wiki/Value_change_dump