That masks off the upper 4 bits ( logical AND, temp.lowbyte AND %00001111 ) and use only the lower 4 bits to convert the nibble value to a byte-wide manchester encoded value....(and with the temphi variable, I shift the upper 4 into the lower 4 and do the same thing with it to get manchester encoded values)...
And do the same thing in reverse at the other end. Your method that you had when you started might work just fine.
Bookmarks