I have a microcontroller that is generating a PWM signal between 0 and 12V of varying frequency. I'm looking to build some sort of circuit that will take this signal and then attenuate the high and low values of that square wave to be anywhere between 0 and Vmax (12V in this case). The trick here is that the low signal may need to be higher than 0V, so it can't just be a voltage divider on the square wave.
I would guess that this would use some sort of potentiometer or maybe even a variable op amp, but I'm a software guy and don't know what I'm doing. :)
Basically I want to be able to generate high and low voltage values of my choice while still retaining the frequency and duty cycle. Ex. 250mV-500mV, 3V-5V, etc.
Any ideas where to start, or what a circuit for this would look like? Please comment if more information is required.