Simple PWM using inverters (logic gates or comparators).

Thread Starter

ian field

Joined Oct 27, 2012
6,539
My google mojo seems to be laying on its back with its legs in the air...………..

Anyone got links to blogs etc with examples & experiments?

Thanks.
 

crutschow

Joined Mar 14, 2008
23,810
Below is a comparator base circuit, write-up here.



And below is one using a Schmitt-trigger CMOS inverting buffer:
The gates are paralleled to give a lower-impedance drive for a MOSFET gate load.

upload_2019-3-24_11-36-4.png
 

Thread Starter

ian field

Joined Oct 27, 2012
6,539
Below is a comparator base circuit, write-up here.



And below is one using a Schmitt-trigger CMOS inverting buffer:
The gates are paralleled to give a lower-impedance drive for a MOSFET gate load.

View attachment 173191
Thanks - that's kinda the right direction. I just need the oscillator section and not the "slicing" bit, there's a build underway with a 4093 - might find out how it performs later.....

If that fails to get it done - i'll probably be back on 555s. an inductor, flyback diode and MOSFET can get a 555 to bootstrap its own supply - last time I did that; it worked too well and overvolted the 555. Simple enough to fix - sense the voltage to pull reset down and it works as a burst mode converter.

Wouldn't mind getting it to work over the lithium cell voltage range, rather than sacrifice any of the higher output power bank boards. The sticky bit is getting it to start.
 

Thread Starter

ian field

Joined Oct 27, 2012
6,539
There is quite a lot of material here: http://www.4qdtec.com/pwm-01.html It is covered in several sections. Also here: http://www.4qdtec.com/

4QD was my bible for the first PWM circuit I built. Sawtooth/trangle wave with comparator. That was more than 20 years ago and the site has changed, but the archives may still have that old stuff.
Thanks - I'd forgotten them. Nothing for me this time round, but having been reminded could come in handy.
 

Thread Starter

ian field

Joined Oct 27, 2012
6,539
What are the actual goals, accuracy, both duty cycle and freq ? Any other
desireables, like 3.3V vs 5V or power or other......

You constrained to do more elemental logic/analog approach ?

Regards, Dana.
Mostly just the oscillator from that style of PWM circuit. Fully adjustable frequency & ratio would've been nice, but not its not mission critical. accuracy would also be nice - if I knew for certain what frequency I need it to stay put on.

Voltage range is giving me the most aggravation. 2.75 - 4.2V would have me jumping for joy, CMOS doesn't fall all that far short of the lower limit, and I can do flyback supply bootstrapping if I REALLY have to. You could say its at the; "proof of concept" stage - I can do power management later when I find out its worth that much effort.
 

Alec_t

Joined Sep 17, 2013
10,615
How much does "ctrl" shift the PWM on that one?
3.93V <Ctrl < 5V ..... duty cycle=0%,
Ctrl=3.93V, duty cycle = 8.8%,
Ctrl = 1.01V, duty cycle = 91.2%,
Ctrl < 1.01V, duty cycle =100%.

Bear in mind this is a simulation result with ideal components.
With the component values shown, the frequency changes from about 22kHz at either end of the PWM range to about 70kHz at the centre of the range. That's the price for simplicity.
 
Last edited:

Thread Starter

ian field

Joined Oct 27, 2012
6,539
3.93V <Ctrl < 5V ..... duty cycle=0%,
Ctrl=3.93V, duty cycle = 8.8%,
Ctrl = 1.01V, duty cycle = 91.2%,
Ctrl < 1.01V, duty cycle =100%.

Bear in mind this is a simulation result with ideal components.
That would do it - half built prototype of something on my bench, I'll finish that off and see how heavily that falls over first though.
 

Thread Starter

ian field

Joined Oct 27, 2012
6,539
If you used ATTINY85 it will run down to 1.8V and over T and V its clock
accuracy +/- 1% if user calibration is invoked.

Can be programmed with Arduino IDE, both code writing and chip programming.

Or Bascom Basic. I think Arduino a better choice for code writing and IDE capability.

Note ATTINY has A/D so using that to adjust DC and or freq pretty straightforward.

Just a thought.


Regards, Dana.
Yebbut - I'd have to go out and buy one of those...……...
 

Thread Starter

ian field

Joined Oct 27, 2012
6,539
Just as an aside, future reference, here is a PSOC approach, also good down to
1.8V. One chip, just a small amount of overall capability used.

Here a SAR digitizes the pots and controls the PWM (16 bit, 2 channels, more if you
want).

And throw in a Wavedac to generate Sine, Tri, Ramp, User Arbitrary. Use same pots
to adjust freq and amplitude.

This is just a fraction of the capability you can get out of Mixed Signal processors these days.

Lots of fun, drag and drop onto canvas, and wire tool to do interchip wiring and routes to pins.
Write some code, in this example not too much, maybe 30 lines of code Add LCD (chip can
manage that as well) and you have an elemental sig gen. Add some more logic and do bursts
of waveforms, like burst 5 cycles of a sine.....All this single chip.


View attachment 173629


Regards, Dana.
Why are you preaching all this guff to a minimalist designer?!!!
 
Top