Control a Radio PLL with a PIC


Closed Thread
Results 1 to 40 of 54

Hybrid View

  1. #1
    Join Date
    Jun 2011
    Posts
    37


    Did you find this post helpful? Yes | No

    Default Re: Control a Radio PLL with a PIC

    What if I want to use a cb channel switch instead of an encoder? The first four pins have a logical progression of 0000 to 1111. Couldn't I use this like a Gray code encoder? Count increase would equal up and count decrease would equal down. What do you think?

  2. #2
    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

    You can use that, you can use the thing you already have, its up to you. They both CAN work. With the CB switch you will only get 16 changes per full revolution. If this is enough then use it. It will prolly still have noisey output so de-bouncing will still be neccessary. Now if you can get this, I have used many, they work really well.

    Let us know how you are getting along on this project. Have you blinked a LED on port A yet?
    -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!

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default Re: Control a Radio PLL with a PIC

    Search here . . .

    http://www.mouser.com/Electromechani...ers/_/N-39xfc/

    Seriously Cheap !
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  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
    You can use that, you can use the thing you already have, its up to you. They both CAN work. With the CB switch you will only get 16 changes per full revolution. If this is enough then use it. It will prolly still have noisey output so de-bouncing will still be neccessary. Now if you can get this, I have used many, they work really well.

    Let us know how you are getting along on this project. Have you blinked a LED on port A yet?
    I think I'm going to try to use the channel selector approach. Using RE1 thru RE4 as the inputs. I read in the manual that there is a command that will sample the designated pins and store the result in a register of my chosing. The problem I am having trouble sorting out in my head is what should I do when the count goes back to 0000 after 1111 and vice versa. And still have the count continue up or down. Is there some way to like have a loop restart when this limit is reached?
    Just messing with it as time allows. So not much progress. Still learnig the PBP commands and uses. And yes, got LED's blinking like crazy using machine code, but haven't tried it wih PBP yet.
    Thanks for the helps Guys!

  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

    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!

  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

    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?

  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

    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!

  8. #8
    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?

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