Jump to content

attila

Technical Forum Moderator
  • Posts

    6,486
  • Joined

  • Last visited

Community Answers

  1. attila's post in Looking for alternative way to interface with the Electronics Explorer... My USB is DESTROYED. was marked as the answer   
    Hi @cjones
    The usb socket can be soldered to the top layer, shield to gnd, just be careful to not get solder in the socket.
    You could replace the socket if broken or solder the usb wires to the pads, but pay attention for correct order: vbus, d-/+, id, gnd


  2. attila's post in Running Self Created Executable File from Script was marked as the answer   
    Hi @CFalardeau97
    It the application is in the PATH or next to the app then it can be called just by name (like: ping, cmd, ...) otherwise the full path should be used, like: Tool.start("C:/test/myapp.exe").
    The argument array is optional, depends on your app.
    The work directory is also optional, it depends if you need this for your app or not.
    In some cases the app may need to be open like this:
    Tool.start("cmd", ["/c myapp.exe"], "C:/test/")
  3. attila's post in 3.3V to 5V Level Shifter Circuit for Open-Source data line to be used with Digital Discovery pattern generator and logic analyzer was marked as the answer   
    Hi @s4fq7
    Search for: 3.3 5v bidirectional level converter module

  4. attila's post in WaveForms missing inputs for ROM logic was marked as the answer   
    Hi @FelixJ
    For ROM logic the first DIOs are use as address bits with a width of custom buffer size. For the first/default device configuration with 1Ki Patterns buffer the address space is 10bits so DIO 0 to 9 can be used as input for the ROM logic. With the 4th and 7th 16Ki DIO 0-14
    https://digilent.com/reference/waveforms_-_rom_logic

  5. attila's post in [Hardware] Digilent Digital Discovery - Logic Probes was marked as the answer   
    Hi @JeromeBoateng
    100R, see:
    https://digilent.com/reference/test-and-measurement/digital-discovery/reference-manual#accessories
    https://digilent.com/reference/_media/reference/test-and-measurement/digital-discovery/250-104_dp_2.54_3.pdf
  6. attila's post in Getting a little confused regarding horizontal position and Record mode was marked as the answer   
    Hi @klaff
    For Record more adjust the trigger position and others under the first Config button.
  7. attila's post in Configure ADP5250 as single channel was marked as the answer   
    Hi @pablo_gatearray
    For WF v3.18.29 or newer disabling of one of the channels will allow 1GHz, for earlier versions use the second configuration under Settings/ Device Manager.

  8. attila's post in Use AD2 as a feedback system was marked as the answer   
    Hi @soak
    The TimeOfIndex() refers to the sample index position in the capture.
    The Time.taken for AD2 is software capture time and for ADP3,5 high precision software trigger time.
    For high refresh rate set no trigger, high sample rate and low number of samples. 
    Use config() to apply the Wavegen changes immediately otherwise sometime during a wait() will be applied.

    Scope.run(); Wavegen.run(); var last_time = 0; var last_voltage; while(true){ if(!Scope.wait()) throw "Stopped"; var time = Scope.Time.taken; var voltage = Scope.Channel1.measure("Average"); if(last_time){ ... Wavegen.Channel1.Simple.Offset.value = err; Wavegen.Channel1.config(); } last_time = time; last_voltage = voltage; }  
  9. attila's post in Digital Discover API function to change the internal clock frequency was marked as the answer   
    Hi @YYY
    hzTry = c_double(99e6)
    dwf.FDwfAnalogIOChannelNodeSet(hdwf, c_int(0), c_int(6), hzTry) 
    # FDwfAnalogIOConfigure(hdwf) if you are using dwf.FDwfDeviceAutoConfigureSet(hdwf, c_int(0))
    hzDev = c_double()
    dwf.FDwfAnalogIOChannelNodeStatus(hdwf, c_int(0), c_int(6), byref(hz)) 

  10. attila's post in Getting command line prints from scripts (not the output window) was marked as the answer   
    Hi @ebrown
    Warnings are fixed in the latest version:
     
  11. attila's post in Is there a Digilent Cable Driver for Win11 on ARM was marked as the answer   
    Hi @Peter0201
    The general driver should be good. This driver is new, it wasn't there when I've last checked.
    The Xilinx software for Windows is available for 32/64bit Intel architecture. The kernel mode driver should run on OS architecture.
    You are running on Mac Arm -> Parallels -> Windows Arm and this performs virtualization to Intel application, ARM driver and Intel software.
    Is it possible or have you tried using 32/64bit Intel Windows? This should be more backward compatible since it would require Intel drivers.
    Probably @malexander could tell you more about the plans on software support.
  12. attila's post in Corrupted output when using Play mode and logic capture was marked as the answer   
    Hi @AlanB
    With this setup you are reaching the DDRam bandwidth limit which is a bit above 800MBps.
    In the test script the input would need 800MBps and the output additional 40MBps.
    The normal digital-out/Patterns custom mode each DIO has 32Ki sample buffer.
    If you only need up to this number of samples you don't have to use play.
  13. attila's post in Why can't I use IO 39 like I can use the rest of the DIO? was marked as the answer   
    Hi @Alejandro-Dev
    With clock stretching option enabled only the first DIOs can be selected and all these will be used/driven for I2C state machine.
    For Digital Discovery with 32Ki sample Pattern Generator buffer the first 15 DIOs, for Analog Discovery with 1Ki the first 10 DIOs... can be used
    Without FDwfDigitalI2cStretchSet any DIO can be used.

  14. attila's post in Corrupt signal using Digital Discovery Play Mode was marked as the answer   
    Hi @AlanB
    It is fixed in the latest version:
    Thank you for the observation.
  15. attila's post in Digital Discovery, Play mode was marked as the answer   
    Hi @AlanB
    Each digital-out (pattern generator) wire can be configured to generate independently a pulse or a custom pattern at a different rate, length... With the Digital Discovery up to 32Ki samples for each wire.
    With the Play mode a digital pattern of 1, 2, 4, 8 or 16bit wide and up to 256MiByte can be downloaded to the device DDRam and generated at up to 100MHz. This will be output at the same rate on 1,2,4,8or16 consecutive wires.
  16. attila's post in Protocol I2C not reading 16bits address was marked as the answer   
    Hi @Joao Paulo
    The sub/register address is not read but written by the master.
    See the following post:
     
  17. attila's post in Digital Discovery Pattern Generator with external trigger to start the pattern output was marked as the answer   
    Hi @Hakon
    It may be better to start the analog-in to reset the trigger detector... dd.py
    dwf.FDwfDigitalInConfigure(hdwf, c_int(1), c_int(1))
    I see ~10ns jitter due to the 100MHz system frequency and about 200ns latency, 202-211ns for 10ns wait.


  18. attila's post in Access to more information in custom logic script was marked as the answer   
    Hi @Someone
    It can be done like this:

     
    // 10us right shift var i0 = round(hzRate*10e-6) var cs = rgData.length for(var i = i0; i < cs; i++){ rgFlag[i] = 1; rgValue[i] = rgData[i-i0]&1; // DIO-0 }  
  19. attila's post in Pattern generator sample buffer size was marked as the answer   
    Hi @AlanB
    You could use the 4th device configuration with 16Ki digital-io/out sample buffer.
    FDwfDeviceConfigOpen(#, 3, &hdwf)
    There is no digital play mode with AD2 but only with Digital Discovery.
     
  20. attila's post in Changing Scope Time Average setting through script was marked as the answer   
    Hi @david2
    Scope.Trigger.Average.value
    See:

     
  21. attila's post in Changing Scope Time Average setting through script was marked as the answer   
    Hi @david2
    Scope.Trigger.Average.value
    See:

     
  22. attila's post in Coherent averaging for network analyzer was marked as the answer   
    Hi @Robin Oswald
     
  23. attila's post in WaveForms SDK: Silent Crash (Multiple Analog Discovery II's) was marked as the answer   
    Hi @maling
    I run the following code with 10 device for more than 10minutes several times without any problem.
    multi.py similar to your GetSpectra()

     
    I only got error when disconnecting the USB cable:


    At which function it fails for you?
    For the error message use print(szerr.value) or cast the C string.
    from ctypes import * import sys import time from dwfconstants import * if sys.platform.startswith("win"): dwf = cdll.dwf elif sys.platform.startswith("darwin"): dwf = cdll.LoadLibrary("/Library/Frameworks/dwf.framework/dwf") else: dwf = cdll.LoadLibrary("libdwf.so") szerr = create_string_buffer(512) def FDwf(fun, args): if fun(*args) == 0: dwf.FDwfGetLastErrorMsg(szerr) print(szerr.value) raise #dwf.FDwfParamSet(DwfParamOnClose, c_int(1)) # 0 = run, 1 = stop, 2 = shutdown cDevice = c_int() dwf.FDwfEnum(c_int(0), byref(cDevice)) print("Devices: "+str(cDevice.value)) hdwfs = [] for k in range(cDevice.value): hdwf = c_int() FDwf(dwf.FDwfDeviceOpen, [c_int(k), byref(hdwf)]) hdwfs.append(hdwf) for k in range(len(hdwfs)): FDwf(dwf.FDwfAnalogImpedanceReset, [hdwfs[k]]) FDwf(dwf.FDwfAnalogImpedanceModeSet, [hdwfs[k], c_int(8)]) # 0 = W1-C1-DUT-C2-R-GND, 1 = W1-C1-R-C2-DUT-GND, 8 = AD IA adapter FDwf(dwf.FDwfAnalogImpedanceReferenceSet, [hdwfs[k], c_double(1e3)]) # reference resistor value in Ohms FDwf(dwf.FDwfAnalogImpedanceFrequencySet, [hdwfs[k], c_double(1e3)]) # frequency in Hertz FDwf(dwf.FDwfAnalogImpedanceAmplitudeSet, [hdwfs[k], c_double(1)]) # 1V amplitude = 2V peak2peak signal FDwf(dwf.FDwfAnalogImpedanceConfigure, [hdwfs[k], c_int(1)]) # start tstart = time.time() sts = c_byte() for j in range(100): # repeat for i in range(100): # steps for k in range(len(hdwfs)): # device print("repeat: "+str(j)+" step: "+str(i)+" dev: "+str(k)) FDwf(dwf.FDwfAnalogImpedanceFrequencySet, [hdwfs[k], c_double(1e3+99e3*i/99)]) # frequency in Hertz # Once you set a value, it will start its measurement routine automatically time.sleep(0.01) for k in range(len(hdwfs)): FDwf(dwf.FDwfAnalogImpedanceStatus, [hdwfs[k], None]) # ignore last capture since we changed the frequency # Read the result from each of the devices, once they complete. for k in range(len(hdwfs)): hdwf = hdwfs[k] while True: FDwf(dwf.FDwfAnalogImpedanceStatus, [hdwf, byref(sts)]) if sts.value == 2: break # Compute the resistance and reactance from the harvested values resistance = c_double() reactance = c_double() FDwf(dwf.FDwfAnalogImpedanceStatusMeasure, [hdwf, DwfAnalogImpedanceResistance, byref(resistance)]) FDwf(dwf.FDwfAnalogImpedanceStatusMeasure, [hdwf, DwfAnalogImpedanceReactance, byref(reactance)]) print("Done with "+str(len(hdwfs))+" devices in "+str(time.time()-tstart)+"s") dwf.FDwfDeviceCloseAll()  
  24. attila's post in AD2 Network analyser was marked as the answer   
    Hi @Malcolm
    It should be able to measure the phase. The NA can use FFT mag/phase averaging and in the latest beta version added coherent average mode for testing.

    See a related post:
     
  25. attila's post in How to control the power supply of Analog Discovery 2 on MATLAB? was marked as the answer   
    Hi @TheoMaria
    As it is in the second example:
     If you are using the DAQ do not call FDwfDeviceOpen since the device can be opened only once at a time.
     The DAQ will open the device the hdwf will get value 1 and use this in the FDwf functions.
    I've modified your example: Waveform_Generation2.m
    ... %% Power Supply % Load library, "hfile" is a variable that points to the location of the library % dummy read to open device data = read(dq, seconds(1)); if ~libisloaded('dwf') loadlibrary('dwf', 'C:/Program Files (x86)/Digilent/WaveFormsSDK/inc/dwf.h'); end if calllib('dwf','FDwfAnalogIOStatus', 1) == 0 % see if device is connected disp('No opened device') return else disp('Enable PS') calllib('dwf','FDwfAnalogIOChannelNodeSet', 1, 0, 0, 1.0); % V+ enable calllib('dwf','FDwfAnalogIOChannelNodeSet', 1, 0, 1, 5.0); % V+ 5V calllib('dwf','FDwfAnalogIOChannelNodeSet', 1, 1, 0, 1.0); % V- enable calllib('dwf','FDwfAnalogIOChannelNodeSet', 1, 1, 1, -5.0); % V- -5V calllib('dwf','FDwfAnalogIOEnableSet', 1, 1); % master enable pause(1) % wait to settle end unloadlibrary('dwf') %% Generate a Periodic Waveform and Record Input ...  
×
×
  • Create New...