Shop OBEX P1 Docs P2 Docs Learn Events
ADC Choice — Parallax Forums

ADC Choice

LitefireLitefire Posts: 108
edited 2007-01-19 21:31 in Propeller 1
I'm trying to decide on a ADC to use with mynew propeller project.· I'm just wondering if anyone has any suggestions on the subject.· 8 bits is plenty, and it doesn't need to be uber-fast either.· Cheeper is better, or maybe more channels per chip... but most of all i'd like to make sure that there's sample code for the chip i use.

thanks!

~~Brian

Comments

  • rokickirokicki Posts: 1,000
    edited 2007-01-18 01:15
    It would help if you tell us why the existing counter-based ADC will not work for you. This is a zero chip solution
    requiring only a couple of discrete components.
  • MacGeek117MacGeek117 Posts: 747
    edited 2007-01-18 01:15
    You could try out the ADC Object in this post.
    RoboGeek

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "I reject your reality and subsitute my own!"

    Adam Savage, Mythbusters
    www.parallax.com
    www.goldmine-elec.com
    www.expresspcb.com
    www.startrek.com
  • inserviinservi Posts: 113
    edited 2007-01-18 16:46
    Hello, personally i like the LTC1298, very simple 12bit serial (2 channels).


    dro

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    in medio virtus
  • LitefireLitefire Posts: 108
    edited 2007-01-18 20:08
    Robogeek, do i need any components for that code to work?

    ~~Brian
  • Mike GreenMike Green Posts: 23,101
    edited 2007-01-18 20:26
    This is the full ADC demo with a discussion of the resistors and capacitors involved.
  • T ChapT Chap Posts: 4,223
    edited 2007-01-19 09:44
    Is there a real schematic somewhere of the same circuit? I can't make out what the ascii schematic is doing. Thanks
  • KlossKloss Posts: 43
    edited 2007-01-19 10:52
    rokicki said...
    It would help if you tell us why the existing counter-based ADC will not work for you. This is a zero chip solution
    requiring only a couple of discrete components.

    Processor supply voltage as reference voltage, no track&hold circuit, no input buffer, unknown
    temperature and aging drift, every converter has to be calibrated manually, etc.
    14 bits resolution? This is a joke, isn't it?
    Other processor manufacturers must be complete idiots, wasting so much time and silicon
    to integrate an ADC that can be replaced by four passive components.

    BTW: An external ADC with serial interface costs nearly as much a complete microcontroller
    with integrated ADC. So, from a commercial point of view, it does not make any sense to
    use a propeller in a project that needs accurate A to D conversion.

    But it does make fun to use this method in hobby projects, because you learn a lot about
    electronics and programming.
  • GadgetmanGadgetman Posts: 2,436
    edited 2007-01-19 11:45
    You forgot to mention that it is also highly susceptible to noise from HF signalling on adjacent pins, needs the components located as close to the Propeller as possible, and can't have corners in the traces...

    And yes, it's fun. smile.gif

    Accuracy? I want speed and lots of inputs!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
  • Mike GreenMike Green Posts: 23,101
    edited 2007-01-19 16:00
    Kloss,
    There are many applications where the issues you raised are not important, particularly where the values being measured are not that accurate, perhaps 2 to 3 digits of significance maximum. For example, if you want to monitor battery voltage, you would expect it to vary from reading to reading. You would assume that its trend is either increasing or decreasing depending on whether you're charging or discharging. Environmental temperature is normally something that also fits well with this kind of ADC in that it changes slowly, you probably don't need more than 8 bits of resolution. Light level sensing is something else that, for many applications, doesn't need much accuracy, etc.

    As you may have gotten from previous postings, the ADC was not designed into the part. It was a fortuitous discovery and happened to work well enough to be practically useful in the kinds of applications I mentioned, applications where the extremely low cost and simplicity may make it possible to add features to a project that might otherwise be too expensive. Chip, in designing the 2nd generation device, is deliberately designing this capability in so that its performance will be much better.

    The basic question is "what do you need for your project?". It may be that a specialized PIC processor is perfect for the job. Microchip makes a lot of money producing hundreds of slightly different microcontrollers, each optimized for a slightly different application area. They're also difficult to program well, particularly when they have to do several different tasks not exactly aligned with the peripheral functions included. The Propeller is intended to simplify the programming and to have a somewhat "raw", almost primordial processor that can be configured, sometimes "on the fly" for different functions, some of them very cheaply. This is very very powerful for small projects, specialized projects, experimental projects. It's not as useful for high volume projects where you can almost "beat off" the chip manufacturers who would love to make you a specialized part that just perfectly fits your needs.
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2007-01-19 18:44
    I agree with all of the above. For a general purpose data logger, especially one that requires multiple channels and attention to the other issues that Kloss mentioned, an external A/D chip will be the real bargain. On the other hand, there are situations where the Prop sigma-delta would be just right to fit into the space and to meet the samping frequency & resolution & accuracy requirements.

    Mike, I don't think the sigma-delta capabilty for the Propeller was any accident. The feedback modes of the counter module were included specifically for that purpose. The method has a long history with microcontrollers. Nonetheless, on a digital processor it is a hack in comparison with a sigma-delta converter that is designed from the ground up to be just that, with careful attention to the comparator, the reference, the track and hold, balanced inputs, error/noise sources, etc etc. Other techniques that use the Prop inputs as a comparator have similar issues. For example, RCTIME is another way to do an analog to digital conversion, in a sense accidental and unintended, but it too has its uses, good ones I might add. Sigma-delta can attain greater precision than RCTIME. RCTIME is all or nothing, and it is limited by one shot of noise at the threshold point, while sigma-delta is an averaging process around the threshold. Good tight layout and attention to all stray capacitances an inductances can reduce the errors and enhance the precision, that to but there is a point of irreduciblility. (Does anyone have an empirical estimate?)

    One issue with sigma-delta is that it holds the Prop right at the switching threshold where the input transistors draw substantial current. If I remember correctly, that amounts to something like 2 or 4 milliamps. With RCTIME, you can see that spike of current as the input approaches threshold. The ground bounce and also heat sloshing around on the chip due to that current must enter into the equations, and one might start thinking chaotic attractor at some level of precision.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Mike GreenMike Green Posts: 23,101
    edited 2007-01-19 20:48
    Tracy,
    Paul Baker and others have commented that the chip was not designed specifically for the use of the sigma-delta capability although the modes were put in for that possibility. Once the chip was built, Parallax was surprised at how well it actually performed, particularly with careful attention to trace lengths, paths, and coupling.

    Interesting point about chaotic attractor.
    Mike
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2007-01-19 21:21
    Mike,

    Here is Chip's comment on the issue (from the "cogs" thread):

    In Propeller chip, cgracey wrote:
    Chip Gracey(Parallax) said...

    Sorry for my slience on this matter, but the capability was planned. It can be optimized on the next chip, though, by closing the feedback loop between two adjacent pins. That means the signals don't have to go across the chip, in and out of cogs, and back out, eating valuable feedback time.
    Paul Baker (Parallax) said...

    Mike is correct, the ADC capabilities were a serendipitous discovery, but because it wasn't deliberately planned for it isn't optimized. The next chip will likely have one key element changed to make the current ADC capabilities better.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Mike GreenMike Green Posts: 23,101
    edited 2007-01-19 21:31
    Sorry, I keep remembering Paul's comment and not Chip's. Thanks for reminding me.
Sign In or Register to comment.