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

    I have a concern for you, in this bit of code
    Code:
    LOOP
    PEEK CHSEL CHSELVAR
    If CHSEL > CHSELVAR Then UP
    Else 
    PEEK CHSEL CHSELVAR
    IF CHSEL < CHSELVAR Then DOWN
    Else
    GOTO Start
    I think your intention is to set chselvar equal to the contents of address chsel. then in the next line you test to see if they are different. So if I am following this correctly, you will have to move the channel selector at the exact moment between the peek and the IF. May work better to set a var like chselvarold then on the next loop see if chselvar = chselvarold. if = then goto start, if not decode what to do.
    -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

    Quote Originally Posted by cncmachineguy View Post
    I have a concern for you, in this bit of code
    Code:
    LOOP
    PEEK CHSEL CHSELVAR
    If CHSEL > CHSELVAR Then UP
    Else 
    PEEK CHSEL CHSELVAR
    IF CHSEL < CHSELVAR Then DOWN
    Else
    GOTO Start
    I think your intention is to set chselvar equal to the contents of address chsel. then in the next line you test to see if they are different. So if I am following this correctly, you will have to move the channel selector at the exact moment between the peek and the IF. May work better to set a var like chselvarold then on the next loop see if chselvar = chselvarold. if = then goto start, if not decode what to do.
    What about if I don't recheck with Peek and do this instead;
    CHLP:
    PEEK CHSEL, CHSELVAR 'Look at the 4 input pins from the channel selector
    If CHSEL > CHSELVAR Then UP 'if it's larger then run subroutine UP
    IF CHSEL < CHSELVAR Then DOWN 'if it's smaller then run subroutine DOWN
    GOTO Start 'if neither are true then goto start

    What do you think?

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