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

ADC Programming

sameiasameia Posts: 7
edited 2010-03-16 16:41 in BASIC Stamp
cry.gif·hi there,

i am a senior student and i has a project that need to be programmed in BS2, my problem is that i must use this program and i don't know how because our programming course was about C++ and visual basic so i am stuck now. so Plz i need an expert to dirct me and i wana now how to get the programming og ADC ..

need your experiance as soon as possible.

Comments

  • BeanBean Posts: 8,129
    edited 2010-03-11 12:22
    I have recently used the MCP3204 http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/MCP3204/List/0/SortField/4/ProductID/574/Default.aspx
    and have found it to be easy to program. The link above has the demo programs for the BS2.

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.

    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    ·
  • sameiasameia Posts: 7
    edited 2010-03-11 13:53
    what i need is programming ADC0809 -8 bit by using BS2

    with PIN= A,PIN2=ALE,PIN3=SC,PIN4=RD,PIN5=EOC
  • stamptrolstamptrol Posts: 1,731
    edited 2010-03-11 14:58
    If you've done VB, PBASIC will be very quick to pick up. And, since someone has told you the pins to use, it gives you something to aim for.

    The a/d chosen is not very complicated and the datasheet is the place to start.

    Hook it up, start writing and let us know the specific snags you run into.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • Jimbo30Jimbo30 Posts: 129
    edited 2010-03-11 15:18
    You can also use the ADC0831 8 bit A to D.· It is really not as hard as you think.· If you are using a sensor, just make sure you know what type and if that sensor can be easily hooked up to the ADC & the Stamp.· For example, if you are using a resistive type sensor make sure you know the difference between linear and nonlinear because you will run into all kinds of issues with nonlinear types.·
  • sameiasameia Posts: 7
    edited 2010-03-16 14:35
    i started my programming but now i am stuck on what command i should use to wait for EOC=0
  • stamptrolstamptrol Posts: 1,731
    edited 2010-03-16 16:41
    Suppose you have the EOC (end of conversion) connected to pin 5. Check the data sheet to see when EOC changes state. Suppose it goes high at the end of conversion.
    Also, check out the IF-THEN-ELSE construct as it may give some more flexibility in program flow.

    main:
    if IN5 = 1 then DOTHIS
    ···· do these steps if IN5 is still 0
    goto main

    dothis: ' label where you process data after the conversion is done
    ····· process the newest data
    goto main

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
Sign In or Register to comment.