Jump to content
  • 0

AD2/DD: SPI custom decoding script no longer works after changing inputs sampling speed


Walter76

Question

Hello,

I am using DD to sniff and decode a custom SPI-like bus.

The script works fine with 100 MHz x 32 and 200 MHz x 32 selection. After selecting 400 MHz x 16 or 800 MHz x 8, decoded data is no longer shown. Reverting back to lower speed has no effect: I have to reload the project...

The standard SPI shows correct waveforms/values in all cases.

Any suggestion?

 

BTW, is there a way to show the HEX values in capital letters (0xFF instead of 0xff)?

// value: value sample

// flag: flag sample

function Value2Text(flag,value)

{

     var Trace = "0x"+value.toString(16);

    return Trace;

}


Value2Text(flag,value)

Thank you a lot,

Walter

 

DD_Custom_SPI_decode.txt Custom_SPI_decode.dwf3logic

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @Walter76,

I apologize for the long delay.

I'm not certain on the correct way have the script work without needing to reload the project (hopefully the engineer much more experienced with WaveForms and scripting will have some insight), but I did figure out what you can do to get the upper case results:

Quote

var value;
print(Value2Text(138));

function Value2Text(value)
  {
      var Trace = value.toString(16);
      Trace = "0x"+Trace.toUpperCase(Trace);
      return Trace;
}

Thanks,
JColvin

Link to comment
Share on other sites

  • 0

Hi @Walter76

The problem is that the 8 or 16bit sampling gets selected for DIN 0-7 or 0-15 and DIO 24... are not captured.
Select 32bit sampling.

If you are only using DIOs then select the DIO first option and in script use:
    var fSelect = 1&(s>>0); // pin24 is the select signal
    var fClock = 1&(s>>1); // pin25 is the clock signal
    var fData = 1&(s>>3); // pin27 is the data signal

For upper case use the following:
    "0x"+value.toString(16).toUpperCase(); // hexadecimal

image.png.8c3a662084a159c4edbc92d465a68c07.png

Edited by attila
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...