Sorry about missing the subject tag, I completely forgot about it. What you said makes sense, but when transmitting over actual wires instead of IR, how does the USART signal a start bit and why doesn't it work the same for IR? I guess what I'm asking is how does the PIC know when I'm sending a byte that starts with a 0 over the wires? I'm using Async mode so there is no clock pulse to signal a start. Using only the five LSBs was only because I cannot use all of PORTA's I/O lines because I am using an external 20MHz ceramic resonator and the MCLR line is input only...this leaves me with five I/O's to do output with. The LEDs are simply for debugging and testing this phase of my circuit. I will need to send a complete byte of data at a time once I get the IR part working. Would it be possible to use the 9 bit option and always have the 9th bit a 1 to signal the start of a byte? Then on the receiving end just disregard the 9th bit? Thank you for your input, I appreciate the help. Scott At 08:55 PM 3/1/2004, you wrote: >Added subject tag... > > >>an LED graph. Even though I'm sending a whole byte over serial, I'm only >>actually using the five least significant bits of the byte. > >So how does the receiver know that when the first bit has been sent? > >For example, the receiver won't see any action at all until the >transmitter tries to send a 1, right? The receiver than takes that >bit as the first of eight, waits the precalculated time period, interprets >the next bit, repeat as needed. > >What you'll actually get is a left shifted version of the sent byte, which >is shifted such that the first bit is the highest order 1 you wanted to >send, followed by the remaining bits of the number and wrapped up >with padded zeros. For example, b'00011010' would be received as >b'11010000', b'00000011' would be received as b'11000000', and >so on. > >The trick here is that you need to use some kind of alternate signal, >bit-bashed out, or some very clever data manipulation with the UART. >Either non-return-to-zero encoding, or pulse length encoding, or any >of the other methods used by commercial products to communicate >via IR can be used. Snoop on Google for IR remote control PIC and >you'll get some good ideas to start with. > >The simplest answer is to make the first bit of your data always 1, >since you've indicated that that's a don't care bit anyway. Thus, >the first bit will always trigger a reception on the receiver's USART, >and as long as the timing is good (which you have a strong indicator >of, since wired serial works), you should be in business. > >Note that this is some speculation on my part, since I've never tried >this, but I do know for sure that it's not too tough to emulate the >Sony IR protocol, since I just made a receiver/transmitter pair that >does just that! That could be your fall-back method, but it requires >more bit-bashing and what-not than using the USART. Good luck! > >Mike H. > >_________________________________________________________________ >One-click access to Hotmail from any Web page download MSN Toolbar now! >http://clk.atdmt.com/AVE/go/onm00200413ave/direct/01/ > >-- >http://www.piclist.com hint: To leave the PICList >mailto:piclist-unsubscribe-request@mitvma.mit.edu > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads