## Vary voltage and frequency of Square Wave

Hi!

I am using an AtMega32 to output a square wave. I am varying the frequency by toggling the output pin using Timer1.
However, I also need to vary the voltage of the wave and frankly, have no idea how to. I tried looking up google but not much of it made sense to me thanx to my limited knowledge of electronics.
Can anyone please help ? I dont have to use the micro controller so even circuit ideas are open. Can I use some kind of voltage controller to modify the wave after the square wave of the set frequency has been output from the micro controller port?

 PhysOrg.com engineering news on PhysOrg.com >> Researchers use light projector and single-pixel detectors to create 3-D images>> GPS solution provides 3-minute tsunami alerts>> Single-pixel power: Scientists make 3-D images without a camera
 Look into a 4 quadrants multipliers. I used this one before: http://www.analog-innovations.com/SE...-DataSheet.pdf But this one is more for RF, it is just an example what you need to look for. I don't know your requirements, whether it needs to be precision, DC couple or anything. I use this a long time ago. Also the down side is when you have highest attenuation, the noise goes way up, so there is a limit of how low the gain can go. There might be some newer ones you can use to fit your needs. Basically, it take your square wave input and change the amplitude according to a control voltage. With a 4 quad multi, you just feed from the source you have and control the amplitude with a control voltage. Also look into variable gain amplifier something like this: http://www.ti.com/lit/ds/symlink/lmp8358.pdf I am not recommending these two device, just an example to give you a head start what direction to look for. Most likely they have better ones for your specific needs. If you can take AC couple, and the frequency is in over 1MHz, then I had a design that use pin diodes that will do the trick.
 Hey thnx a lot! will try understanding these :)

## Vary voltage and frequency of Square Wave

Forget my last post, I just thought of using multiplying R2R DAC as a programmable variable gain amplifier. Here is some information. Basically you drive the reference input and the value you sent to the DAC will give you attenuation.

http://www.analog.com/static/importe...es/AN-1085.pdf

https://www.national.com/an/AN/AN-269.pdf

 It sounds like a good place for CMOS. CMOS is analog designers dream, because it can switch right to a given voltage. I'd suggest looking through the CD4051-CD4053 analog switches. They're cheap as dirt and twice as common. You can place your positive voltage on one input and negative on another and have a lovely square wave that's very well defined.

 Tags atmega32, circuit, frequency, square wave, voltage