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

ADC

Kram11Kram11 Posts: 8
edited 2007-11-10 06:37 in Propeller 1
Can the Propeller chip read an analogue input on one of the pins. If so how?

Comments

  • RaymanRayman Posts: 14,793
    edited 2007-11-06 12:56
    You can do ADC with 2 pins.

    Look here:

    http://www.rayslogic.com/propeller/Programming/ADC.htm

    Also, check out the counters appnote and the Microphone2Vga demo
  • deSilvadeSilva Posts: 2,967
    edited 2007-11-06 14:12
    ... and many threads containing the topic "Sigma-Delta", which means delta-sigma modulator...
  • Kram11Kram11 Posts: 8
    edited 2007-11-06 14:23
    Thank for your help
  • rjo_rjo_ Posts: 1,825
    edited 2007-11-06 14:33
    There is a portal to this formally black art in the Stupid Video thread. And there is an excellent description of using counters in the Parallax applications notes, AN001.
    You are forewarned repeatedly everywhere in the forum to keep your leads short and to keep everything as close to the pins as possible (1 inch). You have to actually build a circuit, you aren't supposed to use a bread board... something having to due with neurotic inductance. (Inductance will drive you nuts[noparse]:)[/noparse]

    You will need a couple of resistors and a couple of capacitors. There is a beautiful applet (Rayman's web site?) to help you refine your circuit.

    No one has shown a "cog-heterodyne" approach to A/D but if you study Phil and Bagger's work on video and just reverse the logic, it seems that just about anything is possible.
  • deSilvadeSilva Posts: 2,967
    edited 2007-11-06 14:43
    Nevertheless, its not "neurotic", its "magnetic". But easy to muddle up...

    It should be a good educational example to not only build a charge balancing converter but also the other known ADCs: Dual Slope (with a cap), Successive Approximation (with a R-2R ladder), "Flash", using all 4COGS with 8 timers!
  • rjo_rjo_ Posts: 1,825
    edited 2007-11-06 15:00
    deSilva

    did I use the right concept (cog-heterodyne)?
  • deSilvadeSilva Posts: 2,967
    edited 2007-11-06 15:29
    It sounds VERY interesting smile.gif I am not 100% sure what you mean, but I think it is good word for using the power ("dyne") of multiple COGs smile.gif Maybe "polydyne" would even be more fitting smile.gifsmile.gif
  • rjo_rjo_ Posts: 1,825
    edited 2007-11-06 16:14
    I like polydyne... it sounds female (friendly) and it is easier to write.
  • rjo_rjo_ Posts: 1,825
    edited 2007-11-06 16:16
    Phil? Baggers?
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-11-07 17:35
    Speaking of heterodyning, I wonder if there's a possible way to use the counters on the prop to turn it into a tuner.· I've been trying to think of ways to get the propeller to receive radio signals.

    I built an AM radio years ago in school which had·an oscillator that would track the tuning frequency·with a constant frequency offset.· When mixed together, the signal would be at a fixed carrier (IF) for the next two stages using tuned Class C amplifiers.· I wonder if one could tune radio frequencies using a similar approach with an oscillator on the propeller.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • deSilvadeSilva Posts: 2,967
    edited 2007-11-08 08:08
    There is extremely much material on this matter in the internet, starting here:
    en.wikipedia.org/wiki/Software-defined_radio
  • RaymanRayman Posts: 14,793
    edited 2007-11-08 11:46
    It might also be interesting to transmit AM...
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-11-08 13:03
    I actually tried transmitting FM on the propeller, and it worked. I picked it up clearly on my home stereo at the other end of the house, and I only used one foot of wire for the antenna. I just connected the wire to an output pin.

    AM might be fairly easy with amplitude shift keying (ASK). Turning your carrier on and off at a given rate would be very easy.

    I think the hard part would be to try to receive RF with the Propeller without significant amount of external circuitry.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • RaymanRayman Posts: 14,793
    edited 2007-11-08 13:58
    I vaguely recall hearing AM as a kid with a kit that was just a diode and a coil...
  • Mike GreenMike Green Posts: 23,101
    edited 2007-11-08 14:34
    Considering how noisy (electrically) the Propeller is ... compared to a diode and parallel resonant "tank" circuit, you will need some quiet off-chip amplification as well as an off-chip demodulator (unless you're working with low frequency RF ... AM broadcast or lower frequency). The Propeller isn't really as fast as you might think (20 instructions per microsecond ... that's maybe 13 per RF cycle). The counters help on the transmit side and there's no equivalent for receiving.
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-11-08 15:22
    Oh, by the way, I did try to transmit AM using just a short length of wire and that didn't transmit more than about a foot away. AM is much lower frequency and the wire would have to be very long. If anyone is considering trying this you might need a coil and possibly some external amplification

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2007-11-08 17:34
    There are integrated tuner ICs like the ULN2204A that incorporate the analog functions that Mike referred to. Maybe the Prop could provide the local oscillator and control as the interface to a nice tuner.
    attachment.php?attachmentid=50346

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
    471 x 191 - 47K
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2007-11-09 05:30
    Speaking of sigma-delta and more unusual applications, I've wondered about the other counter modes. The logic modes can "mix" two input signals. For example, two frequencies taken into the logic A|B inputs of counter A could be sampled in a pasm loop and transfered with offset to counter B in duty mode to play back the beat frequency.

    We use POS detect w/feedback to make a sigma delta converter. But what about, say, POSEDGE detect w/feedback, what is that good for? How about this: A delay line is connected from the counter B output pin to its A input pin. Suppose the time delay depends on a physical parameter to be measured. Then when the output goes from 1->0, it takes some definite time for that to propagate to the input, at which point the output changes 0->1 as a result of the feedback and the counter increments by one as a result of the 0->1 transition. Allow it to free run, with a frequency that depends on the delay time quantized in units of 2/clkfreq. The frequency is counted as in the normal POSEDGE detect mode, but now it is a closed loop ADC for the parameter that governs the delay.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-11-09 12:54
    Good points, Tracy. I think this forum has only scratched the surface of how the counters in the Propeller can be utilized.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
  • rjo_rjo_ Posts: 1,825
    edited 2007-11-09 13:35
    Sometimes I get the feeling that Chip is waiting until we all catch up with Prop I before he releases PropII[noparse]:)[/noparse]
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2007-11-10 06:37
    I think you're right about Chip, that he's way out in front in thinking about the minimal hardware, necessary and sufficient to enable a cornucopia of tasks. He did think about the radio transmission capabilities, aka TV etc., and I remember talking couple of times about the possibility of short range direct radio offload of data from a data logger based on the Prop. He's said too on several occasions that he's surprised by things people have come up with in the year+ that the Prop has been out and about. I bet that all the comments and the wish list for Prop II are being heard.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
Sign In or Register to comment.