Jump to content

attila

Technical Forum Moderator
  • Posts

    6,637
  • Joined

  • Last visited

Posts posted by attila

  1. Hi @Shalin

    Try lower IO voltage. Eventual pullup which can help if the driver has some impedance.
    The absolute minimum is around 0.96V but even if you try lower value it will limit to what it can. (The minimum recommended for the FPGA IO supply is 1.1V)

    Here with 0.95V the threshold is 0.55V/0.65V
    AD3 Wavegen is connected to one DIO of Digital Discovery and another DIO outputs the logic level of the input (with ROM Logic) which is connected to AD3 Scope 1.

    image.png

    image.png

  2. Hi @Agouti

    With Math channel the data can only be delayed. For compensation bidirectional shifting is available under Channel gear dropdown.
    However with Logging you can process the data to show the exact length of each pulse.

    image.png

    if(!Scope.Ref1.enable) Scope.Ref1.Clone(Scope.Channel1);
    var src = Scope.Channel1.data;
    var c = src.length;
    var dt = 1.0/Scope.Time.Rate.real;
    var pwm = [];
    var p = src[0]>0;
    var t = dt, j = 0;
    for(var i = 1; i < c; i++, t+=dt){
        if(p==(src[i]>0)) continue;
        p = !p;
        for(; j<i; j++) pwm.push(t);
        t = 0;
    }
    for(; j<c; j++) pwm.push(t);
    Scope.Ref1.setData(pwm, Scope.Time.Rate.real);

     

  3. Hi @ssm

    If you specify 32bit samples you get 32bit samples. You are also using 32bit array, uint. How are you looking at the values ?

    Here a 32bit walking 1 signal is connected to Digital Discovery DIN 0 to DIO 31 and captured like this:

    image.png

    #include <stdio.h>
    #include <stdlib.h>
    
    #ifdef WIN32
    #include "dwf.h"
    #elif __APPLE__
    #include "/Library/Frameworks/dwf.framework/Headers/dwf.h"
    #else
    #include <digilent/waveforms/dwf.h>
    #endif
    
    int main(int carg, char** szarg) {
        HDWF hdwf;
        STS sts;
        double hzSys;
        int cSamples = 100000;
        unsigned int* rgdwSamples = new unsigned int[cSamples];
        char szError[512] = { 0 };
    
        if (!FDwfDeviceOpen(-1, &hdwf)) {
            FDwfGetLastErrorMsg(szError);
            printf("Device open failed\n\t%s", szError);
            return 0;
        }
    
        FDwfDigitalInInternalClockInfo(hdwf, &hzSys);
        FDwfDigitalInDividerSet(hdwf, (unsigned int)(0.5 + hzSys / 200e3)); // 200kMHz
        FDwfDigitalInSampleFormatSet(hdwf, 32); // 32 bit samples
        FDwfDigitalInBufferSizeSet(hdwf, cSamples);
        FDwfDigitalInConfigure(hdwf, false, true);
        do {
            if (!FDwfDigitalInStatus(hdwf, true, &sts)) return 0;
        } while (sts != stsDone);
        FDwfDigitalInStatusData(hdwf, rgdwSamples, cSamples * sizeof(unsigned int));
        for (int i = 0; i < cSamples && i < 30; i++)  printf("0x%08X\n", rgdwSamples[i]);
        FDwfDeviceCloseAll();
    }

     

×
×
  • Create New...