Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Smoothing DAC output

Status
Not open for further replies.

ChemE

New Member
I need some ideas for smoothing the output changes of a MCP4922 (It's a Digital to analog converter).

When you change the voltage of a DAC it does it in steps. If you do small step changes the voltage will change smoothly... but if your step changes are too large then the changes will be very jerky.

So my question is:
  • Should I program my PIC to incrementally increase the voltage so that it appears smoother? (I am guessing if the incremental increase is too fast it will still look like a step change, am I right?)

OR

  • Should I use an RC circuit to try to make the changes more gradual?

What will give me the best results and are there other options that I should be looking into?

So I have a balance between smoothening the DAC outputs and response time I believe... is there some equations that I can use to calculate how much lag I am introducing with trying to smoothen the output?

I hope everything I wrote is clear enough to understand, if not tell me. Thanks.
 
You know you can make an accurate DAC with any PIC that has Hardware PWM yeah?

eg, a 50% Duty Cycle like this;

Coupled with an RC Filter will produce 2.5V (50% of 5V)

and a 25% duty cycle like this;

Will output 1.25V. Heres a circuit (note, use a better opamp than a LM324 for more accurate results as a buffer amp)


I did a small thing on it here **broken link removed**


Anyhow, a smallish cap might be the answer. Probably 1uF or so, allowing a fairly quick charge/discharge time but allowing limited voltage stability
 
Yeah I knew you make a DAC using the PWM of a PIC but it was easier for me to just use a DAC.

Should I put the 1uF cap as close to the device that I am trying to control with the DAC or is there a more optimum location?

Thank you for the help.
 
you would still have to deal with the transition from one voltage level to another whether you use a DAC or a PWM. If you step up the duty cycle from 25% to 75% without any ramping up of the duty cycle, the output will have an RC charge up profile. It would really depend on what the OP wants the output to look like - can he accept an RC charge up/discharge profile on large transitions or does he need to have a linear transition. With either method, the same problem will occur.

In regards to where you need to place the capacitor... i suppose it depends on the distance between the DAC and whatever the DAC is feeding and the input impedance of that object that the DAC is feeding.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top