I never used the NCO up to this moment. What is the purpose of this module?
Ioannis
I never used the NCO up to this moment. What is the purpose of this module?
Ioannis
Well Ioannis, Here is an excerpt form the data sheet:
The Numerically Controlled Oscillator (NCO1) module
is a timer that uses the overflow from the addition of an
increment value to divide the input frequency. The
advantage of the addition method over simple
counter-driven timer is that the output frequency
resolution does not vary with the divider value. The
NCO1 is most useful for applications that require
frequency accuracy and fine resolution at a fixed duty
cycle.
I have recently built and coded a closed loop PID control for a stepper motor with the NCO.
Dave Purola,
N8NTA
EN82fn
With NCO you can target frequencies with spectacular accuracy as opposed to PWM or other methods. Many of the newer PICs with NCO also have the option of using LFINTOSC and MFINTOSC with NCO for a slower-than-Fosc(/4) clock. My current project targets frequencies as slow as 2 Hz, with accuracy to 0.02 Hz, and as high as 3.1 MHz. NCO lets me get that accurate.
Hi mpgmike:
At the risk of seeming like a troll, may I make a couple suggestions, just in case you ever revisit your NCO Calc program, please?
(1) Allow entry of NCO Frequencies such as 8388608-Hz without rounding.
(2) Correct the NCO bit width constant (2097152) in your calculations.
(3) Display the NCO frequency resolution.
(4) Display the output frequency error.
I whipped up a quick spreadsheet to highlight the calculation problems I'm experiencing. Your NCO Calc app' introduces errors by rounding the NCO frequency and by using the incorrect NCO bit width constant in your calculations.
Have fun. Best wishes. Cheerful regards, Mike, K8LH
![]()
Last edited by Mike, K8LH; - 11th May 2018 at 01:03.
Isn't easier all these calculation done in a Excel file?
Ioannis
Thoughts I never thought. There are 2 modes for NCO, toggle (the one used) and a pulse-out, which yields 2X the frequency output of toggle mode. I had thought of possibly adding calculations for pulse-out mode.
A spreadsheet is easier to make but I don't think it's easier to use. Mike's stand-alone app' is a seriously cool accomplishment. Personally, I'd rather use a small stand-alone app' instead of a spreadsheet.
Many years ago I built an SPBRG Calculator spreadsheet followed by an SPBRG Calculator app' written in JustBASIC. I much prefer using the app'.
Cheerful regards, Mike, K8LH
![]()
Bookmarks