Connect with us

DAC selection.

Discussion in 'Electronic Basics' started by lmcgill, Aug 9, 2006.

Scroll to continue with content
  1. lmcgill

    lmcgill Guest

    Hello All, I have a DC motor that I want to control its speed. The way
    I want to do it is by sending a digital signal from my PC to a DAC and
    then use that voltage to control some PWM circuit. I need help
    selecting an easy-to-use DAC IC. I would love at least 12 bits of
    resolution. Anyway, thanks for any reccomendations. Lucas.
  2. Bob Masta

    Bob Masta Guest

    Not what you asked, but I wonder if you couldn't have the PC
    do the PWM directly? This is definitely possible under real-mode
    DOS because you can have real-time control, but that would be
    limited to Win9x or earlier. For a more general solution that would
    also work on WinXP, maybe something with the serial port, by
    sending out the proper bit-stream.

    One problem with driving a DAC would be what to drive it
    with. In XP you no longer have access to the printer port,
    at least not without installing a Ring 0 driver like GiveIO
    or UserPort. If you can get access to the port, it is trivial
    to make a very good 8-bit DAC with a simple R-2R ladder
    from a handful of 1% resistors. (Due to the nature of the
    ladder, the accuracy is better than 1%. Even 5% resistors
    do a pretty good job.) For 12 bits you might be able to
    grab some of the printer control port bits to extend the R-2R
    ladder. If you don't mind wading through some irrelevant
    stuff, I have notes on the R-2R ladder driven from the
    printer port at

    Best regards,

    Bob Masta

    D A Q A R T A
    Data AcQuisition And Real-Time Analysis
    Home of DaqGen, the FREEWARE signal generator
  3. Rich Grise

    Rich Grise Guest

    That sounds a little silly.

    You already have a processor, why not just have it generate your PWM?

    What is it, really, that you're trying to accomplish?

    Good Luck!
  4. lmcgill

    lmcgill Guest

    Thanks for the replies. It's funny you both said the same thing and
    that is that I was intending to do. I am intending on applying this to
    a CNC typ application- drive a spindle DC motor and 3 or so stepper
    motors (each needing PWM). I thought it would get pretty tricky to do
    all that from one machine. I thought it would be easier to let a
    sparate circuit control the spindle motor and my PC to control the
    steppers. Does this sound like I'm on the right track or do you still
    feel that it would be possible to control all 4 motors (4 different PWM
    signals) from one PC? Any more input would be fantastic-Lucas.
  5. Rich Grise

    Rich Grise Guest

    I didn't realize at first that it was a PC - I had assumed an embedded
    processor of some kind. But, if you run DOS, in "real" mode, it should
    be doable - just watch out for the RTC interrupt.

    Good Luck!
  6. Bob Masta

    Bob Masta Guest

    I'll second that. To elaborate, you'll either need a Win9x
    or earlier system, or special Ring 0 driver for WinNT/2K/XP
    (GiveIO, UserPort, etc) which I haven't tried.
    Use the printer port for output, which will give you up to 8 lines
    of PWM. There are a couple of ways to do PWM:
    The simplest conceptually (to my mind, anyway) would be
    to set the time-of-day interrupt (INT 8) to a very high rate and then
    on each interrupt you decide whether each port bit should be
    high or low. If you need to simultaneously maintain a valid
    time of day (which I personally wouldn't bother with, since
    you can read CMOS whenevcer you need it), then you
    need to chain to the original INT 8 handler at the proper rate,
    once every N of your new faster ints.

    The other approach is to use the interrupt in one-shot mode
    and keep resetting it for the amount of time before the next
    state change is due. This is simple with only a single output,
    but gets more involved as the number of outputs increase.
    But it may not be all that bad, and may actually be simpler
    in the long run. It has the advantage that there are less
    total ints happening, so less overhead for whatever else
    the system has to do.

    Best regards.

    Bob Masta

    D A Q A R T A
    Data AcQuisition And Real-Time Analysis
    Home of DaqGen, the FREEWARE signal generator
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day