Jump to content
  • 0

Digital Discovery - Digital Out SPI


bobql

Question

Hello,

In the code snippet below I can output SPI at a frequency that I need.  However, I can only output 1 continuous command.  I would like to be able to burst more that 1 command at a time at a 1000Hz frequency.  For example, instead of sending rgdData only, i would like to send  (rgdData, rgdData2, rgdData3, rgdData4 ) and repeat.  Is there any way to do this in python?  I am trying to mimic the sensor feature in the waveforms GUI.  I can do it there but not in python.    I've also attached my full python code.

----------------------------------------------------------------

# data sent out LSB first
dwf.FDwfDigitalOutDataSet(hdwf, c_int(2), byref(rgdData), c_int(cBits))

dwf.FDwfDigitalOutWaitSet(hdwf, c_double(spi_delay(hzFreq, 1e-5)))
dwf.FDwfDigitalOutRepeatSet(hdwf,0)

dwf.FDwfDigitalOutConfigure(hdwf, c_int(1))
print("Generating output for 5 seconds...")
time.sleep(5)

dwf.FDwfDeviceCloseAll()

DigitalOut_SPI v5 32bit works.py

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0
On 4/30/2024 at 4:36 AM, attila said:

Hi @bobql

Concatenate rgData1,2,3,4 and insert idle bit(s) between. Use custom pattern also for CS to activate/deactivate this, and for clock if this needs to stop in inactive state.

Hi @attila,

Do you have an example in python to do this?

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