On Tue, 18 Aug 1998, Sylvain Bilanger wrote: > Hi, > I'm trying to do some RF comm.What i'm triing to do is send a ASCII > caracter every seconde. My problem is that i the following: > > First I transmit 7 bits with a Pic to a transmitter (all in asynchrone > comm)... After i check for the data at the recepter everything is fine > there. The pic gets good data... But the problem is when i'm not sending > any data... The RX module keeps on receiving data... What can i do to > ignore this data. I tried parity but it's no good, because the bits keep > on flipping and the noise does'nt help... Should i use CRC? If so can > anyone give me an example. It does not matter what you use, as long as it is packet-oriented. This means, that you will pack the byte in a box with a header and a trailer usually. The simplest way is, to have a 'start' code followed by a byte. Bytes that equal the start byte need to be 'escaped' to prevent errors. For this you comandeer another byte 9not the code for start). Now, this byte (called esc code) is itself if followed by another esc, and is the start byte if followed by the complemented start byte f.ex. For RF and other signalling through lossy media, add a leader (aka sync leader) before the start byte. This allows the receiver to stabilize and train (if required). You can also add a parity bit or more (ECC) to the packet. There is no end to it. All this is not perfect. You are fighting against S/N on the channel, and all you can do is reduce the probability of a noise signal being interpreted as data. This will NEVER be zero. The cost is reduced baud rate per bandwidth, and possibly, energy (to run the Tx longer). The calculations for this depend on the modulation type and bandwidth that you have and on the exact kind of noise. The maths are covered in any communications algorythms book. The easiest way to improve your system is to use a receiver with a signal quality output (i.e. carrier sense). All the other ways go into the higher maths/convolutional encoding/ECC direction ... One example of an ECC-enabled canned protocol is the RC5 by Philips. Just get the code bit table and see how you can transmit your data using that. This may work, or not. just my 2 bits, Peter