View Single Post
Old Jul 25, 2011, 09:41 PM
Dennis Frie is offline
Find More Posts by Dennis Frie
Just another user
Dennis Frie's Avatar
Denmark, Capital Region of Denmark, Naerum
Joined Feb 2011
1,362 Posts
Just got an idea to simplify/change the circuit a little.
The diode used to generate the biasing voltage and reference voltage can be replaced with a filtered PWM output - which will give a DC-voltage. The DC-voltage can be directly controlled by changing the duty cycle of the PWM signal (to give a DC voltage from 0 - 5 volt).

I have made a few tests on breadboard, and I'm able to get a good synch with just 4 components. The RC-filter, a diode and the AC-coupling capacitor. A 10K (or something like that) pull-down resistor in the climping circuit might be a good idea.
To use as few components as possible I have used ground as reference voltage

This code can be used to generate fast PWM on pin 9 (OC1A/PB1)
TCCR1A =
(1<<COM1A0)|
(1<<COM1A1)|
(0<<WGM11)|
(1<<WGM10) ;

TCCR1B =
(1<<WGM12)|
(0<<CS12)|
(0<<CS11)|
(1<<CS10);

OCR1AL = 207; // Compare register - used to control voltage.
Dennis Frie is offline Find More Posts by Dennis Frie
Last edited by Dennis Frie; Jul 26, 2011 at 05:36 AM.
Reply With Quote