Jump to content

ssm

Members
  • Posts

    65
  • Joined

  • Last visited

Posts posted by ssm

  1. Hello everyone,

    I am trying to use the digital discovery board to read a series of raw 32 bits coming through pins 0 to 31. There are many examples I looked at, but all of them uses 16 bit int for the sample. I need to read them as samples, each 32 bits. I tried using the waveforms and it worked nicely. It even gave me the option to read them as unsigned numbers in decimal format which is what I need.

    any help is greatly appreciated,

    Here is a segment of my code:

    FDwfDigitalInInternalClockInfo(hdwf, &hzSys);

    FDwfDigitalInDividerSet(hdwf, hzSys/2e5); // sampling at 200KHz

    FDwfDigitalInSampleFormatSet(hdwf, 32); // so the size of the sample is 32 bits

    FDwfDigitalInBufferSizeInfo(hdwf, &cSamples);

    // default buffer size is set to maximum

    rgwSamples = new unsigned int[cSamples]; // here is the problem, the type is 16 bits, so I am reading 16 bit signed (although declared unsigned)

    // set trigger position to the middle

    FDwfDigitalInTriggerPositionSet(hdwf, cSamples/2); // not sure about this, it was in one of the examples

    // trigger on any pin transition

    FDwfDigitalInTriggerSourceSet(hdwf, trigsrcDetectorDigitalIn);

    FDwfDigitalInTriggerAutoTimeoutSet(hdwf, 10.0);

    //FDwfDigitalInTriggerSet(hdwf, 0,0,0xFFFFFFFF,0xFFFFFFFF); // I tried this, it did not work

     FDwfDigitalInConfigure(hdwf, true, false);

    // begin acquisition

    FDwfDigitalInConfigure(hdwf, false, true); // start

    do{

             if(!FDwfDigitalInStatus(hdwf, true, &sts)) return 0;

    }while(sts != stsDone);

    // get the samples

    FDwfDigitalInStatusData(hdwf, rgwSamples, cSamples*sizeof(unsigned int)); // again the size of the sample here is 16 but this is the only thing the worked

     

    thank you

    Sam

  2. but all these examples are with the AD2 not the DD board, are there any c coded examples on the digital discovery board?

    I am getting the following error:

    Open automatically the first available device

    Device open failed

    Device not supported. No compatible configuration found. Update Digilent WaveForms.

    FDwfDeviceOpenEx

     

    when I try to open using "FDwfDeviceConfigOpen"

  3. thank you for the reply, I installed the latest version 3.21.25, btw Waveforms is working well, it is the SDK that is showing the error. 

    Compiling the code along with the link to dwf is working fine, it is just when I execute, it shows the error above. I have iMAC i5 processor with Sonoma 14.2.1. OS

     

    image.thumb.png.58e8df8e43d13413646eaf08ae982f69.png

  4. Hi 

    I am having problems running SDK on iMAC, Sonoma 14.2.1. The code is compiling fine but when I execute, I get the following: dyld[XXX]: Library not loaded: @rpath/dwf.framework/Versions/A/dwf

    Reference from: ...

    Reason: no LC_RPATH's found

    any ideas?

    thanks

    sm

  5. Hi @attila

    thank you for the great help,

    I am trying to compile my SDK code on a new linux ubuntu machine and I am getting the following:

    /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/libdwf.so: undefined reference to `DmgtConfigureFPGA'
    /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/libdwf.so: undefined reference to `DstmIO32'
    collect2: error: ld returned 1 exit status
    make: *** [Makefile:3: all] Error 1

    any help is highly appreciated

    ssm

  6. yes, that is correct, note that the signal is 5+/-0.1 V, since it is greater than 5v I put the range to be 50V, otherwise I am not using the full range of 50V

    additional note, the following is working fine:

     the signal pk2pk is +/- 0.1V and the offset is 4.8 V

    I am using the following code:

    FDwfAnalogInChannelRangeSet(hdwf, 0, 0.2);
    FDwfAnalogInChannelOffsetSet(hdwf, 0, 4.8);  

    image.thumb.png.e03df6b1939f5655369f09f7a801bbbb.png

     

  7. thank you @attila

    well my experiment is that I am using a constructed custom signal, this signal is run once and the result is collected during this run,

    the duration of this signal is short (I have different cases, some cases is in the us) I need to offset this signal, i tried to embed the offset in that signal it did not work, I tried to use the offset from the board, it did not work, so that is why I am using the PPS V+, I can switch it ON and wait before I start my experiment

    ssm

  8. Dear Help,

    I am trying to use the programmable power supply as an offset for a signal. Using the offset with the WaveGen is not working because it is taking a long time to reach the target offset I need, so I am just using a dc power source instead.

    Can I use the V+ and ground to use as a power source in the circuit? I only need the positive voltage, up to 3.7V, is that possible?

    I can see this example in the SDK set (if you can point me to more examples I will be grateful):

    // set up analog IO channel nodes

        // enable positive supply

        FDwfAnalogIOChannelNodeSet(hdwf, 0, 0, 1);

        // enable negative supply

        FDwfAnalogIOChannelNodeSet(hdwf, 1, 0, 1);

        // master enable

        FDwfAnalogIOEnableSet(hdwf, true);

        printf("Total supply power and load percentage:\n");

        for(int i = 0; i < 60; i++){

            // wait 1 second between readings

            Wait(1);

            // fetch analogIO status from device

            FDwfAnalogIOStatus(hdwf);

            // supply monitor

            FDwfAnalogIOChannelNodeStatus(hdwf, 3, 0, &vSupply);

            FDwfAnalogIOChannelNodeStatus(hdwf, 3, 1, &aSupply);

            wSupply = vSupply * aSupply;

            prcSupply = 100 * (aSupply / 0.2);

            printf("%.3lf W \t%i%%\n", wSupply, prcSupply);

                // in case of over-current condition the supplies are disabled

            FDwfAnalogIOEnableStatus(hdwf, &fOn);

            if(!fOn){

                // re-enable supplies

                FDwfAnalogIOEnableSet(hdwf, false);

                FDwfAnalogIOEnableSet(hdwf, true);

            }

        }

  9. Dear Help,

    I am trying to sync the scope in reading a signal applied using WaveGen for measurement,

    here is the code/pseudocode for the scope:

    SampleRate = 170.4997

    NoSamples = 302

    MaxVdd = 0.5

                    FDwfAnalogInChannelEnableSet(hdwf, -1, true);

                    FDwfAnalogInAcquisitionModeSet(hdwf, acqmodeSingle);

                    FDwfAnalogInChannelRangeSet(hdwf, -1, 2);

                    FDwfAnalogInFrequencySet(hdwf, SampleRate);

                    FDwfAnalogInBufferSizeSet(hdwf, NoSamples);

                    FDwfAnalogInTriggerSourceSet(hdwf, trigsrcAnalogOut1);

                    //(samples/2-10)/frequency

                    FDwfAnalogInTriggerPositionSet(hdwf, (NoSamples/2 -10) / SampleRate);

                    FDwfAnalogInTriggerAutoTimeoutSet(hdwf, 1.0);

                    FDwfAnalogInTriggerTypeSet(hdwf, trigtypeTransition);

                    FDwfAnalogInTriggerLevelSet(hdwf, 0.0);

                    FDwfAnalogInTriggerConditionSet(hdwf, trigcondRisingPositive);

                    FDwfAnalogInChannelFilterSet(hdwf, -1, filterAverage);

                    FDwfAnalogInConfigure(hdwf, true, false);

    WaveGen setting

    MeasurementTime = NoSamples/SampleRate

    CustomSignalFreq = 1/MeasurementTime

                    FDwfAnalogOutNodeEnableSet(hdwf, 0, AnalogOutNodeCarrier, true);

                    FDwfAnalogOutNodeFunctionSet(hdwf, 0, AnalogOutNodeCarrier, funcCustom);

                    FDwfAnalogOutNodeOffsetGet(hdwf, 0, AnalogOutNodeCarrier, &pvoltOutOffset);

                    for (int i1=0; i1<NoSamples; i1++) {

                        InputFileSamples[i1]=(OriginalInputFileSamples[i1]-pvoltOutOffset)/EXP->MaxVdd;

                    }

                    FDwfAnalogOutNodeDataSet(hdwf, 0, AnalogOutNodeCarrier, InputFileSamples, NoSamples);

                    FDwfAnalogOutNodeFrequencySet(hdwf, 0, AnalogOutNodeCarrier, CustomSignalFreq);

                    FDwfAnalogOutRunSet(hdwf, 0, 1.0 / CustomSignalFreq);

                    FDwfAnalogOutNodeAmplitudeSet(hdwf, 0, AnalogOutNodeCarrier, MaxVdd);

    image.thumb.png.3de801663905b59dadf0afc8e35c6a80.png                

    The Measured Signal is the one read by the scope and it is supposed to be like the signal above it,

    please can you tell me what am I doing wrong?

    thank you for the help,

    ssm

  10. Hi @attila

    thanks for the reply,

    it seems to remove the package, otherwise if I keep it and try to compile my code it doesn't complete:

    sudo apt --fix-broken install

    Reading package lists... Done

    Building dependency tree       

    Reading state information... Done

    Correcting dependencies... Done

    The following packages will be REMOVED:

      digilent.waveforms

    0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.

    1 not fully installed or removed.

    After this operation, 51.2 MB disk space will be freed.

    Do you want to continue? [Y/n] y

    (Reading database ... 94853 files and directories currently installed.)

    Removing digilent.waveforms (3.17.1) ...

    Processing triggers for mime-support (3.62) ...

    Processing triggers for gnome-menus (3.31.4-3) ...

    Processing triggers for man-db (2.8.5-2) ...

    Processing triggers for shared-mime-info (1.10-1) ...

    Processing triggers for desktop-file-utils (0.23-4) ...

     

    b.t.w. here is the release details:

    cat /etc/os-release

    PRETTY_NAME="Debian GNU/Linux 10 (buster)"

    NAME="Debian GNU/Linux"

    VERSION_ID="10"

    VERSION="10 (buster)"

    VERSION_CODENAME=buster

    ID=debian

    HOME_URL="https://www.debian.org/"

    SUPPORT_URL="https://www.debian.org/support"

    BUG_REPORT_URL="https://bugs.debian.org/"

×
×
  • Create New...