AnsweredAssumed Answered

output short break after frequency updated

Question asked by william2016 on Jan 6, 2017
Latest reply on Jan 8, 2017 by william2016

Hello All,

I have a problem to keep the signal continuous after frequency changed. Please check the image attached.signal break after freq changed

I am doing frequency sweeping, i.e.scanning a short range of frequency and measure some parameters.

The problem is when the frequency is changed, there is a short break of output.

Even I switching freq register doesn't help at all.

 

Here is the code only using one freq register:

word=(unsigned int)(0x2100); //control register
SendWordDDS(word);

t=fv;
t=t&0x00003fff; //last 14bits
word=(unsigned int)(0x4000+(t)); //14bit LSBs + 01(the first two bits) 01means freq0
SendWordDDS(word);
t=fv;
t=t&0x0fffc000; //from 15 to 28 bits
word=(unsigned int)(0x4000+(t>>=14)); //14bit HSBs + 01(the first two bits)
SendWordDDS(word);

word=(unsigned int)(0xc000); //phase register 0
SendWordDDS(word);
word=(unsigned int)(0x2000); //exit reset
SendWordDDS(word);

 

I know it is not a good way to only use one freq register, which has been noted in datasheet.

I changed the code to switch freq register, but doesn't help.

Please give a little instructions.

Can you provide a sample code to do freq sweeping?

Thanks

The routine to send freq is:

unsigned int word;
unsigned long int t;

if(!IsDDSinitialized)
{//only reset the register at first setting of freq
word=(unsigned int)(0x2100); //control register
SendWordDDS(word);
}
else
{
if(CurrentFreqReg==0) word=(unsigned int)(0x2000); //control register, no reset
else word=(unsigned int)(0x2000); //control register, no reset
SendWordDDS(word);
}

t=fv;
t=t&0x00003fff; //last 14bits
if(CurrentFreqReg==0) word=(unsigned int)(0x4000+(t)); //14bit LSBs + 01(the first two bits) 01means freq0
else word=(unsigned int)(0x8000+(t)); //14bit LSBs + 10(the first two bits) 10means freq1

SendWordDDS(word);
t=fv;
t=t&0x0fffc000; //from 15 to 28 bits
if(CurrentFreqReg==0) word=(unsigned int)(0x4000+(t>>=14)); //14bit HSBs + 01(the first two bits)
else word=(unsigned int)(0x8000+(t>>=14)); //14bit HSBs + 10(the first two bits)10means freq1
SendWordDDS(word);
if(!IsDDSinitialized)
{
word=(unsigned int)(0xc000); //phase register 0
SendWordDDS(word);
}

//finally apply setting, output updated
if(CurrentFreqReg==0) word=(unsigned int)(0x2000); //exit reset
else word=(unsigned int)(0x2800); //exit reset, freq1
SendWordDDS(word);

//update the freq bank
if(CurrentFreqReg==0)CurrentFreqReg=1;
else CurrentFreqReg=0;
IsDDSinitialized=0;

Outcomes