Hi Angus,

On Wed, Oct 29, 2014 at 09:32:55AM +1100, Angus Gratton wrote:
> Measuring the simple timing of a pulse edge is the kind of thing I'd
> usually just do some quick scripting for, but I figured it's nice to
> be able to look at the data directly in pulseview as well so I wrote a
> very simple encoder.
> 
> Here's a shot of pulseview with two of these decoders loaded:
> http://i.imgur.com/ZfsZ2pg.png
> 
> Can measure across high/low/edge-to-edge/falling-to-falling or
> rising-to-rising.
> 
> I've attached a patch. Happy to change/cleanup it in any way if
> necessary, or be told that this isn't the right approach for this kind
> of thing.

This can also be done in frontends as feature (e.g. PulseView already shows
the distance between two cursors, but more can be done in that direction
of course, e.g. Frequency in Hz).

Nonetheless it's also very useful to have this functionality in a PD as
well. However, please checkout the existing 'pwm' decoder which is
already in the repo (and received a few improvements as of today).

It currently shows the duty cycle in percent, I think it would probably
make sense to extend it to also (at the same time) show the distances
(in µs or whatever) like your PD does. You can add another annotation
class ('distance' or such), and put the existing 'duty-cycle'
annotation class and the new 'distance' one on two different annotation
rows so they're both visible at the same time in PulseView.

Let us know if you can make a patch for this, and/or if you have any
other suggestions on how to improve the 'pwm' decoder in general.

We have a simple pwm test-case already btw:
sigrok.org/gitweb/?p=sigrok-test.git;a=tree;f=decoder/test/pwm


Cheers, Uwe.
-- 
http://hermann-uwe.de | http://randomprojects.org | http://sigrok.org

------------------------------------------------------------------------------
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to