Jump to content

Alejandro-Dev

Members
  • Posts

    14
  • Joined

  • Last visited

Alejandro-Dev's Achievements

Member

Member (2/4)

4

Reputation

  1. I will soon start using more of the digital IO pins for a project so I was testing them out. They all seemed to work fine except for IO 39. I am testing the pins with I2C protocol, like so: dwf.FDwfDigitalI2cSclSet(hdwf, c_int(13)) dwf.FDwfDigitalI2cSdaSet(hdwf, c_int(14)) Using number 15 (DIO 39) in either function will result in error but the rest of the IOs are working fine. I tested this in two diffeent DDs and got the same results. Is this an expected behaviour? Am I missing something?
  2. Hi! Is there a way to configure the DD to be an SPI slave?
  3. From the example Digital_Spi.py I can get the following to work sending and receiving in the DD with a loopback cable: rgbTX = (c_ubyte*10)(0, 1, 2, 3, 4, 5, 6, 7, 8, 9) rgbRX = (c_ubyte*10)() rgdw = c_uint32() dwf.FDwfDigitalSpiSelect(hdwf, c_int(0), c_int(0)) # CS DIO-0 low dwf.FDwfDigitalSpiWriteRead(hdwf, c_int(1), c_int(8), rgbTX, c_int(len(rgbTX)), rgbRX, c_int(len(rgbRX))) # write to MOSI and read from MISO print("TX: "+str(numpy.fromiter(rgbTX, dtype=numpy.uint8))) print("RX: "+str(numpy.fromiter(rgbRX, dtype=numpy.uint8))) But I cannot get the same result using the individual write and read functions, like this: dwf.FDwfDigitalSpiWrite(hdwf, c_int(1), c_int(8), rgbTX, c_int(len(rgbTX))) # write array of 8 bit (byte) length elements dwf.FDwfDigitalSpiRead(hdwf, c_int(1), c_int(8), rgbRX, c_int(len(rgbRX))) # read array of 8 bit (byte) length elements print("TX: "+str(numpy.fromiter(rgbTX, dtype=numpy.uint8))) print("RX: "+str(numpy.fromiter(rgbRX, dtype=numpy.uint8))) Why is that?
  4. Thanks, @attila. How would a custom pattern file for UART protocol would look like? Would using a js script be a possibility?
  5. Hi, I want to use the DD to put a device under stress by sending UART messages at high speeds. I want to know how fast can it actually send messages using for example the python SDK (but I am open to other options to send messages faster). I measured the time in python that it takes to send messages and it is between 3 and 4ms, which is too slow for my purposes. Also I made a test using two DDs, one sending UART messages with the python SDK and the other one is receiving the messages. For the receiving one I used Waveforms with the logic analyzer to analyze the signal. Speeds are also between 3 and 4ms so I don't think python was a problem. Is it possible to program the DD to send messages without the need of calling a python function? Can I load the program in the DD? Would maybe VHDL be the way to go and is this possible with the DD? Or what kind of hardware do I need to achieve this?
  6. 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: And the third argument of FDwfDigitalSpiDataSet is: Thanks!
  7. I cannot find the examples for the SDK in Linux on the directory mentioned in the documentation: /usr/local/share/digilent/waveforms/samples/py As /usr/local/share/digilent does not exist. Are the examples somewhere else, maybe in a git repository? Thanks
  8. It somehow worked today after rebooting my computer, same code, same wiring, not sure what the issue was.
  9. I am trying to run the python UART example on a DD with a loopback between pins 24 and 25. I am using almost the same code from the example except that I am opening the first available device instead of the AD with configuration. print("Opening first device") dwf.FDwfDeviceOpen(c_int(-1), byref(hdwf)) # device configuration of index 3 (4th) for Analog Discovery has 16kS digital-in/out buffer # dwf.FDwfDeviceConfigOpen(c_int(-1), c_int(0), byref(hdwf)) Are the DIO for pins 24 and 25 selected correctly? I am doing the following as in the example: dwf.FDwfDigitalUartTxSet(hdwf, c_int(0)) # TX = DIO-0 dwf.FDwfDigitalUartRxSet(hdwf, c_int(1)) # RX = DIO-1 I am not getting any readings on the terminal though. Are there any obvious reasons? Am I missing something? Opening first device Configuring UART... Sending on TX for 10 seconds... Receiving on RX... Thanks, Alejandro
  10. Would it be possible to do a stress test on the DD with the python SDK? For example send data at a faster rate than it can receive/send back and measure at what rate does that happen?
  11. I was using an Ubuntu Virtual Machine running on Windows. Solved by using WIndows.
  12. HI, I am trying to test how fast I can read and write to the Digital Discovery using the Python SDK. I am using the DigitalIO example. I timed the FDwfDigitalIOStatus and FDwfDigitalIOInputStatusnoticed functions and got the following: FDwfDigitalIOStatus, (fetch info from device): 0.6s FDwfDigitalIOInputStatusnoticed, (read pins): 0.7s Is seems like a long time, is this as expected?
  13. Hi, thanks for the info. Is there a reference for this maybe somewhere in the SDK Reference? Should I assume that dwf.FDwfDigitalIOOutputEnableSet(hdwf, c_int(1<<9) enables pin 32? And will then dwf.FDwfDigitalIOOutputEnableSet(hdwf, c_int(0xFFFF) enable pins 24-39? Thanks,Alejandro
×
×
  • Create New...