Hi harryweb,
There can be any number of things to consider when receiving data with the USART. But if the first 2 examples you presented were the normal sequence of bytes being received, something like this might work.
Code:
B1 var byte ' First character
B2 var byte ' space
W1 var word ' Value received
loop:
HserIn [B1]
if (B1 <> "B") and (B1 <> "F") then loop
HserIn [B2, DEC5 W1]
Now B1 holds the first char, and W1 has the value (0-65535)
Of course, this assumes that the data stream is always in the same format. If it differs from packet to packet, you'll need to think harder about how to capture all the variations. And then there's timeouts you can add, in case something goes wrong, the program can still go on working, instead of just sitting and waiting for data that will never come.
Darrel
Bookmarks