Hi all,
I’m out of office for the next month. In my job I’m lately working with a SPI transceiver (sx1276).
I very often need to trace the SPI transactions with a logic device, and I find it very hard to do
without a high level analyzer.
I’ve decided to take this as a project - create a HLA while I’m out of the office, so it’ll be easier for me to do when I come back. The problem is that I don’t have the logic device or the required hardware (transceiver & MCU) with me, which I expect will make it impossible to check if my extension really works.
Is there any way to generate custom SPI data? Alternatively, is there any source of recorded captures of standard devices (I guess my transceiver’s protocol is similar to others)?
Thanks in advance!
Is there any way to generate custom SPI data?
Yes! It will take you a few steps to setup, and will require a C++ build system (e.g. visual studio) but not very much C++ code.
First, our low level analyzers, like SPI, include built-in simulation support which we turned off by default in Logic 2.
You can switch on simulation mode by setting an environment variable, described here:
That will cause the built-in SPI analyzer to start producing a simple pattern.
However, to simulate your own data, you will need to modify the SPI analyzer simulation code. (At this point though, if you don’t want to touch C++, I recommend putting a shim into your python that simply replaces the SPI data with your data as it comes into your HLA.)
At this point, you will need to build and add the SPI analyzer from source code:
https://github.com/saleae/spi-analyzer/tree/alpha
(Note that’s the alpha branch, which is the code currently shipping in Logic 2)
A few things to note here, you should change the name in the code to avoid it conflicting with the built-in SPI analyzer. Then you can modify the simulation pattern here: https://github.com/saleae/spi-analyzer/blob/d1149e9c66a367ac7c541c48752d6c8b9c98536b/src/SpiSimulationDataGenerator.cpp#L65
That’s a bit of work, so simply over-writing the data field in your HLA as you process the SPI frames might be a lot quicker. However if you want to simulate the real thing as best as possible, the C++ route is the way to go.