Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers

NCO 8.1 Problem

Altera_Forum
Honored Contributor II
1,989 Views

HI, no matter what output freq. I set my NCO to have it is always coming out at 20 Mhz, or this is what I am measuring on the scope. 

 

I don't think this was happening when i was using quartus 6.1 but now I am using 8.1. 

 

Any ideas? 

 

Thank you in advance for your help.
0 Kudos
8 Replies
Altera_Forum
Honored Contributor II
546 Views

Hi, 

 

I will assume the Fs of your NCO and DAC are fixed. 

 

In that case you can confirm the problem through signaltap by directly checking the tuning word value at the NCO. 

 

You may even take samples of sine data and meaure the frequency in Matlab by setting signaltap to signed values then convert to text file(remove header and you are left with table that can be read).  

 

Kaz
0 Kudos
Altera_Forum
Honored Contributor II
546 Views

HI, what you mean by Fs? 

 

If that is the clk in then yes.
0 Kudos
Altera_Forum
Honored Contributor II
546 Views

Hi 

 

Which is your clock frequency? And desired output frequencies? 

The phi_inc_i input of your NCO is correct? 

 

You could also try to simulate (basic waveform simulation in quartus) to check if the core is working 

 

Regards,  

 

Thiago
0 Kudos
Altera_Forum
Honored Contributor II
546 Views

Clock is 100MHz, NCO is just 1Mhz, i have tried various different NCO freq. and is coming out as 20Mhz everytime. 

 

I have just got a random 32-Bit phi_inc_i input.
0 Kudos
Altera_Forum
Honored Contributor II
546 Views

I think that your problem is with the phi_inc_i then 

This input is responsible for the NCO output frequency 

The mega wizard only shows you the value you should set the phi_inc_i, but it doesn't effectively change the frequency 

 

In the thread http://www.alteraforum.com/forum/showthread.php?t=3895 you can find some information on how this works 

 

You must set the phi_inc_i with the value shown on the Phase Increment Value parameter indicated by the wizard to get the desired frequency 

 

I hope this helps you 

 

Regards, 

 

Thiago
0 Kudos
Altera_Forum
Honored Contributor II
546 Views

Hi, so for example for a freq. of 10MHz the phase value comes to 429496730, I just convert this to a binary number and use it as the input as v and g's yea? 

 

 

I didn't realise that it was this input that actaully generated the freq. 

 

Cheers
0 Kudos
Altera_Forum
Honored Contributor II
546 Views

Exactly! 

You could also use the Altera lpm_constant function to get the value correctly and connect it to the NCO phi_inc_i input 

 

Regards, 

 

Thiago
0 Kudos
Altera_Forum
Honored Contributor II
546 Views

Hi, 

 

On the note of lpm_constant... a friendly advice with respect. 

 

For god's sake use inference. Designers now tend to use inference even for large memory blocks. This results in compact, readable, debuggable, time-saving, and portable code. 

 

To use lpm_constant is like going back centuries. I don't know why altera wouldn't remove this nonsense from their list of cores. 

 

I am saying that because I suffered so much when I took over a design and it was having lterally thousands of modules including several instants of lpm-constants and flipflops. I kept swearing at everybody as I was trying to find my way through a "Spaghetti" of connections and portmap of signals with names extending full line. 

 

kaz
0 Kudos
Reply