I've searched the forum and found this post
http://www.societyofrobots.com/robotforum/index.php?topic=4460.0 which is kind of related.
I, too, have a signal coming in from, say, an NE555. Assume its just a continuous tone for the purpose of this post.
This is linked to a loud speaker via a simple transistor (don't need an amplifier as the 555 is already giving me an input of 0 to 5v).
But what I need to do is be able to control the volume via the mcu.
So I could use PWM and an RC network to create a voltage - but am not sure if there are chips out there to turn the voltage into a volume ctrl.
Have Googled and found chips like the AD5220, Max5400, Max5401 which are variable resistance pots. However: they seem to be aimed more at TV remotes ie increment/decrement the volume based on pressing a button. I could maybe do this by outputting pulses BUT I want to do it very quickly and am not sure they could do that ie the volume could need to change from zero to max and back again in a millisecond or so. I can't afford the time to keep incrementing the volume from Mute to Loudest and back to Mute.
So maybe the PWM + RC network, ie a DAC, may seem the best solution. Does anyone know how I could this, or know of a chip (an amplifier with a gain of 1 say) that can allow me to change the gain from 0% to 100% very quickly?