Dear All,
I am trying to send a square-wave from the USRP DAC (basic TX board). I
have
made the the following little C++ program - but it gives me underruns
whenever I set the interpolation factor less than 64. Any help is
appreciated!
BR/
Per Z.
======================================================
#include <usrp_standard.h>
#include
using namespace std;
#define NO_ARGS 1
#define VALUE 4096
#define VALUE8 VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE,VALUE
#define VALUEm8 -VALUE,-VALUE,-VALUE,-VALUE,-VALUE,-VALUE,-VALUE,-VALUE
#define VALUE256 VALUE8,VALUE8,VALUEm8,VALUEm8,
VALUE8,VALUE8,VALUEm8,VALUEm8,
VALUE8,VALUE8,VALUEm8,VALUEm8,
VALUE8,VALUE8,VALUEm8,VALUEm8,
VALUE8,VALUE8,VALUEm8,VALUEm8,
VALUE8,VALUE8,VALUEm8,VALUEm8,
VALUE8,VALUE8,VALUEm8,VALUEm8,
VALUE8,VALUE8,VALUEm8,VALUEm8 \
#define BUFFSIZE 1024
short Buffer1[BUFFSIZE]={VALUE256,VALUE256,VALUE256,VALUE256};
short Buffer2[BUFFSIZE]={VALUE256,VALUE256,VALUE256,VALUE256};
usrp_standard_tx* tx;
int main(int argc,char **argv)
{
bool underrun;
tx = usrp_standard_tx::make(0,16,2,47768);
tx->set_tx_freq (0,0); // chan: [0,1]
tx->set_tx_freq (1,0); // chan: [0,1]
tx->start();
while (1) {
tx->write((void ) Buffer1,BUFFSIZE2,&underrun);
if (underrun)
cout << “Underrrun \n”;
tx->write((void ) Buffer2,BUFFSIZE2,&underrun);
if (underrun)
cout << “Underrrun \n”;
}
return 0;
}