Shop OBEX P1 Docs P2 Docs Learn Events
Best ADC Object for Newbies — Parallax Forums

Best ADC Object for Newbies

william chanwilliam chan Posts: 1,326
edited 2008-03-15 16:42 in Propeller 1
Hi,

I am trying to find a ADC object using 2 pins on the propeller to perform ADC on a op-amp output.
Which is the best object in the OBEX to use?

What should be the best values for the resistors and capacitors?

Thanks.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.fd.com.my
www.mercedes.com.my

Comments

  • OzStampOzStamp Posts: 377
    edited 2008-03-10 04:58
    Hi Chan.

    The Microphone to VGA object for the Propeller Demo board is a good one to start with.
    Goto the obex website ( Parallax object library site)

    Disect that asm code and you have a good a/d converter..

    Look at the schematic of the Propeller Demoboard as well...it is all there mate..

    Let your fingers do the walking...


    cheers Ron Mel OZ..
  • william chanwilliam chan Posts: 1,326
    edited 2008-03-10 05:36
    Dear OZ,

    Thanks for your kind reply.
    But that ADC is not an object but is the Top Object File.
    That makes it more difficult to understand, furthermore it is in assembly...


    1. How do I turn this Top Object File to a normal object file?
    How to add a get_sample_value method to this file to simplify reading the ADC value?
    2. Is "asm_sample" the value that I should be reading?
    3. When using the SX, I usually use a 10k resistor to reduce loading to the ADC and another 10k resistor for the feedback pin.
    In the case of the Propeller Demo board, no resistors are used to reduce loading by the ADC and a 100K resistor is used for the feedback. Is this ok?
    4. For the SX, only one capacitor is used to stabilize the ADC sampling point to ground.
    In the Propeller Demo board, one more capacitor (1nF) is connected at the sampling pin to Vdd.
    What is the effect of this second capacitor?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
  • deSilvadeSilva Posts: 2,967
    edited 2008-03-10 05:51
    The Propeller has no ADCs. However all its pins can work as Vdd/2 comparator inputs.
    So to correct my first sentence, the Propeller has 32 1-bit ADCs.

    This can be utilized to implemenet a Delta Sigma Modulator, which consisists in the simplest case of two resistors and a cap. (For HF symmetry considerations two caps are used, this is of no logical significance)

    This is the circuit you find on the DemoBoard, and there have been some programs written for it.

    It can be more convenient to connect a classical ADC, a no-nonsense converter is the PCF8591, which however has a low bandwidth due to its I2C interface, which on the other hand makes it ready to use with all I2C programs, see my example some weeks ago..

    The OBEX is full of objects for other ADCs

    Post Edited (deSilva) : 3/10/2008 9:43:11 AM GMT
  • william chanwilliam chan Posts: 1,326
    edited 2008-03-10 06:01
    De Silva,

    You are right when you say 2 resistors and a cap are need for a Prop ADC.
    But in the Prop Demo Board schematic, only one 100K resistor is used. Why is that so?
    (The other 10K resistor is only there bias the Mic.)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
  • deSilvadeSilva Posts: 2,967
    edited 2008-03-10 06:17
    It seems the output impedance from the mic is sufficient.

    The both resistors have to be scaled such that (Uin-1,65V)/Rin = (Ufb-1,65V)/Rfb are in equilibrium. The value selected is 1,6V/100k = 16 µA. When the AC current from the mic does not exceed this value, no additional resistor is neded.

    The value ofthe cap(s) is of subordinate significance.

    Post Edited (deSilva) : 3/10/2008 6:24:16 AM GMT
  • OzStampOzStamp Posts: 377
    edited 2008-03-10 07:20
    Hi

    That Microphone circuit on the Propeller demoboard is awesome..
    It picks up noises from meters away..
    Play with the settings in the Attenuator area..

    We are using that board on a test jig .. it pick up the sound of a falling object
    and it triggers something... secret from there on...

    cheers ron mel oz
  • AribaAriba Posts: 2,685
    edited 2008-03-10 07:28
    A nice ADC demo and a calculator for the resistor values can you find here:

    www.rayslogic.com/propeller/Programming/ADC.htm
  • william chanwilliam chan Posts: 1,326
    edited 2008-03-10 07:44
    Ariba,

    The way you took the Mic2VGA Demo and simplified it and added your own get_sample routines are ingenious !

    Thanks a million.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
  • deSilvadeSilva Posts: 2,967
    edited 2008-03-10 09:43
    I agree that Andy is ingenious!

    But it needs no Demo and no Simplification...

    This is obvious from the start... Sorry, couldn't avoid this.
  • AribaAriba Posts: 2,685
    edited 2008-03-10 14:51
    I like to get cudos, but not for something that I have not done wink.gif

    The link above goes to Raymans's website, so it should read:

    "Rayman,

    The way you took the Mic2VGA Demo and simplified it and added your own get_sample routines are ingenious !

    Thanks a million."
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2008-03-15 16:42
    deSilva said...

    It can be more convenient to connect a classical ADC, a no-nonsense converter is the PCF8591, which however has a low bandwidth due to its I2C interface, which on the other hand makes it ready to use with all I2C programs, see my example some weeks ago..
    deSilva's example is in this thread, at least: http://forums.parallax.com/showthread.php?p=702560
Sign In or Register to comment.