Is there a simple trick to get integer multiples of oscillator frequencies? - Page 1
Forum section: electronics / beginners

author: magetoo
author_rank: Frequent Contributor
timestamp: July 24, 2014, 09:18:51 am
content: So here's something that's been rattling about in my head lately. Not terribly important, but I wonder how people who know what they are doing would solve this.I have this idea of running a certain old sound chip at a nonstandard frequency in order to hopefully get it to play nicely with modern parts and audio rates; this nonstandard frequency is a little odd, but happens to be exactly three times a common value for crystals for UARTS/baud rate generation. So that got me thinking, how would one go about multiplying a clock frequency by three?Clock / frequency generation is not something I've really had to think about much so far. Lately I've been reading up on PLLs, but 3:1 is so close that it seems there might be a simpler way; this won't need gigahertz or tunability or some oddball 42:pi ratio.Spoiler: What I'm looking for is 13.824 MHz, and parts for that frequency do seem to exist. I'm still curious to hear if there's a junk box solution to this sort of thing that's obvious to everyone but me. (Getting higher harmonics out of the crystal maybe?)

author: Andy Watson
author_rank: Super Contributor
timestamp: July 24, 2014, 09:35:36 am
content: Tank circuits!Make an L-C circuit resonant at the frequency you desire. Excite with lower frequency and use a couple of gates to square-up the output again. Essentially, you are making a band-pass filter to select-out the harmonics of the original clock. It helps if the original clock is not sinusoidal (you need the harmonic content).

author: KJDS
author_rank: Super Contributor
timestamp: July 24, 2014, 09:37:19 am
content: if you can get a crystal, rather than an oscillator, design the oscillator circuit to run on the third harmonic of the crystal. That does mean you'll need a transistor and an LC tuned circuit but its far easier than a multiplier.

author: Unknown
author_rank: Unknown
timestamp: July 24, 2014, 09:42:21 am
content: Google "harmonic oscillator". The basic idea is use the crystal for a square wave oscillator at its fundamental frequency, then add a narrow bandpass fiter for the 3rd harmonic. Throw in something to square it up, and you've got a clock.Myself, I keep a couple of LTC690* silicon oscillators handy for less critical applications like yours. Cheaper & easier

author: magetoo
author_rank: Frequent Contributor
timestamp: July 24, 2014, 11:23:56 am
content: That was pretty quick, thanks for the replies!Quote from: Tac Eht Xilef on July 24, 2014, 09:42:21 amslaps foreheadThat's really quite obvious, now that you (both) mention it. Why didn't I think of that right away?And I'm guessing that if one can leave the crystal out of the loop and get a nice square wave in, then the filter doesn't have to be amazingly narrow and sharp either, as long as it rejects f and 5f well enough. Hmm.QuoteHow dare you call my digitally pristine 48kHz audio "less critical". :-)Neat chips! I'll have to remember those for next time I order something.Quote from: KJDS on July 24, 2014, 09:37:19 amSee, that's the kind of thing that is obvious to people who actually know what they are doing, but completely above my head.I guess you'd go about it the same as a circuit for oscillating at the fundamental frequency, and then tune "everything else" (that isn't the crystal) for the harmonic you are interested in? Or does one need to suppress the fundamental somehow too?Guess I've got some reading to do.

author: KJDS
author_rank: Super Contributor
timestamp: July 24, 2014, 12:09:15 pm
content: It's not about filtering, it's about getting the oscillator to oscillate at the thrid harmonic. I hate oscillator design but here's an example of how it's done.http://books.google.co.uk/books?id=e_oZ69GAuxAC&pg=PA184&lpg=PA184&dq=crystal+harmonic+oscillator&source=bl&ots=vZhJYniUar&sig=fv9TpaFZpJBkG_H9Zd4FJPJox7M&hl=en&sa=X&ei=G_fQU_3rCsXm7AbP84DYBQ&ved=0CD4Q6AEwAw#v=onepage&q=crystal%20harmonic%20oscillator&f=false

author: vk6zgo
author_rank: Super Contributor
timestamp: July 24, 2014, 12:50:23 pm
content: Actually,the frequency it will oscillate at is an "overtone" which is usually very close to,but not exactly the same as a harmonic of the fundamental.Google for "Overtone Oscillator".

