Shop OBEX P1 Docs P2 Docs Learn Events
Help in Programming — Parallax Forums

Help in Programming

FardeenFardeen Posts: 9
edited 2004-11-12 20:52 in BASIC Stamp
I am currently working on a wireless vital sign monitor. My project includes taking heart, pressure and temperature signals and analysing them.
I accomplish this by taking the signals, filtering and amplifying them, converting them digitally and processing them in a microcontroller before transmitting them wireless and displaying them using Labview.
I am using a microconroller because I am using serial communications for Labview software instead of DAQ (due to budge issues).
My microcontroller code therefore (BS2) requires to take in 3 signals from 3 different ·A/D, decode them to binary, and then send them in an infinite loop in a·format
······················<Tab>Signal1<Tab>Signal2<Tab>Signal3.
I however suck at assembly language and inspite of refering to so many different sources and sites, I am still having a hard time accomplishing this.
Can anybody help me please???
jumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gifjumpin.gif

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-11-08 21:39
    Do yo want your pogram to run on the BASIC Stamp II? If yes, you will use PBASIC, not assembly.

    What A/D convertors are you using? We have lots of example code for differnt converters.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • FardeenFardeen Posts: 9
    edited 2004-11-09 17:22
    I am using 8 bit A/D ( ADC08832)
    I will appreciate any examples and help I can get.
    Thanks alot.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-11-10 14:23
    I don't have an ADC0832, but I did write the attached code for someone who does -- they said it worked for them.· As always, I suggest that you review the ADC0832 docs before running the code ... I'm human.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • FardeenFardeen Posts: 9
    edited 2004-11-12 19:55
    Hey Jon

    I have written the code for my project. I just want someone to look over it.

    My program is supposed to take 3 input signals from 8 bits A/D (AD08831) and process them·so as to output serially in the format

    ····································· <Tab>Signal1<Sab>Signal2<Cab>Signal3

    so that I can separate them on receivind end (Labview).

    Also, is there a way I could just take a signle input from A/D into my chip and serially display the outut on the basic stamp editor??

    I noticed the connections between the [url=mailto:BS@-IC]BS2-IC[/url]·and RS232 on the BS2 manual and just wanted to doublecheck before doing that so as not to blow up anything.



    Thanks
  • FardeenFardeen Posts: 9
    edited 2004-11-12 19:59
    Sorry. I forgot to attach the file in the first message.
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-11-12 20:09
    <Tab> has an ASCII value of 9, and is a defined constant in PBASIC.

    You should be able to do this: SEROUT pin, baud, [noparse][[/noparse]TAB, sensorValue]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • FardeenFardeen Posts: 9
    edited 2004-11-12 20:32
    Thanks for the response Jon.

    Can I just use a single line command as

    SEROUT pin, baud, 50, timeout, [noparse][[/noparse]TAB, sig1, CR, sig2, TAB, sig3]

    where timeout is a label

    Also, would the constants TAB, CR, and·TAB each be sent as 8 bits serially or?????

    I would be very thankful if you can overlook my code please.

    Thanks again
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-11-12 20:52
    Yes, you can do that; but note that there is no timeout parameter for SEROUT -- what you send gets sent. If you need to make sure that the receiver is ready then you'll have to use flow control. Our RS-232 AppMod shows how to do this (you'll also need a pin for the flow control input).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
Sign In or Register to comment.