Q: transistor as a variable resistor for oscillator circuits

transistors

this is my first question,

I want to ask a simple question, I searched but couldn't find proper answer, here is my situation; I want to build frequency generator circuit with op-amp oscillator topologies, but I want to control the circuit with ATMega328p's RC-Filtered PWM Analog outputs, but as you know, oscillator circuits tuned with changing R and/or L (if RL resonator/tuned circuit used) or C ( if RC circuit used for oscillation) values, it is obvious that I cannot change L or C values easily, so I decided to change R values to tuning oscillation frequency (as variable), so I think that I need to implement digitally controlled potentiometer or variable resistor, after that I came up with an idea; when using a BJT transistor at Active region, it acts as a variable resistor (ofcourse there will be some voltage drops due to Vbe)

but I cannot achieved this goal because active region needs small signal input at base, here is my question : can I set the PWM or RC Filtered Analog output's amplitude as needed for active region ( as mV scale, I think) or should I consider another way to accomplish this issue?

thanks in advance, sorry for my bad english

Best Answer

You could use a DDS which is easy (the hard work has been done for you). Assuming you don't want to do that, read on.

For low frequencies (through the audio range) the easiest way is to generate triangle waves with a VCO which can then be shaped into sine waves if necessary. This can be done with a DAC to generate the control voltage and an oscillator made with an integrator and a comparator switching the integration direction.

For high frequencies (1MHz and up) you can easily change the C by using a varactor diode. You can phase-lock the signal to a reference signal if you want.

You can use a JFET or a lamp + LDR (light dependent resistor) to vary resistance, or as Ignacio says, use an MDAC to simulate a relatively low frequency resistor.

Or you can use a digital pot! Some are specified well enough to use them as rheostats, though they are always better used as potentiometers. Again, not so great at high frequencies.