Search the Community

Showing results for tags 'analog'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • New Users Introduction
    • Announcements
  • Digilent Technical Forums
    • FPGA
    • Digilent Microcontroller Boards
    • Non-Digilent Microcontrollers
    • Add-on Boards
    • Scopes & Instruments
    • LabVIEW
    • Other
  • General Discussion
    • Project Vault
    • Learn
    • Suggestions & Feedback
    • Buy, Sell, Trade
    • Sales Questions
    • Off Topic
    • Educators
    • Technical Based Off-Topic Discussions

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 26 results

  1. Hi there folks, great to meet you. Recently the company i work bought an Analog Discovery 2 to work with, and all I can say is - This is a great instrument, although I am using very small amount of its power. I have noticed something that lost me 2 days of work to discover that the problem is not my communication but in the way that the data is read by the AD2. The setup is like this - I have two boards communicating over I2C to each other and I am monitoring the messages in the Protocol part of the Waveforms. When i am sending large packets with more than 5 bytes of data there are some errors appearing on the tool but the messages actually are all right. My guess is that the discretization frequency is too small so it is getting errors in messages (i have seen this too when I have used the logic analyzer part of the software, although the I2C speed is 100kHz, when the scan frequency is smaller than 400kHz the protocol is not decoded in the right way.) There is no way(as far as I have tried) to adjust the frequency in Protocol mode. I am uploading pictures, hope it gets clear. Another thing is that the buffer that it stores the information from the protocol is quite large and the tool(waveforms) starts to work slowly, maybe it will be good to be able to adjust the size and flush the buffer more frequently. I will be glad to here from you is there a way to fix this issues. Thanks in advance.
  2. Hello, I'am writting my own software to setup an Analog Discovery 2 device and conduct some mesurements in C# using SDK library and wraper. I can connect with the device, disconnect and even retrieve some information such as serial no. I would like to have some sort of protection in case if device is rapidly unplugged from computer. In this particular circumstances in Waveforms software an error will occur. I have tried some sort of checking with use of enumerators but enumerators works poperly when device is connected. When device is disconnected last status is remaining and no error messages are visible. What I hve to do to solve this problem? Connecting with device: public bool AD2_Connect(ref int AErrorCode, ref int ANoOfAD2Devices) { bool AIsConnected = false; string AVersion = null; string ADeviceName = null; string ADeviceSn = null; // detect number of all connected supported devices dwf.FDwfEnum(dwf.enumfilterAll, ref ANoOfAD2Devices); // open automatically the first available device if (dwf.FDwfDeviceOpen(-1, ref hdwf)==0) { AIsConnected = false; } else { dwf.FDwfGetVersion(out AVersion); //get veriosn dwf.FDwfEnumDeviceName(0, out ADeviceName); //get device name dwf.FDwfEnumSN(0, out ADeviceSn); //get serial no AIsConnected = true; //set flag } dwf.FDwfGetLastError(ref AErrorCode); //get last error code string AErrorMsg = null; dwf.FDwfGetLastErrorMsg(out AErrorMsg); //get last error message return AIsConnected; //return flag } Then I need to check if device is still connected. My version of chceckig if device is disconnected or connected, but it doesn't work. int AIsUsed = -1; int ADevicesNo = -1; dwf.FDwfEnum(dwf.enumfilterAll, ref ADevicesNo); dwf.FDwfEnumDeviceIsOpened(0, ref AIsUsed);
  3. Hello I am a user of Analog Discovery2 and I believe it is missing one very important (for me at leas) function. I basically want to monitor and register the communication between two devices which use UART to do so. The Protocol panel looks great but I am able to register only one of the devices at the same time. Logic panel is very unfeasible in my case because I want to register many lines of the communication (like 5 min). Is there any way I can achieve that? Maybe there is a custom script which would help in my case?
  4. mitchpitch

    Analog shield DAC for galvo

    Is the analog shield's DAC range from -5V to 5V? My purpose is to use the shield for driving the x/y mirrors of a laser galvo. And is there information about the update frequency of the write function? Thanks in advance!
  5. spri

    AnalogOut Triggers

    I am trying to write a custom application using the SDK in python that will synchronize a number of pulses (with a variety of frequencies and pulse widths) on both the analog and digital pins, to synchronize several pieces of equipment in my lab. I would like to start a pulse on DIO-0 and let it run for several minutes, and then click a button which starts pulses on the two AWGs which are synchronized with the ongoing digital pulse. I think the best (or most straightforward?) way to do this is to enable or configure the analog pins on the button click, and then trigger the AnalogOut AWGs on the rising edge of the next digital pulse. The AnalogOut should pulse for a specified length of time (1-5seconds), then turn off while the digital pin keeps pulsing. The TriggerHoldOff command would be great so I can trigger the AWG on the next DIO pulse (but not all subsequent pulses), but it looks like it only exists for AnalogIn -- any other ideas on how do this? Also, is there a way to count the number of digital pulses which were sent before the AnalogOut was triggered?
  6. Hello all. New to WaveForms, so excuse me if this is too easy. I'd like to capture an analog channel, and two digital ones - where information is encoded into the width of the pulses. Sure enough, I can do this. But of the digital, one is PWM, which I'd like to manipulate into the corresponding stream of percentages (or 8-bit values, does not matter); the other one encodes the duration of something - therefore I'd like to measure their positive duration, as in a timer/counter... Can this be done in WaveForms with the AD2?
  7. I'm currently trying to synchronize analog pulses on both AWGs with digital pulses, and simultaneously run both analog scopes and the digital scope. I am trying to trigger all outputs and all scope acquisitions to happen simultaneously with a single PC-Trigger source using the SDK. First question: Why isn't there an AnalogInTriggerSlopeSet function? (You can set the TriggerSlope to rising edge for AnalogOut, DigitalOut, and DigitalIn). Without an AnalogInTriggerSlopeSet function, how do you set the AnalogInTrigger to respond to the same signal as the other three? Second Question: What prompts the change in Analog/DigitalInStatus from 'prefill' to 'armed' or 'done'? In the Acquisition code in the SDK, it looks like the status changes when the buffer fills? In my code below, why isn't it progressing to 2=Done to break out of the loop? It looks like it is getting stuck waiting for the trigger (which already happened). #digital pulse control setup self.dwf.FDwfDigitalOutEnableSet(hdwf, c_int(0), c_int(1)) # enable dIO pin 0 self.dwf.FDwfDigitalOutDividerSet(hdwf, c_int(0), c_int(int(hzSys.value/(100*self.qRate)))) # divider=internal clock/ (100counts*frequency) self.dwf.FDwfDigitalOutCounterSet(hdwf, c_int(0), c_int(100-self.qDuty), c_int(self.qDuty)) # set counts low, counts high from duty cycle print "configured digital output" # analog pulse control setup self.dwf.FDwfAnalogOutNodeEnableSet(hdwf, c_int(0), AnalogOutNodeCarrier, c_int(True)) self.dwf.FDwfAnalogOutNodeEnableSet(hdwf, c_int(1), AnalogOutNodeCarrier, c_int(True)) # for second channel set master the first channel, slave channel is controlled by the master self.dwf.FDwfAnalogOutMasterSet(hdwf, c_int(1), c_int(0)); self.dwf.FDwfAnalogOutNodeFunctionSet(hdwf, c_int(-1), AnalogOutNodeCarrier, funcSquare) self.dwf.FDwfAnalogOutNodeFrequencySet(hdwf, c_int(-1), AnalogOutNodeCarrier, c_double(self.xRate)) self.dwf.FDwfAnalogOutNodeAmplitudeSet(hdwf, c_int(-1), AnalogOutNodeCarrier, c_double(0.5)) self.dwf.FDwfAnalogOutOffsetSet(hdwf, c_int(-1), c_double(0.5)) self.dwf.FDwfAnalogOutNodeSymmetrySet(hdwf, c_int(-1), AnalogOutNodeCarrier, c_double(symm)) #pulse width self.dwf.FDwfAnalogOutNodePhaseSet(hdwf, c_int(1), AnalogOutNodeCarrier, c_double(self.x2Phase)) #phase shift for second channel self.dwf.FDwfAnalogOutRunSet(hdwf, c_int(-1), c_double(self.xDuration)) #set run duration on all channels self.dwf.FDwfAnalogOutIdleSet(hdwf,c_int(-1), c_int(0)) print "configured analog output" #configure digital input scope self.dwf.FDwfDigitalInDividerSet(hdwf, c_int(int(hzSys.value/(100*self.xRate)))) #same sample rate as xray self.dwf.FDwfDigitalInSampleFormatSet(hdwf, c_int(16)) # 16bit per sample format cSamples = 1000 # set number of sample to acquire rgwSamples = (c_uint16*cSamples)() self.dwf.FDwfDigitalInBufferSizeSet(hdwf, c_int(cSamples)) print "configured digital input" #configure analog input scope self.dwf.FDwfAnalogInFrequencySet(hdwf, c_double(int(hzSys.value/(100*self.xRate)))) self.dwf.FDwfAnalogInBufferSizeSet(hdwf, c_int(1000)) self.dwf.FDwfAnalogInChannelEnableSet(hdwf, c_int(0), c_bool(True)) self.dwf.FDwfAnalogInChannelRangeSet(hdwf, c_int(0), c_double(5)) self.dwf.FDwfAnalogInChannelEnableSet(hdwf, c_int(1), c_bool(True)) self.dwf.FDwfAnalogInChannelRangeSet(hdwf, c_int(1), c_double(5)) rg1 = (c_double*1000)() #rg = pointer to allocated buffer to copy the acquisition data rg2 = (c_double*1000)() #rg = pointer to allocated buffer to copy the acquisition data print "configured analog input" #set up PC trigger to start pulse output AND acquisition self.dwf.FDwfAnalogOutTriggerSourceSet(hdwf, c_int(0), trigsrcPC) self.dwf.FDwfDigitalOutTriggerSourceSet(hdwf, trigsrcPC) self.dwf.FDwfAnalogOutTriggerSlopeSet(hdwf, c_int(0), c_int(0)) # set channel 1 to trigger on rising edge self.dwf.FDwfDigitalOutTriggerSlopeSet(hdwf, c_int(0)) self.dwf.FDwfDigitalInTriggerSourceSet(hdwf, trigsrcPC) self.dwf.FDwfDigitalInTriggerSlopeSet(hdwf, c_int(0)) #rising edge self.dwf.FDwfAnalogInTriggerSourceSet(hdwf, trigsrcPC) # self.dwf.FDwfAnalogInTriggerSlopeSet(hdwf,) #this command doesn't exist for analogin! print "set up triggers" #configure everything to wait for trigger self.dwf.FDwfAnalogOutConfigure(hdwf, c_int(0), c_bool(True)) # start master, slave will follow self.dwf.FDwfDigitalOutConfigure(hdwf, c_int(1)) self.dwf.FDwfDigitalInConfigure(hdwf, c_bool(0), c_bool(1)) self.dwf.FDwfAnalogInConfigure(hdwf, c_int(1), c_int(1)) # starts both analog in pins (hdwf, bool-reconfigure, bool-start) print "initialized pins" #send the trigger self.dwf.FDwfDeviceTriggerPC(hdwf) print "PC trigger pulse sent" #plot the things sts = c_int() while True: #data acquisition status should == 5 - filling buffer self.dwf.FDwfDigitalInStatus(hdwf, c_int(1), byref(sts)) sts1 = sts.value self.dwf.FDwfAnalogInStatus(hdwf, c_int(1), byref(sts)) print ("analog status = " + str(sts.value)) print ("digital status = " +str(sts1)) if sts.value == DwfStateDone.value : #status ==2 = done print "acquisition complete" break When I run this, this is my printout:
  8. Hi, so I am trying to complete a project for one of my classes and I decided to us the script part of the analog discovery; however, there is not enough comments on the code to explain what it is specifically doing. I found an example code that is titled "Wavegenpiano". I would like to know if someone can explain what that code is doing., ie, what each part of the code is doing. I would like to use that code associated with a buzzer to output a song. TL;DR How can I use the script part of the analog discovery to have a buzzer output out a sound?
  9. """ DWF Python Example Author: Digilent, Inc. Revision: 2015/02/05 Requires: Python 2.7 Start synchronized the AWG outputs of multiple Analog Discovery devices. Connect the Trigger-1 pin of each device together. """ from ctypes import * import time import sys if sys.platform.startswith("win"): dwf = cdll.dwf elif sys.platform.startswith("darwin"): dwf = cdll.LoadLibrary("libdwf.dylib") else: dwf = cdll.LoadLibrary("libdwf.so") #print DWF version version = create_string_buffer(16) dwf.FDwfGetVersion(version) print "DWF Version: "+version.value cDevice = c_int() dwf.FDwfEnum(c_int(2), byref(cDevice)) # 2 = enumfilterDiscovery print "Found "+str(cDevice.value)+" devices" cChannel = 2 cOutput = cDevice.value*cChannel hdwf = c_int() #open device for iDevice in range (0, cDevice.value): dwf.FDwfDeviceOpen(c_int(iDevice), byref(hdwf)) if hdwf.value == 0: print "failed to open" quit() for iChannel in range (0, cChannel): print "Configure "+str(iDevice+1)+"/"+str(iChannel+1) # enable channel dwf.FDwfAnalogOutNodeEnableSet(hdwf, c_int(iChannel), c_int(0), c_int(True)) # 0 = AnalogOutNodeCarrier # configure dwf.FDwfAnalogOutNodeFunctionSet(hdwf, c_int(iChannel), c_int(0), c_int(1)) # 1 = funcSine dwf.FDwfAnalogOutNodeFrequencySet(hdwf, c_int(iChannel), c_int(0), c_double(1000.0)) dwf.FDwfAnalogOutNodeAmplitudeSet(hdwf, c_int(iChannel), c_int(0), c_double(1.0)) # set trigger source to external trigger 1 dwf.FDwfAnalogOutTriggerSourceSet(hdwf, c_int(iChannel), c_byte(11)); # 11 = trigsrcExternal1 #set different phase iOutput = iDevice*cChannel+iChannel dwf.FDwfAnalogOutNodePhaseSet(hdwf, c_int(iChannel), c_int(0), c_double(360.0*iOutput/cOutput)) # start the channel, this will wait for the trigger dwf.FDwfAnalogOutConfigure(hdwf, c_int(iChannel), c_bool(True)) # configure Trigger-1 pin to output the triggerPC signal for the last device dwf.FDwfDeviceTriggerSet(hdwf, c_int(0), c_byte(1)) # 1 = trigsrcPC # after open, before the first run wait a bit for the offsets to stabilize time.sleep(5) print "Pulse trigger to start generation..." dwf.FDwfDeviceTriggerPC(hdwf); time.sleep(60) print "done." dwf.FDwfDeviceCloseAll()
  10. After going through a range of the SDK examples, I'm running into some strange behavior that I'm hoping someone can help explain. The result I'm trying to achieve is sending out a low duty cycle pulse (Digital or Analog but something similar to a TTL) that triggers the repeated acquisition on the Analog Discovery. I can achieve this result using the GUI but would like to insert this process into a python script so I can process and save the data. When I route W1 into CH1 in the following example what I see is expected. However, when I try to route the digital out into CH1 things look extremely wonky. Again, I'd like to see a waveform that would be considered a PWM waveform that has a duty cycle of ~99% low and I'd like to be able to control that duty cycle with a reasonable degree of precision and accuracy. Any help would be appreciated and hope the solution is easy as I've been staring at this entirely too long. Am I just trying to put too many points into the digital out? Another potential solution that I'm not entirely sure how to implement, is loading a custom waveform from a file and running that through the waveform generator. Is there an example for that that would also fit with the DAQ needs? Cheers, Brian AnalogIn_Acquisition_5.py
  11. Hello, For a project in one of my courses my adviser asked me to find a way to control the sample rate and record length in the Analog Discovery in order to understand how to use the FFT module. Thank you, cjobi247
  12. Hello, is it possible to sample an external analog signal using the XADC? Or do I need the AMS101 Eval-Card for that? I'm using the Sony XC-HR50 analog Camera (datasheet: https://pro.sony.com/bbsc/ssr/product-XCHR50/ ), which has a CCD Sensor. I am very new to Zedboard and trying do save the picture of the camera. Thank you, kind regards The Video Output is shown below:
  13. I'm trying to take accurate readings using the "Logger" module in Waveforms 2015. When I power up a simple DC circuit with +5V, and use a DMM I get readings of ~4.44 volts. However when I run the data logger module, all of the readings are <100 mV. Shouldn't the logger be reading ~4.44 volts, or is there some configuration I am missing Thanks in advance!
  14. Hello, I'm a newbie using the Analog Discovery (Legacy), and attempting to run through a few experiments. When using the Power Source or "Supplies" tool in Waveforms 2015, all the directions and manuals show a dropdown menu where you can adjust the voltage (0-5V). The manual from Digilent's own website SPECIFICALLY regarding the Analog Discovery Legacy shows this as an option as well. I can't find any such option however in my program, it just isn't there. I should mention that I am powering the AD itself via USB from my laptop, but I don't think that is the issue as according to the status I am outputting ~5V via USB just fine, and the manual also shows the dropdown while being powered by USB. I also don't know what the little green bar underneath is supposed to represent, as it moves up only partially seemingly to random places when I turn on the "Master" enable, in case that it something to be concerned about. Any help is appreciated. Thanks!! P.S. Sorry for the re-post I realized I put this question outside the "Waveforms" Forum.
  15. Hello folks, I'm a newbie using the Analog Discovery (Legacy), and attempting to run through a few experiments. When using the power source tool via Waveforms 2015, all the directions and manuals show a dropdown menu where you can adjust the voltage (0-5V). The manual from Digilent's own website SPECIFICALLY regarding the Analog Discovery Legacy shows this as an option as well. I can't find any such option however in my program. I should mention that I am powering the AD itself via USB from my laptop, but I don't think that is the issue as according to the status I am outputting ~5V via USB just fine. I also don't know what the little green bar underneath is supposed to represent, as it moves up only partially seemingly to random places when I turn on the "Master" enable. Any help is appreciated. Thanks!
  16. I have been working with the Digilent analog shield for quite some time now, and initially, using its functions was an easy task and calling analog.read and analog.write in my main loop presented no trouble. Fast forward to today, every time I have called analog.write(the only analog shield function i need) in my main loop code, it seems to fail. The code function is called in a large menu setup and the code isn't the cleanest, but I have put in print statements both before and after the code is called. Both statements are printed in the Serial monitor, ensuring that the arduino is certainly reading the analog.write code, but whenever i test a channel, the output does not change from what was initially written out in the code's setup function. if someone could describe what is happening, that would be grand. please help.
  17. energyzappa

    Zero error - Analog Shield ?

    With the Analog shield mounted on an Arduino Leonardo, I'm seeing a zero error at each of the analog inputs with a zero voltage input or the Arduino's Ground connected to the analog pin. Using the signed read in non-differential mode, the A0 input reads -65 counts, A1 input reads -75, A2 input reads 85 and A3 reads -65. Is there any adjustment that I can make to the board to reduce this zero error? This zero error persists even when I switch from powering the board through the USB to a wall wart power supply. Thanks
  18. All: I'd like to get your thoughts on the following question: In https://reference.digilentinc.com/_media/cmod_a7/cmod_a7_rm.pdf, page 9. The Analog input circuit describes using a voltage divider to step a 0 to 3.3 range to 0 to 1 as required by the analog inputs. What I am also noting (and have measured) is that the input has a 3.3K impedance. I've been trying to get a TMP36GZ temperature monitor to work with this input and now suspect based on this temperature sensor's spec that the 3.3K draws too much current for this high impedance device. Has anyone else had any experience with limitation on the these analog inputs due to their lower impedance? Peter
  19. Benjamin7785

    AnalogShield on Arduino Mega2560

    Hi all, because I was running out of memory on my Arduino UNO using the analogShield I changed to the Arduino Mega2560. As it turned out, the Arduino Mega2560 is not officially supported with the library from the digilent resource center. However, there is a modified lib on github which supports the Mega2560 almost flawlessly. Here is the Link: https://github.com/wespo/analogShield The only modification I had to do was to bend away pin 11,12,13 of the digilent analogshield. This way the 6pin SPCI port is used for SPI communication. (The mega2560 doesn't use SPI on pin 11,12,13) Ben
  20. Are Analog Shield and Network Shields are compatible with the chipKIT Max32 at the same time? If so are there any special considerations? Thanks you for any help you can provide.
  21. Hello, I have an Analog Discovery and I recently installed WaveForms version 3.3.5 (I actually found it a bit ambiguous how to install WaveForms. I attached an image below of the files I downloaded from Digilent. All I did was click and drag the framework into the corresponding directory and likewise for the application. Then I ran the driver installer). I am running Mac OS X El Capitan 10.11.5 on my Mac laptop. When I look under the USB device tree in System Information I can see "Digilent USB Device" but when I open up WaveForms it alerts "No device detected". Would anyone know how to solve my issue by chance? Any help is very much appreciated.
  22. Hello: I am trying to better understand the functionality of the Chipkit Max32 board with respect to the analogWrite command. I have been testing pins A4, A5, 21, 23, 44 and 45 using the anlogWrite function. I am testing each pin separately, i.e. one at a time. I have the pin connected to ground through a 180Ohm resistor and monitoring the voltage across the resistor using an oscilloscope. I am using the following code changing the pin number in the analogWrite for each pin: void setup() { Serial.begin(9600); } void loop() { for (int i=0;i<256;i++){ analogWrite(4,i); delay(5000); Serial.print(i); Serial.println(""); } } I am using the delay(5000) command to give me enough time to monitor and measure the oscilloscope value and the Serial.print function to know where I am in the code execution. When I test the A4 and A5 pins, I measure 0V, regardless of the value written with the analogWrite. When I test the 21, 23, 44 and 45 pins the voltage is 0 until a value of 127 is reached. above 127 the voltage is 3.3V., constant. Do I need to initialize any other values for the analogWrite to function properly? Thank You
  23. Hello everyone, and thanks in advance for reading this! On a current project, I’m working with a network of Arduino UNOs R3, each with an AnalogShield installed (to be precise, it’s 4 Arduinos+AnalogShields total, communicating over I2C). I immediately found a problem when I connected all their Vin ports together to a 12V power supply: they sourced too much current (my main power supply was reading more than 1 A!). So I quickly stopped that and tried connecting the 5V ports together to a 5V power supply. At first this was OK, but soon they started to source too much current again. I also tried powering one of them via USB and connecting all the 5V ports together… This works most of the time, but some times the 5V line’s voltage oscillates badly or they start sourcing too much current again... It's funny because sometimes things seem to work, and then stop working. I checked the health of all Arduinos and they are perfect. And I checked powering all Arduinos by themselves (no shields) both through their Vin and 5V ports, and that works with no issues... So it must be an issue with the AnalogShields... For the moment, as a temporary measure, I’m powering all of them independently through their USB ports, and connecting only their grounds together. But in my final configuration I’d like to be able to power all of them with a single power supply. Can anybody point to where the issue could be?
  24. Question 1: I changed a little bit to print out the value on passthrough code: #include <analogShield.h> //Include to use analog shield.#include <SPI.h> //required for ChipKIT but does not affect Arduino void setup(){ //no setup Serial.begin(9600); } unsigned int count = 0;void loop(){ count = analog.read(1); //read in on port labeled 'IN0' Serial.println(count); analog.write(0, count); //write out the value on port labeled 'OUT0'} I read values for all ADC pins 0->3. And I see that A0,A2,A3 read correct values with 32,000 for 0V, But for A1, this value is around 2200. Could you help me explain why that happens? Is that the Shield damaged ? Question 2: Is the default value around 45k, if I dont read anything ? COuld you help me answer ASAP ? Thank you
  25. attila

    Waveforms-3 On Zybo

    Here you can find instructions on how to set up Linux and WaveForms 3 for Zybo: http://www.instructables.com/id/WaveForms-Analog-Discovery-on-Zybo/