Jump to content
  • 0

Analog Discovery 2 SPI Spy - Waveforms SDK - Phase Setting ignored


Sebastian C

Question

Hello,

I have connected the AD2 to Spy on an existing SPI Bus between a STM Controller and an IC provided by our Company, and am trying to just spy and log the traffic for tool verification reasons.

When i use the Setup with the Waveforms GUI, everything works fine. It displays all Samples, the data looks ok, everything fine.

As soon as I start using the tool via API (Python or C#, happens on both) the SPI Phase Settings seems to get ignored. I get flipping Bits all over the place, which is the same behaviour as if i set the Phase in the Waveforms GUI (Waveforms -> Protocol -> SPI) to the wrong setting.

The correct Setting for my application is polarity=0 and phase=1, so I used FDwfDigitalSpiModeSet with it's parameter set to 1.

I attached the C# and Python programs below for reference, maybe i overlooked something in there, but wouldn't know what should be wrong with it...

Program.cs spi_tracker.py

Edited by Sebastian C
added tags
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @Sebastian C

Use:
# trigger detector mask:                         low     & hight   & ( rising             |           falling )
dwf.FDwfDigitalInTriggerSet(self.hdwf, c_int(0), c_int(0), c_int(1<<self.idxCS), c_int(1<<self.idxCS))

The FDwfDigitalSpi# functions are for master. For spy purpose it is suffice to use the FDwfDigitalIn functions, see: WF SDK/ samples/ py/ DigitalIn_Spi_Spy.py

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