Receiving Asynchronous Data Bursts

[Johan’s] been working on a chunk of code for about seven years and he thinks it’s ready to help you with your next project. He calls it D1 (The One) and it lets you receive asynchronous data without the need for a hardware USART. It’s capable of working with signals from an IR or RF remote, as well as tangentially related transmissions like RFID and magstripe readers.

It uses timer and port interrupts to sample the incoming data. Once it’s captured a transmission, the code sets a flag so that you can pull what it got into your own application. If you’re expecting to receive a protocol that sends packets several times in a row a verification module is also included which runs as a precondition of setting the received flag. The package is written in PIC assembly, but with all the information that [Johan] included in his post this shouldn’t be hard to port over to other chip architecture.

7 thoughts on “Receiving Asynchronous Data Bursts

    1. That was my first thought, but I suspect it’s one of those on again, off again type projects. That said, it looks like he was pretty thorough – I imagine it would have taken him a month or two if he worked solidly at it.

  1. Rotfl, no, it’s not seven years full time work ;)
    But it is a project that has been used in many projects over several years and has been modified and improved over the time.

    I think the best feature is that you easily can control how the data is sampled. In the automatic mode the pulse length is automatically adjusted during sampling. It detects IR transmissions without the need to know the protocol or timings.

    I plan to post some examples in the future showing how it works. I think the most interesting one is when I replaced the chip in a low cost radio controlled power switch to support features that exists in much more advanced solutions. I have also used it for an IR to RF translator, learning and detecting one protocol and transmitting another.

    1. The mini-writeup here didn’t do you justice then :) Actually, I didn’t have a lot of time to read through your documentation at the linked page, so I just scan-read. Unfortunately, it was hard to pick out the exciting parts like the automatic sampling period adjustment and so on. It sounds a lot more interesting now, I’ll have to remember to make the time to explore it properly.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.