How to modulate a clock freq from a standard lfo

Started by changes, July 14, 2013, 06:08:59 PM

Previous topic - Next topic

changes

Hey guys
Well this has been bugging me the last few days so if anyone can help i would really appreciate it

I have a microprocessor putting out a clock frequency of 50-100kHz that i want to modulate using a typical triangle lfo rather than doing it inside the chip
is there any simple way doing that?
CHANGES

R.G.

Probably not.

If it's the uC's clock, it will be hard to vary smoothly inside the chip. If it's the output of a timer inside the chip, the simple ways all involve having the uC read something external, then changing the timer.  If the uC has an external clock, you could modulate that with the LFO, but that's considerably more hardware-complex than doing the programming inside the chip if you want to do a good job. If you want to do a sloppy job, and the uC can use an external 50-100kHz clock INTO the uC, then you can use a 555 or its variants and LFO modulate that, feeding this to the uC.

Good, cheap fast. You may pick any two.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

changes

Thank you for the quick reply R.G.

The uC is an atmega328 and the clock output is variable - user defined
I am using all timers of the chip and would prefer to do this somehow outside. Is there any chance that by setting up a 4046 or something similar would work?
CHANGES

PRR

4046 seems like the bee's knees for 100KHz VFO.
  • SUPPORTER

R.G.

Quote from: changes on July 14, 2013, 07:52:15 PM
The uC is an atmega328 and the clock output is variable - user defined
I am using all timers of the chip and would prefer to do this somehow outside. Is there any chance that by setting up a 4046 or something similar would work?
Sure. A 4046 is another way to do a similar clock oscillator, as Paul notes too. It's a little touchy to keep down to a 2:1 range, but it can be done, especially if specific frequencies, just a sweep is all that's needed.

But a lot depends on what you're doing with the clock that's put out. Is this just the clock output, or must the uC do something to it, too. If there is no dependency on the uC, just the LFO and 555/4046/others would work. If the uC has to be aware of what's happening too, you either have to get the info back into the uC about what the clock is doing, or you have to have the uC generate it in the first place. If the uC doesn't need to know about it, the options get simpler.

There are ways to externally frequency modulate an output from the uC, but the complexity goes up too. The 4046 can be phase locked to a clock out of the uC, then fed an AC offset into the VCO with the feedback signal to force it to wobble around the locked frequency, especially if the wobble is much lower in frequency than the output.

In my mind, the critical issue is whether the uC needs to interact with the clock you're modulating. If not, you can do it any number of ways. If so, it gets complicated.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

changes

The uC takes a pot input to range the clock output from min to max depending on where you set the pot.
The LFO is a standard dual opamp triangle at a range of 0.25-4 Hz if i'm not mistaken.
I'm not that familiar with the 4046 to set it up like that. I was just guessin it might work. Could you please tell me where and what to use?
CHANGES

R.G.

If it's OK for the uC to just produce the center frequency from the pot, and then for the output to be modulated by the LFO by the triangle, then you would set up the 4046 as a phase locked loop (PLL) to follow the uC's output. You would then add the LFO waveform to the phase detector voltage, and feed that to the VCO. In effect, you're adding a very slow error term to the loop and forcing it to be off the center frequency you're trying to follow.

This works in many cases, but I'm not enough of a PLL expert to know that it would necessarily work with the situation you're describing. There is a fair amount of work left to be done to make this come out well, but that's what I'd try.

Get the 4046 or 74HC7046 datasheets and read the applications info. I'm guessing based on some of the experiences I've had with 4046 PLLs that the tricky parts may be limiting the range of the 4046 VCO down to maybe 4:1, and then arranging the locked-following range to be big enough so that it doesn't come out of lock at the maximum excursions of the added LFO. There will also be issues with prepping the LFO signal to be small enough so that when added to the phase detector error voltage, things stay working. This will involve some opamp messing about to get the DC levels and AC LFO excursions right, and the complexity of that is probably about the same as the complexity of the LFO, perhaps 2-3 opamps.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.


puretube

#8
Then again,
you can let it oscillate all the range,
and just limit the CV, FWIW...  :icon_wink:







[edit]: slipped-keyboard-typo...

changes

Hey thank you R.G. and puretube. I'll study hard and see what i can come up with.
Cheers
CHANGES