Shop OBEX P1 Docs P2 Docs Learn Events
propellor a/d converter — Parallax Forums

propellor a/d converter

linear_shiftlinear_shift Posts: 1
edited 2008-11-11 19:15 in Propeller 1
Hi, can the Propeller be used directly as an a/d converter? In other words, no external a/d chips? If so how, and what is its maximum sample rate and resolution (at what base voltage and number of bits)? I would be using it as an a/d converter for my radio telescope for high speed DC sampling, and I would like at least 100k samples/sec at 10-bit resolution.

Thanks, ls.

Comments

  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-09-16 20:41
    The precision you are looking for is not possible with the Propeller. Take a look at AN001 from the downloads section: http://www.parallax.com/tabid/442/Default.aspx

    It's best to incorporate an external ADC.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-16 20:41
    Download the application note on the cog counters (AN001: www.parallax.com/tabid/442/Default.aspx). It includes a sample program that does the a/d conversion. You do have to connect two capacitors and two resistors to a pair of I/O pins and these have to be close to the Propeller chip to achieve the best accuracy, lowest noise, and highest speed as described in the program.

    You'll get about a 78KHz sample rate at 10-bits, maybe twice that at 9-bits. Look at the sample program comments for more details.
  • heathclfheathclf Posts: 43
    edited 2008-11-11 00:26
    I'd like to use the prop for an A/D converter as well. The voltages I'll be measuring are from 1mV to 5V, at less than 100Hz. If I divided the voltage I'm measuring over two 200Ohm resistors (so I'd be measuring from .5mV to 2.5V) would that work? According to the propeller manual:

    "When the Propeller goes into shutdown mode, the internal clock is stopped causing all cogs
    to halt and all I/O pins are set to input direction (high impedance)."

    So I guess if the pins are set to input, then they wouldn't draw any current, and not affect my voltage divider...right?

    I realize that I could use the ADC0831, and if this fails, I probably will, but would the divider work; at least at relatively low frequencies, or is there something I'm not considering?

    Thanks.
  • RaymanRayman Posts: 14,243
    edited 2008-11-11 00:47
    Look here on how to pick resistors to give you the input range you want:

    http://www.pulsedpower.net/Applets/Electronics/SigmaDeltaADC/SigmaDelta.html
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-11-11 01:58
    Wow, thanks for that link Raymond, very helpful. I'm going to bookmark it at home and work. Are you the Raymond listed on the page?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • heathclfheathclf Posts: 43
    edited 2008-11-11 02:08
    Wow is right. Thanks for the help.
  • RaymanRayman Posts: 14,243
    edited 2008-11-11 02:17
    Yes, that's me...

    PS:· I still have yet to see a simple explaination of how to pick the best C values...· We beat that topic to death a while back here, but would still like to find a good reference for this.
    Paul Baker (Parallax) said...
    Wow, thanks for that link Raymond, very helpful. I'm going to bookmark it at home and work. Are you the Raymond listed on the page?

  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2008-11-11 05:28
    Rayman,

    "I still have yet to see a simple explaination of how to pick the best C values" - I thought that this was answered. Basically you want to treat the capacitors as a LOW pass filter so that the roll-off frequency·is set below the operating frequency of the Sigma-Delta ADC (80MHz). Treat C1 and C2 as if they were in parallel and use the formula:

    f = 1 / (2*pi*R*C)

    C = C1//C2 and C1=C2
    R = R2

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • RaymanRayman Posts: 14,243
    edited 2008-11-11 11:44
    Beau: OK. That sounds good. Do you think that C also makes an RC filter on the input? I think maybe it doesn't because the uC always keeps the cap voltage nearly constant...
  • AribaAriba Posts: 2,687
    edited 2008-11-11 13:01
    IMHO the Low pass, which the ADC sees, is built from C1||C2 and R1 (not R2). This time constant defines how fast the Feedback output can follow the Input signal.

    f = 1/(2*Pi*R1*(C1+C2))

    C1 = C2 = 1 / (2*Pi*f*R1) / 2


    Andy
  • RaymanRayman Posts: 14,243
    edited 2008-11-11 14:10
    I think that is what Beau means... People define R1 and R2 differently... But, I can buy the argument that the frequency given by the RC time constant of the feedback resistor and the capacitors in parallel has to be less than 80 MHz.

    This defines a lower limit for the capacitance. But, what defines the upper limit?
  • Beau SchwabeBeau Schwabe Posts: 6,560
    edited 2008-11-11 15:43
    Ariba,

    "IMHO the Low pass, which the ADC sees, is built from C1||C2 and R1 (not R2)." - Yes, it's R1 sorry.

    Rayman,

    "This defines a lower limit for the capacitance. But, what defines the upper limit?" - I think that the lower lmit can be a very wide range, the lower limit would be a frequency roll-off that is at least twice·the frequency being sampled due to nyquist.










    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 11/11/2008 3:56:56 PM GMT
  • RaymanRayman Posts: 14,243
    edited 2008-11-11 19:15
    Beau: I think you're saying that the RC time of the input resistor and the C1||C2 form a low-pass filter on the input, right?

    Maybe that's true, but it's not so clear to me...
Sign In or Register to comment.