[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”
Seven years? Commodore has him beat by more than a few years. IEC bus anyone? ;)
Not meaning to insult here, but seven years to implement bit-banging and a lookup table? Maybe the writeup doesn’t do it justice.
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.
He said it took “several” years, not seven.
Looks like a handy tool for all kinds of situations. It’s definitely getting a bookmark.
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.
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.
It would be nice to pick some examples, cause hard to understood how to use in main application.
We wait for that.
Please be kind and respectful to help make the comments section excellent. (Comment Policy)