+ Reply to Thread
Results 1 to 6 of 6

Thread: Smoothing DAC output

  1. #1
    ChemE Newbie
    Join Date
    Apr 2007
    Posts
    38

    Default Smoothing DAC output

    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.


  2. #2
    gramo Excellent gramo Excellent gramo Excellent gramo Excellent gramo Excellent gramo Excellent
    Join Date
    Oct 2006
    Location
    Australia
    Posts
    1,207
    Blog Entries
    3

    Default

    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 http://users.tpg.com.au/gramo/Site/dac.htm


    Anyhow, a smallish cap might be the answer. Probably 1uF or so, allowing a fairly quick charge/discharge time but allowing limited voltage stability

  3. #3
    ChemE Newbie
    Join Date
    Apr 2007
    Posts
    38

    Default

    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.

  4. #4
    OutToLunch Good OutToLunch Good OutToLunch Good
    Join Date
    Jun 2006
    Location
    North Carolina, USA
    Posts
    355

    Default

    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.

  5. #5
    ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent ericgibbs Excellent
    Join Date
    Jan 2007
    Location
    Hampshire. England.
    Posts
    10,836
    Blog Entries
    13

    Default

    hi,
    Look here:
    http://ww1.microchip.com/downloads/e...Doc/21897B.pdf

    Checkout the applications section.
    Eric " Good enough is Perfect "
    I will NOT answer PM's requesting technical help, please use the Forum
    PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/

    Link to my Articles: http://www.electro-tech-online.com/a...icgibbs-55450/

  6. #6
    gramo Excellent gramo Excellent gramo Excellent gramo Excellent gramo Excellent gramo Excellent
    Join Date
    Oct 2006
    Location
    Australia
    Posts
    1,207
    Blog Entries
    3

    Default

    I like the look of page 25

+ Reply to Thread

Similar Threads

  1. Output = Input - Problems
    By adamthole in forum Micro Controllers
    Replies: 20
    Latest: 24th April 2007, 04:09 AM
  2. 555 timer output help for a newbee...
    By WIZARDSV650S in forum Electronic Projects Design/Ideas/Reviews
    Replies: 6
    Latest: 6th April 2007, 04:04 AM
  3. Using PicBasic with Output compare for sounds
    By mduong77 in forum Micro Controllers
    Replies: 7
    Latest: 29th March 2007, 02:29 AM
  4. Output going high on power up?!?!
    By 2camjohn in forum Micro Controllers
    Replies: 5
    Latest: 23rd March 2004, 06:49 PM
  5. How to design such output stage
    By eeglp in forum Electronic Projects Design/Ideas/Reviews
    Replies: 4
    Latest: 8th April 2003, 06:01 PM

Tags for this Thread