Yesterday 19:20
Forum: The Lounge
Starter: charliecoultas
Views: 0
Replies: 3
+ Reply to Thread
Results 1 to 10 of 10

Thread: NCO to forum2176 days old

  1. #1
    Member Oldhack's Avatar
    Join Date
    Aug 2010
    Posts
    153
    Thumbs Up
    Received: 8
    Given: 0
    Total Downloaded
    640.58 MB

    0 Not allowed!

    Default NCO to forum

    Hello

    Do you think it would be benefit to add NCO to the forum.
    Many Thanks
    Gary

  2. #2
    Prolific Poster normnet's Avatar
    Join Date
    Jul 2004
    Posts
    2,246
    Thumbs Up
    Received: 131
    Given: 32
    Total Downloaded
    916.81 MB

    0 Not allowed!

    Default Re: NCO to forum

    Quote Originally Posted by Oldhack View Post
    Hello

    Do you think it would be benefit to add NCO to the forum.
    Many Thanks
    Gary
    I give up. Whats NCO?

    Norm

  3. #3
    Senior Member barak's Avatar
    Join Date
    Apr 2008
    Posts
    743
    Thumbs Up
    Received: 48
    Given: 11
    Total Downloaded
    783.11 MB

    0 Not allowed!

    Default Re: NCO to forum

    I think its Numerically controlled oscillator

  4. #4
    Member Oldhack's Avatar
    Join Date
    Aug 2010
    Posts
    153
    Thumbs Up
    Received: 8
    Given: 0
    Total Downloaded
    640.58 MB

    0 Not allowed!

    Default Re: NCO to forum

    Hello

    Sorry about being unclear, Yes it is a Numerically controlled oscillator, you use a Register to run a oscillator using a chosen clock.
    It is one of the new modules in the new 16F chips like the 16F1503, very useful for generating precise square waves.
    If we get a forum section for this I want to post a small code demo for it.
    Many thanks
    Gary

  5. #5
    Fanatical Contributor Les's Avatar
    Join Date
    Feb 2002
    Posts
    3,336
    Thumbs Up
    Received: 294
    Given: 111
    Total Downloaded
    1.50 GB

    0 Not allowed!

    Default Re: NCO to forum

    We don't need a new section for such a project, use the main forum or the WIKI.
    For more example programs for Proton and Proton24 or updates, please visit: Proton WIKI or Proton Files

  6. #6
    Administrator John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,962
    Thumbs Up
    Received: 94
    Given: 28
    Total Downloaded
    1.39 GB

    0 Not allowed!

    Default Re: NCO to forum

    Gary,
    As Les suggests the WIKI is the way to go. It would fit into 'Other Example Code' category. Sounds an interesting feature.
    Let me know if you need any help doing this.
    John
    Last edited by John Drew; 20th May 2012 at 03:55.

  7. #7
    Member Oldhack's Avatar
    Join Date
    Aug 2010
    Posts
    153
    Thumbs Up
    Received: 8
    Given: 0
    Total Downloaded
    640.58 MB

    0 Not allowed!

    Default Re: NCO to forum

    Hello
    The Boss is the Boss, I will look at WIKI as an alternative or I will post in the main.
    Bigthanks
    Gary

  8. #8
    Member teo's Avatar
    Join Date
    Sep 2010
    Posts
    224
    Thumbs Up
    Received: 8
    Given: 1
    Total Downloaded
    2.43 GB

    0 Not allowed!

    Default Re: NCO to forum

    Hi,
    I am happy to see that someone uses new peripherals (CIP)
    Can anyone post some examples how to use the NCO?
    Thank you in advance,
    Teo

  9. #9
    Senior Member barak's Avatar
    Join Date
    Apr 2008
    Posts
    743
    Thumbs Up
    Received: 48
    Given: 11
    Total Downloaded
    783.11 MB

    1 Not allowed!

    Default Re: NCO to forum

    An example can be made from code that was used in connection with the thread in http://www.protonbasic.co.uk/showthr...l=1#post503884
    It uses NCO and CLC on 16F1509 to implement a XOR between external signal and a reference (NCO).

    Code:
    Device = 16F1509
    Config1 FOSC_HS, WDTE_OFF, PWRTE_OFF, MCLRE_OFF, CP_OFF, BOREN_OFF, CLKOUTEN_OFF, IESO_ON, FCMEN_ON           
    Config2 WRT_OFF, STVREN_ON, BORV_LO, LPBOR_OFF, LVP_OFF
    '
    Xtal = 12                    
    '
    OSCCON = 111000          
    APFCON = 000000           
    '
    ANSELA = 0
    ANSELB = 0
    ANSELC = 0
    '
    TRISA = 000000                               
    TRISB = 000000
    TRISC = 000000           ' RC7 is CLC1IN1 for external signal XOR with NCO
    '
    CLC1_config:                ' configured as XOR with the NCO
    Symbol LC1EN = CLC1CON.7
    Symbol LC1OE = CLC1CON.6
    Symbol LC1OUT = CLC1CON.5
    
    
    CLC1CON  = 0x01             ' OR-XOR
    CLC1POL  = 0x00
    '
    CLC1SEL0 = 0x01             ' LC1_IN[1] is lc1d1    - Signal on pin RC7
    CLC1SEL1 = 0x00             ' LC1_IN[12] is lc1d4   - NCO out
    '
    CLC1GLS0 = 0x02             ' lc1d1T is gated into lc1g1
    CLC1GLS1 = 0x00             ' not gated
    CLC1GLS2 = 0x00             ' not gated
    CLC1GLS3 = 0x80             ' lc1d4T is gated into lc1g4
    '
    NCO_config:
    NCO1CON = 000000
    Symbol N1EN   = NCO1CON.7
    Symbol N1OE   = NCO1CON.6
    Symbol N1OUT  = NCO1CON.5
    Symbol N1POL  = NCO1CON.4
    Symbol N1PFM  = NCO1CON.0
    '
    NCO1CLK = 000001         ' FIXED DUTY CYCLE, clock source FOSC
    '
    Dim tempword As Word     
    '
    main:    
        DelayMS 250             
        '
        LC1OE = 1               
        LC1EN = 1
        '
        tempword = 34602        ' Increment for close to 180KHz -> ((12000000 * 34602)/2^20)/2 = 197,994.23 Hz
        NCO1INCH = tempword.HighByte
        NCO1INCL = tempword.LowByte
        '
        N1OE   = 1
        N1OUT  = 1
        N1POL  = 0
        N1PFM  = 0
        N1EN   = 1
        '
        '---------------
        While 1 = 1             ' NCO output on RC1, output of NCO XOR with CLC1IN (RC7) is on RA2    
            DelayMS 100
            PORTC.3 = ~PORTC.3  ' do something in a loop the NCO and CLC are running in hardware
        Wend
        '---------------

  10. #10
    Member teo's Avatar
    Join Date
    Sep 2010
    Posts
    224
    Thumbs Up
    Received: 8
    Given: 1
    Total Downloaded
    2.43 GB

    0 Not allowed!

    Default Re: NCO to forum

    Barak, thanks for a prompt reply.
    All the best,
    Teo

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. PIC based DDS / NCO
    By Sean_Goddard in forum Proton Plus Compiler v3
    Replies: 4
    Last Post: 12th November 2010, 12:40
  2. where is the forum Help ...
    By Danny in forum Wish List / Product Feedback
    Replies: 2
    Last Post: 21st May 2003, 19:26

Members who have read this thread : 65

Actions :  (Set Date)

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts