Quote Originally Posted by Fredrick View Post
Any idé how i can to improve my code?
RF is tricky, no matter what you do. Just too many variables for the average joe to account for, circuit layout, power stability, sunspot cycle, and so on and so on...

My experiences: (which are far outweighted by a number of people on these forums when it comes to RF)
-Try changing the number of sync bytes in the transmitter...6 sync's is a good start. Try 2, try 10, try anything, see what happens.
-Try changing the baud rate. I had a TX434 from Rentron. The datasheets say it's only good for 4800bps. I got it to work very reliably at 9,600 and fairly decent up to 19,200, but it didn't like 2400bps. Try 2400, try 9600, try 4800...
-Change the PACING length. You have it set at 1000, a decent number. But...maybe the RF module wants less. If you have 1ms between each character, that also means that you have 1ms between each sync character, which may be screwing up your sync'ing, which may mean that the data slicer isn't being balanced completely. Try leaving out the PACING altogether, sending your sync bytes as fast as possible, then manually PACING your sent bytes with a slight pause in between each character.