Jump to content
  • 0

How to measure Scope and Protocol


kazu

Question

I would like to ask about the "WaveForms" script (Protocol & Scope).
Use the "Protocol (I2C)" script to issue read commands in succession, and use "Script" to measure the fall time of Ch2 → Ch1 of "Scope" and detect an arbitrary range. The measurement is stopped at that point.

I want to do something like this, can I do it?
If possible, I would appreciate it if you could provide a sample script.

Thank you regards

 

I2C_Measures.pdf

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Hi @kazu

It could be done like this:

for(var t = 0; t < 10 && wait(0.5); t++){ // wait 500ms
    Scope.single()
    Protocol.I2C.Write(0x2A)
    Scope.wait()
    // Scope trigger on Ch0-SDA falling, T0
    var rg = Scope.Channel2.data // SCL
    var i0 = Scope.Channel2.IndexOfTime(0) // sample index at T0
    var i1 = 0
    // count SCL samples above 1.5V, dT SDA->SCL
    while(i1 < rg.length && rg[i1]>1.5) i1++ 
    var dt = (i1-i0)/Scope.Time.Rate.value 
    print(t, dt*1e6,"us")
}

image.thumb.png.1b02b357ffb2c96a456752a9a339d3b6.png

Link to comment
Share on other sites

  • 0

Is it possible to issue the protocol command [Protocol.I2C.Read (0x00,2)] triggered by the change in channel 1 (Hi → Lo)?
I was able to measure the time with the script you taught me, but as the next step, I asked because it became necessary to acquire the change of channel 1 and issue an I2C read.

Thank you

Regards.

Link to comment
Share on other sites

  • 0

Thank you for your advice.
By the way, I'm not familiar with "Pattern", but if you have a manual, please tell me the URL.
Is it possible to detect the change point of the BUS1 signal and send "Protocol.I2C.Read (0x00,2)" by using "Pattern"?

Thank You

Regards

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...