Tim, On Sun, 09 Apr 2006 14:23:16 +0100, Tim ODriscoll wrote: > On Sun, 2006-04-09 at 13:59 +0100, Howard Winter wrote: >... > > Incidentally, how does your scheme send something with the first bit = 1? You seem to take your first sample > > half a bit-time after the initial transition to low, so you have no "start bit", implying that you'd have a > > short high-low-high pulse to start the byte and represent a 1 in the first bit - this is not a good idea as > > the frequency of that pulse is way above the rest of the data, making it more easily mangled on the way, with > > possible misreading of the first bit. > > There is a very short start-bit in there, but it's only a few uS long > and doesn't show up easily on my scope. My transmit routine brings the > line low for 10uS, then starts shifting the byte out. I could write a > 990uS delay for the first bit so the receiver lines up precisely in the > middle of each bit, but I figure +10uS off the middle of a 1ms bit is > allowable. Is that what you meant? Re-reading your paragraph I'm not > sure if you mean a start-bit that's of much shorter bit-time than the > rest of the data is a bad idea..... Yes, that's it. The thing is, serial I/O is a communications protocol and as such its big thing is speed, which translates to the frequency you can send down the wire reliably. Your start bit is at a dramatically higher frequency than the rest of the data, so is going to be degraded much sooner than the data when conditions are less than ideal, but this may manifest itself as corruption of the first data bit by the start bit, because of ringing, reflections on the transmission line, and so on. Now if you're only passing the signal a few inches along a PCB between PICs then this won't be an issue - but if you try to separate them and connect with a cable, problems may occur. It comes down to this: If you can accurately transmit a start-bit at 100kHz, why are you sending the data at 1kHz? If you can send at the faster speed, why not do so? If you can't, the short start-bit is a problem! This is from a communications point of view - you may have entirely valid reasons to send 1mS data bits, and the start bit may well travel safely in your design - I just thought I'd mention that you're doing something unusual! :-) Cheers, Howard Winter St.Albans, England -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist