Shop OBEX P1 Docs P2 Docs Learn Events
strange SERIN behaviour — Parallax Forums

strange SERIN behaviour

Peter VerkaikPeter Verkaik Posts: 3,956
edited 2007-01-06 01:00 in BASIC Stamp
I am running a simple bs2sx program to display 80 leds.
For this I receive 10 bytes via pin2.
The mainloop in the attached program is
main:
·· SERIN RX2\TX2,CMDBAUD,CMDTO,main,[noparse][[/noparse]STR _ledarray\10] 'read 10 bytes into _ledarray
·· 'SERIN RX2,CMDBAUD,CMDTO,main,[noparse][[/noparse]STR _ledarray\10] 'read 10 bytes into _ledarray
·· for temp=0 to 9 'display _ledarray bytes if serial data received
·· debug hex2 _ledarray(temp),13
·· next
·· GOTO main

When I use·the serin with handshake, then·I receive all 0xFF all the time, but the RX is not connected.
When I use the serin without handshake,·then·I receive no data, as it should, because RX is not connected.
I do need the handshake to inform the source device that it may send the 10 bytes.

Funny thing is, I used the same program on an identical board just a few weeks ago
without any problem. Could it be a faulty bs2sx?
Can I work around this by using a manual handshake
high TX 'allow transmission of 10 bytes
SERIN RX2,CMDBAUD,CMDTO,main,[noparse][[/noparse]STR _ledarray\10] 'read 10 bytes into _ledarray
low TX 'disallow transmission of 10 bytes
or is there than a change of missing data?

regards peter

Comments

  • Martin HebelMartin Hebel Posts: 1,239
    edited 2007-01-05 15:24
    It sounds like your data may be inverted. What are you using for hardware to connect the two and what are you using for a value of CMDBAUD?

    If RX is not connected, it may be hard to say what you should be seeing since that pin is not dedicated.

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    StampPlot - Graphical Data Acquisition and Control
    AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-01-05 15:43
    All the settings are correct because this identical program
    runs on an identical board. The board is also fine because it
    receives data flawlessly when not using the handshake.
    When I select the handshake mode, I receive 0xFF alll the time,
    even when not sending data.
    But I just figured out what the problem was.
    The rx wire was not connected to the device and probably picked
    up some noise. That still does not explain why I didn't get
    the 0xFF when not using handshake.
    It is no more issue now, because it appears to operate fine now.
    Thanks anyway for responding.

    regards peter
  • allanlane5allanlane5 Posts: 3,815
    edited 2007-01-06 01:00
    Perhaps your ground wire has become disconnected?

    I hesitate to mention this to somebody like Peter, since if anybody knows Parallax in depth, he does. But still.
Sign In or Register to comment.