Control a Radio PLL with a PIC


Closed Thread
Results 1 to 40 of 54

Hybrid View

  1. #1
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: Control a Radio PLL with a PIC

    It looks like you should have a comma:

    PEEK CHSEL, CHSELVAR

  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

    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!

  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 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?

  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

    That worked great! Thanks

  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 scalerobotics View Post
    It looks like you should have a comma:

    PEEK CHSEL, CHSELVAR
    Adding the comma worked great! Thanks

  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

    Got that working! Thanks for the tip,
    Now on to the display. 3 digit 7 segment display, common cathode.
    I want to take the port C pin states and look those up in a table.
    Then Send the table contents at that address to the 3 digit display.
    I've been reading post and looking at some lookup codes but to be honest, I don't know where to start.
    I think I know what I want in the table but getting it to the display is where I'm getting confused.
    Any suggestions?

  7. #7
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Control a Radio PLL with a PIC

    Rayl113, I assume the display is going to be multiplexed as all you are using is port c? Is it going to have latches for the digit data or is it going to be some kind of serial display?
    Dave Purola,
    N8NTA
    EN82fn

  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 Dave View Post
    Rayl113, I assume the display is going to be multiplexed as all you are using is port c? Is it going to have latches for the digit data or is it going to be some kind of serial display?
    The display is laid out like this;
    RB0=A
    RB1=B
    RB2=C
    RB3=D
    RB4=E
    RC0=F
    RC1=G
    RC2=dp
    RC3=Digit-1
    RC4=Digit-2
    RC5=Digit-3
    RC6=Digit-4(future)
    RC7=Digit-5(future)

    I'm using NPN transistors to switch the digit commons to ground.
    It would probably be a good idea to latch in the display data but I'm not sure how to proceed.
    It's mostly learn by trial and error at this point.

  9. #9
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Control a Radio PLL with a PIC

    Rayl113, I have attached an old program that you can use parts of or simply as a template to understand the workings of a multiplexed display using a pic. I hope this helps. I found an old hallway clock from a school and backward engineered the circuit. I just had to as the clock has 5 inch 7 segment digits. It used a pic processor so, I redesigned the software to accomodate the already designed circuit. Works Great....
    Attached Files Attached Files
    Dave Purola,
    N8NTA
    EN82fn

  10. #10
    Join Date
    Jun 2011
    Posts
    37


    Did you find this post helpful? Yes | No

    Default Re: Control a Radio PLL with a PIC

    Thanks. I think I got that part figured out;
    Display:
    'Segment A = PORTB.0
    'Segment B = PORTB.1
    'Segment C = PORTB.2
    'Segment D = PORTB.3
    'Segment E = PORTB.4
    'Segment F = PORTC.0
    'Segment G = PORTC.1
    'Segment dp = PORTC.2
    'Digit1 = PORTC.3
    'Digit2 = PORTC.4
    'Digit3 = PORTC.5

    Where I'm stuck is building the tables and selecting the information to send to each digit. I have a spreadsheet with the values already calculated.
    I want to sample PORTD and use that as the address of the info I want to send to the digits.
    e.g., If PORTB = $3F, I want to use Address $3F as a pointer within the table and pull the info from that location and send it to the digits. Let's say "C19".
    I need "C" in digit 1, "1" in digit 2, and "9" in digit 3.
    This is where I'm stuck. The manual is really lacking when it comes to creating Lookup tables. I've looked at some of the example files, but gotten more confused.
    So any help on this would be appreciated.

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