Control a Radio PLL with a PIC


Closed Thread
Results 1 to 40 of 54

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Control a Radio PLL with a PIC

    CHSEL VAR PORTA

    This will assign the whole PORTA, all the time to chsel variable... it's a simple alias. Still, it's the WHOLE PORTA reading, you still need to remove the bit you don't want/need.

    If you want to assign a single pin to a variable
    A_SINGLE_PIN VAR PORTA.0

    As far as I'm aware of, there's no shortcuts. Bitwise & Logical mask/operations are indeed listed in the manual, not explained as it's a basic knowledge you should already be aware of when programming. Case not, there's Wikipedia & Google
    http://en.wikipedia.org/wiki/Bitwise_operation
    http://www.ralphb.net/IPSubnet/logical.html
    and so forth
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Control a Radio PLL with a PIC

    chsel var byte
    '
    '
    '
    '
    chsel = (PORTA>>1) & $0F

    this read PORTA, shift the whole value one place to the right (to remove PORTA.0), then isolate the 4 lower bits.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    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 mister_e View Post
    chsel var byte
    '
    '
    '
    '
    chsel = (PORTA>>1) & $0F

    this read PORTA, shift the whole value one place to the right (to remove PORTA.0), then isolate the 4 lower bits.
    Ok, so let's say then, that I don't use the lsb as the toggle pin, and use 0 thru 3 as my 4 input bits, would the command be chsel = (PORTA) %00001111 ??
    Or am I missing the point?

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Control a Radio PLL with a PIC

    Really close
    chsel = PORTA & %00001111
    you're on the right direction!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    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 mister_e View Post
    Really close
    chsel = PORTA & %00001111
    you're on the right direction!
    Thanks! I'll give that a try.

  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

    That worked! Thanks again.
    Have another little snag.
    It doesn't like my Peek command syntax.
    Get this error; ERROR Line 27: Bad expression.27: Syntax error

    Here is line 27; PEEK CHSEL CHSELVAR 'Line 27, Look at the 4 input pins from the channel selector and put in CHSELVAR

    It appears that I'm not inputting the Peek command correctly. Anyone familiar with this command?

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