Help with crystals/PLL

Go To Last Post
46 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I need to generate the following two frequencies (one at a time):

12083919 Hz
18125879 Hz

Any suggestions regarding how to go about it are welcome.
Are crystals with these frequencies available? They are not in my part of the world. :(

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Perhaps a reasonable fast DDS chip from analog devices ?

What other requirements:
sinus, square, stability, accuracy, jitter/noise,
amplitude,....

Later added:
You could also use a PLL style approac.
Program an AVR as 32 Bit DDS so that it outputs 10kHz
if its clock frequency is your desired frequency.

Generate the AVR clock by a varactor tuned LC
oscillator and lock it using the 10kHz output to
a known 10kHz frequency (generated by another AVR
or something similar).

This can be built from ready to get parts on one
weekend without going to shops.

Last Edited: Sat. Aug 30, 2008 - 10:14 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

What other requirements:
sinus, square, stability, accuracy, jitter/noise,
amplitude,....

Oops! Should have mentioned that right off the bat. :oops: Just a regular crystal oscillator type square wave (nominal, exact square wave not a critical requirement). Nothing special. To be used as a clock for an AVR. Small amounts of jitter are not an issue, but the average frequency should not drift much.

There is a stable frequency signal available on board which can be used to generate these frequencies, although the PLL divider ratio would be a little strange (768 and 1152 respectively). Hence my mention of the PLL technique. I'm aware that PLL design is not trivial, hence the alternate solution using crystals might be preferred.

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How about an Si570 synthesiser? You'll need a divider on the output, as the minimum frequency is a lot higher than you require.

Leon

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What is the reason for these weird frequencies? I am guessing you need this for some non-standard serial interface?

There is probably an easier way to get around your problem with off the shelf crystals...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

These weird frequencies are linked with NTSC horizontal sync frequencies. So no leeway there. Have to work with them. :(

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you can manage to create a 6.041959MHz clock from an AVR or other, then you can use a PLL multiplier to get your two frequencies at x2 and x3, or x4 and x6 from a 3.020979MHz clock...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hmm.. don't some of the mega series have a PLL as a system clock source?

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

UNiXWHoRe wrote:
If you can manage to create a 6.041959MHz clock from an AVR or other, then you can use a PLL multiplier to get your two frequencies at x2 and x3, or x4 and x6 from a 3.020979MHz clock...

This seems to be the best approach. :)

Can anyone recommend a low cost PLL + divider combo that will do the job? Or will I have to go back to the glue logic I used decades ago?

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Perhaps something like this:

http://www.ak-modul-bus.de/cat/d...

Added by edit:
or this

http://www.ak-modul-bus.de/cat/d...
http://www.ak-modul-bus.de/cat/d...

In which way are the frequencies related to NTSC ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Horizontal frequency x 768 and 1152.

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Could use two of these with a small AVR to generate the 6.041959MHz clock:

http://search.digikey.com/script...

Or you could just use some AVR that has two separate high speed timers and generate the clocks by PWM directly... Tiny461 has this, uses an integrated PLL to multiply the timer's reference clock up to 64MHz. Some of the Mega's have this too, I think the mega48 off the top of my head... All that would be needed is a buffer apart from the AVR...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

UNiXWHoRe wrote:
If you can manage to create a 6.041959MHz clock from an AVR or other, then you can use a PLL multiplier to get your two frequencies at x2 and x3, or x4 and x6 from a 3.020979MHz clock...

Just in case you're interested at how I did the maths on this:

12.083919MHz / 18.125879MHz = 0.6666...

So first frequency is 2/3's of the second, so take the second, divide by 3, and use this as a base frequency for multiplication... This one was easy because both frequencies have a common denominator down to half a Hertz. If they would be different, you would have had to multiply both to an intermediate frequency (usually much higher that the input) that have a common denominator and work a base frequency with a divider from there.

Last Edited: Sat. Aug 30, 2008 - 06:47 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Tiny 25,45,85 do have a PLL, but it is tied to the RC oscillator. :( You all know my feelings about that. :roll: I want the PLL tied to the crystal oscillator, or maybe have a separate PLL IC altogether.

cy2071a from Cypress seems promising, but their datasheet sucks. Looks like it needs to be factory programmed. :(
http://sss-mag.com/pdf/cy2071a.pdf

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As I said in my first post, I don't need them both together, just one at a time, maybe just one, period.

I think 3.020979MHz crystals are available. I could synthesise the desired frequencies from that, no problem. Are there suitable ICs which will do this cheaply, or do I need to go back to the CD4046 types in conjunction with CD4520 and some glue logic (not sure about the IC numbers; its been a while - about 18 years).

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do you HAVE to use a Tiny25/45/85 and the internal oscillator? Tiny261/461/861 are similar but have timer1 configurable to use a pll-multiplied system clock as reference clock, so you can multiply your AVR clock (for example 8MHZ) by 4 and have the Timer operate at 32MHz. Then it's just a matter of configuring the timer to PWM your two frequencies. They have 3 PWM outputs with separate registers (prescaler I think is common). This approach would need no external PLL at all, just a good quality 8MHz clock source for the AVR.

For video applications I would steer clear of the internal oscillator. Do yourself a favor and use a xtal, or at least a good quality ceramic resonator.

Last Edited: Sat. Aug 30, 2008 - 07:00 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks. That was just the information I needed. :D Damn Atmel site doesn't tell you which AVRs have PLLs. :P I was NOT looking forward to downloading all the data sheets and going through them one by one. If anyone has a list of AVRs which have this PLL thingy like UNiXWHoRe kindly pointed out, please lead me to it.

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

From the Tiny261 data sheet:

Quote:
The source of the PLL input clock is the output of the internal RC oscillator having a frequency of 8.0 MHz

This is not looking good. :(

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well then calibrate it... ;)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

For video applications I would steer clear of the internal oscillator. Do yourself a favor and use a xtal, or at least a good quality ceramic resonator.

;)

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The traditional way to do this is simply to use a pll - like the glue logic HCT4066 which is good for 18MHz at 5v - with a sync separator from incoming line syncs in one comparator input and the output followed by the divide by 768 or 1152 and fed to the other. Adjust the filter on the output of the comparator so the change in voltage as the phase changes is small enough to keep your frequency jitter in spec.

This works *very* well - to the point of creating non-jittering graphics on live asynchronous video signals.

Neil

p.s. your numbers look as if you're sampling video - traditionally this is done at either three or four times subcarrier frequency. But there's no point sampling line and field syncs - and frankly, there's no point designing such a system at the moment; look here: http://www.interfacebus.com/Seri...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@neil
I think you mean a 4046, and there are many
different versions of it, not all go into the
20 MHz range !

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

The traditional way to do this is simply to use a pll - like the glue logic HCT4066 which is good for 18MHz at 5v - with a sync separator from incoming line syncs in one comparator input and the output followed by the divide by 768 or 1152 and fed to the other.

That is how I was planning to do it. Any ready-made ICs for this? Surely there must have been some progress in the past 18 years. A user programmable version of the Cypress CY2071a (link to data sheet above) would have been just the thing. :(

I suppose I could use the CD4046 in conjunction with an AVR, feeding the PLL output into the external clock input of one of the timers.

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did you also check that one
(mentioned above)

http://www.ak-modul-bus.de/cat/d...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

CY27EE16 is a bit overspecified. 6 waveform generators with 2K EEPROM each.

The ICS501 would be the way to go if I decide to generate the frequencies from a 3.020979MHz crystal. :D

The ICS3070102 is also looking pretty good. Wonder how much these cost.

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The ICS525 is looking even better. :) Thanks for telling me about this manufacturer - seems to be making the kind of stuff I need.

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

4064. Doh. The HCT is fast enough...

Sony used to make special divider chips for their video recorders that divided by interesting numbers like 1173... doubt they're still available though.

Tiny13A has a CTC timer 1, I think, and will clock at 20MHz; does it have the right divide ratios to act as a programmable divider for those values?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ah, no timer 1, but a timer 0 (eight bit) that ought to do with a little program logic... so you could get the division from a single chip and an external pin to select the ratio.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

http://www.ak-modul-bus.de/stat/...

prices are euro.

ICS501: 2.90 Euro
ICS307-2 4.90 Euro
CY27EE16 7.40 Euro

in Germany

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Or an Analog Devices DDS chip with one freq in Register A and the other in register B, so you can easily swap back and forth between them. But a rather pricy option.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did I mention low cost and low part count? :oops:

Thanks for all the suggestions. I love this forum. :D

Neil: the problem with the Tiny13 timer is the synchronizer/edge detector for the external input.

Quote:
However, due to variation of the system clock frequency and duty cycle caused by Oscillator source (crystal, resonator, and capacitors) tolerances, it is recommended that maximum frequency of an external clock source is less than clk_I/O/2.5.

I suppose I could run the AVR itself (system clock) off the output of the PLL but this seems a tad risky to me. Once the PLL has stabilized and is in lock there is no problem, but what about when it is not?

The timer on a Tiny261 can run at 64MHz, but only off the internal PLL that is locked to the internal RC oscillator. On top of this there are the output synchronization registers which will introduce a delay that I'm sure a PLL will not like. :(

Hopes of using an AVR for this are fading. :(

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Emuler, I was thinking a two-chip solution; use the 4064 as the detector/pll/oscillator and the tiny only as a divider. You're comparing your line sync with the output of the tiny; the clock input is the desired output frequency. Two small inexpensive chips seems not a bad compromise.

I suppose it's possible that the tiny could replace the 4046 as well; I'd have to think about that one, but that approach I'd take would be to feed it the sync pulse on an interrupt input pin and provide an exored output with the internal high bit of the count; filter that and use it to drive the oscillator. To keep timings consistent, sleep mode guarantees a constant time from interrupt to action - internal or external. But since you need the oscillator anyway, I'd rather drive it as an external chip and keep all the pll logic separate.

It might be easier with a larger AVR (M8 perhaps) for the extra counters if you wanted to keep it all in one chip.

I seem to recall a thread a year or so go about using an AVR with a crystal and varactor diode to self-regulate its oscillator frequency.

Neil

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Emuler, I was thinking a two-chip solution; use the 4046 as the detector/pll/oscillator and the tiny only as a divider.

I'm with you all the way on this. What I'm concerned about though is the varying output of the PLL before it locks. Maybe I'll put additional circuitry to limit the excursions of the PLL output so that it doesn't violate the clock requirements of the AVR. Maybe use the prescaler as well so that the AVR only sees half the frequency of the PLL output.

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If the tuning range of the PLL is not large (10 percent
or so), I think the locking process will not disturb
the AVR. It may even be possible to use the AVRs
oscillator circuit to built an varactor-tuned LC
oscillator. Then with the phase/frequency
comparator within the AVR its a one-chip
solution, but for series production a tuned LC
circuit is not so nice.

http://www.edn.com/archives/1998...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If your frequency change is slow, this shouldn't be a problem. If you don't need to change the frequency in real time, i.e. each unit will be one or the other, not both, then you could construct an oscillator which is constrained quite tightly and have a lot of filtering on the VCO signal.

Neil

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks, ossi and Neil. I was a bit concerned because 18MHz is not very far away from the 20MHz AVR limit.

Tentative topology:

1. input signal fed to PLL
2. output of PLL goes to clock of AVR
3. divided output from AVR fed back to other input of PLL

I'll have to check whether the 4046 will work well with pulse waveforms or whether I will have to make them square waves (50% duty cycle). Two more flip-flops. :( IC count rising ominously.

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

1) *reference* signal sent to pll
2) output of *vco* fed to AVR

You don't need to match the waveforms' shape. The 4046 has a couple of options for input comparison including a flip-flop output on pin 13 which might be your best bet.

You will need to ensure that you select a suitable type and possibly manufacturer - most HCT seem to top out at 18MHz but I did find one that did 20MHz, I think.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A good datasheet:

http://www.nxp.com/acrobat_downl...

But Philips/NXP has also a very good application
note about 4046, don't know if it's available
on the web.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks guys. This seems doable. Might have to run the part at 6V Vcc to get the 18 MHz, but that's no biggie. 12 MHz should not be a problem.

I have the National Semiconductor HCMOS data book which has a nice appnote for this. Got to dig it out.

Need to work on other parts of the circuit now, but I'll come back to this when those are done and tell you how I got along. Thanks again. :D

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Btw. for PAL (which is what we use over here) the same ratios can be obtained by using standard 12 and 18 MHz crystals. No need for all these shenanigans.

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

PAL is the only proper in-band colour TV system. NTSC was rushed to market and they never resolved the issues with subcarrier frequency drift across a line, and, really, the less said about SECAM the better - save perhaps to note that the French broadcasters found the only way to perform clean mixes was to transcode to PAL and then back to SECAM later.

Me? Thirty years in the PAL-centric BBC? How did you guess? :mrgreen:

btw is your NTSC signal working at 60Hz field or 59.94?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

btw is your NTSC signal working at 60Hz field or 59.94?

Oh Lord! Now you're scaring me. :o :cry:

All the more reason for a PLL; let the PLL sort it out. :P

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are other simple PLL chips (e.g. LM564) around that are faster than the 74HC4046, so you could run everything on 5 V and no problem with being close to the limit.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did you mean LM565? VCO maximum operating frequency = 500 kHz. :(

If you think education is expensive, try ignorance.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sorry I got the wronge chip name: SE564 or NE564 are fast PLL chips, up to 50 MHz. Not low power CMOS, but that does not matter much at these high frequencies.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This idea

http://www.nxp.com/acrobat_downl...

seems also to work with AVRs (tested it with ATmega88),
so add a varactor diode and the oscillator-part is done.
Divider and phase-comparator can also be done in an AVR.