Shop OBEX P1 Docs P2 Docs Learn Events
programing question — Parallax Forums

programing question

wonkawonka Posts: 12
edited 2005-04-19 04:45 in BASIC Stamp
Hello,
I need help I have untill friday to get this project up and running and I am issue with my program. I need help with timing I use·the pause command to that and reading in bits for my a/d converter. I also think i have a contuines loop it mess up her a attachment of my code and ideas or anything please help.


thanks adam

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-04-19 01:25
    Adam,

    ·· I am confused by a few spots in your program...For example, why are you doing 4 PAUSE 500 commands in a row instead of one PAUSE 2000?· Also, is your A/D converter parallel output?· If so, how do you know when there is valid data on it?· The code is a little sporadic so it's hard to tell what's going on.· You could really use some alias' for the ports so we know what's connected.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-04-19 02:31
    I'm with Chris... confused.· This is a case where poor style kills the best-laid plans.· As an exercise I tried to rewrite your program in a more professional style, hoping that it will help you flesh out your logic and get things working.

    What kind of A2D are you using?· Do it simply put its value onto the bus, or does it require some kind of stimulous (most do)?

    If you provide more details about your circuitry and project logic, we'll be able to offer more assistance.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • wonkawonka Posts: 12
    edited 2005-04-19 04:35
    hello,

    I am using a signal conditoner that goes into a A2D converter ADC0804. I have it set for continous reading. It then sends digtal signal to the microcontroller. Eight output pins from the A2D is send to the first input pin 0-7 on the microcontroller.







    Thanks,

    Adam
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-04-19 04:37
    What is the output resolution per bit? You have question in your code about voltage but give no clue as to what your A2D is measuring.

    The devil is in the details... provide 'em, and you'll get more help and fewer questions shot back.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • wonkawonka Posts: 12
    edited 2005-04-19 04:42
    My volt is reading from 0-5 volts from the signal conditionor and i am compare the intital start up to 1mv and 350 degrees to 1.53 volts.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-04-19 04:45
    If you have a 5 volt reference and eight bits of resolution then the best you can do is 19.6 millivolts (5 / 255 = 0.0196). For 1.53 volts you should read 78 from the A2D.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
Sign In or Register to comment.