Si5351A


+ Reply to Thread
Page 1 of 7 123 ... LastLast
Results 1 to 15 of 96

Thread: Si5351A1968 days old

  1. #1
    Member CharlieBrown's Avatar
    Join Date
    Jul 2006
    Posts
    147
    Thumbs Up
    Received: 1
    Given: 13
    Total Downloaded
    5.03 GB

    0 Not allowed!

    Default Si5351A

    Hi,

    has anyone tried coding this chip in Proton Basic ?

    Looks like we have a new hero on the block..........

    Any examples ?

    regards

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    AlanGC
    Guest AlanGC's Avatar

    0 Not allowed!

    Default Re: Si5351A

    H
    I Charlie Brown

    Did you manage to connect t the Si5351A with Proton ? I'm looking at doing the same.

    Thanks

    Alan

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Member CharlieBrown's Avatar
    Join Date
    Jul 2006
    Posts
    147
    Thumbs Up
    Received: 1
    Given: 13
    Total Downloaded
    5.03 GB

    0 Not allowed!

    Default Re: Si5351A

    No Alan, I didn't do it, but want to , I got away with using a Nano as there are ample of Sketch available, but not happy leaving PIC for that.

    maybe some day during the holidays I'll try it. Do let me know if you succeed with any code.

    TU

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,596
    Thumbs Up
    Received: 341
    Given: 162
    Total Downloaded
    1.99 GB

    1 Not allowed!

    Default Re: Si5351A

    I don't have an SI5351A chip, however, looking at the internet there are quite a few examples but they are written in C.

    I have done a crude conversion of an example from the URL:

    http://www.qrp-labs.com/synth/si5351ademo.html

    It is based upon example 1 code from the URL and may not work as expected, however, hopefully it will give you some ideas to complete your code.

    Code:
        Device = 18F25K20
        Xtal = 16
        Declare Optimiser_Level = 2
        Declare Dead_Code_Remove = 1
    
    
        Declare Hserial_Baud = 9600                 ' Set baud rate to 9600
        Declare Hserial_RCSTA = %10010000           ' Enable serial port and continuous receive
        Declare Hserial_TXSTA = %00100000           ' Enable transmit and asynchronous mode
        Declare Hserial_Clear = 1                   ' Enable Error clearing on received characters
    
    
    $define cSI_CLK0_CONTROL     16              ' Register definitions
    $define cSI_CLK1_CONTROL     17
    $define cSI_CLK2_CONTROL     18
    $define cSI_SYNTH_PLL_A      26
    $define cSI_SYNTH_PLL_B      34
    $define cSI_SYNTH_MS_0       42
    $define cSI_SYNTH_MS_1       50
    $define cSI_SYNTH_MS_2       58
    $define cSI_PLL_RESET        177
    
    
    $define cSI_R_DIV_1          %00000000       ' R-division ratio definitions
    $define cSI_R_DIV_2          %00010000
    $define cSI_R_DIV_4          %00100000
    $define cSI_R_DIV_8          %00110000
    $define cSI_R_DIV_16         %01000000
    $define cSI_R_DIV_32         %01010000
    $define cSI_R_DIV_64         %01100000
    $define cSI_R_DIV_128        %01110000
    
    
    $define cSI_CLK_SRC_PLL_A    %00000000
    $define cSI_CLK_SRC_PLL_B    %00100000
    
    
    $define cXTAL_FREQ          27000000        ' Crystal frequency
    
    
    $define cI2C_WRITE          %11000000       ' I2C address for writing to the Si5351A
    $define cI2C_READ           %11000001       ' I2C address for reading to the Si5351A
    
    
        Dim dP1 As Dword                        ' Synth config register P1
        Dim dP2 As Dword                        ' Synth config register P2
        Dim dP3 As Dword                        ' Synth config register P3
    
    
        Dim bI2CRegister_Reg As Byte
        Dim bI2CRegister_Data As Byte
    
    
        Dim bOutputOff_Clk As Byte
    
    
        Dim bSetupMultisynth_Synth As Byte
        Dim dSetupMultisynth_Divider As Dword
        Dim bSetupMultisynth_Div As Byte
    
    
        Dim dSetupPLL_PLL As Byte
        Dim bSetupPLL_Mult As Byte
        Dim dSetupPLL_Num As Dword
        Dim dSetupPLL_Denom As Dword
        Dim fSetupPLL_Num As Float
        Dim fSetupPLL_Denom As Float
    
    
        Dim dSetFrequency As Dword
    
    
        Dim dSetFrequency_PllFreq As Dword
        Dim dSetFrequency_L As Dword
        Dim fSetFrequency_F As Float
        Dim bSetFrequency_Mult As Byte
        Dim dSetFrequency_Num As Dword
        Dim dSetFrequency_Denom As Dword
        Dim dSetFrequency_Divider As Dword
    
    
    '---------------------------------------------------------------------------
        GoTo Main                           ' Jump over the subroutines
    
    
    '---------------------------------------------------------------------------
    $define SI5351A_I2CSendRegister(pReg, pData) '
        bI2CRegister_Reg = pReg                  '
        bI2CRegister_Data = pData                '
        GoSub _SI5351A_I2CSendRegister
    
    
    _SI5351A_I2CSendRegister:
        BStart
        BusOut cI2C_WRITE
        BusOut bI2CRegister_Reg
        BusOut bI2CRegister_Data
        BStop
        Return
    
    
    '---------------------------------------------------------------------------
    $define SI5351A_I2CReadRegister(pReg, pData)'
        bI2CRegister_Reg = pReg                 '
        GoSub _SI5351A_I2CReadRegister          '
        pData = bI2CRegister_Data
    
    
    _SI5351A_I2CReadRegister:
        BStart
        BusOut cI2C_WRITE
        BusOut bI2CRegister_Reg
        BReStart
        BusOut cI2C_READ
        bI2CRegister_Data = BusIn
        BusNack
        BStop
        Return
    
    
    '---------------------------------------------------------------------------
    ' Set up specified PLL with mult, num and denom
    ' pMult is 15..90
    ' pNum is 0..1,048,575 ($FFFFF)
    ' pDenom is 0..1,048,575 ($FFFFF)
    '
    $define SI5351A_SetupPLL(pPll, pMult, pNum, pDenom)'
        dSetupPLL_PLL = pPll      '
        bSetupPLL_Mult = pMult    '
        dSetupPLL_Num = pNum      '
        dSetupPLL_Denom = pDenom  '
        GoSub _SI5351A_SetupPLL
    
    
    _SI5351A_SetupPLL:
        fSetupPLL_Num = dSetupPLL_Num
        fSetupPLL_Denom = dSetupPLL_Denom
        dP1 = (128 * (fSetupPLL_Num / fSetupPLL_Denom))
        dP1 = ((128 * bSetupPLL_Mult) + dP1 - 512)
        dP2 = ((128 * (fSetupPLL_Num) / fSetupPLL_Denom))
        dP2 = ((128 * dSetupPLL_Num) - (dSetupPLL_Denom * dP2))
        dP3 = dSetupPLL_Denom
    
    
        SI5351A_I2CSendRegister(dSetupPLL_PLL, dP3.Byte1)
        SI5351A_I2CSendRegister(dSetupPLL_PLL + 1, dP3.Byte0)
        SI5351A_I2CSendRegister(dSetupPLL_PLL + 2, dP1.Byte2 & $03) '(dP1 & $00030000) >> 16)
        SI5351A_I2CSendRegister(dSetupPLL_PLL + 3, dP1.Byte1)
        SI5351A_I2CSendRegister(dSetupPLL_PLL + 4, dP1.Byte0)
        SI5351A_I2CSendRegister(dSetupPLL_PLL + 5, ((dP3 & $000F0000) >> 12) | (dP2.Byte2 & $0F)) '((dP2 & $000F0000) >> 16))
        SI5351A_I2CSendRegister(dSetupPLL_PLL + 6, dP2.Byte1)
        SI5351A_I2CSendRegister(dSetupPLL_PLL + 7, dP2.Byte0)
        Return
    
    
    '---------------------------------------------------------------------------
    ' Set up MultiSynth with integer divider and R divider
    ' R divider is the bit value which is OR'ed onto the appropriate register, it is a $define
    '
    $define SI5351A_SetupMultisynth(pSynth, pDivider, pDiv) '
        bSetupMultisynth_Synth = pSynth     '
        dSetupMultisynth_Divider = pDivider '
        bSetupMultisynth_Div = pDiv         '
        GoSub _SI5351A_SetupMultisynth
    
    
    _SI5351A_SetupMultisynth:
        dP1 = (128 * dSetupMultisynth_Divider) - 512
        dP2 = 0                                         ' dP2 = 0, dP3 = 1 forces an integer value for the divider
        dP3 = 1
    
    
        SI5351A_I2CSendRegister(bSetupMultisynth_Synth,     dP3.Byte1)
        SI5351A_I2CSendRegister(bSetupMultisynth_Synth + 1, dP3.Byte0)
        SI5351A_I2CSendRegister(bSetupMultisynth_Synth + 2, (dP1.Byte2 & $03) | bSetupMultisynth_Div) '((dP1 & $00030000) >> 16) | bSetupMultisynth_Div)
        SI5351A_I2CSendRegister(bSetupMultisynth_Synth + 3, dP1.Byte1)
        SI5351A_I2CSendRegister(bSetupMultisynth_Synth + 4, dP1.Byte0)
        SI5351A_I2CSendRegister(bSetupMultisynth_Synth + 5, ((dP3 & $000F0000) >> 12) | (dP2.Byte2 & $0F)) '((dP2 & $000F0000) >> 16))
        SI5351A_I2CSendRegister(bSetupMultisynth_Synth + 6, dP2.Byte1)
        SI5351A_I2CSendRegister(bSetupMultisynth_Synth + 7, dP2.Byte0)
        Return
    
    
    '---------------------------------------------------------------------------
    ' Switches off Si5351a output
    ' Example: SI5351A_OutputOff(cSI_CLK0_CONTROL) will switch off output CLK0
    '
    $define SI5351A_OutputOff(pClk)   '
        bOutputOff_Clk = pClk         '
        GoSub _SI5351A_OutputOff
    
    
    _SI5351A_OutputOff:
        'i2c_init()
        SI5351A_I2CSendRegister(bOutputOff_Clk, $80)        ' Refer to SiLabs AN619 to see bit values - $80 turns off the output stage
        BStop
        Return
    
    
    '---------------------------------------------------------------------------
    ' Set CLK0 output ON and to the specified frequency
    ' Frequency is in the range 1MHz to 150MHz
    ' Example: SI5351A_SetFrequency(10000000) will set output CLK0 to 10MHz
    '
    ' This example sets up PLL A and MultiSynth 0 and produces the output on CLK0
    '
    $define SI5351A_SetFrequency(pFrequency) '
        dSetFrequency = pFrequency           '
        GoSub _SI5351A_SetFrequency
    
    
    _SI5351A_SetFrequency:
        dSetFrequency_Divider = 900000000 / dSetFrequency                   ' Calculate the division ratio. 900,000,000 is the maximum internal
                                                                            ' PLL frequency: 900MHz
        If (dSetFrequency_Divider // 2) > 0 Then Dec dSetFrequency_Divider  ' Ensure an even integer division ratio
    
    
        dSetFrequency_PllFreq = dSetFrequency_Divider * dSetFrequency       ' Calculate the pllFrequency: the dSetFrequency_Divider * desired output frequency
    
    
        bSetFrequency_Mult = dSetFrequency_PllFreq / cXTAL_FREQ             ' Determine the multiplier to get to the required pllFrequency
        dSetFrequency_L = dSetFrequency_PllFreq // cXTAL_FREQ               ' It has three parts:
        fSetFrequency_F = dSetFrequency_L                                   ' bSetFrequency_Mult is an integer that must be in the range 15..90
        fSetFrequency_F = fSetFrequency_F * 1048575                         ' dSetFrequency_Num and dSetFrequency_Denom are the fractional parts, the numerator and denominator
        fSetFrequency_F = fSetFrequency_F / cXTAL_FREQ                      ' each is 20 bits (range 0..1048575)
        dSetFrequency_Num = fSetFrequency_F                                 ' the actual multiplier is  bSetFrequency_Mult + dSetFrequency_Num / dSetFrequency_Denom
        dSetFrequency_Denom = 1048575                                       ' For simplicity we set the denominator to the maximum 1048575
    '
    ' Set up PLL A with the calculated multiplication ratio
    '
        SI5351A_SetupPLL(cSI_SYNTH_PLL_A, bSetFrequency_Mult, dSetFrequency_Num, dSetFrequency_Denom)
    '
    ' Set up MultiSynth dSetFrequency_Divider 0, with the calculated dSetFrequency_Divider.
    ' The final R division stage can divide by a power of two, from 1..128.
    ' reprented by constants cSI_R_DIV1 to cSI_R_DIV128 (see si5351a.h header file)
    ' If you want to output frequencies below 1MHz, you have to use the final R division stage
    '
        SI5351A_SetupMultisynth(cSI_SYNTH_MS_0, dSetFrequency_Divider, cSI_R_DIV_1)
    '
    ' Reset the PLL. This causes a glitch in the output. For small changes to the parameters, you don't need to reset the PLL, and there is no glitch
    '
        SI5351A_I2CSendRegister(cSI_PLL_RESET, $A0)
    '
    ' Finally switch on the CLK0 output ($4F) and set the MultiSynth0 input to be PLL A
    '
        SI5351A_I2CSendRegister(cSI_CLK0_CONTROL, $4F | cSI_CLK_SRC_PLL_A)
        Return
    
    
    '----------------------------------------------------------------------------------------------------------
    Main:
        Declare All_Digital = 1
    
        SI5351A_SetFrequency(1000000)
        Stop

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #5
    Member CharlieBrown's Avatar
    Join Date
    Jul 2006
    Posts
    147
    Thumbs Up
    Received: 1
    Given: 13
    Total Downloaded
    5.03 GB

    0 Not allowed!

    Default Re: Si5351A

    Thanks Les,

    Shall try and post my feedback in this thread.

  10. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  11. #6
    AlanGC
    Guest AlanGC's Avatar

    0 Not allowed!

    Default Re: Si5351A

    Hi Les and Charlie Brown

    Thanks for the info, I will give it a go Les. Its a interesting chip with more than one output! This is another link
    but uses ASM. http://www.vk5tm.com/starlo2.php. Adafruit and QRPkits.com have a nice little pcb with the device
    on.

    Regards

    Alan

  12. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  13. #7
    starwars
    Guest starwars's Avatar

    0 Not allowed!

    Default Re: Si5351A

    Hi Les
    I've tried the code above with the 18F44K22
    and added these lines
    Device = 18F44K22
    Xtal = 16
    Declare Optimiser_Level = 2
    Declare Dead_Code_Remove = 1
    Declare SDA_Pin PORTC.4
    Declare SCL_Pin PORTC.3
    Declare Slow_Bus On
    Is there anyway to debug the program trace the flow especially since there are several registers being modified.

    Thanks

    Harry

  14. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  15. #8
    starwars
    Guest starwars's Avatar

    0 Not allowed!

    Default Re: Si5351A

    Hi Alan
    Have you had any luck with the code? I managed to compile it, and add the ports, but I seem to be missing something.

    Thanks for reading.

    Harry

  16. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  17. #9
    Member CharlieBrown's Avatar
    Join Date
    Jul 2006
    Posts
    147
    Thumbs Up
    Received: 1
    Given: 13
    Total Downloaded
    5.03 GB

    0 Not allowed!

    Default Re: Si5351A

    got this code working.
    Code:
        Device = 18F25K22
    
        Declare SDA_Pin PORTC.3
        Declare SCL_Pin PORTC.4
        Declare Slow_Bus On
    
    
        
        $define cSI_CLK0_CONTROL     16              ' Register definitions
        $define cSI_CLK1_CONTROL     17
        $define cSI_CLK2_CONTROL     18
        $define cSI_SYNTH_PLL_A      26
        $define cSI_SYNTH_PLL_B      34
        $define cSI_SYNTH_MS_0       42
        $define cSI_SYNTH_MS_1       50
        $define cSI_SYNTH_MS_2       58
        $define cSI_PLL_RESET        177
        
        $define cSI_R_DIV_1          000000       ' R-division ratio definitions
        $define cSI_R_DIV_2          010000
        $define cSI_R_DIV_4          100000
        $define cSI_R_DIV_8          110000
        $define cSI_R_DIV_16         000000
        $define cSI_R_DIV_32         010000
        $define cSI_R_DIV_64         100000
        $define cSI_R_DIV_128        110000
    
    
        $define cSI_CLK_SRC_PLL_A    000000
        $define cSI_CLK_SRC_PLL_B    100000
        
        '$define cXTAL_FREQ          27005065        ' Crystal frequency
        $define cXTAL_FREQ          25000000        ' Crystal frequency
        
        $define cI2C_WRITE          000000       ' I2C address for writing to the Si5351A
        $define cI2C_READ           000001       ' I2C address for reading to the Si5351A
    
    
        Dim dP1                     As Dword        ' Synth config register P1
        Dim dP2 As Dword                            ' Synth config register P2
        Dim dP3 As Dword                            ' Synth config register P3
    
    
        Dim bI2CRegister_Reg        As Byte
        Dim bI2CRegister_Data       As Byte
    
    
        Dim bOutputOff_Clk          As Byte
    
    
        Dim bSetupMultisynth_Synth  As Byte
        Dim dSetupMultisynth_Divider As Dword
        Dim bSetupMultisynth_Div    As Byte
    
    
        Dim dSetupPLL_PLL           As Byte
        Dim bSetupPLL_Mult          As Byte
        Dim dSetupPLL_Num           As Dword
        Dim dSetupPLL_Denom         As Dword
        Dim fSetupPLL_Num           As Float
        Dim fSetupPLL_Denom         As Float
    
    
        Dim dSetFrequency           As Dword
    
    
        Dim dSetFrequency_PllFreq   As Dword
        Dim dSetFrequency_L         As Dword
        Dim fSetFrequency_F         As Float
        Dim bSetFrequency_Mult      As Byte
        Dim dSetFrequency_Num       As Dword
        Dim dSetFrequency_Denom     As Dword
        Dim dSetFrequency_Divider   As Dword
        Dim FREQSTR                 As String *8    ' Holds the Frequency as a String for display
        Dim DisplayPos              As Byte         ' For displaying each Frequncy digit
        Dim LocPos                  As Byte         ' Positioning the formatted digit
        Dim HzSeparator             As Byte         ' Can be any character, used to separate digits 14,000,000 or 14.000.000
        
        GoTo Main                                   ' Jump over the subroutines
        
    '---------------------------------------------------------------------------
    $define SI5351A_I2CSendRegister(pReg, pData) '
        bI2CRegister_Reg = pReg                  '
        bI2CRegister_Data = pData                '
        GoSub _SI5351A_I2CSendRegister
    
    
    
    
    _SI5351A_I2CSendRegister:
        BStart
        BusOut cI2C_WRITE
        BusOut bI2CRegister_Reg
        BusOut bI2CRegister_Data
        BStop
    Return
    
    
    '---------------------------------------------------------------------------
    $define SI5351A_I2CReadRegister(pReg, pData)'
        bI2CRegister_Reg = pReg                 '
        GoSub _SI5351A_I2CReadRegister          '
        pData = bI2CRegister_Data
    
    
    
    
    _SI5351A_I2CReadRegister:
        BStart
        BusOut cI2C_WRITE
        BusOut bI2CRegister_Reg
        BReStart
        BusOut cI2C_READ
        bI2CRegister_Data = BusIn
        BusNack
        BStop
    Return
    
    
    '---------------------------------------------------------------------------
    ' Set up specified PLL with mult, num and denom
    ' pMult is 15..90
    ' pNum is 0..1,048,575 ($FFFFF)
    ' pDenom is 0..1,048,575 ($FFFFF)
    '
    $define SI5351A_SetupPLL(pPll, pMult, pNum, pDenom)'
        dSetupPLL_PLL = pPll      '
        bSetupPLL_Mult = pMult    '
        dSetupPLL_Num = pNum      '
        dSetupPLL_Denom = pDenom  '
        GoSub _SI5351A_SetupPLL
    
    
    
    
    _SI5351A_SetupPLL:
        fSetupPLL_Num = dSetupPLL_Num
        fSetupPLL_Denom = dSetupPLL_Denom
        dP1 = (128 * (fSetupPLL_Num / fSetupPLL_Denom))
        dP1 = ((128 * bSetupPLL_Mult) + dP1 - 512)
        dP2 = ((128 * (fSetupPLL_Num) / fSetupPLL_Denom))
        dP2 = ((128 * dSetupPLL_Num) - (dSetupPLL_Denom * dP2))
        dP3 = dSetupPLL_Denom
    
    
    
    
        SI5351A_I2CSendRegister(dSetupPLL_PLL, dP3.Byte1)
        SI5351A_I2CSendRegister(dSetupPLL_PLL + 1, dP3.Byte0)
        SI5351A_I2CSendRegister(dSetupPLL_PLL + 2, dP1.Byte2 & $03) '(dP1 & $00030000) >> 16)
        SI5351A_I2CSendRegister(dSetupPLL_PLL + 3, dP1.Byte1)
        SI5351A_I2CSendRegister(dSetupPLL_PLL + 4, dP1.Byte0)
        SI5351A_I2CSendRegister(dSetupPLL_PLL + 5, ((dP3 & $000F0000) >> 12) | (dP2.Byte2 & $0F)) '((dP2 & $000F0000) >> 16))
        SI5351A_I2CSendRegister(dSetupPLL_PLL + 6, dP2.Byte1)
        SI5351A_I2CSendRegister(dSetupPLL_PLL + 7, dP2.Byte0)
    Return
    
    
    
    
    '---------------------------------------------------------------------------
    ' Set up MultiSynth with integer divider and R divider
    ' R divider is the bit value which is OR'ed onto the appropriate register, it is a $define
    '
    $define SI5351A_SetupMultisynth(pSynth, pDivider, pDiv) '
        bSetupMultisynth_Synth = pSynth     '
        dSetupMultisynth_Divider = pDivider '
        bSetupMultisynth_Div = pDiv         '
        GoSub _SI5351A_SetupMultisynth
    
    
    
    
    _SI5351A_SetupMultisynth:
        dP1 = (128 * dSetupMultisynth_Divider) - 512
        dP2 = 0                                         ' dP2 = 0, dP3 = 1 forces an integer value for the divider
        dP3 = 1
    
    
    
    
        SI5351A_I2CSendRegister(bSetupMultisynth_Synth,     dP3.Byte1)
        SI5351A_I2CSendRegister(bSetupMultisynth_Synth + 1, dP3.Byte0)
        SI5351A_I2CSendRegister(bSetupMultisynth_Synth + 2, (dP1.Byte2 & $03) | bSetupMultisynth_Div) '((dP1 & $00030000) >> 16) | bSetupMultisynth_Div)
        SI5351A_I2CSendRegister(bSetupMultisynth_Synth + 3, dP1.Byte1)
        SI5351A_I2CSendRegister(bSetupMultisynth_Synth + 4, dP1.Byte0)
        SI5351A_I2CSendRegister(bSetupMultisynth_Synth + 5, ((dP3 & $000F0000) >> 12) | (dP2.Byte2 & $0F)) '((dP2 & $000F0000) >> 16))
        SI5351A_I2CSendRegister(bSetupMultisynth_Synth + 6, dP2.Byte1)
        SI5351A_I2CSendRegister(bSetupMultisynth_Synth + 7, dP2.Byte0)
    Return
    
    
    '---------------------------------------------------------------------------
    ' Switches off Si5351a output
    ' Example: SI5351A_OutputOff(cSI_CLK0_CONTROL) will switch off output CLK0
    '
    $define SI5351A_OutputOff(pClk)   '
        bOutputOff_Clk = pClk         '
        GoSub _SI5351A_OutputOff
    
    
    _SI5351A_OutputOff:
        'i2c_init()
        SI5351A_I2CSendRegister(bOutputOff_Clk, $80)        ' Refer to SiLabs AN619 to see bit values - $80 turns off the output stage
        BStop
    Return
    
    
    
    
    '---------------------------------------------------------------------------
    ' Set CLK0 output ON and to the specified frequency
    ' Frequency is in the range 1MHz to 150MHz
    ' Example: SI5351A_SetFrequency(10000000) will set output CLK0 to 10MHz
    '
    ' This example sets up PLL A and MultiSynth 0 and produces the output on CLK0
    '
    $define SI5351A_SetFrequency(pFrequency) '
        dSetFrequency = pFrequency           '
        GoSub _SI5351A_SetFrequency
    
    
    
    
    _SI5351A_SetFrequency:
        dSetFrequency_Divider = 900000000 / dSetFrequency                   ' Calculate the division ratio. 900,000,000 is the maximum internal
        ;; Prints 90                                                                    ' PLL frequency: 900MHz
        If (dSetFrequency_Divider // 2) > 0 Then Dec dSetFrequency_Divider  ' Ensure an even integer division ratio
    
    
        dSetFrequency_PllFreq = dSetFrequency_Divider * dSetFrequency       ' Calculate the pllFrequency: the dSetFrequency_Divider * desired output frequency
        ;; Prints 900000000
    
    
        bSetFrequency_Mult = dSetFrequency_PllFreq / cXTAL_FREQ             ' Determine the multiplier to get to the required pllFrequency
        ;; Prints 33
        
        dSetFrequency_L = dSetFrequency_PllFreq // cXTAL_FREQ               ' It has three parts:
        ;; Prints 9000000
        
        fSetFrequency_F = dSetFrequency_L                                   ' bSetFrequency_Mult is an integer that must be in the range 15..90
        fSetFrequency_F = fSetFrequency_F * 1048575                         ' dSetFrequency_Num and dSetFrequency_Denom are the fractional parts, the numerator and denominator
        fSetFrequency_F = fSetFrequency_F / cXTAL_FREQ                      ' each is 20 bits (range 0..1048575)
        ;; Prints 349525.000
        
        dSetFrequency_Num = fSetFrequency_F                                 ' the actual multiplier is  bSetFrequency_Mult + dSetFrequency_Num / dSetFrequency_Denom
        ;; Prints 349524
        dSetFrequency_Denom = 1048575                                       ' For simplicity we set the denominator to the maximum 1048575
    '   ;; Prints 1048575
    
    
    ' Set up PLL A with the calculated multiplication ratio
    '
        SI5351A_SetupPLL(cSI_SYNTH_PLL_A, bSetFrequency_Mult, dSetFrequency_Num, dSetFrequency_Denom)
        ;;   SI5351A_SetupPLL(26, 33, 349524, 1048575)
    
    
    
    
    ' Set up MultiSynth dSetFrequency_Divider 0, with the calculated dSetFrequency_Divider.
    ' The final R division stage can divide by a power of two, from 1..128.
    ' reprented by constants cSI_R_DIV1 to cSI_R_DIV128 (see si5351a.h header file)
    ' If you want to output frequencies below 1MHz, you have to use the final R division stage
    '
        SI5351A_SetupMultisynth(cSI_SYNTH_MS_0, dSetFrequency_Divider, cSI_R_DIV_1)
        ;; SI5351A_SetupMultisynth(42,90,0)
        
    ' Reset the PLL. This causes a glitch in the output. For small changes to the parameters, you don't need to reset the PLL, and there is no glitch
    '
        SI5351A_I2CSendRegister(cSI_PLL_RESET, $A0)
        ;; SI5351_I2CSendRegister(177,$A0)
        
    ' Finally switch on the CLK0 output ($4F) and set the MultiSynth0 input to be PLL A
    '
        SI5351A_I2CSendRegister(cSI_CLK0_CONTROL, $4F | cSI_CLK_SRC_PLL_A)
        ;; SI5351A_I2CSendRegister(16, $4F | 0)
    Return
    
    
    DisplayFreq:       
        FREQSTR = Str$(Dec8 dSetFrequency)                  ' Store as a string for formatting
        LocPos = 0                                          ' Used to get array data
        DisplayPos = 2                                      ' Initial Display position
        While LocPos <= Len(FREQSTR)                        ' Till the length of the string
            If LocPos <= 1 Then                             ' [0] and [1] position of the array 
                Print At 1,DisplayPos, FREQSTR[LocPos]      ' Print [0] and [1] at location 3, 4
            ElseIf LocPos >= 2 And LocPos < 5 Then          ' Print [2], [3], [4] at 6,7,8
                Print At 1,DisplayPos, FREQSTR[LocPos]      
            ElseIf LocPos >= 5 And LocPos < 8 Then          ' Print [2], [3], [4] at 6,7,8
                Print At 1,DisplayPos, FREQSTR[LocPos]
            EndIf
            Inc LocPos : Inc DisplayPos                     ' Increment the location
            If LocPos = 2 Or LocPos = 5 Then                ' For the two specific locations
                Print At 1, DisplayPos, HzSeparator         ' Print the Hz Separator
                Inc DisplayPos                              ' Move to the next location for display
            EndIf
        Wend
        
    Return
    
    
    '----------------------------------------------------------------------------------------------------------
    Main:
        Clear
        
        'SI5351A_SetFrequency(7000100)
        dSetFrequency = 1000000
        SI5351A_SetFrequency(dSetFrequency)
        
        Cls
        Print At 1,1, "freq: ", Dec dSetFrequency
        Print At 2,1, "VOL "
        'GoSub DisplayFreq

  18. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  19. #10
    Prolific Poster John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,887
    Thumbs Up
    Received: 91
    Given: 34
    Total Downloaded
    4.60 GB

    0 Not allowed!

    Default Re: Si5351A

    Hi Charlie
    A couple of questions
    Did you just use the default fuses?
    Is it possible to modulate the Si5351a?
    John

  20. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  21. #11
    Member CharlieBrown's Avatar
    Join Date
    Jul 2006
    Posts
    147
    Thumbs Up
    Received: 1
    Given: 13
    Total Downloaded
    5.03 GB

    0 Not allowed!

    Default Re: Si5351A

    Yes, I used the default fuses.

    the Ultimate 3S uses some form of modulation, but I know not....... how.

  22. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  23. #12
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,596
    Thumbs Up
    Received: 341
    Given: 162
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: Si5351A

    Well done Charudatt

    It's good to see my code being adjusted so that it works. It certainly was an ordeal to write the code without an actual device to test it on. :-)

    I've had a couple of sample Si5351A devices delivered so I'll investigate the code a bit further, when time permits.

    I've just looked on your profile page Charudatt. That's a good photo and it's good to actually see you, it's like actually meeting you. Maybe one day!

  24. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  25. #13
    Prolific Poster John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,887
    Thumbs Up
    Received: 91
    Given: 34
    Total Downloaded
    4.60 GB

    0 Not allowed!

    Default Re: Si5351A

    I've been busy doing some research. Apparently certain values can aggravate jitter and maybe spurs. The ideal integer divisors may need to be part of the program tests in order to reduce jitter.
    I've ordered one of the Adafruit boards. I'll use your code, but not the same chip as I haven't got one of those. I'll probably use my favourite 16f1827 because I've many in the junk box. I have a spectrum analyser so looking forward to some tests. Not sure what I'll use the completed generator for
    John

  26. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  27. #14
    david
    Guest david's Avatar

    0 Not allowed!

    Default Re: Si5351A

    Hi John,
    The device is a basic fractional mode PLL multiplier and jitter will be awful at many frequencies but acceptable at others. Most network clocks require jitter figures of <300fS when integrated over 12kHz-20MHz. This device is well wide of the mark. If you want good jitter you need a jitter cancelling PLL which is effectively 2 PLLs, one with a good reference clock (for stability) and the other with a low phase noise clock (usually just a xtal). Suitably combined they provide high stability with low phase noise.
    A good example of this is the Si5345/44/42 family which has sub ppt resolution and around 100fS jitter.
    These are very similar devices to talk to and the burst mode (self incrementing addressing) can save a lot of repetitive coding.
    For multi-output applications try to avoid having nearly similar frequencies on two adjacent outputs as they will produce products which may fall inside your jitter integration bandwidth resulting in an unwanted spur.
    For hobby applications this may not be a concern but if you need good phase noise and jitter performance then the jitter cancelling types are preferred.

    Cheers,
    David

  28. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  29. #15
    Member CharlieBrown's Avatar
    Join Date
    Jul 2006
    Posts
    147
    Thumbs Up
    Received: 1
    Given: 13
    Total Downloaded
    5.03 GB

    0 Not allowed!

    Default Re: Si5351A

    Thank you for your help Les, without , which , it wouldn't have been possible.

    Nice to know that you got some samples. I was trying to understand the datasheet, but its bloody confusing. Why don't they make it simpler.....

    I sincerely , look forward to seeing more of it , from you (Les)

    The most important part of getting this code to work , was using a PIC controller for the Job, what could be more interesting than, having a code in my famous complier.

  30. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. [SOLVED !] Si5351A with Proton ?
    By AlanGC in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 26th October 2015, 20:46

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts