>>im planning to use a continuos loop in the transmitter, so it would >send >>the byte over and over again, and the transmitter would catch the >byte and >>do whatever it has activated. Infrared remote-control links in consumer equipment usually use a 40 KHz carrier and pulse-width modulation. It's a good idea to use this sort of scheme if possible since the most complicated part, the light detector and analog signal processing in the receiver, is available as a low-cost module. Also, pushbutton- operated transmitters can be purchased off the shelf. Throughput of about 500-1000 baud and range on the order of 10 meters is possible. The receiver processes the signal from the photodiode through a bandpass filter and level detector. When the level of 40 KHz energy is sufficiently high, the digital output (usually active-low) turns on. At the transmitter, the LED is turned on and off at a 40 KHz rate (50% duty cycle). To send a bit, make a dropout of a few hundred us. If the dropout is close to the last one, call the bit a 1, if it is far, call it a zero. The start bit is a long time with no dropout. For example, to send 1101, transmit: 111111111111101110111011111101110 ^-start------^ 1 1 0 1 After the sequence leave the LED off for a while (depending on how long the batteries in the transmitter need to last), and then repeat. The AM/AGC circuit in the receiver rejects noise best when the transmitter's average power (inside the block) is high. This is why long on times and short off times are used. When no signal is recieved most of the reciever modules will output occasional short noise pulses, which the start pulse detection logic immediately rejects. The effective bit rate varies with the content of the data. This is usually not a problem. The block rate needs to be defined for the worst case data. Some systems send the data both normal, then inverted, in the block. This makes the blocks constant length as well as providing some redundancy. If the response time can be slow (for example, pressing buttons on a remote control), use a lot of redundancy: for example receive 3 blocks and take action only if all 3 are the same. >> >>but how do i make the receiver recognize the start bit and stop >bit???? A receiver for this type of code could be built around a routine that measures how long the IR stays on: wait till IR on measure time wait till IR off The result would be classed into 3 times: very long -> start bit, long -> 0 bit, short -> 1 bit. It would also be good to time out the "wait till IR on" and if it is longer than specified, reject the whole block and go back to waiting for a start bit. The core of the transmitter software would be a simple "send N cycles of 40 KHz" routine coupled with a routine to shift through the bits and call the sending with one of 3 values of N. Integrating the IR recption with the PIC's other duties can be done in various ways, but it does make it more complicated. The IR receiver module could be connected to the INT input, or a timer interrupt state-machine polling of the IR input implemented. Start with simple software timing until you're able to make that work.