Nathan,
Thanks for the reply. However, it doesn't seem like this problem is tied to the timeout value. Note the following 2 programs:
PROGRAM #1
inchr var byte
clear
low ax2
sethserial H57600
MAIN:
pulsout ax2,5
hserstat 4, main
high ax3
hserin [inchr]
low ax3
goto main
Looking at program #1 -
PULSOUT is used as a sync point.
After receiving a byte of data and executing HSERSTAT, the HIGH AX3 executes at +76 microseconds after the sync pulse. This means that the HSERSTAT is VERY fast.
After reading the received char with HSERIN (with no timeout parameter), the LOW AX3 executes at 196 microseconds after sync. This means that the HSERIN took about 120 microseconds to execute. So far so good.
PROGRAM #2
inchr var byte
clear
low ax2
sethserial H57600
MAIN:
pulsout ax2,5
hserstat 4, main
high ax3
hserin main,100,[inchr]
low ax3
goto main
Now looking at program #2 -
Again, PULSOUT is used as a sync point.
And again, after receiving a byte of data and executing HSERSTAT, the HIGH AX3 executes at +76 microseconds after the sync pulse.
However, after reading the received char (which we know is already there because of HSERSTAT) with HSERIN (with a timeout parameter), the LOW AX3 executes at 1456 microseconds after sync (almost 1.5 milliseconds). This means that the HERSIN now took about 1380 microseconds or over 1.3 milliseconds to execute. Not so good.
Changing the timeout value (from 1 to 10 to 100) doesn't make any difference either.
(I realize that the HSERSTAT along with the HSERIN with its timeout parameters in the real world would be redundant.)
If HSERSTAT works so fast in determining if there is data available, why does HSERIN (with a timeout value) take so long?
Thanks,
RickC
[This message has been edited by RickC (edited 05-27-2003).]