0

I would like to generate a square signal with SW adjustable duty cycle, phase etc using the output pin of a microcontroller (3.3V). Frequency <100Hz. However, I also want

  1. the amplitude of the high state to be in ~ 2-7V range adjustable with a trim potentiometer from a 12V supply rail,
  2. When the signal is low it should be close to zero.
  3. no spikes or disconnected states between transitions to high/low
  4. signal to be zero when the microcontroller output is zero (non-inverted).

The signal will be fed into high impedance op-amp inputs which will driveflash/strobe circuits, so it is like a common analog input signal to multiple strobe circuits. What is the simplest way to do this? A mosfet, analog switch IC or ?

Thank you!

bekoch
  • 9
  • 1
  • How much current do you need? You can probably use the MCU to drive a mosfet driver to switch the output of a variable buck converter. 100Hz is quite slow. – K H Jan 24 '21 at 08:41

3 Answers3

1

Another option is simply an N-MOSFET. 99.9% of the time you can do the inversion in the MCU itself and remove U1, but on the off-chance that you can't for whatever reason, add an inverter U1. Also, restrict your pot range by adding lower and upper fixed resistors:

schematic

simulate this circuit – Schematic created using CircuitLab

An even simpler option is to replace both the inverter and the MOSFET with an open-drain (or open-collector) 12V-tolerant non-inverting buffer.

Reinderien
  • 3,102
  • 16
  • 28
  • 1
    probably no big deal, but this will default to output-high, when microcontroller is reset or unpowered. If that is not the desired behavior, a pull-up resistor can be added to U2 gate. – Pete W Jan 24 '21 at 21:56
0

I would use an analog mux. You require "no spikes", this is a vague requirement, but a fast analog mux should meet your needs.

Depending on which analog mux you choose, you may need a level shifter.

schematic

simulate this circuit – Schematic created using CircuitLab

Mattman944
  • 13,638
  • 1
  • 19
  • 43
  • Thank you! The Analog MUX would be a SPDT analog switch, correct? I was wondering about the break-before-make feature of these switches: could there be a problem during the transition between high-low, since the output is briefly floating? I suppose one can add a pull-down resistor to the output of the mux? – bekoch Jan 24 '21 at 09:48
  • Yes, a SPDT, something like a 4053, but this is an old part, there are probably better options. A pull-down wouldn't hurt. – Mattman944 Jan 24 '21 at 10:08
0

here's another, not particularly precise, but just for variety. pot is 7K. falstad link enter image description here

Pete W
  • 1,207
  • 1
  • 5
  • 12