Shop OBEX P1 Docs P2 Docs Learn Events
Serial IO — Parallax Forums

Serial IO

Chip CoxChip Cox Posts: 73
edited 2010-03-29 17:48 in Propeller 1
sad.gif·Sorry if this same question seems to keep getting asked, but I'm just not getting the answers through my thick head.· I have a wifly ethernet breakout board that I want to connect to my propeller.· The communication with the wifly is similar to devices like the GPS module in that you send a request for information and get a response back.· I am getting through to the device and get a response to my command that puts the device into command mode.· This is confirmed because I see a rapid blinking led which means the chip thinks it's in command mode and I get a CMD response by serially which indicates I am in command mode.· This also tells me that my wiring is correct since I am getting two way communications.· Sounds great, no problem.· Not so fast....·· The next command I need to send is one that gets the time from the device.· I send the message the same way I sent the string that moved me into command mode.· But I get back an echo of that command and then either nothing or garbage ( kind of like the wrong baud rate or I've stepped on something ).· I'm using the Parallax Serial Terminal object as my object for this and the debugger.· Both the debugger and wifly are running at 9600 8N1.· I don't know whether I am stepping on something or if my timing is getting off somewhere and starting to pick up signals mid byte resulting in the garbage or what.· I've attached a copy of a test source program ( to limit size ).·
Thanks

Comments

  • StefanL38StefanL38 Posts: 2,292
    edited 2010-03-29 07:31
    hard to say what is wrong without a logfile what you send and receive
    I would analyse the bytestream by using a testroutine that receives and debugs single bytes "printing" them as decimal or hexadecimal values (to see non printable ASCII-values too)
    or by using a serial terminal software that can log the received bytes decimal or hexadecimal
    also if you provide what you expect to be received would help to emulate your device

    best regards

    Stefan
  • Chip CoxChip Cox Posts: 73
    edited 2010-03-29 12:20
    Yea, that would be nice to have. The only thing I can offer from that perspective is that its flat ASCII, no control characters either way. Only Clear test. The response to the last command I sent ( show time ) should be the string Time: HH:MM:SS . The serial part is not having to encode the actual TCP or UDP string in command mode.
  • StefanL38StefanL38 Posts: 2,292
    edited 2010-03-29 17:48
    so this might be the reason
    the method StrIn waits for ASCII-Code decimal 13 (carriage return to finish the receiving.
    You said you received something. If really just plan ASCII-codes between decimal is send 32 and 128
    you should NOT receive anything. So something between what's really happening and what you described oes not fit together.
    Believe me. I had phemomens like this dozens of times. And the best way to solve them is to analyse every dammed single detail

    The way towards this is use a serial connection that is well knwon as working bugfree.

    For example Br@ys Terminal

    go try to communicate with your device using br@y's terminal

    And watch the bytes that are send and received

    If you think it's more fun to guess around trying this guessing that - no problem
    I don't want to reduce somebodies fun

    best regards

    Stefan
Sign In or Register to comment.