In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Jon Williams wrote: Remember that SX/B is "simpler" than PBASIC, even it if it is syntactically similar -- and with that simplicity comes the power to do what you want. You could always create a WAITFOR subroutine: WAITFOR: temp1 = __PARAM1 DO SERIN Sin, Baud, temp2 LOOP UNTIL temp2 = temp1 RETURN In your application you can: WAITFOR "C" Now, if you are expecting things to arrive within a given window, you could do something like this that would cause WAITFOR to return a success code if it worked: WAITFOR: temp1 = __PARAM1 DO SERIN Sin, Baud, temp2, 20, NO_RX LOOP UNTIL temp2 = temp1 temp1 = 0 GOTO WAITFOR_EXIT NO_RX: temp1 = $FF WAITFOR_EXIT RETURN temp1 One thing I did notice is that you don't update your buffer pointer after receiving a byte. Perhaps you should add "INC ax" afer you move bx into the buffer. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=84122#m84149 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)