In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Jon Williams wrote: Make sure the DEVICE directive is set for OSCXT2 and you put 4 MHz resonator in the circuit when you want to run stand-alone. If you change the FREQ directive for the ISR version, you will have to update the ISR (value after RETURNINT) so that it runs every 26 uS, otherwise you'll need to update all the values as well. About those values... the start bit is supposed to be 2400 uS. 2400 / 26 = 92 -- I use 90% of that (83) since that is still longer than a "1" bit period and gives the code a little flexibility with a remote that might not have perfect timing. Same for the "1" bit test; in this case I split the difference between the two bit times, use 900. (INT) 900 / 26 = 34. The code checks to see if the current bit time is less than this value -- the only time that should ever happen is if the bit is a valid zero. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=97908#m98493 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)