Author Topic: Arbitrary high-frequency clock generation with MCU  (Read 3141 times)


Arbitrary high-frequency clock generation with MCU
« on: May 16, 2007, 06:17:58 PM »
So for the last few months I have been thinking about ways to generate high frequency clocks with MCU's (PICs or AVRs, mostly PICs though).  By high frequency, I mean about 5 Mhz, generated by a chip with a 20Mhz or so clock.  The application woudl be for tap tempo delay - the PT2395 to be exact, which uses clock frequencies of the range 2.5Mhz - 6Mhz.  Obviously, a fair amount of precision is required, so that the delay time represents the tapping!  I've made a tap tempo trem, so that is no problem, it's the synthesis of such a high frequency that is the hard part.  Here have been my ideas and pitfalls:

1) Using a timer to count a certain number of clock ticks and flip the state of a pin after that number of ticks.  This works great for lower frequencies, IE audio frequencies.  Also, you can count interrupts of a short range timer and flip every time a certain number of overflows have happened.  That worked fine for the tremolo.  The problem is, if you want to generate a 4.2 Mhz clock frequency, you're screwed!  You could generate 10Mhz, 5Mhz, etc, but even then, counting 4 ticks and flipping the state is bound to create a lot of error!

2) Then the idea came up of serially controlling a digitally controlled pot, and using that pot to control an oscillator.  The problem here is that most of these have maybe 256 positions max...  a discrete number of 256 delay times is somewhat reasonable, but not reasonable enough, to me.  I want more accuracy than that.  There also might be some problems as far as calibration goes.

3) I've heard myths of serially controlled/programmed oscillators - you feed them a series of bits, and they give you a frequency.  I really can't find any information on this kind of thing, either because they don't exist or because I'm not googling the right thing.  The closest thing I've found (I have no idea if this actually counts, or how to use it):

4) I've heard similar myths of frequency multipliers.  I know division is a million times easier than multiplication as far as frequencies go, but it might be a possibility.  If we could multiply by, say, 1024 or something, generating a proper frequency would be no problem using the ticks-counting method.

Any ideas?  Just to put everything on the table, if I am able to develop a tap tempo circuit/program I will almost definitely be selling it.  That said, I will also most definitely be posting code/schematics/etc online.



Re: Arbitrary high-frequency clock generation with MCU
« Reply #1 on: May 17, 2007, 02:09:46 AM »
Analogue Signal Processing