Shop OBEX P1 Docs P2 Docs Learn Events
Digital to Analog Converter - BS2p - Example Code Question — Parallax Forums

Digital to Analog Converter - BS2p - Example Code Question

Dan HDan H Posts: 4
edited 2007-06-22 14:17 in BASIC Stamp
I am working on a programmable precision voltage source using the BS2p and I'm interested in any code examples pertaining to the control of a digital to analog converter. I'm using a 16-bit unit from Analog Devices. The model is an AD669 Ref: http://www.analog.com/en/prod/0%2C2877%2CAD669%2C00.html.

Any help·is greatly appreciated!

Thanks!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-06-20 22:19
    Make sure you've look at the Parallax tutorials in their Stamps in Class section of the website. One is called Basic Analog and Digital and it has some examples of DAC use. Also look at the documentation on the ADCs that Parallax sells (in their Components/ICs store section) and go through the Nuts and Volts columns in their Download area.
  • phil kennyphil kenny Posts: 233
    edited 2007-06-20 22:53
    Just wondering if you plan on using the full resolution and accuracy
    of this part.

    If so, be aware that each bit represents 153 microvolts. Even with
    a careful PCB layout and watching how the ground traces are routed,
    achieving the full potential of this part isn't easy and will require a
    highly accurate DVM to calibrate it.

    Are you planning on using a pair of 74HC595 serial-in, parallel-out
    8 bit shift registers for interfacing to the Basic Stamp?

    Sounds like an interesting project!

    phil
  • Dan HDan H Posts: 4
    edited 2007-06-21 17:36
    Mike, Phil,

    Thanks for the references and the design considerations. The application requires ~1mV precision, so perhaps my earlier "precision" description was a bit overstated. I guess it's all a matter of expectation and scale I suppose...

    Phil,

    The use of two SerialToParallel shift registers to drive the DAC is an interesting thought. I'm planning on driving the converter directly via the P0-15 pins. I'll be establishing a data bus connection with the DAC, a keyboard, and an LCD display. X0-X1 would be chip/device selection pins. Even though this is a low volume, non-production application I am trying to keep the chip count low also.

    This is my first Stamp project. If you think I'm missing something, please feel free to yell!

    Thanks again!

    Dan...
  • phil kennyphil kenny Posts: 233
    edited 2007-06-21 19:12
    Dan,

    If you restrict the resolution to 1.25 mv, you don't really need to drive
    all the DAC inputs. Some of the low order bits can be tied to ground.

    Assuming the full scale output is going to be 10 volts, connecting the 3
    LSB pins to ground will free up some of the Basic Stamp pins and still
    give you 1.25 mv resolution (10 volts/8192 bits).

    Showing us a few more details of your planned data bus will allow
    us to make better comments on the design.

    phil
  • Dan HDan H Posts: 4
    edited 2007-06-22 14:17
    Phil,

    Wow! I've never participated in a forum where people were so pro-active and wanted to be involved at this level! Thanks!

    The DAC will be operating in bipolar mode (+/- 10v) which may modify your resolution numbers slightly; but your suggestion of ignoring the lower (3) LSBs is an intriguing idea.· I have the advantage of no cost limitations (within reason) and I also don't want to paint myself into a corner, should I want to increase the delivered resolution at a later time. For example, some of the systems I'll be testing (driving with this device) have working ranges of +/- 1v (maybe less) and·others will·have input ranges of +/- 8v.

    I also realize that the Stamp/DAC system I'm building may also have an inherent noise level that·may render the lower bits less usable. It all depends upon how hard I work at keeping the system electrical noise levels low.

    I'm bread boarding the DAC as I write this and I'll be happy to share what I learn along with the code·that·drives the DAC. This will be when the entertainment term in the equation will get much bigger for all of you; as you observe my first serious attempt at PBASIC. My background ranges from assembly language programming of 6800/6809/68000 micros (yes... I'm showing my age here!) and then jumps (with a big gap) to 3GL programming of mini and main frame computer systems.

    Dan...
    ·
Sign In or Register to comment.