Digital to Analog Converter


Closed Thread
Results 1 to 9 of 9
  1. #1
    Join Date
    May 2007
    Posts
    21

    Default Digital to Analog Converter

    Hi all,

    I'm working on a project,and using 18f4550. I'm designing a circuit board and planning to control a dc-motor. I would try pwm, instead my instructor wanted me to use DAC. Can you beriefly explain me, how should I choose DAC? For example I know AD converter ın PIC is 10 bits. Is it appropriate to use a 12 bit DAC? Thanks alot.

  2. #2
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default

    Hi, Kutsi

    You've two ways for the DAC ...

    if using 8 bits output ( for a motor it's far enough !!! ) ... then use a full port with a 1% resistors R/2R ladder to generate the voltage output ... ( a little AOP buffer will make it perfect ... )
    no need a MAX 512 or else here ...

    if using more bits, a LTC 1257 or 1451 from Linear will work fine, you're not to use all your DAC resolution ... and can send two "0"s as LSBs past the ADC 10 bits you've read !!!

    Alain

    PS: PWM freq. to use depends upon the motor technology, but there's always some switching noise you can hear in the windings ... but low speed torque obtained is better ( easier to see smoke if overloaded too !!! )

    DC won't produce any noise ... but will give poor starting torque, if there's no rpm regulation implemented. a current protection is easier to add in this way ...
    Last edited by Acetronics2; - 10th May 2007 at 16:06.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  3. #3
    Join Date
    Jul 2005
    Posts
    78


    Did you find this post helpful? Yes | No

    Default

    To start, let’s assume your A/D (10 bits) is going to read some parameter, you make a calculation based on that info, spit that number to the D/A which sets how fast the motor runs.

    At first glance, you’ll need a 10 bit max D/A to run the motor because that is all the accuracy you have, the 10 bits given by your A/D. However, if your motor doesn’t run linearly (such as it needs a few volts before it even starts to turn) you may be wasting D/A range to get past the dead zone. How accurately you need control the motor is gonna decide how many bits you need (so you'll have to give us more info for an informed choice). 8 bits as a starting point for experimentation isn't a bad choice.

    I’m not one to reinvent wheels; you can buy a very well designed D/A for little more then some precision resistors will cost you to build the R/2R ladder, and it will perform better to boot. I’ve used a few of Maxim’s D/A chips with an I2C serial interface (basically serial data and clock). PBP had commands to run these off 2 PIC pins.

    Maxim can be a problem to get parts if the major distributors don’t have it, they tend to long lead times with high min orders. I’m sure people here will offer you way too many alternatives if you ask. ;-)

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Maxim are a pain in the LA LA LA LA LA sometimes... they're also trigger happy to obsolete their parts.. at least those much specifics...

    But i agree, 10 bits in, 10bit (or lower) out.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Join Date
    May 2007
    Posts
    21


    Did you find this post helpful? Yes | No

    Lightbulb

    Thanks for the tips. I will try them,and turn back with many other questions, I guess.

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Talking

    Hi, Ernie

    I do not know where you buy your resistors ...

    but my 1% 100 ppm ones from RAMTRONICS cost me ... 1.8 cent/ unit !!!

    " Hobbyist " price ... of course.

    Alain
    Last edited by Acetronics2; - 11th May 2007 at 08:54.
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  7. #7
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Post

    You need more than just the resistors. You also need a suitable OP AMP for buffering. The more you Load the ladder down, the less usable resolution you'll have. R2/R ladders are old school stuff. Better to use the dedicated chip - having this knowledge is worth more.

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Talking

    Quote Originally Posted by T.Jackson View Post
    having this knowledge is worth more.
    And YOU have it .... Super Trent !!!

    LOL

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  9. #9
    Join Date
    Jun 2006
    Location
    Glasgow, Scotland
    Posts
    26


    Did you find this post helpful? Yes | No

    Default LTC1453 DAC Setup

    Just an additional note I used the LTC1453 DAC and it was easy to use and worked great I used it to drive an analog devices 4-20mA convertor chip.

    hope this is of some use to somebody.

    thanks again for all your help and patience

    ************************************************** **************
    '
    'LTC1453 DAC Setup
    output portC.5 'clock pin
    output portA.2 'data pin
    output portA.3 'CS/Load pin low to enable clock high to load data to dac output
    symbol DCK = portc.5
    symbol DDA = portb.0
    symbol DCS = porta.2
    DAOut var word ' daoutput variable
    DAspan var word ' Da span adjust variable
    Volt1 var word ' Raw data variable
    ' ----------------------------------------------------------------------------
    ' Get Load Value and output to DAC 0-2.5 vdc for range of 12 bits
    ' ----------------------------------------------------------------------------
    DAC1: low DCS
    DAout = volt1*DAspan ' voltage output raw signal scaling
    DAout = div32 1000

    shiftout DDA,DCK,1,[DAout\12]
    HIgh DCS
    return

Similar Threads

  1. analog and digital
    By lerameur in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th June 2008, 02:40
  2. PortA analog and digital IO
    By krohtech in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 30th November 2007, 02:25
  3. Replies: 2
    Last Post: - 14th April 2006, 09:42
  4. AD7391 digital to analog converter
    By srob in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th November 2005, 12:07
  5. Analog pins for digital input
    By Charles Linquis in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 9th September 2005, 00:32

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts