oh!, ok. Then, I forget about interrupts.
Yes, I´m using a IR module, and I get directly a sequence of bits with a fixed period.
http://www.vishay.com/docs/81732/tsop348.pdf
I see two options:
1. Read the IR pin, wait one period, read, wait .... but this method causes the accumulated error.
2. Read the IR pin, start measuring the time, and detect possible changes in the IR pin.
I have only an implementation of the first method, but it do not work, and this is poor implementation. As you say, the timing should be re-synchronised in every bit.
How to measure the time between bits with the RS08? (for example, how to measure the time between variations in the IR pin, to decide if we have seen one positive bit, or three consecutive positive bits?)
Best regards.