Shop OBEX P1 Docs P2 Docs Learn Events
Data Streaming to XCite RF Modem BS2 Stamp — Parallax Forums

Data Streaming to XCite RF Modem BS2 Stamp

JadencccpJadencccp Posts: 3
edited 2005-12-05 05:50 in BASIC Stamp
Here is basically what I'm trying to do:

In a subroutine I would like to transfer an 10bit (8 bit data, start/stop bit) at 2400 baud to an rsXXX module.· I have had no success thus far and am the mercy of the forum users.· Basically I would very much appreciate some sample code for the subroutine to transfer 0101010111.· The rsXXX module will then make it so the XCite can handle the data, if I'm not mistaken.

Any help is greatly appreciated.· Thank you!
-Alex Moore

Comments

  • Philip GamblinPhilip Gamblin Posts: 202
    edited 2005-12-05 01:30
    Have you read up on the SEROUT or DEBUG Commands in the PBasic help. It's a great place to start.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-12-05 02:07
    Philip is correct...SEROUT should work just fine.· It's a simply matter to set the baud rate and SEROUT data.· Really the only additional information you will need is whether the device is TTL serial or RS-232 levels.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • JadencccpJadencccp Posts: 3
    edited 2005-12-05 03:32
    Interesting, I found this:
    SEROUT 1, 16780, [noparse][[/noparse]"HELLO", CR]
    SEROUT 1, 16780, [noparse][[/noparse]"Num = ", DEC 100]


    To make sure, "HELLO" will be sent from pin 1 to the rs232 then to the XCite modem. I did not know it was this easy.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-12-05 04:57
    Alex -

    Now that you've seen how simple RS-232 serial communication is, you may be interested in seeing how that same asynchronous serial output can be dumped right into an Excel spreadsheet! Check out StampDAQ, a FREE utility from Parallax:
    http://www.parallax.com/html_pages/downloads/software/software_stampDAQ.asp

    If, instead, direct graphical plotting is more your game, there's always StampPlot Lite, and StampPlot Pro. The Lite version (which is probably all you need to test out your system) is also FREE! Here it is, FREE for the asking:
    http://www.parallax.com/html_pages/downloads/software/stamp_plot_pro_info.asp

    I'll bet you think that's all there is? Nope!

    The excellent text "Applied Sensors" (formerly "Earth Measurements") by Dr. Tracy Allen, a regular contributor to this Stamp Forum, covers many aspects of logging data from various input sensors using the PBASIC Stamp as the data collector. This informative text is just a part of the Educational Series available from Parallax. That too is FREE for the download, from here:
    http://www.parallax.com/detail.asp?product_id=28153 (near bottom of page)

    Insofar as the outbound data transmission is concerned, here are the various RF offerings (including BlueTooth) available from Parallax. If you want near-guaranteed reliability, I would choose one of these products, as opposed to some product that hasn't been tested fully with the PBASIC Stamp:
    http://www.parallax.com/html_pages/products/communication/rf_modules.asp

    In the end, how you choose to do this, is certainly up to you. However, if this were my project, I'd be tempted to design something fairly straightforward and reliable like this:

    /code

    sensor-
    ········· ·\
    sensor--->--> Stamp [noparse][[/noparse]SEROUT] -->/ RF LINK /--> [noparse][[/noparse]SERIN]·Stamp --> PC: Running·StampDAQ or StampPlot
    ·········· /
    sensor-

    code/

    I would "protect" my data by using and transmitting a 16-bit CRC along with any sensor data sent. If reliability over cost is a goal, I'd make the RF link bi-directional, and use a simple,· home-brew ACK/NAK protocal, which then would allow the immediate re-transmission of faulty data, on the fly. If power consumption is not an issue, then I'd look to use the Stamp BS-2SX and probably shoot for a transmission rate of 9600 baud to start. Once that was solid, I might trying bringing up the data transmission rate some, to improve the data throughput, if that's an issue at all.

    Just some thoughts and resources.

    Regards,

    Bruce Bates
  • JadencccpJadencccp Posts: 3
    edited 2005-12-05 05:50
    That is greatly appreciated and I will definitely be using StampDAQ. Thank you so much, this is possibly the best response to a question I've ever received on a support forum.

    Take care Bruce.

    Alex Moore
Sign In or Register to comment.