Jump to content

Bruno

Members
  • Posts

    6
  • Joined

  • Last visited

Bruno's Achievements

Newbie

Newbie (1/4)

0

Reputation

  1. Hi @attila I manage to create a pulse at 1V8 during 1.1 ms using the Digital Discovery. I have 1 question that remains : How can I ouput 5V with the DD? In the Reference manual it's says that it's possible at least to read 5V signals. (Shall I use VIO? how can I address to that PIN ?) For this issue this is what I tried : """ DWF Python Example Author: Digilent, Inc. Revision: 2020-04-07 Requires: Python 2.7, 3 """ from ctypes import * from dwfconstants import * import math import time import sys 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") version = create_string_buffer(16) dwf.FDwfGetVersion(version) print("DWF Version: "+str(version.value)) print("Opening first device") hdwf = c_int() dwf.FDwfDeviceOpen(c_int(-1), byref(hdwf)) if hdwf.value == 0: print("failed to open device") szerr = create_string_buffer(512) dwf.FDwfGetLastErrorMsg(szerr) print(str(szerr.value)) quit() # the device will only be configured when FDwf###Configure is called dwf.FDwfDeviceAutoConfigureSet(hdwf, c_int(0)) hzSys = c_double() dwf.FDwfDigitalOutInternalClockInfo(hdwf, byref(hzSys)) # 1kHz pulse on IO pin 25 dwf.FDwfDigitalOutEnableSet(hdwf, c_int(1), c_int(1)) #GPIO 1 to get PIN 25 # prescaler to 2kHz, SystemFrequency/1kHz/2 #dwf.FDwfDigitalOutDividerSet(hdwf, c_int(0), c_int(int(hzSys.value/1e3/2))) # 0 tick low, 1 tick high dwf.FDwfDigitalOutCounterSet(hdwf, c_int(1), c_int(0), c_int(1)) # set 5V digital IO voltage for devices which support dwf.FDwfDeviceParamSet(hdwf, DwfParamDigitalVoltage, 5000) # mV dwf.FDwfDigitalOutConfigure(hdwf, c_int(1)) print("Generating output for 10 seconds...") time.sleep(10) dwf.FDwfDigitalOutReset(hdwf) dwf.FDwfDeviceCloseAll() Unfortunately, I only have a 3V2 output and not a 5V output. Source : https://digilent.com/reference/test-and-measurement/digital-discovery/reference-manual Section 9.2. Multi-purpose Digital I/O
  2. The same phenomena happens when I launch DigitalOut_Pulse.py But if I launch DigitalOut_Pins.py I get a nice clean signal at 1V2 and then no noise anymore. (In the image you see DigitalOut_Pulse.py followed by DigitalOut_Pins.py)
  3. Hi @attila I manage to get a Digital Discovery (I guess it's the DD1). When I launch your code DigitalOut_Pulse2.py without doing anything I get noise picked up by the digital channel (see D15 Channel 15). Also, I get a Vrms value at 700mV instead of the 1V8 written in the code. Do you happen to know why?
  4. Hi @attila I have downloaded the new software and installed everything, now "DwfParamDigitalVoltage" is recognized. Thank you ! Though, when I run your program I measure 3.3 Volts with my Logic Analyzer each time it sends a pulse. I don't know why it doesn't send a 1.8 V pulse... When I try to do it manually through WaveForms, like written in my first post, I measure as well 3.3 V. So I cannot even do it manually... What should I do? Best Regards,
  5. Hi @attila Thank you for your message. I tried to do something similar but when you do this : # set 1.8V digital IO voltage for devices which support dwf.FDwfDeviceParamSet(hdwf, DwfParamDigitalVoltage, 1800) # mV VSCode tells me that "DwfParamDigitalVoltage" is not defined. Which is an error that I had. How can I download the latest SDK please? Best Regards
  6. Hello, I have an Analog Discovery 2 board and I would like to perform a digital output pulse at 1V8 (pulse duration of 1.1ms). I have to create an interruption in my I2S Clock and what it has been done previously was that to create a pulse with the digital output 0. But the problem is that it doesn't work all the time when I launch their script. When I do it manually with the WaveForm Software 3.15.2 it works only if I set the Digital Input to 1V8 ("Settings->Device manager" tab). In the picture attached you can see 2 Digital Input 1V8 and both configuration work. Then I proceed to Switch->Push/Pull and when the value goes to 1, the I2S clock stops immediately (which is what I want). Can I find an API to do it in the SDK? I mean... I can do it on the WaveForm... Best Regards,
×
×
  • Create New...