• 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

    TwoFreq si5351a.zip
  • Recent Activity

    xldaedalus-432

    Mysterious PORTB problem

    Thread Starter: xldaedalus

    I'm using Proton+ to develop firmware for a product with switches. The MCU is an 18F26K22. Most of the switches reside on PORTB. I am NOT using a...

    xldaedalus Yesterday, 18:21 Go to last post
    Les-15

    Pic16f18877 oread

    Thread Starter: evoortman

    Hi, On a PIC16F18877 the OREAD command doesn't seem to work. The code is working on a PIC16F1939. Both controllers use 32MHz int osc. If i...

    Les Yesterday, 13:05 Go to last post
    amod-29593

    Multiple functions by a single switch

    Thread Starter: amod

    Hi, How can I use multiple function by a single switch.I want to use 4 functions by a single switch.

    amod Yesterday, 15:31 Go to last post
    Oldhack-15978

    FUSES for PIC18F47K20

    Thread Starter: gtv_pic

    000 Good morning I am using the PIC18F47K20 and in the help of the proton I did not locate the FUSES for said micro. Where can I locate...

    Oldhack Yesterday, 16:34 Go to last post
    Les-15

    SHIN generates ASM ERROR with the 16F18877

    Thread Starter: evoortman

    Hi, On a PIC16F18877 the SHIN command generates an ASM ERROR: Could this also be related to renamed or moved SFRs in the newer controllers? ...

    Les Yesterday, 19:18 Go to last post