Quote Originally Posted by Peter987 View Post
Howdy
Can anyone give me some examples please in more detailed depth regarding the MELabs Pic Compiler command serin.

I have two 16F84 PICS communicating perfectly using one byte at a time, however I am in the dark as to how to use the command
serin 1,N1200,b10,b11,b12,b13 to receive multiple bytes.

How does the serin command know when the last byte is sent etc. What choices do I have?

What do you do in the case of less bytes are transmitted than there are variables allocated for in the serin command?

Some examples would be much appreciated.

Many thanks in advance,
Peter987
->How does the serin command know when the last byte is sent etc.
Depends on what you mean by 'last byte'. If you mean the last byte in a block of data, well, that's all up to you, a counter, a stop character, knowing that there are always X numbers of bytes in a block of data, anything you want. If you mean the last byte in a serin command with 4 variables, then it's when the 4th variable gets received.

->What do you do in the case of less bytes are transmitted than there are variables allocated for in the serin command?
Check out the 'timeout' option of the serin command as described in the PBP manual. Remember, serin, and PBP in general, are only as smart as you make them. If serin is written to get one byte, it's going to get one byte, if it's written to get 10 bytes, it's getting 10 bytes, unless you tell it to do something else, like timeout.