• 0

Digilent Analog Discovery 2 Spi Spy (SDK)


Question

Hi,

I am trying to implement spi_spy thru SDK.  
My C program, based on Digital_Spi_Spy.py, decodes  correctly about ~90% of the data. Sometimes it seems to loose trigger and the rest of the frame is corrupt.

The WaveForms Protocol->SPI->Spy works perfectly every time for my setup.

Included is my C code and a .jpg from my and WaveForms output log. The faulty data is marked as yellow in the left log in the picture.

I am writing in C and the spi frequency is 300kHz settings are active low, cpol 0, cpha 0.

Is there something I am missing here? How is SPI Spy implemented in WaveForms?

Best Regards,
Tood

spi_spy_sdk_and_waveforms_log.JPG

hello.c

Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hi @Tood

The implementation in the WF app is similar to the Python example.
In the app the data reception and decoding is done in a background thread and the display in the main.
In Python probably the loop is slower. Try replacing the prints by storing data in a buffer and print/write at the end, or use threading.

Link to post
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