Shop OBEX P1 Docs P2 Docs Learn Events
Propeler AD conversion possibility....? — Parallax Forums

Propeler AD conversion possibility....?

Mladen BruckMladen Bruck Posts: 3
edited 2007-10-01 00:22 in Propeller 1
Is there anyone can tell me more about Propeler AD conversion possibility? I like to connect 4 wire touch panel to Propeler....

Tnx

Comments

  • deSilvadeSilva Posts: 2,967
    edited 2007-09-30 22:38
    You could search for "sigma" leading you to some threads where delta-sigma modulation is used (people seem to call it sigma-delta here...)

    The demo board is well equipped for this with two tiny caps and a resistor close to the microphone....
    There is also software for it
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-30 22:42
    For something slow you can discharge a pulse charged cap, using the comparator feature of all Prop pins @ Vdd/2. Not VERY precise but useable within 2% I should say...

    Post Edited (deSilva) : 10/1/2007 12:07:54 AM GMT
  • Mladen BruckMladen Bruck Posts: 3
    edited 2007-09-30 22:56
    4 wire Touch screen have two resistor's X and Y. So basically I need a way to measure this two resistors, so I presume I need two AD channels (or comparators)....
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-30 23:19
    Yes, it looks quite simple: connect the X and Y line to
    (a) an appropriate cap (we come to that later) and the caps to + 3V3.
    I assume the X and Y resistors are grounded at the other side...
    (b) to a Prop pin each we shall call X and Y respectively


    The program is at follows:
    Set X and Y to high for a short time, enough to charge the caps by a 20mA pulse.
    Set X and Y to input
    WAITPNE for X or Y to have unloaded below V/2, save CNT
    WAITPEQ that both have reached V/2, save CNT

    Assess the precision. If not sufficient, use a real ADC smile.gif

    It you need the reading each T than C should be T/2R where R is the maximum resistance oft X and Y

    Post Edited (deSilva) : 10/1/2007 12:08:42 AM GMT
  • RaymanRayman Posts: 14,162
    edited 2007-09-30 23:33
    You should download the Propeller AppNotes:

    AN001 - Propeller Counters (v1.1; 392 KB)

    It talks about using the counters for fast ADC.
  • deSilvadeSilva Posts: 2,967
    edited 2007-09-30 23:38
    This is another possibility. Yes, reading....

    But the counters won't help you much. They are nice for D/A convertion. Or you need an opamp as well...
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-09-30 23:41
    @Mladen:

    I have used the prop to read a four-wire touch screen. I posted my code on one of the threads. Do a search. I don't have the code handy on this computer or I'd post it again for you now.

    [noparse][[/noparse]edit]
    Here's the thread where I posted my code:
    http://forums.parallax.com/showthread.php?p=669411
    [noparse][[/noparse]/edit]

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


    The more I know, the more I know I don't know.· Is this what they call Wisdom?

    Post Edited (Ken Peterson) : 9/30/2007 11:49:20 PM GMT
  • RaymanRayman Posts: 14,162
    edited 2007-09-30 23:59
    The "Microphone2VGA" example in "Object Exchange" is a really good example of ADC with just 2 pins, 2 caps, and 2 resistors. These are built into the demo board. You don't have to use counters to do it, but this gives the fastest conversion rates possible. Here's a snippet:

    ' At 80MHz the ADC sample resolutions and rates are as follows:
    '
    ' sample sample
    ' bits rate
    '
    ' 9 156 KHz
    ' 10 78 KHz
    ' 11 39 KHz
    ' 12 19.5 KHz
    ' 13 9.77 KHz
    ' 14 4.88 KHz
  • Ken PetersonKen Peterson Posts: 806
    edited 2007-10-01 00:22
    The code that I put up has a modified ADC object that does two ADC channels at once. It needs 8 pins to do the touch screen. Two for A/D for each axis (X & Y) and two for driving each axis. With additional hardware this pin requirement can be reduced somewhat. I developed the code using the touch panel that I pulled out of my old Palm Pilot. Make sure you put your 100K resistors and caps within 1" of the propeller if possible.

    I have some explanation in my documentation about how the touch panel works. Hopefully it makes sense.

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


    The more I know, the more I know I don't know.· Is this what they call Wisdom?
Sign In or Register to comment.