Jump to content
  • 0

AD2 and Waveforms: Best way to decode analog input signals


DigilentFan

Question

Sometimes, (if digital protocol analysis struggles) it is desired to decode protocols at analog input signals (for e.g. to look in depth into rise/fall times, signal levels changed by pull resistors etc.). Is there a way to select the analog inputs as source for the protocol decoders in waveforms?

If yes, how are the signals mapped to LOW - HIGH? How to use it?

Is it possible to mix up analog and digital signals (for e.g. in case of I2C: SDATA as analog and CLK as digital input)?

If not is there a suggested way around (for e.g.  acquire analog data, and feed this data into a script, performing the one bit AD conversion as well as the protocol decoding) with the advantage to get decoding done by waveforms?

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @DigilentFan

You could use a script like this to port Scope data to Logic Analyzer.

image.png

function toDigital(rg){
    var rgd = [];
    var l = 0;
    rg.forEach(function(v){
        if(v<1.0) l = 0; // logic with hysteresis, < 1V
        else if(v>2.0) l = 1; // > 2V
        rgd.push(l);
    })
    return rgd;
}
var rg1 = toDigital(Scope.Channel1.data);
var rg2 = toDigital(Scope.Channel2.data);
var rg = [];
var c = rg1.length;
for(var i = 0; i < c; i++){
    rg.push(rg1[i]|(rg2[i]<<1)); // Scope1 as DIO0 and Scope2 as DIO1
}
Logic.RemoveTab("FromScope");
Logic.AddTab("FromScope", rg, Scope.Time.Rate.real);

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...