Shop OBEX P1 Docs P2 Docs Learn Events
Talking to a Pocket PC w/ Serial — Parallax Forums

Talking to a Pocket PC w/ Serial

ArchiverArchiver Posts: 46,084
edited 2004-04-05 18:11 in General Discussion
I have a few questions for the list.

I want to start a two way serial (rs232) communications pipe from a Stamp to a
PocketPC running VB.NET. I have been able to get the PocketPC to talk to a PC
using HyperTerm and display the text from the PC to the PocketPC. Now I just
need to get some advice on what is the best approach to get it talking to the
Stamp.

My application is to read info like Speed/RPM/Temps/Indicator lights from a
motorcycle using the Stamp and use the Pocket to display it. Most of the time
the communication will be from the stamp to the PocketPC just to display the
values, but sometimes the PocketPC will need to tell the Stamp to do something
like open/close a relay or the like.

Any ideas on a good protocol?

I'm thinking of using a letter to define each sensor and sending it as the first
char in the string, followed by the current value and a chr(13). If I need to
set something in the stamp I'll use a char + an '=' and value + CHR(13), then
wait for a response from the Stamp.

Speed is very important. I'd like to get updates on Speed & RPM no less then 15x
a second. Others can be slower. I'm also only going to be sending new values
when they change, to keep bandwidth use to a minimum.

Thanks,

Jim Fouch

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-04-05 18:11
    15 times per second is 66 mSec per report -- certainly
    within the BS2's capabilities.

    You MIGHT want to use some form of hardware handshake,
    (like an RTS pin) from the PocketPC to the Stamp, to
    let the Stamp know when to listen for data. The
    Stamp is a single-tasking beast, so when it is
    talking it can't listen. You'll pull the RTS
    line to signal to the stamp to Listen, wait
    50 mSec or so for the Stamp to get into a
    Listen mode, then send the data.

    The Stamp will sample the RTS line before
    every transmission, and if it is low NOT send,
    but listen.

    You also might want something like the sMT chip
    (8-pins) to generate a 50 mSec 'tick' to synchronize
    the Stamp's activities.

    Another approach is to have the Stamp 'Listen'
    for a short period after every 'Send' (with a
    timeout) and use those 'time-slots' to send
    data or an 'ACK' signal from the PocketPC.

    --- In basicstamps@yahoogroups.com, Jim Fouch <fouch.soft@g...> wrote:
    > I have a few questions for the list.
    >
    > I want to start a two way serial (rs232) communications pipe from a
    Stamp to a PocketPC running VB.NET. I have been able to get the
    PocketPC to talk to a PC using HyperTerm and display the text from
    the PC to the PocketPC. Now I just need to get some advice on what is
    the best approach to get it talking to the Stamp.
    >
    > My application is to read info like Speed/RPM/Temps/Indicator
    lights from a motorcycle using the Stamp and use the Pocket to
    display it. Most of the time the communication will be from the stamp
    to the PocketPC just to display the values, but sometimes the
    PocketPC will need to tell the Stamp to do something like open/close
    a relay or the like.
    >
    > Any ideas on a good protocol?
    >
    > I'm thinking of using a letter to define each sensor and sending it
    as the first char in the string, followed by the current value and a
    chr(13). If I need to set something in the stamp I'll use a char +
    an '=' and value + CHR(13), then wait for a response from the Stamp.
    >
    > Speed is very important. I'd like to get updates on Speed & RPM no
    less then 15x a second. Others can be slower. I'm also only going to
    be sending new values when they change, to keep bandwidth use to a
    minimum.
    >
    > Thanks,
    >
    > Jim Fouch
Sign In or Register to comment.