Jump to content

bobql

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by bobql

  1. Hi @attila, Do you have an example in python to do this?
  2. Hi Attila, Do you have an example of how to do this?
  3. 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
  4. Hi @attila So, if I understand you correctly, I configure and run my pattern with DigitalOut_SPI.py and then use DigitalIn_Spi_Spy.py to capture the data. Correct? I tried to run the my version of DigitalOut_SPI4.py (attached) but I can not see how to control the CS correctly. Also, how do I insert hardware delays between frames? For example, if I wanted to burst SPI commands every 1ms. Right now I have it set to repeat 2x, but I need the CS to go high between each frame. Can you tell me how to do that? See scope shot of CS staying low for both 32 clock frames. Also, how do I get MSB first out instead of LSB first? Sorry for all the questions, but I am new to this...I tried searching the forum for similar questions and answers. Thanks! DigitalOut_SPI v4.py
  5. Hi Attila, Is there anyway to mimic in labview the "Sensor" feature implemented in the Waveforms GUI? We have a 5 axis sensor that I would like to read at very consistent read rates. Below is a test case I have done using the a script in Sensor tab. I found that the longer the iterations, the outcome is worse....i.e. timing is not correct.
  6. Hello, I am able to run a SPI example in python and I am trying convert the program into labview using functions from WaveForms™ SDK. I am running into a problem with: rgbTX = (c_ubyte*4)(0x00,0x40,0x00,0x01) rgbRX = (c_ubyte*4)(0x00,0x00,0x00,0x00) # cDQ 1 MOSI/MISO, 8bit words, MOSI words, MISO words dwf.FDwfDigitalSpiWriteRead(hdwf, c_int(1), c_int(8), rgbTX, c_int(len(rgbTX)), rgbRX, c_int(len(rgbRX))) I am having a hard time defining rgbTX and rgbRX in labview. I've tried this below but it doesnt work.
  7. Hi, I loaded some python examples form waveforms SDK for SPI and it seems to work, but I need to be able to enable the 3.3V supply to my DUT. I cannot find any reference to turn on the supplies. Please advise. Thanks, Bob
  8. Hello, I'm new to using Digilent tools. I have been evaluating the SPI feature using Waveforms (ver 3.22.16 64bit) and am able to read and write from my slave device using 32-bit protocol. Our new device will feature a 48-bit protocol, but I cannot get the protocol to work. Is the tool limited to 32bit max? If so, is there anyway to increase to 48bit? Thanks, Bob [UPDATE]: Fixed the issue: Instead of sending all 32bits like 0x12345678, I have to split it up 8bits at a time. For Example: instead of this command Write(48, 0x0620004D55aa ); I need to use Write(8, 0x06, 0x20, 0x00, 0x4D, 0x55, 0xaa );
×
×
  • Create New...