Jump to content
  • 0

SPI sensor script ReadWrite not working (3.6.8)


gasstationwithoutpumps

Question

In Waveforms 2015 3.6.8 on a Mac OS 10.11.6 with an Analog Discovery 2, I am not able to get the SPI sensor scripts to work.  I'm having no trouble with Master or Custom scripts, but with the Sensor scripts the ReadWrite() commands always return an array of zeros, even if I'm not in Debug mode.  (I tried starting from a fresh run of Waveforms, to make sure that the debug setting was not just being excessively sticky.)

Can anyone else duplicate this behavior?  Or is it just me?

Incidentally, the documentation for the protocol instrument and the scripts is woefully inadequate—I had to figure out how things worked by trial and error, because of the extreme lack of information in the documentation.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

I tried many different versions of the sensor script, but I've discarded them all, as none did anything useful (I always got 0s from ReadWrite).

It took me a while to figure out exactly what Read and ReadWrite did—what they expected as arguments and what they returned.  It did not help that turning on "debug" caused them to return 0 (is that documented?).  (Why can't both the logic analyzer and the script see the data?)  

I ended up having to guess what functionality was available and how to use it by reverse-engineering the few examples given.  I managed to get a working custom script that way, but never managed to get a sensor script that did anything.  It didn't help that I was trying to use the protocol tool to debug an SPI slave that I was building—I was never certain whether the problem was with my understanding of the protocol tool or a bug in my own SPI interface.

It would have been nice to know about the huge delay between a Write and Read—it took me a while to realize why they were behaving differently from the same series of transactions as ReadWrite.  I ended up using the custom tool and the logic analyzer to do all my debugging, but I would have liked to then transition to doing a large sequence of reads with the sensor tool, to look for intermittent problems, but no matter what I tried, I always got 0s from the ReadWrite in the sensor tool (I think—it was not clear how to add debugging outputs to the sensor script, since only a single line of output was ever visible).

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...