Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
17 years ago

NCO 8.1 Problem

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.

8 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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