Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Generate a PWM signal from an analog voltage

Status
Not open for further replies.

HF_ATL

Newbie level 4
Newbie level 4
Joined
Mar 3, 2014
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
52
Hello all,


I'm a newbie and would like to have some help regarding a project I want to start.
I need to generate a PWM signal from an analog voltage. The analog voltage varies from 0 to 3.3V
The PWM signal should have:

- A period of 1ms for analog voltage = 0V
- A period of 2ms for analog voltage = 3.3V

The entire PWM pulse should be 20ms, which gives a duty cycle of 5% for the first case and 10% for the second case.

What I thought was:

- Use the SG3525A for this project and nothing else more, and:

Since the period is 20ms, that corresponds to 50Hz, so I have to choose the Rt and Ct so that with the formula provided in the datasheet, the oscillator frequency=50Hz, thus switching frequency=25Hz. The amplitude of the sawtooth signal needs to be 3.3V. (Rt and Ct after choosed by me needs to be placed between its respective pins and gnd, right?)

But, in this case, if the V_in=0V I'll not get PWM with 1ms "on" time.


Datasheet: https://www.st.com/st-web-ui/static/active/en/resource/technical/document/datasheet/CD00000958.pdf


Any help will be much appreciated!


Thanks
 
Last edited by a moderator:

Re: Generate an analog voltage from a PWM

First, you need to get your nomenclature right; I had to read your post several times before I figured what you want. You are not changing your period, you are changing your pulse width (PWM=Pulse Width Modulation, right?) Your PERIOD is 20mS. That corresponds to a frequency of 50Hz, not 500.
 

Re: Generate an analog voltage from a PWM

Hi,

First you can do it digitally.
Using Simple CPU to generate a custom PWM signal according to ADC acquisition.
You can add, if you want a really really simple processor, a PWM module (like DS1050 for example) to do all the work using a IIC messages.

Second option - use a PWM driver. For example : DRV104 from TI.
You can use a pre amplifier to adjust your analog levels (pin 1 - Duty Cycle Adjust) and determine what is the cycle of the chip (pin 3 - Oscillator frequency adjust)
There are a lot of IC's that are similar.

Amir
 

Re: Generate an analog voltage from a PWM

Yes, you're right. I've confused all the nomenclature, sorry for that. Now is updated the first post.

First, you need to get your nomenclature right; I had to read your post several times before I figured what you want. You are not changing your period, you are changing your pulse width (PWM=Pulse Width Modulation, right?) Your PERIOD is 20mS. That corresponds to a frequency of 50Hz, not 500.

- - - Updated - - -

Thank you Amir, I'll study both options and will come back.

Hi,

First you can do it digitally.
Using Simple CPU to generate a custom PWM signal according to ADC acquisition.
You can add, if you want a really really simple processor, a PWM module (like DS1050 for example) to do all the work using a IIC messages.

Second option - use a PWM driver. For example : DRV104 from TI.
You can use a pre amplifier to adjust your analog levels (pin 1 - Duty Cycle Adjust) and determine what is the cycle of the chip (pin 3 - Oscillator frequency adjust)
There are a lot of IC's that are similar.

Amir
 

Re: Generate an analog voltage from a PWM

This thread seems hanging in the aether connected to nothing.

From what I gather the original OP, whoever that is, wants to convert a PWM signal to an analog voltage. The time-tested method to do that is a low-pass filter, sometimes called an integrator.

john

Edit: Now, post #1 is visible. It was not before.
 
Last edited:

Re: Generate an analog voltage from a PWM

Look in Google for Radio Control Circuit For driving Model Servo because they move to one end with 1ms wide pulses and move to the other end with 2ms pulses. The pulses are repeated at about 50Hz.
 

Re: Generate an analog voltage from a PWM

I can't edit anymore my first post but the title is incorrect, it should be "Generate a PWM signal from an analog voltage", so sorry again for all of this confusion.

So, my thoughts are:

Using the PWM drive DRV104 from TI will not be the most suitable PWM drive (I need 50Hz -> 20ms period) as I have read the following in its datasheet:

"Oscillator PWM frequency is adjustable. A resistor to ground sets the current IREF and the internal PWM oscillator frequency. A range of 500Hz Frequency Adjust to 100kHz can be achieved with practical resistor values. Although oscillator frequency operation below 500Hz is possible, resistors higher than 10MΩ will be required. The pin then becomes a very high-impedance node and is, therefore, sensitive to noise pickup and PCB leakage currents. Resistor connection to this pin in slave mode sets the frequency at which current limit reset occurs"

On the other hand, it seems that using SG3525 chip with no micro controller, f_osc >= 100Hz but output signals will have an f=1/2 f_osc, so I can get 50Hz from that (there is a flip-flop before the driver stage) can be enough for the application and will only need to buy this chip and solder it on a small breadboard.

Am I on the right track?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top