In SX Microcontrollers, SX/B Compiler and SX-Key Tool, PJMonty wrote: Jon, The ISR you wrote for decoding SIRCS data looks solid and quite compact. I wrote a SIRCS decoder as part of a much bigger project a year ago. In my case, dues to the way the rest of the project worked, I created a software timer that ran at .1 ms. This gave me a way to time incoming pulses with .1 ms resolution. For what it's worth, here is the pertinent part of the comment block for my code: [code]; To decode, watch the input bit and wait for it to go low. It should be held low for ; 2.4 ms followed by .6 ms of high. After that, the data starts coming in. The key to ; decoding the remaining bits is to time the length of the lows that happen. Technically, ; if it's low for .6 ms, it's a zero, and if it's low for 1.2 ms, it's a one. All of these ; timings are subject to jitter and inaccuracy caused by the time base used in the cheap ; remotes. Because of this, I use 1 ms as a cutoff. Below it is a zero, above it is a one. ; This (should) give me better handling of off timed pulses. [/code] I'm not sure if this will give you any new ideas, but you never know. In re-reading my comments, I realize I should change my cutoff value from 1 ms to .9 ms to actually be in the middle of .6 ms and 1.2 ms. [list]Thanks, PeterM ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=97908#m98367 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)