Control a Radio PLL with a PIC


Closed Thread
Results 1 to 40 of 54

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Control a Radio PLL with a PIC

    well let me say I think its the more complicated way, but hey that makes it more fun. I would guess you will have to read the count on the selector, compare it to the last count, If it is higher, add 1 to the freq, if its less subtract. To cross the zero, you will have 2 choices when at 0 of at $F. from o you will go to 1 or $F, and from $F you will go to 0 or $E. So just check for that when you get to those counts.

    I would think you will have to really spin the selector VERY fast to miss any counts, so I would start with that scheme and see how it works. Don't forget you may need to de-bounce the inputs.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  2. #2
    Join Date
    Jun 2011
    Posts
    37


    Did you find this post helpful? Yes | No

    Default Re: Control a Radio PLL with a PIC

    Thanks Bert. Should I use the IF...THEN string? Something like this;
    Start
    PEEK CHSEL CHSELVAR
    IF CHSEL = 0000 THEN CHECK0
    IF CHSEL = 1111 THEN CHECK1
    ELSE LOOP

    LOOP
    PEEK CHSEL CHSELVAR
    If CHSEL > CHSELVAR Then UP
    Else
    PEEK CHSEL CHSELVAR
    IF CHSEL < CHSELVAR Then DOWN
    Else
    GOTO Start

    UP
    PLLDATA = PLLDATA +1
    MOVLF PLLDATA PLLDATAOUT
    GOTO Start

    DOWN
    PLLDATA = PLLDATA -1
    MOVLF PLLDATA PLLDATAOUT
    GOTO Start

    CHECK0
    IF CHVAR = 0001 THEN UP
    IF CHVAR = 1111 THEN DOWN
    ELSE LOOP

    CHECK1
    IF CHVAR = 0000 THEN UP
    IF CHVAR = 1110 THEN DOWN
    ELSE LOOP

    Of course I didn't include all the defines. Am I on the right track?

  3. #3
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Control a Radio PLL with a PIC

    Seems like the basic idea. Not sure what language that is but the idea looks about right
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  4. #4
    Join Date
    Jun 2011
    Posts
    37


    Did you find this post helpful? Yes | No

    Default Re: Control a Radio PLL with a PIC

    Quote Originally Posted by cncmachineguy View Post
    Seems like the basic idea. Not sure what language that is but the idea looks about right
    Uh Oh. Thought it was PBP. What did I do wrong?

  5. #5
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Control a Radio PLL with a PIC

    Ray, I stand corrected. I was thinking peek came from a different language, but I see it is a valid pbp command, though according to the book not recommended.

    As for the movelf, well I think that is some ask haunting you. In pbp you would just use
    Code:
    plldataout =plldata
    So yes I still think that's the basic idea.
    Oh yea, loop is a reserved word in latest release of pbp, so not a good choice for your label.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  6. #6
    Join Date
    Jun 2011
    Posts
    37


    Did you find this post helpful? Yes | No

    Default Re: Control a Radio PLL with a PIC

    Yes, I corrected that. Thanks.
    Where do I find the reserved words? Looked through the manual. Couldn't find them.

  7. #7
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Control a Radio PLL with a PIC

    can't answer that one, I must say I have ony read it here MANY times, so I assume it to be true. I think it might be in the front or the back in a section talking about differences from previous versions or differences from BS2. Not sure.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  8. #8
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    654


    Did you find this post helpful? Yes | No

    Default Re: Control a Radio PLL with a PIC

    Quote Originally Posted by RayL113 View Post
    Where do I find the reserved words? Looked through the manual. Couldn't find them.
    Look in appendix C in your manual.

    http://melabs.com/resources/pbpmanual/
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

Members who have read this thread : 0

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