Proton BASIC Compiler - Frequency synthesiser si5351a

  • PicŪ Basic

  • Frequency synthesiser si5351a

    This article describes some experiments with the si5351a synthesiser chip.
    There are sample programs written in C on the web but nothing in BASIC. Thanks to Les Johnson (the developer of PDS) a conversion to Proton Basic has now been achieved.

    Several of us have contributed to this development since - CharlieBrown, AlanC, David and myself. We made use of the initial conversion by Les.

    From the datasheet:
    "The Si5351 is an I2C configurable clock generator that is ideally suited for replacing crystals, crystal oscillators, VCXOs, phase-locked loops (PLLs), and fanout buffers in cost-sensitive applications. Based on a PLL/VCXO + high resolution MultiSynth fractional divider architecture, the Si5351 can generate any frequency up to 160 MHz on each of its outputs with 0 ppm error. "

    Several of us have used the si5351a module from Adafruit. It is cheap, very stable in its operation and uses little current (<30mA). It is possible to change the output level via settings of 2mA, 4mA, 6mA and 8mA.

    The output is a square wave so is quite rich in odd harmonics. Generally it will be necessary to use a low pass filter somewhere in your circuit although in some situations the harmonics can be used to advantage.

    As the micro only has to provide an I2C command almost any PIC(c) can be chosen. The example uses a PIC16F1827 but only because I have a stock of these and the device has an internal clock - saves on a crystal.

    Accuracy of the Adafruit module is quite good but it can be easily trimmed by making adjustments to the crystal clock setting in the program (see cXTAL_FREQ ). When you have cXTAL_FREQ right the rest of your frequencies will be accurate. In my case I'm getting within a Hertz or two as measured by my frequency meter. Temperature stability is good despite the simplicity of an exposed crystal.

    I have not yet built a circuit board. Experiments have been done on prototyping board. There are numerous references about the need to have a really clean supply to avoid hum. The output signal from my very crude setup is reasonably clean but I can just detect some mains hum. Jitter seems quite acceptable. My final build will use battery power as I plan to make it a portable unit for repeater measurements.

    The most basic circuit is a +5V supply, a micro of your choosing, an LCD as an option and the Adafruit board. I've added two resistors to perform a switch function on the project. One switch causes the unit to move up to the next frequency in eedata memory and a down button to move down through the eedata list. Wrap around is performed.

    The attached circuit is by way of getting users started, it is not a final project but you should be able to use the program for modifications to your needs.

    It is worth noting that the si5351a supports two ports (one for each PLL) when using integers. To use the third port two of the CLK outs must share a PLL and therefore must be in an integer relationship, alternatively a floating point approach must be used which will result in more jitter. Until I learn how AND need the third, two outputs will be more than acceptable.

    I would like to modulate the device but there is no simple way. I'm looking at two alternatives (1) a varactor diode across the crystal or (2) using a phase modulator out of an old commercial FM transceiver.

    I suggest you read the discussion here to follow the development of the project.
    The ZIP file is my test program.

    Attachment 3039

    Showing the harmonic content from 6MHz to 100MHz with CLK0 set to 7.1MHz as the fundamental. Notice the even harmonics are well down on the odd harmonics.

    Have fun
    John Drew

  • Recent Activity


    UART and USB Issues with PIC18F97J94

    Thread Starter: mitch

    I am having trouble getting UART3, UART4 and the USB to work on a PIC18F97J94.. I am migrating a project from the 18F47J53 to an 18F97J94 as I...

    top204 Today, 13:36 Go to last post