You do need to send some synch bytes. I use 3. Earlier today I had the same problem you did, but after reading this thread I fixed it and decided to post how. Mine are on the same breadboard less than 1 inch away from each other.
on transmitter end:
-Send synch bytes (I used three 55h packets)
-Send a start byte (make something up, like E7h)
-Send the data byte and it’s compliment (like 55h and then AAh)
-(optional) send stop byte
on receiver end:
-Check for first byte received to be the start byte (ie, E7h).
-Check the next 2 bytes to be compliments of eachother by reading them in and then logic AND them together. If result is 0, then data success.
-(optional) check for stop bit.
You wont get 100% transmission with this because of signal attenuation and all the other RF signals floating through, but you will ONLY get the data you want this way and none of the random bytes you may be seeing already. I’ve been sending a constant stream which is updated every millisecond or so for the past few hours and I have yet to accept a bad packet. Also, using this method, I noticed that if you had to send two bytes at once, use the same process outlined above, but bring the synch bytes low instead of the 55h (like, send a few 00h) after the first byte sent.
EXAMPLE CODE:
Transmitter:
Timer0_interrupt:
push ACC
mov A,R7
push ACC
acall SendSynch
mov R7,#10111110b
mov A,Lap2
acall SendDigit
acall SendLOW
mov R7,#10111101b
mov A,Lap1
acall SendDigit
mov TH0, #164
mov TL0, #164
clr TF0
setb TR0
pop ACC
mov R7,A
pop ACC
reti
SendSynch:
clr TI
mov SBUF,#55h
jnb TI,$
clr TI
mov SBUF,#55h
jnb TI,$
clr TI
mov SBUF,#55h
jnb TI,$
clr TI
ret
SendLOW:
clr TI
mov SBUF,#00h
jnb TI,$
clr TI
mov SBUF,#00h
jnb TI,$
clr TI
mov SBUF,#00h
jnb TI,$
clr TI
ret
SendDigit:
CLR TI
mov SBUF,R7
jnb TI,$
clr TI
orl A,#30h
mov SBUF,A
jnb TI,$
clr TI
cpl A
mov SBUF,A
jnb TI,$
clr TI
mov SBUF,#01000010b
jnb TI,$
clr TI
ret
Receiver:
monitor:
jnb RI,$ ;wait to read in a byte of data
mov R0,SBUF
clr RI
mov A,R0 ;move the byte to register A
cjne A,#10111110b,L2 ;compare the byte to the start byte we want
mov R2,#27h ; and restart if it's not correct
sjmp getBytes
L2: cjne A,#10111101b,monitor
mov R2,#26h
getBytes:
jnb RI,$ ;read in the next byte of data
mov R0,SBUF
clr RI
jnb RI,$ ;read in the 2nd byte of data as well
mov R1,SBUF
clr RI
mov A,R0 ;move the first byte to the accumulator
anl A,R1 ;logic AND the first byte with the second byte
jnz monitor ;if the result is not zero, then restart
jnb RI,$ ;Read in the last byte
mov R1,SBUF
clr RI
mov A,R1
cjne A,#01000010b,monitor ;compare the byte to the stop byte we want
;and restart if it's not correct
mov A,R2
mov R1,A
mov A,R0
mov @R1,A
lcall WriteLaps
sjmp monitor