Search Results - MEL PICBASIC Forum


Search:

Type: Posts; User: mpgmike; Keyword(s):

Search: Search took 0.00 seconds.

  1. Thread: NCO Calculator

    by mpgmike
    Replies
    24
    Views
    46,959

    Re: NCO Calculator

    Please do. I originally created it because I needed it for a project at the time, and decided to share it. I have no "inventor's syndrome" attachments, so if you want to contribute to the...
  2. Thread: NCO Calculator

    by mpgmike
    Replies
    24
    Views
    46,959

    Re: NCO Calculator

    No, I didn't.
  3. Thread: NCO Calculator

    by mpgmike
    Replies
    24
    Views
    46,959

    Re: NCO Calculator

    I forced myself to work with MPLABX over the past few days. I needed a combination of features only found in the PIC16F18426, which is too new for PBP3. I'm building the software in ASM using...
  4. Thread: NCO Calculator

    by mpgmike
    Replies
    24
    Views
    46,959

    Re: NCO Calculator

    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...
  5. Thread: NCO Calculator

    by mpgmike
    Replies
    24
    Views
    46,959

    Re: NCO Calculator

    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...
  6. Thread: NCO Calculator

    by mpgmike
    Replies
    24
    Views
    46,959

    Re: NCO Calculator

    The basic formula reduces down to:

    NCO Value = (Frequency * 2,097,150) / Fosc

    Building the NCO Calc in Visual Basic, the behind-the-scenes math was:

    NcoDec = (Freq * 2.09715) / Fosc
    NcoDecR...
  7. Thread: NCO Calculator

    by mpgmike
    Replies
    24
    Views
    46,959

    Re: NCO Calculator

    In the NCO Calc I entered:

    Fosc = 32 MHz
    Frequency = 1,843,200 (didn't use commas in the NCO Calc, added for clarity here)

    What I got in return was:

    NCO Decimal = 120795.84
    NCO HEX = 1D7DC...
  8. Thread: NCO Calculator

    by mpgmike
    Replies
    24
    Views
    46,959

    Re: NCO Calculator

    Using Mr. E-Calc, I wanted to calculate values for a PWM frequency using LFINTOSC, which is 32 kHz. I entered 0.031 where it asks for Fosc (MHz) and wouldn't you know it, IT WORKED! Got me thinking...
  9. Thread: NCO Calculator

    by mpgmike
    Replies
    24
    Views
    46,959

    Re: NCO Calculator

    8514

    I'm a bit new to this whole PC programming thing. I spent some time with the NCO Calculator and realized it really needed a bit of refinement. Attached is a cleaner version. Old one still...
  10. Thread: NCO Calculator

    by mpgmike
    Replies
    24
    Views
    46,959

    Re: NCO Calculator

    I should also mention that your NCO registers must be:

    NCO1CON = %10000000
    NCO1CLK = 1

    This puts it into Fixed Duty Cycle Mode with Fosc as your Clock Source.
  11. Thread: NCO Calculator

    by mpgmike
    Replies
    24
    Views
    46,959

    NCO Calculator

    8502

    I'm building a project that requires calculating numerous frequencies with the Numerically Controlled Oscillator (NCO) function in Fixed Duty Cycle Mode. Realizing that it would take me way...
Results 1 to 11 of 11