I'm confused as to the use of hserin on m2 parts. The example in the manual is
This looks as though it will read both bytes in the buffer however the text says "If two bytes are expected in the buffer it is necessary to use two
separate hserin commands to retrieve both bytes."
Either way, the example appears to preclude reception of full binary data that could include any value (i.e if 255 is a valid input). Is there a register I can read to see if data is in the buffer rather than just looking for a change in value?
Thanks
Code:
hsersetup B9600_4, %00 ; baud 9600 at 4MHz
main:
w1 = $FFFF ; set up a non-valid value
hserin w1 ; receive 1 byte into w1
if w1 <> $FFFF then ; if a byte was received
hserout 0,(w1) ; echo it back out
end if
goto main ; loop
separate hserin commands to retrieve both bytes."
Either way, the example appears to preclude reception of full binary data that could include any value (i.e if 255 is a valid input). Is there a register I can read to see if data is in the buffer rather than just looking for a change in value?
Thanks