I just want to confirm my code, am I using the GE Thomas Convention where "1" is "10" or am I using the IEEE convention where "1" is "01" because it seems like I'm encoding it the IEEE convention way but at serout I invert it so it becomes the GE Thomas Convention.
Include "Modedefs.bas"
main:
u var byte : counter var byte : encode var byte : u = %1101
'Manchester encoding
For counter = 0 to 3
If u.0[counter]=0 Then
encode.0[counter*2]=0 : encode.0[counter*2+1]=1 'If it is a zero make the first bit 0 and second bit 1
Else
encode.0[counter*2]=1 : encode.0[counter*2+1]=0 'If not then make first bit 1 and second bit 0
EndIf
Next counter
serout PORTB.0, n2400, [ $55 , $55 ,$55, $55, $aa , encode ] '
goto main
Bookmarks