Jose, This explanation goes a little deeper than you require but I have given it as an example of how we achieve reliable communications. Depending on the hardware used in your link, you may not get away with long runs of "1"s and "0"s. Normally a Data Slicer circuit is used in the receiver that tracks the average DC level of the incoming signal and attempts to "slice" at the mid point between the voltage level of "1" and "0". Long runs of either polarity will cause this type of slicer to be biased near the extreme top or bottom of the incoming waveform. This leads to false triggering due to noise crossing the data detection threshold. The idea of the PREAMBLE is to condition the slicer to detect transitions at as close to 50% as possible. If all incoming data is DC balanced (same number of "1"s as "0"s then the slicer performance will be optimal. We use Manchester encoding for transmission over radio of data packets. We first send a small string of AAh to condition the slicer (the very first byte is almost always lost). We then send a unique SYNC byte that does not occur in the Manchester encoding of the data (33h). Next, the data is sent. To send normal NRZ data as Manchester via the micro UART, you break each data byte into 2 nibbles. Each "1" in the original data byte is sent as "1" "0" combination and each "0" as "0" "1". This decreases the throughput by 50% but increases reliability and detection sensitivity. As our units run up to 115kB, the "virtual" communication rate is still very good. Lastly we send a CRC-16 checksum. Keep your packets small. Also, ensure the transmitter is keyed on long enough before transmission before data is sent and left on long enough to allow the last byte out. We also send a PREAMBLE byte after the packet to ensure last byte is received and don't have to worry about timing the last byte. The packet synchronisation is achieved by ensuring you get a PREAMBLE followed immediately by a SYNC byte. Any other combination is ignored. After the synchronisation is achieved, you receive data into a buffer until the required number of bytes is received. It is a good idea to set a timer going during reception of data so that if a partial packet is received, you can reset and start over. Once all bytes are received, copy the buffer to another buffer (called double buffering) , flag the buffer as full and then process the received packet. If packet is valid then the unit would send an acknowledge back to the sending unit. If the sending unit does not get an acknowledge then it will resend the original packet. After (x) number of retries without success, your application can determine how to handle a comms error. On top of all this , our units monitor for clear channel before transmission (by measuring RSSI - Received Signal Strength Indicator levels). If the channel is being used when it "wants" to transmit, it waits a "random" period of time and retries. It is relatively easy to get RF transmission over several hundred metres, the problems begin to increase as you want higher and higher levels of reliability and guaranteed packet delivery. Non critical applications such as remote control toys and garage door openers are fine as the user simply holds the button at close range and eventually a valid packet gets through. Best Regards David Huisman ---------------------------------------------------------------- Orbit Communications Reliable RF data modules,wireless telemetry rfic and other communication solutions Web site: http://www.orbitcoms.com Email: info@orbitcoms.com PO Box 3469, Tuggerah, NSW 2259, Australia Phone:+61-2-4329-7765 Fax:+61-2-4329-7893 -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body