Shop OBEX P1 Docs P2 Docs Learn Events
SERIN timeout and WAIT — Parallax Forums

SERIN timeout and WAIT

dev/nulldev/null Posts: 381
edited 2009-07-08 13:39 in BASIC Stamp
I am running this command on a BS2p, but it never times out (never reaches the NoRadio tag):
SERIN pRFRx, N9600 + Inverted, 100, NoRadio, [noparse][[/noparse]WAIT("!!!!"), STR mystring\3]



Doesn't the timeout option work with the WAIT option?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
/dev/null

Comments

  • Tracy AllenTracy Allen Posts: 6,662
    edited 2009-07-07 21:38
    It may be that the radio if not squelched will continue to pick up noise. Even noise will reset the SERIN timer. On the other hand, that will not happen on a radio that has a built-in protocol checking, Zigbee for example.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • dev/nulldev/null Posts: 381
    edited 2009-07-07 21:42
    I can't squelch the Parallax RF receiver?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    /dev/null
  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-07 21:54
    Nope.

    The Parallax receiver has a threshold. Any signal above that causes the data line to be high. Any signal below that causes the data line to be low. That's it. If your ambient noise level is too high, the data line will be high all the time. If the noise is intermittent, it will look like garbage characters and the SERIN will not time out. There is no squelch.
  • dev/nulldev/null Posts: 381
    edited 2009-07-07 23:26
    Hmm. I'm looking at the BlueSMiRF from Sparkfun. Maybe that will suit my needs for bidirectional com to my robot indoors?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    /dev/null
  • Tracy AllenTracy Allen Posts: 6,662
    edited 2009-07-08 04:53
    I'm not familiar with the BlueSMiRF, but it would probably eliminate any problem such as that you are having with the raw radio signal. If it uses bluetooth technology, that will take care of all the noise issues and pass only the real verified data through to the receiver. It would act as if you have a cable with wires connected (apart from some small offets of timing).

    With the radio receiver you have, do you also control the transmitter? If so, you should know that the usual way to deal with noise is to transmit a preamble, something like,

    SEROUT pRFTx, N9600 + Inverted, 2, [noparse][[/noparse]REP $55\4,"!!!!", STR mystring\3]

    While there no squelch per se, nevertheless the threshold for the "data slicer" on the receiver end usually adapts to the signal level and finds a level where it is centered on what it "hears". The preamble or even a single pulse will silence the noise and condition the data slicer so that the receiver can properly slice the message. The preamble in the above is four %01010101 characters, paced 2 milliseconds apart. I think the docs for the Parallax xmtr/rcvr probably go into this issue.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • dev/nulldev/null Posts: 381
    edited 2009-07-08 13:39
    Hey Tracy.

    Yes I control the transmitter.

    Thanks for tips, but I think there is just too much noise in my house to get this working, even with the preamble. I have a house full of wireless things and gadgets (I'm gonna die of EM raditaion, I know it!), and I live dead center in the city.

    Also, I need bidirectional communication, and when you try that with the Parallax transmitters, it gets worse than with just one pair.

    I've ordered a pair of BlueSMIRF, it's gonna be fun testing them. They are supposed to have a very clean signal, with range up to 100m, more than I need.

    I've also ordered ZigBee modems, so I'm gonna try them out as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    /dev/null
Sign In or Register to comment.