PDA

View Full Version : This'll clean your clock! -- and calm your jitters.



Phil Pilgrim (PhiPi)
06-05-2010, 03:23 PM
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:




CON

_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000

PUB start

frqa := $f77_7777
ctra := %00100 << 26 | 0
dira := 1
repeat




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):

http://forums.parallax.com/attachment.php?attachmentid=70867

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:

http://forums.parallax.com/attachment.php?attachmentid=70868

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.

-Phil

* The 74LV4046 is just a much speedier cousin to the venerable CD4046.

Dr_Acula
06-05-2010, 03:57 PM
Good to see a solution with an old-school chip like the 4046. This is a very nifty circuit. Nice FFT. Well done.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller (http://www.smarthome.viviti.com/propeller)

Post Edited (Dr_Acula) : 6/5/2010 8:02:25 AM GMT

heater
06-05-2010, 04:52 PM
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 Seckshund
06-05-2010, 07:02 PM
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 ??

Bean
06-05-2010, 09:17 PM
Phil,
Can you also check what frequency range the circuit works at (without changing any componet values) ?
I'd be very interested to know.

Bean

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
There are two rules in life:
· 1) Never divulge all information
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you choose not to decide, you still have made a choice. [RUSH - Freewill]

Phil Pilgrim (PhiPi)
06-06-2010, 01:16 AM
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

Phil Pilgrim (PhiPi)
06-06-2010, 02:39 AM
Bean,

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

-Phil

bill190
06-06-2010, 03:15 AM
Hummm...

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)
06-06-2010, 04:14 AM
No, the Prop's internal PLLs have too short a time constant to quell all the jitter.

-Phil

Leon
06-06-2010, 04:43 AM
Here is a chip that is intended specifically for removing jitter:

www.national.com/analog/timing/clocking (http://www.national.com/analog/timing/clocking)

It uses a low-cost crystal and varactor diode.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM

Phil Pilgrim (PhiPi)
06-06-2010, 07:27 AM
Leon,

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

-Phil

Leon
06-06-2010, 05:56 PM
I've got some of their PLL chips, but haven't tried them yet.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Leon Heller
Amateur radio callsign: G1HSM