author: nitro2k01
author_rank: Frequent Contributor
timestamp: July 24, 2014, 01:32:06 pm
content: Out of curiosity, which sound chip? 10+ MHz is far too high for SID. Is it YMF262 or one of the other OPL chips maybe?

author: T3sl4co1l
author_rank: Super Contributor
timestamp: July 24, 2014, 05:30:11 pm
content: If you're still curious, there are a few ways:The most old-fashioned is an injection locked oscillator. The oscillator is typically a blocking oscillator or relaxation oscillator type, which has a voltage or current that charges slowly, until approaching, and then crossing a threshold. When that happens, it fires a pulse and resets the cycle. If a small perturbation is added to the 'charge' signal, or subtracted from the threshold -- same thing, then when that perturbation is high (near a peak), the oscillator is more likely to reset early, and in phase with that signal. Depending on the unperturbed frequency, and the magnitude of perturbation, many oddball ratios can be had, normally something like a ratio of p/q with p+q < 10 or so. They can be chained to get very large ratios, of course.A few examples are: to generate TV scan lines (NTSC TV is 525 lines per frame, interlaced alternate fields; meaning, at the field rate of 60Hz, each field is alternately 262 or 263 lines -- a toggle flip-flop would be needed to select which sequence occurs on alternate cycles, or an extra line would be inserted or removed somehow). The horizontal sync was, in turn, derived from the colorburst frequency (when color came along), with a ratio of... 228? Another application was in somewhat cheaper organs in the 60s, which typically used tube LC oscillators for the highest octaves, and germanium transistor flip-flops (essentially injection locked astable multivibrators) to generate the lower octaves. (Between the germanium transistors, Z5U ceramic capacitors, and ambient temperatures produced by the tube power amp, among other things, even this 1:2 ratio apparently wasn't terribly stable!)Apparently, the technique is still in use today for extremely high frequency prescalers (>30GHz) in frequency counters; at least, I've seen a few research articles on it. No idea what uses this commercially.Straight multiplication is easy. Often used in radio up-converters. You take a tuned RF amplifier, set it for a particularly nasty bias condition so it generates a lot of distortion, and tune the output for one of those harmonics. Ratios up to 5:1 are practical, and much larger non-prime numbers are achieved through cascading. An example might be a reactance modulated FM/PM source: because the phase shift is nominal (within +/-90 degrees), the deviation is very small (fractional percent), so for the FM to be of practical magnitude (+/-10kHz, say), it has to be multiplied significantly. You might have a crystal oscillator at 1MHz, reactance mod, then multipliers to take that up to, say, the ~500MHz amateur band (576MHz..?), where the deviation is acceptable as "narrow band FM". (Commercial wide band FM (100kHz deviation) is produced through different means; originally with difficulty, in rather elaborate systems that mechanically servoed the drifty frequency; later, using a fantastic tube called a phasitron; then with varactor control and PLLs; digital synthesis is probably used today.)Other than that, the canonical digital method is a VCO phase-locked to a reference. The reference is divided by q with a digital counter, and the VCO output is divided by p with another. The counter outputs are what the PLL is comparing. Thus, the VCO runs at p/q times the input.Tim

author: magetoo
author_rank: Frequent Contributor
timestamp: July 24, 2014, 06:23:16 pm
content: Quote from: nitro2k01 on July 24, 2014, 01:32:06 pmYep, YMF262. The datasheet mentions using a 14.32 MHz clock (incidentally, 3×4.77) which I think was common for ISA bus related things back then. That gives an audio output rate of 49722 samples/sec.8 cycles per operator, and 36 operators (18 voices), which is where the factor of 9 (or 3) comes from. If it had only had 16 voices instead of 18...I had this idea that maybe one could massage the data stream slightly (seems like a task for a CPLD) and send it to a I2S DAC at 48 kHz instead.All very theoretical so far, and I'm sure there are all kinds of traps here.

author: David Hess
author_rank: Super Contributor
timestamp: July 24, 2014, 09:00:43 pm
content: If you are working with a discrete crystal, then a third overtone oscillator will be the easiest way. That just amounts to adding a frequency selective network to suppress the fundamental and other modes.With an existing clock, injection locking is probably the simplest because it will generate a high output level but I would consider frequency tripling a close second.In a high performance application, I would phase lock a crystal oscillator to the lower frequency source without using division. Some test instruments do this allowing sub-multiples of their internal frequency reference to be used as an external reference.