• 0
tcmichals

measuring minimum and maximum jitter between two digital inputs

Question

Is there a way to measure the minimum and maximum time between two digital inputs over time?  For example, two digital inputs:

(1) digital input ,rising edge and is the trigger to start the time measurement
(2) digital input, rising edge, stops timer 
- The time value is compare against a running minimum and maximum time value. 

The goal is to have a continous measurement of the minimum and maximum time difference between the rising edge of digital input 1 and 2.  

i.e measure jitter between two digital inputs over time. 

 

 

Share this post


Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 1

Hi @tcmichals

You could use a custom decoder in Logic Analyzer to measure the timing and Script tool to find the min/max.
The repetitive captures will have gap between them but you could use Record (Mode) to have measurement on longer continuous sequence.

image.png.08c82e79f8b5cab3acbcfb7d06914a71.png

image.png.a5b1327cef723c27631c82629897ce0d.png

image.png.34ee07cd9f6e1977a7f411b79c58fcae.png

Decoder:

c = rgData.length
p0 = 1
p1 = 1
v = 0
i0 = 0
for(var i = 0; i < c; i++){
    d0 = rgData[i] & 0x01 // DIO 0
    d1 = (rgData[i] >> 1) & 0x01 // DIO 1
    if(p0 == 0 & d0 == 1){ // DIO 0 rise reset 'v'
        v = 0
        i0 = i
    }
    if(p1 == 0 & d1 == 1){ // DIO 1 rise store 'v'
        for(var j = i0; j < i; j++){
            rgValue[j] = v
            rgFlag[j] = hzRate
        }
    }
    v++
    p0 = d0
    p1 = d1
}

Value to Text:

function Value2Text(flag, value){
  switch(flag){
    case 0: return "X";
    default: return 1e6*value/flag; // us, microsecond
  }
}

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.