Jump to content
  • 0

SPI Dual Example Question


Alejandro-Dev

Question

I am a bit confused with the example Digital_Spi_Dual.py from the python SDK examples. Which pins/cables should be connected to which to make it work? (maybe with that I will be able to figure it out).

In lines 40, 41 and 42:
 

dwf.FDwfDigitalSpiClockSet(hdwf, c_int(1))
dwf.FDwfDigitalSpiDataSet(hdwf, c_int(0), c_int(1)) # 0 DQ0_MOSI_SISO = DIO-2
dwf.FDwfDigitalSpiDataSet(hdwf, c_int(1), c_int(5)) # 1 DQ1_MISO = DIO-3


I understand from the documentation that we are selecting pin 1 with the second argument (25 on the Digital Discovery) as clock but then in the next line we also use pin1 as MISO?

From the documentation the second argument of FDwfDigitalSpiClockSet is:

Quote

- idxChannel – DIO channel to use for SPI clock (default DIO1)



And the third argument of FDwfDigitalSpiDataSet is:

Quote

- idxChannel – DIO channel to use for SPI data

 

Thanks!

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Hi @Alejandro-Dev

The "Digital_Spi_Dual.py" examples is the following: 
dwf.FDwfDigitalSpiClockSet(hdwf, c_int(1))  # Clock = DIO-1, Digital Discovery DIO-25
dwf.FDwfDigitalSpiDataSet(hdwf, c_int(0), c_int(2)) # 0 DQ0_MOSI_SISO = DIO-2, Digital Discovery DIO-26
dwf.FDwfDigitalSpiDataSet(hdwf, c_int(1), c_int(3)) # 1 DQ1_MISO = DIO-3, Digital Discovery DIO-27

WaveForms SDK Reference Manual.pdf :

image.png.87f4f7728eb22d7515e9e87f93a8b4b2.png 
image.png.f376c65407e23733ccb495b07e0a0708.png

 

Link to comment
Share on other sites

  • 0
19 hours ago, attila said:

Hi @Alejandro-Dev

The "Digital_Spi_Dual.py" examples is the following: 
dwf.FDwfDigitalSpiClockSet(hdwf, c_int(1))  # Clock = DIO-1, Digital Discovery DIO-25
dwf.FDwfDigitalSpiDataSet(hdwf, c_int(0), c_int(2)) # 0 DQ0_MOSI_SISO = DIO-2, Digital Discovery DIO-26
dwf.FDwfDigitalSpiDataSet(hdwf, c_int(1), c_int(3)) # 1 DQ1_MISO = DIO-3, Digital Discovery DIO-27

WaveForms SDK Reference Manual.pdf :

image.png.87f4f7728eb22d7515e9e87f93a8b4b2.png 
image.png.f376c65407e23733ccb495b07e0a0708.png

 

Thanks!

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