Shop OBEX P1 Docs P2 Docs Learn Events
Bidirectional uart error — Parallax Forums

Bidirectional uart error

Peter VerkaikPeter Verkaik Posts: 3,956
edited 2004-10-21 06:55 in General Discussion
Hi,
While testing my compactflash interface, that
communicates using a bidirectional uart, I discovered
that occasionally the uart buffer was not cleared
after changing the direction. That is, the last byte
transmitted, was the first byte received after changing
from transmit to receive using setDirection().
I send a command every 0.5 sec and during a four
hour test, I counted 26 times where the last byte
transmitted is the first byte received. So it is very
rare, but it does happen. I solved this by explicitly
clearing the buffer after a direction change. I haven't
had this error since.
Perhaps Parallax can clear the buffer explicitly
in the start() method in the next release of the
IDE, to prevent this error to appear.

regards peter
·
Sign In or Register to comment.