Control a Radio PLL with a PIC


Closed Thread
Results 1 to 40 of 54

Hybrid View

  1. #1
    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, It is possible, as you can have a table that is upto 255 entries in size maximum. An easy way is to have 3 tables, one for each digit and then use the "3f" entry as the index. The output of each table would be the digit value to display. The other way is to use a table that outputs "word" values. That way you only have one table for the lookup, indexed by a byte value from "00" to "ff" and outputs the word. That way the word can have a value equal to between "0000" and "ffff" . The entries into the table for the output could be the 3 digit hex representation of the display such as "C19".
    Dave Purola,
    N8NTA
    EN82fn

  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 Dave View Post
    Rayl113, It is possible, as you can have a table that is upto 255 entries in size maximum. An easy way is to have 3 tables, one for each digit and then use the "3f" entry as the index. The output of each table would be the digit value to display. The other way is to use a table that outputs "word" values. That way you only have one table for the lookup, indexed by a byte value from "00" to "ff" and outputs the word. That way the word can have a value equal to between "0000" and "ffff" . The entries into the table for the output could be the 3 digit hex representation of the display such as "C19".
    I got it working by using 3 tables. Thanks. I never could get the word version to work. It only gave me 16 bits and I needed 24. Haven't tried the long word version yet. That's next.

    Now I need to set the FOSC bits in the CONFIG1H register to 0010. I'm sure it's a CON command. But don't know which one. Any help appreciated.

  3. #3
    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'm glad you got it working, I just got back from a vacation with the wife and kids. We did some serious shooting and the wife likes gun's now... Yipeeeee
    Dave Purola,
    N8NTA
    EN82fn

  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

    Trying to get my code to run on a PIC18LF2680. When I step thru the code I notice it skips over all of the "VAR" statements.
    However, when I continue, it acts like it is performing the required instruction. But when I try to run stand-alone, it doesn't work. I can see with an O'Scope that the clock is working but no I/O activity.
    Here's the config code;
    #CONFIG
    __CONFIG _CONFIG1H, _OSC_HS_1H
    __CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
    ;Set osc, Low-Voltage Programming disabled,
    ;Extended Instructionset disabled,
    #ENDCONFIG
    Define OSC 4 ' 17
    ' 18
    TRISA = $00 'set port a to all outputs ' 19
    TRISB = $00 'set port b to all outputs ' 20
    TRISC = $FF 'set port c to all inputs ' 21
    LATB = $00 'clear port b latches ' 22
    PLLDATA Var Byte ' stores value for PLLDATA ' 28
    LASTCH Var Byte ' stores value for LASTCH ' 29
    PLLDATAOUT var byte 'stores ouput for portB ' 30
    CHSEL Var Byte 'channel selector storage ' 31
    Display Var BYTE 'Display storage ' 32
    Char1 VAR BYTE 'Digit 1 transistor switch ' 33
    Char2 VAR BYTE 'Digit 2 transistor switch ' 34
    Char3 VAR BYTE 'Digit 3 transistor switch ' 35
    LASTCHSEL Var Byte 'stores the previous position of the ch selector ' 36
    SEGSW Var BYTE ' 37
    LOGOCNT Var BYTE ' 38
    Digit3 Var PORTA.0 ' 41
    Digit2 Var PORTA.1 ' 42
    Digit1 Var PORTA.2 ' 43
    BNDDNSW Var PORTA.3 ' 50
    BNDUPSW Var PORTA.4 ' 51
    LTCHENBL Var PORTA.5 'Latch Enable ' 46
    'LTCHENBL = 0
    CHSEL = PORTC & $0f 'set the inputs for the channel selector register ' 57
    READ 5, LASTCH 'Read the last channel data from the EEProm 58
    IF LASTCH = $FF THEN LASTCH = $70 'power up ch = CH 16 (Call channel) ' 59
    IF LASTCH = $00 THEN LASTCH = $72 'power up ch = Ch 18 (Coast Guard) ' 60
    PLLDATAOUT = PLLDATA 'put PLLDATA on the output pins ' 121
    PORTB = PLLDATAOUT
    LTCHENBL = 1
    LTCHENBL = 0
    PORTB = Display
    LOGOCNT = $a0 'set the countdown timer for logo display ' 65
    Start:

    Is there something else I need to do in the configuration statement?
    Thanks

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