I would drop the internal RC clock and use a ceramic resonator or crystal instead. Otherwise you will be driven to despair by timing errors, I'd sample at least 4x per bit if possible then nudge the centerline slightly. Timer2 and PR2 will work, I've done it. With a good clock. --Bob On Fri, Aug 21, 2009 at 11:12 AM, Dave Tweed wrote: > PicDude wrote: >> Okay, that seems like a surprisingly simple solution to this problem. >> I'm evaluating on paper for now, and can't see it working well with 4x >> the bit rate, but 5x seems to work well... so far. This is assuming >> minimal error for now, but I'll try factoring in a few percent error >> to see how 5x would handle it. What's nice is that the ISR processing >> for this is indeed very minimal, so a faster sample rate is fine. > > Like I said, the interval depends on the exact characteristics of the data > you're trying to decode. > > Actully, I misspoke. Suppose the data is high for 40% of the bit interval > for a zero, and 60% for a one. In that case, you'd need to sample with a > period that is less than -- with some margin -- 20% of the bit interval in > order to reliably resolve the difference. > > -- Dave Tweed > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist