Counter PLL won't sync at 5.71 MHz (Never Mind)
Rayman
Posts: 14,822
I'm looking into what frequencies can be generated by the PLL without jitter...
·
Doing this by setting PHSA in an assembly loop.
·
I've been able to generate 7 frequencies in the range of 4 to 5.71 MHz this way.
But, the PLL won't sync right and I don't see why...
·
I've attached my test file set to produce a perfectly symmetric 5.71 MHz square wave [noparse][[/noparse]175ns period] in NCO mode.
But, when I turn on the PLL, it won't sync.· I think it should sync with anything between 4 and 8 MHz, so I'm stumped...
Anybody see what's going on?
Thanks to Phil for showing me the error of my ways.
Post Edited (Rayman) : 7/11/2008 6:01:19 PM GMT
·
Doing this by setting PHSA in an assembly loop.
·
I've been able to generate 7 frequencies in the range of 4 to 5.71 MHz this way.
But, the PLL won't sync right and I don't see why...
·
I've attached my test file set to produce a perfectly symmetric 5.71 MHz square wave [noparse][[/noparse]175ns period] in NCO mode.
But, when I turn on the PLL, it won't sync.· I think it should sync with anything between 4 and 8 MHz, so I'm stumped...
Anybody see what's going on?
Thanks to Phil for showing me the error of my ways.
Post Edited (Rayman) : 7/11/2008 6:01:19 PM GMT
Comments
hard copy of the Propeller Manual soon. It may be OT because it's not relevant to your code.
Is this way of synthesizing frequencies possible? ... :
To use a clock crystal for the propeller that's 8.192 Mhz (yes this works).
To output one bit of a counter running at 8.192 Mhz x PLL to get 1 kHz (I don't know but I think so).
To count the counter by not only 1 but by adding any other number to it. (I'm not sure but I think so).
The number that you add to the counter should make that (n Khz) frequency come out of the bit without any jitter
up to a certain frequency maybe 4.096 Mhz and probably even 5.71 Mhz.
This is like square wave DDS I guess, and the PLL shouldn't be unstable with it for
any reason that I know about since PLL would be crystal controlled to a multiple of 8.192 MHz all the time.
(This is simple: a counter clocked by F=8192 will output F=1 on bit 12 unless it's not counting by ones,
in which case bit 12 outputs F=whatever number is added to the counter on every clock tick.)
I'll assume that since everyone says the Propeller can't synthesize High Frequencies without jitter that
this idea can't be done, but maybe only the method of locking the PLL on variable frequencies jitters.
Post Edited (VIRAND) : 7/9/2008 10:25:45 PM GMT
However, because the pll essentially takes the average of the input signal over a few cycles the signal you feed in doesn't have to be quite perfect. For instance if there is a glitch in every second cycle the pll will probably clean it up. This means that you should have a few more frequencies to play with.
I think Rayman and I are both interested in whether it is possible to make a frequency synthesizer
with the Propeller that doesn't jitter, but although a typical frequency synthesizer uses a PLL and one
crystal and counters, the Propeller PLL apparently doesn't work well that way,
and I hope a different method will work that doesn't need the PLL.
I.e.,
130 MHz, 120 MHz, 110 MHz, 100 MHz, 90 MHz, 80 MHz, and 70 MHz
look relatively stable...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
The above frequencies come from FREQA= $1000_0000, $1200_0000, $1400_0000, $1600_0000, $1800_0000, $1A00_0000, $1C00_0000
I would still like to know why the PLL doesn't work in the code with the first post.
·
To be completely jitter free, shouldn't the desired frequency have a·period that's exactly·divisible by the PLL Clock?
·
i.e.
·
80MHz = 12.5ns
5.71MHz = 175.131348...ns
175ns would be divisible, but I don't think that was the intent.· That would give a frequency of·5.714285...MHz
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
I think there's more to it than that. Every time FRQx is added to PHSx, causing bit 31 to toggle, there's a residual remainder — or not. This remainder accumulates over time, causing an earlier bit 31 toggle somewhere down the line. The earlier toggle is what causes the jitter. The more "1" bits there are after the first "1" bit in FRQx, the more often (per toggle) a non-zero remainder occurs; hence, the more pronounced the jitter.
-Phil
Update: Reading the thread again, I think Paul and I are talking about one thing (letting the counter generate the frequency); Beau and Rayman, about another (doing it under program control). The former can produce more different frequencies at the high end of the spectrum, but they are subject to jitter. The latter produces more frequencies at the lower end of the spectrum (frequency = clkfreq/n), but they are jitterless. Also, many of the jitterless frequencies produced under program control can't be replicated without jitter by the counters which, I think, is what Rayman was trying to demonstrate.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Still some PropSTICK Kit bare PCBs left!
Post Edited (Phil Pilgrim (PhiPi)) : 7/11/2008 5:25:29 AM GMT
The code in the first post produces a perfect square wave in PHSA[noparse][[/noparse]31] and yet it won't work in PLL mode...
The reason your code didn't work in PLL mode is that your waitpeq is looking at the pin (ina), which is the output of the PLL, not phsa.31, which is the input to the PLL. Even if you were using the x1 output (PLL / 16 tap), there's no reason to expect the output to be in phase with phsa.31. The phases may be locked, but that doesn't mean they're identical. I don't know what kind of phase detector the Propeller uses, but some PLLs lock when the the input and output phases are in quadrature (90 degrees out of phase) with each other.
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Still some PropSTICK Kit bare PCBs left!
Post Edited (Phil Pilgrim (PhiPi)) : 7/11/2008 3:30:11 PM GMT
·
Right, even allowing the counter to do this might still introduce a system "heart beat" as the PLL gets updated or adjusted.· My limited understanding of a·PLL, is that you basically have a VCO (voltage controlled oscillator)...·If for example you are multiplying by a factor of 16 as a function of the PLL, then for the·coarse adjustment of the PLL, you look for 16 pulses on a counter incremented from the VCO and that gets reset·every system clock interval.· (Too many pulses, the VCO gets bumped down ; Too few pulses, the VCO gets bumped up)· For the fine adjustment of the PLL you do a Phase comparison on the last edge of the 16 pulses against the edge of the system clock.· In this case, simply dividing the output of the VCO by 16, and then doing a Phase comparison with the system clock.· Depending on the lead or lag in Phase delay, the VCO gets bumped up or down.· The adjustments are made by bumping up or bumping down the input voltage to the VCO.· The difference between coarse and fine is usually controlled·by the amount of current or how many transistors are switched on to charge or discharge the VCO caps.··A dynamic approach would have several current levels.· Depending on the magnitude of the Phase error determines·the charge or discharge current used.·
·
Selecting a frequency that is·closer to the system heartbeat, I would think, will introduce the least amount of jitter no matter which method you choose.
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 7/11/2008 4:27:27 PM GMT
Thanks!· I had a feeling I was missing something...· Now, I feel stupid...
I appreciate you taking the trouble to set me straight!
Ray