Page 1 of 1

Generating a burst infinite times

Posted: Fri Nov 24, 2017 5:52 pm
by shonen3000
Hello,

I'm writing an app for generating bursts. The backend is written in C/C++ and front end is HTML, JS. I found out that the maximum number of burst (rp_GenBurstRepetitions) is 50k on the current system (0.98). I got this value while observing the output on a oscilloscope. I was trying to generate an infinete number of bursts, but could not quite do it. This is only a portion of the code, but the only one that is actually generating bursts.

SYSTEM INFROMATION:
##############################################################################
# Red Pitaya GNU/Linux Ecosystem
# Version: 0.98
# Build: 617
# Branch:
# Commit: 1819a1d704b949065c09b981ee84cd912179a72c
# U-Boot: "redpitaya-v2016.4"
# Linux Kernel: "redpitaya-v2016.2-RP4"
# Pro Applications: 15fbd007cc7246e710f0b0f39f91d9f824a42f48 Applications (v0.97-RC6-3-g15fbd00)
##############################################################################

Code: Select all

void makeBursts(void){
    rp_channel_t channel = RP_CH_1;
    rp_GenOutDisable(channel);
    
    if (WAVEFORM.Value() == 0){
	    rp_GenWaveform(channel, RP_WAVEFORM_SINE);
	}
	else if (WAVEFORM.Value() == 1){
	    rp_GenWaveform(channel, RP_WAVEFORM_RAMP_UP);
	}
	else if (WAVEFORM.Value() == 2){
	    rp_GenWaveform(channel, RP_WAVEFORM_SQUARE);
	}

    if(BURST_REPETITIONS.Value() > 50000)
    {
        rp_GenFreq(channel, FREQUENCY.Value());
        rp_GenAmp(channel, AMPLITUDE.Value());
        rp_GenMode(channel, RP_GEN_MODE_CONTINUOUS);
        rp_GenBurstCount(channel, BURST_COUNT.Value());
        //rp_GenBurstRepetitions(channel, BURST_REPETITIONS.Value());        
        rp_GenBurstPeriod(channel, BURST_PERIOD.Value());  <------------- problem 
    }
    else
    {
        rp_GenFreq(channel, FREQUENCY.Value());
        rp_GenAmp(channel, AMPLITUDE.Value());
        rp_GenMode(channel, RP_GEN_MODE_BURST);
        rp_GenBurstCount(channel, BURST_COUNT.Value());
        rp_GenBurstRepetitions(channel, BURST_REPETITIONS.Value());
        rp_GenBurstPeriod(channel, BURST_PERIOD.Value());
    }

    rp_GenTrigger(1);
    sleep(1);

    rp_GenOutEnable(channel);
}
I was getting a continuous signal of the selected frequency. Afterwards I searched the Redpitaya github page and found this https://github.com/RedPitaya/RedPitaya/ ... _handler.c .

Code: Select all

int gen_setGenMode(rp_channel_t channel, rp_gen_mode_t mode) {
    if (mode == RP_GEN_MODE_CONTINUOUS) {   <-------------------- this brach 
        ECHECK(generate_setGatedBurst(channel, 0));
        ECHECK(generate_setBurstDelay(channel, 0));
        ECHECK(generate_setBurstRepetitions(channel, 0));
        ECHECK(generate_setBurstCount(channel, 0));
        return triggerIfInternal(channel);
    }
    else if (mode == RP_GEN_MODE_BURST) {
        ECHECK(gen_setBurstCount(channel, channel == RP_CH_1 ? chA_burstCount : chB_burstCount));
        ECHECK(gen_setBurstRepetitions(channel, channel == RP_CH_1 ? chA_burstRepetition : chB_burstRepetition));
        ECHECK(gen_setBurstPeriod(channel, channel == RP_CH_1 ? chA_burstPeriod : chB_burstPeriod));
        return RP_OK;
    }
    else if (mode == RP_GEN_MODE_STREAM) {
        return RP_EUF;
    }
    else {
        return RP_EIPV;
    }
}
It sets all of my above parameters to 0, and changing them back didn't fix the problem. I was wondering if these is a way to generate a continious burst signal without of usign a loop which I have already made, but there are small holes inbetween the sets of 50k of burst. Does this FPGA (fpga_0.94.bit) have this functionality implemented?

Best regards,
Miha