Missing pulse detection - Page 1
Forum section: electronics / testgear

author: calexanian
author_rank: Super Contributor
timestamp: November 18, 2019, 08:53:28 pm
content: Has anybody come across a system that will recognize a missing pulse. The situation is we are debugging a timer device and out of nowhere we are getting it running long by a regular amount of time. We have eliminated the tuning fork crystal and temp drift. Its microchip PIC18 based and we have a pin just transitioning on the timer 1 interrupt every second. Want to set up a way of automatically detecting if it misses a transition. Syncing an external one second clock and a comparator then to an event counter would be hard to do consistently. Could build up a board and write a little piece of firmware to flag every time a second goes by without a pulse. There has to be one of new PC based analyzers that can do this. After checking the timer 1 interrupt and if the problem was not there we would move up to increment our flag pin from the actual system clock.Any thoughts? Some dumb simple thing out there I am missing?

author: maginnovision
author_rank: Super Contributor
timestamp: November 18, 2019, 09:22:14 pm
content: Can't you just trigger on a ±PW with a standard oscilloscope?

author: nctnico
author_rank: Super Contributor
timestamp: November 18, 2019, 09:27:15 pm
content: This should be possible with a reasonable oscilloscope.

author: tggzzz
author_rank: Super Contributor
timestamp: November 18, 2019, 09:41:51 pm
content: Any decent logic analyser will enable you to define a trigger FSM that can recognise a missing pulse and use it as the trigger.It can also capture and store anything interesting that lead up to the missing pulse.

author: calexanian
author_rank: Super Contributor
timestamp: November 18, 2019, 10:19:29 pm
content: My problem in counting how many times per hour and doing 24 hour evaluations

author: maginnovision
author_rank: Super Contributor
timestamp: November 18, 2019, 10:29:36 pm
content: Use history or segmented memory?

author: 2N3055
author_rank: Super Contributor
timestamp: November 18, 2019, 10:46:38 pm
content: Even Rigol DS1054Z can trigger on this. Put a counter on trig out....

author: nfmax
author_rank: Super Contributor
timestamp: November 19, 2019, 01:36:47 pm
content: Quote from: calexanian on November 18, 2019, 10:19:29 pmUse a scope in mask test mode, and configure the trigger out to send a pulse for failure; then connect it to a counter or datalogger

author: macboy
author_rank: Super Contributor
timestamp: November 19, 2019, 04:12:32 pm
content: Quote from: calexanian on November 18, 2019, 08:53:28 pmWhat does the ISR do? Are you updating the TMR1 count within the ISR? If so, are you doing it correctly and safely?As others mentioned, any decent digital oscilloscope or logic analyser can trigger on a missing (or long or short) pulse. Set up the scope to capture for some time before and after the trigger, to get a good snapshot of the event.

author: DaJMasta
author_rank: Super Contributor
timestamp: November 19, 2019, 04:57:43 pm
content: This is what microcontroller watchdogs are made for - they just look for the heartbeat and error out if it doesn't show. You're right that any normal micro (that you trust to be stable enough to run successfully for longer than your DUT) would be able to handle it, so that would be my approach. If you need to see the waveform too, I'd just have the micro trigger an external trigger line and then single shot capture it on a scope with a long timebase (long enough to capture the end of the previous pulse after one times out).Code would be timestamping the input signal and just comparing it to a timeout - make it generous so that clock drift of the micro you're using won't be an issue in the time period (maybe 1500ms), then turn on an indicator and set a trigger output to whatever capture device you want. Almost any device with triggering capability could do it, but it's a non-standard enough feature that it would probably take a device that you can script to to make it work - but they're around. If you've got a frequency counter that keeps statistics, you could probably know from the outliers if it had missed a pulse in the duration it was recording. You may even be able to do it with mask testing on a scope if you had another PPS signal to trigger off of, or if your scope gave you the option for a trigger timeout.If it were me and there wasn't a bit of gear that had the feature built in, I'd just stick it on an arduino and not worry about it - probably takes as much time to write the code as to connect up power, ground, inputs, outputs to the board itself.

author: calexanian
author_rank: Super Contributor
timestamp: November 19, 2019, 07:03:18 pm
content: Looked at all the scopes and analyzers we have. None of them can do exactly what we need. since this is a larger volume product for us we decided to just invest the time in writing a piece of firmware/hardware to compare pulses generated from various spots in the DUT and compare to a precision time pulse generator and blurp out a time stamp and deviation every time there is an event.Thanks for the suggestions but this one rose up the ranks to an important enough problem that we will just make a custom tool and justify the expenditure of time.

author: DaJMasta
author_rank: Super Contributor
timestamp: November 19, 2019, 07:55:51 pm
content: Quote from: calexanian on November 19, 2019, 07:03:18 pmIt occurred to me after initially posting, but what about a scope in mask testing mode, but the mask isn't for one period, it's for two. That would not detect two consecutive missing pulses, but it would reliably detect a single missing pulse without an external time reference to compare to. Increasing the number of periods captured and compared to the mask increases the number of consecutive missing pulses it could detect. I assume any scope with an operating system that lets you script it or any scope with GPIB/LXI/other remote control could use a bit of script on a remote computer to timeout if it doesn't retrigger in time and then increment a counter or make a timestamped log or something.

author: nctnico
author_rank: Super Contributor
timestamp: November 20, 2019, 09:14:30 am
content: Quote from: DaJMasta on November 19, 2019, 07:55:51 pmI agree. Better use standard test equipment with some scripting than putting something together yourself.Given it is a Microchip device I wouldn't rule out external interference and lack of filtering on power supplies and pins which can cause weird behaviour. An electronic igniter for a furnace could be a nice tool to try and reproduce the effect.