Shop Learn
This'll clean your clock! -- and calm your jitters. — Parallax Forums

This'll clean your clock! -- and calm your jitters.

Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,057
edited 2010-06-06 09:56 in Propeller 1
The Propeller's NCO and PLL counter output modes suffer phase jitter under certain circumstances, namely when there are a lot of "1" bits after the highest-order "1" bit in FRQx. The jitter can be remedied by adding an external PLL. This will help, even with the counters' PLL mode, if the external PLL has a longer time constant than that of the Propeller's built-in PLLs. To test this, I used the following short program to generate a jittery counter output:


  [b]_clkmode[/b]      = [b]xtal1[/b] + [b]pll16x[/b]
  [b]_xinfreq[/b]      = 5_000_000

[b]PUB[/b] start

  [b]frqa[/b] := $f77_7777
  [b]ctra[/b] := %00100 << 26 | 0
  [b]dira[/b] := 1

The output frequency was around 5 MHz with pronounced phase jitter. I ran this signal through the following circuit, which is a phase-locked loop* with an extremely long time constant (i.e. not one you'd want to use for frequency modulation):


The result was a square wave clock of the same average frequency, but without the phase jitter. To quantify the improvement, I ran each signal through my scope's FFT analyzer, saving the raw input as a reference, and displaying the PLL'd spectrum below it:


Clearly visible in both spectra are the fundamental and some odd harmonics, as would be expected from a square wave. But the straight counter output has a lot of small peaks nestled amongst the expected harmonics, which is caused by the phase jitter. The PLL output has none of that.

I haven't tried shortening the PLL time constant to see where the jitter starts to show up. This was more just a proof of principle to see if the external PLL would help. And it did.


* The 74LV4046 is just a much speedier cousin to the venerable CD4046.
719 x 401 - 5K
640 x 480 - 11K


  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-06-05 07:57
    Good to see a solution with an old-school chip like the 4046. This is a very nifty circuit. Nice FFT. Well done.


    Post Edited (Dr_Acula) : 6/5/2010 8:02:25 AM GMT
  • heaterheater Posts: 3,370
    edited 2010-06-05 08:52
    Phil, thats neat.

    Do you have an application in mind? Looks like something the "Propeller as radio transmitter" idea could use.

    For me, the past is not over yet.
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-06-05 11:02
    The spec sheet says that it should be good to 38MHz at 3.0-3.6V. But then it says something about the centre freq of 10MHz (with 50% duty cycle) I will have to go and read about what that means.

    Why did I think a new, more challenging, job was a good idea ??
  • BeanBean Posts: 8,122
    edited 2010-06-05 13:17
    Can you also check what frequency range the circuit works at (without changing any componet values) ?
    I'd be very interested to know.


    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.
    PropBASIC thread

    March 2010 Nuts and Volts article·
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    There are two rules in life:
    · 1) Never divulge all information
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    If you choose not to decide, you still have made a choice. [noparse][[/noparse]RUSH - Freewill]
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,057
    edited 2010-06-05 17:16
    Thanks, guys. Heater, yes, a HF transmitter design is percolating in the back of my mind. I've also obtained a DDS chip that has a sinewave output and programs via I2C, but it's considerably more expensive than the '4046. Toby and Bean, I'm not entirely sure what the frequency specs mean either, and I'll have to experiment with the lock-in range. The 74LV4046 datasheet is pretty sketchy with the details, and I've had to rely on CD4046 and 74HC4046 datasheets, along with an ancient PLL "cookbook", to fill in the gaps. Unlike the CD4046, the LV version has three phase comparators, but I've only tried #2.

    'Still a lot experimenting to do...

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,057
    edited 2010-06-05 18:39

    It appears that, with the circuit shown, the capture and lock range is 2.5 MHz to 5.6MHz.

  • bill190bill190 Posts: 769
    edited 2010-06-05 19:15

    Instead of using NCO, could you use PLL single-ended, then set the PLL to 1x and get the same result? (Use the Propeller counter internal PLL?)
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,057
    edited 2010-06-05 20:14
    No, the Prop's internal PLLs have too short a time constant to quell all the jitter.

  • LeonLeon Posts: 7,620
    edited 2010-06-05 20:43
    Here is a chip that is intended specifically for removing jitter:

    It uses a low-cost crystal and varactor diode.

    Leon Heller
    Amateur radio callsign: G1HSM
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,057
    edited 2010-06-05 23:27

    'Interesting chip family. They have a high pin count, though, and are a bit on the spendy side.

  • LeonLeon Posts: 7,620
    edited 2010-06-06 09:56
    I've got some of their PLL chips, but haven't tried them yet.

    Leon Heller
    Amateur radio callsign: G1HSM
Sign In or Register to comment.